You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Jeff Turner <je...@socialchange.net.au> on 2001/10/05 05:47:01 UTC

[PATCH] Run-from-jar broken

Hi,

I just tried invoking Cocoon with 'java -jar cocoon.jar', and it gives
this error:

[jeff@kermit lib]$ java -jar cocoon.jar 
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log/Priority
        at org.apache.cocoon.Main.main(Main.java:241)

This is because in the manifest, the Class-Path spans more than one line, but
the linebreaks are not escaped with \'s. The attached patch fixes this.


Btw, general info for other people trying 'java -jar cocoon.jar':

When you first try it, and it dies claiming it needs some Avalon jars, don't
bother getting them all in your classpath; it won't help. If you read the jar
spec, it says that the "Class-Path:" manifest option *replaces* the
command-line classpath. Your command-line classpath is effectively ignored.

If you examine cocoon.jar's manifest, you'll see that the jars in "Class-Path:"
have no path. Ie, cocoon.jar must be in the same directory as the libs. So to
get 'java -jar cocoon.jar' working, you must:

 - ensure you're building with my patch applied
 - run ./build.sh or build.bat
 - copy build/cocoon/cocoon.jar to lib/
 - in lib/, type 'java -jar cocoon.jar'. You should see:
 
[jeff@kermit lib]$ java -jar cocoon.jar
ERROR   10022   [        ] (): Please, specify at least one starting URI.
Please, specify at least one starting URI.

   Type 'java -jar cocoon.jar --help' for info on how to actually use it ;)


--Jeff

Re: [PATCH] Run-from-jar broken

Posted by Jeff Turner <je...@socialchange.net.au>.
On Fri, Oct 05, 2001 at 09:12:24AM +0200, Martin Man wrote:
> hi jeff,
> 	patch applied on both branches, please crosscheck...

Thanks. All looks fine.

I'll look into creating a manifest automatically with <pathconvert> and
<echo file="src/Manifest.mf">. The current situation is very brittle, because
it's likely that people updating the jars will forget to update the manifest.

--Jeff
> 
> rgds,
> martin

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [PATCH] Run-from-jar broken

Posted by Martin Man <mm...@apache.org>.
hi jeff,
	patch applied on both branches, please crosscheck...


rgds,
martin


On Fri, Oct 05, 2001 at 01:47:01PM +1000, Jeff Turner wrote:
> Hi,
> 
> I just tried invoking Cocoon with 'java -jar cocoon.jar', and it gives
> this error:
> 
> [jeff@kermit lib]$ java -jar cocoon.jar 
> Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log/Priority
>         at org.apache.cocoon.Main.main(Main.java:241)
> 
> This is because in the manifest, the Class-Path spans more than one line, but
> the linebreaks are not escaped with \'s. The attached patch fixes this.
> 
> 
> Btw, general info for other people trying 'java -jar cocoon.jar':
> 
> When you first try it, and it dies claiming it needs some Avalon jars, don't
> bother getting them all in your classpath; it won't help. If you read the jar
> spec, it says that the "Class-Path:" manifest option *replaces* the
> command-line classpath. Your command-line classpath is effectively ignored.
> 
> If you examine cocoon.jar's manifest, you'll see that the jars in "Class-Path:"
> have no path. Ie, cocoon.jar must be in the same directory as the libs. So to
> get 'java -jar cocoon.jar' working, you must:
> 
>  - ensure you're building with my patch applied
>  - run ./build.sh or build.bat
>  - copy build/cocoon/cocoon.jar to lib/
>  - in lib/, type 'java -jar cocoon.jar'. You should see:
>  
> [jeff@kermit lib]$ java -jar cocoon.jar
> ERROR   10022   [        ] (): Please, specify at least one starting URI.
> Please, specify at least one starting URI.
> 
>    Type 'java -jar cocoon.jar --help' for info on how to actually use it ;)
> 
> 
> --Jeff

> Index: src/Manifest.mf
> ===================================================================
> RCS file: /home/cvspublic/xml-cocoon2/src/Manifest.mf,v
> retrieving revision 1.3
> diff -u -r1.3 Manifest.mf
> --- src/Manifest.mf	2001/09/25 10:17:30	1.3
> +++ src/Manifest.mf	2001/10/05 03:40:19
> @@ -1,7 +1,7 @@
>  Manifest-Version: 1.0
>  Main-Class: org.apache.cocoon.Main
> -Class-Path: avalon-framework-4.0.jar avalon-excalibur-4.0.jar batik-all.jar
> - bsf.jar fop-0_20_1.jar jakarta-regexp-1.2.jar jstyle.jar logkit-1.0b5.jar
> +Class-Path: avalon-framework-4.0.jar avalon-excalibur-4.0.jar batik-all.jar \
> + bsf.jar fop-0_20_1.jar jakarta-regexp-1.2.jar jstyle.jar logkit-1.0b5.jar \
>   rhino.jar xalan-2.2.0-dev.jar xerces_1_4_3.jar xt.jar
>  
>  Name: org/apache/cocoon/components/markup/sitemap/java/sitemap.xsl
> 

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org

-- 
-----------------------------------------------------------------------
"You don't need eyes to see, you need vision"                 Faithless
gpg_key_available: http://globales.cz/~mman/martin.man.gpg
gpg_key_fingerprint: 2CC0 4AF6 92DA 5CBF 5F09  7BCB 6202 7024 6E06 0223

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org