You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by robert rowntree <ro...@mindspring.com> on 2003/08/22 03:08:50 UTC
uberjar problem - main class not found
J:\>%java_home%\bin\java -jar J:\po_1_2\target\b2bpo-1.2-uber.jar
the java command above, throws a "class not found " exception:
but , the class is embedded in an inner jar inside the main "uber-jar"
---- exception details below followed by analysis --------------
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
com.werken.classworlds.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)
at
com.werken.classworlds.boot.Bootstrapper.main(Bootstrapper.java:116)
Caused by: java.lang.ClassNotFoundException:
com.borneo.client.FileEventClient
------------------- jar analysis below:
yet when i drill-down in the uber Jars, and in the contents of uber jars,
the class "FileEventClient" is there.
jar manifests , drilldowns are listed below:
---- uberjar -------
0 Aug 21 2003 07:29 META-INF/
-1 Aug 21 2003 07:29 META-INF/MANIFEST.MF
0 Aug 21 2003 06:40 com/
0 Aug 21 2003 06:40 com/werken/
0 Aug 21 2003 06:40 com/werken/classworlds/
0 Aug 21 2003 06:40 com/werken/classworlds/boot/
0 Aug 21 2003 06:40 com/werken/classworlds/protocol/
0 Aug 21 2003 06:40 com/werken/classworlds/protocol/jar/
0 Aug 21 2003 06:40 WORLDS-INF/
0 Aug 21 2003 06:40 WORLDS-INF/conf/
0 Aug 21 2003 06:40 WORLDS-INF/lib/
-1 May 31 2003 13:14 com/werken/classworlds/boot/Bootstrapper.class
-1 May 31 2003 13:14
com/werken/classworlds/boot/InitialClassLoader.class
-1 May 31 2003 13:14
com/werken/classworlds/protocol/jar/Handler.class
-1 May 31 2003 13:14
com/werken/classworlds/protocol/jar/JarUrlConnection.class
-1 Aug 21 2003 06:40 WORLDS-INF/classworlds.jar
-1 Aug 21 2003 07:29 WORLDS-INF/conf/classworlds.conf
-1 Aug 21 2003 06:40 WORLDS-INF/lib/b2bpo-1.2.jar <--- main
class here
-1 Aug 21 2003 06:40 WORLDS-INF/lib/bcel-5.0.jar
-1 Aug 21 2003 06:40 WORLDS-INF/lib/dom4j-1.3.jar
------- WORLDS-INF/lib/b2bpo-1.2.jar ---------
0 Aug 20 2003 22:08 META-INF/
-1 Aug 20 2003 22:08 META-INF/MANIFEST.MF
-1 Aug 20 2003 22:08 activation.jar
-1 Aug 20 2003 22:08 axis.jar
-1 Aug 20 2003 22:08 client.jar <--- main class here
-1 Aug 20 2003 22:08 commons-discovery.jar
-1 Aug 20 2003 22:08 commons-logging.jar
-1 Aug 20 2003 22:08 dom.jar
-1 Aug 20 2003 22:08 events.jar
-1 Aug 20 2003 22:08 ftp.properties
-1 Aug 20 2003 22:08 j2ee.jar
-1 Aug 20 2003 22:08 jax-qname.jar
-1 Aug 20 2003 22:08 jaxp-api.jar
-1 Aug 20 2003 22:08 jaxrpc.jar
-1 Aug 20 2003 22:08 log4j-1.2.8.jar
-1 Aug 20 2003 22:08 log4j.properties
-1 Aug 20 2003 22:08 mail.jar
-1 Aug 20 2003 22:08 namespace.jar
-1 Aug 20 2003 22:08 net.jar
-1 Aug 20 2003 22:08 po_1_2_config.jar
-1 Aug 20 2003 22:08 saaj.jar
-1 Aug 20 2003 22:08 sax.jar
-1 Aug 20 2003 22:08 util.jar
-1 Aug 20 2003 22:08 wsdl4j.jar
-1 Aug 20 2003 22:08 xalan.jar
-1 Aug 20 2003 22:08 xercesImpl.jar
-1 Aug 20 2003 22:08 META-INF/INDEX.LIST
------- client.jar ---------
0 Aug 20 2003 10:06 META-INF/
-1 Aug 20 2003 10:06 META-INF/MANIFEST.MF
0 Aug 20 2003 10:06 com/
0 Aug 20 2003 10:06 com/borneo/
0 Aug 20 2003 10:06 com/borneo/client/
-1 Aug 20 2003 10:06 com/borneo/client/FileEventClient.class <--
main class is here
----- end
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/2003
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: uberjar problem - main class not found
Posted by Ben Walding <be...@walding.com>.
This level of nesting is not supported for uberjars.
Reasons:
1) It's not supported and would be non-trivial to do (this is not to say
hard, but it's not a use case that I normally see)
2) It'd be fiendishly slow. Classworld's uberjars are already quite
slow, another level of unpacking would exacerbate this.
That being said, the slowness will be addressed soon enough (i.e. a
couple of months probably).
Cheers,
Ben
robert rowntree wrote:
>J:\>%java_home%\bin\java -jar J:\po_1_2\target\b2bpo-1.2-uber.jar
>
>the java command above, throws a "class not found " exception:
>
>but , the class is embedded in an inner jar inside the main "uber-jar"
>
>---- exception details below followed by analysis --------------
>
>Exception in thread "main" java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
>)
> at
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
>.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
>com.werken.classworlds.boot.Bootstrapper.bootstrap(Bootstrapper.java:209)
> at
>com.werken.classworlds.boot.Bootstrapper.main(Bootstrapper.java:116)
>Caused by: java.lang.ClassNotFoundException:
>com.borneo.client.FileEventClient
>
>------------------- jar analysis below:
>
>yet when i drill-down in the uber Jars, and in the contents of uber jars,
> the class "FileEventClient" is there.
>
>jar manifests , drilldowns are listed below:
>
>---- uberjar -------
>
> 0 Aug 21 2003 07:29 META-INF/
> -1 Aug 21 2003 07:29 META-INF/MANIFEST.MF
> 0 Aug 21 2003 06:40 com/
> 0 Aug 21 2003 06:40 com/werken/
> 0 Aug 21 2003 06:40 com/werken/classworlds/
> 0 Aug 21 2003 06:40 com/werken/classworlds/boot/
> 0 Aug 21 2003 06:40 com/werken/classworlds/protocol/
> 0 Aug 21 2003 06:40 com/werken/classworlds/protocol/jar/
> 0 Aug 21 2003 06:40 WORLDS-INF/
> 0 Aug 21 2003 06:40 WORLDS-INF/conf/
> 0 Aug 21 2003 06:40 WORLDS-INF/lib/
> -1 May 31 2003 13:14 com/werken/classworlds/boot/Bootstrapper.class
> -1 May 31 2003 13:14
>com/werken/classworlds/boot/InitialClassLoader.class
> -1 May 31 2003 13:14
>com/werken/classworlds/protocol/jar/Handler.class
> -1 May 31 2003 13:14
>com/werken/classworlds/protocol/jar/JarUrlConnection.class
> -1 Aug 21 2003 06:40 WORLDS-INF/classworlds.jar
> -1 Aug 21 2003 07:29 WORLDS-INF/conf/classworlds.conf
> -1 Aug 21 2003 06:40 WORLDS-INF/lib/b2bpo-1.2.jar <--- main
>class here
> -1 Aug 21 2003 06:40 WORLDS-INF/lib/bcel-5.0.jar
> -1 Aug 21 2003 06:40 WORLDS-INF/lib/dom4j-1.3.jar
>
>------- WORLDS-INF/lib/b2bpo-1.2.jar ---------
>
> 0 Aug 20 2003 22:08 META-INF/
> -1 Aug 20 2003 22:08 META-INF/MANIFEST.MF
> -1 Aug 20 2003 22:08 activation.jar
> -1 Aug 20 2003 22:08 axis.jar
> -1 Aug 20 2003 22:08 client.jar <--- main class here
> -1 Aug 20 2003 22:08 commons-discovery.jar
> -1 Aug 20 2003 22:08 commons-logging.jar
> -1 Aug 20 2003 22:08 dom.jar
> -1 Aug 20 2003 22:08 events.jar
> -1 Aug 20 2003 22:08 ftp.properties
> -1 Aug 20 2003 22:08 j2ee.jar
> -1 Aug 20 2003 22:08 jax-qname.jar
> -1 Aug 20 2003 22:08 jaxp-api.jar
> -1 Aug 20 2003 22:08 jaxrpc.jar
> -1 Aug 20 2003 22:08 log4j-1.2.8.jar
> -1 Aug 20 2003 22:08 log4j.properties
> -1 Aug 20 2003 22:08 mail.jar
> -1 Aug 20 2003 22:08 namespace.jar
> -1 Aug 20 2003 22:08 net.jar
> -1 Aug 20 2003 22:08 po_1_2_config.jar
> -1 Aug 20 2003 22:08 saaj.jar
> -1 Aug 20 2003 22:08 sax.jar
> -1 Aug 20 2003 22:08 util.jar
> -1 Aug 20 2003 22:08 wsdl4j.jar
> -1 Aug 20 2003 22:08 xalan.jar
> -1 Aug 20 2003 22:08 xercesImpl.jar
> -1 Aug 20 2003 22:08 META-INF/INDEX.LIST
>
>------- client.jar ---------
>
> 0 Aug 20 2003 10:06 META-INF/
> -1 Aug 20 2003 10:06 META-INF/MANIFEST.MF
> 0 Aug 20 2003 10:06 com/
> 0 Aug 20 2003 10:06 com/borneo/
> 0 Aug 20 2003 10:06 com/borneo/client/
> -1 Aug 20 2003 10:06 com/borneo/client/FileEventClient.class <--
>main class is here
>
>
>----- end
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/2003
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org