You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ed Young <ej...@SummitBid.com> on 2006/10/16 18:21:20 UTC
NoClassDefFoundError when running jar
I'm trying to "mavenize" a simple console application that is a module
of a larger maven project. I developed the app in eclipse and am now
moving into the maven project.
The app imports one jar file used to process command line parameters
(argparser.jar). The jar file is installed in the .m2 repository on
the local machine.
I'm able to compile and package the jar file, but when I try to run
it, I get a java.lan.NoClassDefFoundError, even when I specify the
path to the jar using -claspath.
This console app is a module of a larger maven project. The top level
pom.xml file includes this:
Top level pom.xml:
<modules>
<module>common</module>
<module>servlet</module>
<module>console</module>
</modules>
The pom.xml for the console module specifies a dependency for the
argparser jar:
<dependency>
<groupId>argparser</groupId>
<artifactId>argparser</artifactId>
<version>1.0</version>
</dependency>
And it exists in my .m2 repository.
I can compile and package the project, but can't run it because of the
NoClassDefFoundError.
I can run the console app only if I remove any references to the
argparser classes in the code.
I've been reading throught the Better Builds with Maven and googling
quite a bit on this, but am missing something.
Thanks in advance.
Ed
Build Example:
mvn clean compile package -o
mvn clean compile package -o
[INFO]
NOTE: Maven is executing in offline mode. Any artifacts not already in
your local
repository will be inaccessible.
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] Comcast - SeaDAC - Parent
[INFO] Comcast - SeaDAC - Common Module
[INFO] Comcast - SeaDAC - Servlet Module
[INFO] Comcast - SeaDAC - Console Module
[INFO] ----------------------------------------------------------------------------
[INFO] Building Comcast - SeaDAC - Parent
[INFO] task-segment: [clean, compile, package]
[INFO] ----------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory C:\src\workspace\seadac-10-2\target
[INFO] Deleting directory C:\src\workspace\seadac-10-2\target\classes
[INFO] Deleting directory C:\src\workspace\seadac-10-2\target\test-classes
[INFO] No goals needed for project - skipping
[INFO] [site:attach-descriptor]
[INFO] ----------------------------------------------------------------------------
[INFO] Building Comcast - SeaDAC - Common Module
[INFO] task-segment: [clean, compile, package]
[INFO] ----------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory C:\src\workspace\seadac-10-2\common\target
[INFO] Deleting directory C:\src\workspace\seadac-10-2\common\target\classes
[INFO] Deleting directory
C:\src\workspace\seadac-10-2\common\target\test-classes
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[WARNING] While downloading xerces:xerces:2.4.0
This artifact has been relocated to xerces:xercesImpl:2.4.0.
[INFO] [compiler:compile]
Compiling 18 source files to C:\src\workspace\seadac-10-2\common\target\classes
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [jar:jar]
[INFO] Building jar:
C:\src\workspace\seadac-10-2\common\target\comcast-seadac-common-1.0-SNAPSHOT.jar
[INFO] ----------------------------------------------------------------------------
[INFO] Building Comcast - SeaDAC - Servlet Module
[INFO] task-segment: [clean, compile, package]
[INFO] ----------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory C:\src\workspace\seadac-10-2\servlet\target
[INFO] Deleting directory C:\src\workspace\seadac-10-2\servlet\target\classes
[INFO] Deleting directory
C:\src\workspace\seadac-10-2\servlet\target\test-classes
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
Compiling 1 source file to C:\src\workspace\seadac-10-2\servlet\target\classes
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [jar:jar]
[INFO] Building jar:
C:\src\workspace\seadac-10-2\servlet\target\comcast-seadac-servlet-1.0-SNAPSHOT.jar
[INFO] ----------------------------------------------------------------------------
[INFO] Building Comcast - SeaDAC - Console Module
[INFO] task-segment: [clean, compile, package]
[INFO] ----------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory C:\src\workspace\seadac-10-2\console\target
[INFO] Deleting directory C:\src\workspace\seadac-10-2\console\target\classes
[INFO] Deleting directory
C:\src\workspace\seadac-10-2\console\target\test-classes
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
Compiling 1 source file to C:\src\workspace\seadac-10-2\console\target\classes
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [surefire:test]
[INFO] No tests to run.
[INFO] [jar:jar]
[INFO] Building jar:
C:\src\workspace\seadac-10-2\console\target\comcast-seadac-console-1.0-SNAPSHOT.jar
[INFO]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] Comcast - SeaDAC - Parent ............................. SUCCESS [2.469s]
[INFO] Comcast - SeaDAC - Common Module ...................... SUCCESS [3.125s]
[INFO] Comcast - SeaDAC - Servlet Module ..................... SUCCESS [1.172s]
[INFO] Comcast - SeaDAC - Console Module ..................... SUCCESS [2.141s]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9 seconds
[INFO] Finished at: Mon Oct 16 10:16:29 MDT 2006
[INFO] Final Memory: 7M/17M
[INFO] ------------------------------------------------------------------------
java -cp "c:/Documents and
Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0" -jar
console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
sea DAC Console APP
Exception in thread "main" java.lang.NoClassDefFoundError:
argparser/StringHolder
at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
--
Ed
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: NoClassDefFoundError when running jar
Posted by pjungwir <ma...@9stmaryrd.com>.
Just a wild guess, but could this be a matter of / vs. \? I see you're
running on windows; maybe java isn't parsing the classpath as you think it
is. When you're sharing a directory with argparser.jar, try "-cp
argparser.jar" instead of "-cp ./argparser.jar."
Paul
--
View this message in context: http://www.nabble.com/NoClassDefFoundError-when-running-jar-tf2453430.html#a6866209
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: NoClassDefFoundError when running jar
Posted by Wayne Fay <wa...@gmail.com>.
Try using a fully qualified path to your argparser.jar ie:
java -cp c:\...\argparser.jar
Try adding argparser.jar to your CLASSPATH ie
set CLASSPATH=c:\...\argparser.jar;%CLASSPATH%
There might be code in the ConsoleApp that, for whatever reason, does
some funky Java classloading and thus *requires* the argparser.jar be
in the same directory. But this is way OT for Maven list so please
don't send us the ConsoleApp code or anything...
Wayne
On 10/17/06, Ed Young <ej...@summitbid.com> wrote:
> If I could include the argparser.jar file in the console jar file that
> would solve my problem, but I'm having trouble figuring out how to do
> that.
>
> What I know:
> If I put the argparser.jar file in the same directory as the console
> app jar file I can run the console app:
>
> C:\src\workspace\seadac-10-2\console>java -jar
> target/comcast-seadac-console-1.0-SNAPSHOT.jar
> sea DAC Console APP
> sea DAC XML ConsoleApp
>
> ...but this won't work all the time. If I could include the argparser
> (or any other required jar) in the console app jar, I'd be all set.
>
> This part has me stumped:
> If I put the argparser jar file anywhere other than the same directory
> where the console app jar is, I can't get it to run no matter how I
> configure the classpath:
> # ls -la
> total 138
> drwx------+ 6 ???????? 0 Oct 17 22:23 .
> drwx------+ 8 ???????? 0 Oct 17 22:23 ..
> -rwx------+ 1 ???????? 498 Oct 13 15:36 .classpath
> -rwx------+ 1 ???????? 324 Oct 13 15:36 .project
> drwx------+ 2 ???????? 0 Oct 13 13:55 .settings
> drwx------+ 7 ???????? 0 Oct 13 15:39 .svn
> -rwx------+ 1 ???????? 131492 Aug 30 13:44 argparser-1.0.jar
> -rwx------+ 1 ???????? 1107 Oct 16 15:53 pom.xml
> drwx------+ 4 ???????? 0 Oct 2 15:43 src
> drwx------+ 3 ???????? 0 Oct 17 22:21 target
>
> C:\src\workspace\seadac-10-2\console>java -cp .\argparser-1.0.jar -jar
> target/comcast-seadac-console-1.0-SNAPSHOT.jar
> java -cp .\argparser-1.0.jar -jar
> target/comcast-seadac-console-1.0-SNAPSHOT.jar
> sea DAC Console APP
> Exception in thread "main" java.lang.NoClassDefFoundError:
> argparser/StringHolder
> at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
>
> C:\src\workspace\seadac-10-2\console>java -cp ./argparser-1.0.jar -jar
> target/comcast-seadac-console-1.0-SNAPSHOT.jar
> java -cp ./argparser-1.0.jar -jar
> target/comcast-seadac-console-1.0-SNAPSHOT.jar
> sea DAC Console APP
> Exception in thread "main" java.lang.NoClassDefFoundError:
> argparser/StringHolder
> at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
>
> C:\src\workspace\seadac-10-2\console>java -cp argparser-1.0.jar -jar
> target/comcast-seadac-console-1.0-SNAPSHOT.jar
> java -cp argparser-1.0.jar -jar target/comcast-seadac-console-1.0-SNAPSHOT.jar
> sea DAC Console APP
> Exception in thread "main" java.lang.NoClassDefFoundError:
> argparser/StringHolder
> at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
>
> I realize that this isn't a maven issue, and is java newbie stuff, but
> I feel like I've tried everything classpath-wise and the only solution
> is to have the jars all in the same directory.
>
> Where am I going wrong?
>
> Thanks.
>
> On 10/16/06, Eduardo Dela Rosa <ed...@gmail.com> wrote:
> > Hi,
> >
> > Perhaps your problem lies on this part of your code:
> >
> > Exception in thread "main" java.lang.NoClassDefFoundError:
> > argparser/StringHolder
> > at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
> >
> > It may not be only about your classpath; To me it means that you're missing
> > a jar file (probably a third party library) that has to be inside your
> > "console" module.
> >
> > Check inside the "ConsoleApp.java" and see what classes you are using and
> > check your console module jar if the library that contains that class is
> > actually inside
> > the console module jar file.
> >
> > This is because in other cases the "NoClassDefFoundError" indirectly
> > pertains to the
> > another class which is being used by a class that throws the error.
> >
> > HTH.
> >
> > On 10/17/06, Ed Young <ej...@summitbid.com> wrote:
> > >
> > > Thanks for the reply. I know this is something of a newbie issue, so I
> > > appreciate your help. It's really got me blocked.
> > >
> > > I've tried passing the entire path to the jar file including the
> > > filename itself and I get the same error.
> > >
> > > Here's where argparser lives:
> > > c:/Documents and
> > > Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0:
> > > total 129 free 22717304
> > > drwxrwxrwx 2 eyoung2297c root 0 Aug 30 13:45 .
> > > drwxrwxrwx 2 eyoung2297c root 0 Aug 30 13:44 ..
> > > -rw-rw-rw- 1 eyoung2297c root 131492 Aug 30 13:44 argparser-1.0.jar
> > >
> > > Here's the command line:
> > > C:\src\workspace\seadac-10-2>java -cp "c:/Documents and
> > > Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0/argparser-
> > > 1.0.jar"
> > > -jar console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> > > java -cp "c:/Documents and
> > > Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0/argparser-
> > > 1.0.jar"
> > > -jar console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> > > sea DAC Console APP
> > > Exception in thread "main" java.lang.NoClassDefFoundError:
> > > argparser/StringHolder
> > > at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
> > >
> > > Or if I put the jar file in the top level of the project and point to it:
> > > C:\src\workspace\seadac-10-2>java -cp ./argparser-1.0.jar -jar
> > > console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> > > java -cp ./argparser-1.0.jar -jar
> > > console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> > > sea DAC Console APP
> > > Exception in thread "main" java.lang.NoClassDefFoundError:
> > > argparser/StringHolder
> > > at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
> > >
> > > Thanks again,
> > >
> > > Ed
> > >
> > >
> > > On 10/16/06, Wendy Smoak <ws...@gmail.com> wrote:
> > > > On 10/16/06, Ed Young <ej...@summitbid.com> wrote:
> > > >
> > > > > java -cp "c:/Documents and
> > > > > Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0" -jar
> > > > > console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> > > > > sea DAC Console APP
> > > > > Exception in thread "main" java.lang.NoClassDefFoundError:
> > > > > argparser/StringHolder
> > > > > at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java
> > > :55)
> > > >
> > > > Nothing to do with Maven... you haven't added the argparser jar to
> > > > your classpath.
> > > >
> > > > Make sure you give the path all the way down to the filename of any
> > > > .jar files that contain classes you need.
> > > >
> > > > --
> > > > Wendy
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: users-help@maven.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > Ed
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> >
> > --
> > Eduardo Dela Rosa
> >
> >
>
>
> --
> Ed
>
> ---------------------------------------------------------------------
> 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
Re: NoClassDefFoundError when running jar
Posted by Ed Young <ej...@SummitBid.com>.
If I could include the argparser.jar file in the console jar file that
would solve my problem, but I'm having trouble figuring out how to do
that.
What I know:
If I put the argparser.jar file in the same directory as the console
app jar file I can run the console app:
C:\src\workspace\seadac-10-2\console>java -jar
target/comcast-seadac-console-1.0-SNAPSHOT.jar
sea DAC Console APP
sea DAC XML ConsoleApp
...but this won't work all the time. If I could include the argparser
(or any other required jar) in the console app jar, I'd be all set.
This part has me stumped:
If I put the argparser jar file anywhere other than the same directory
where the console app jar is, I can't get it to run no matter how I
configure the classpath:
# ls -la
total 138
drwx------+ 6 ???????? 0 Oct 17 22:23 .
drwx------+ 8 ???????? 0 Oct 17 22:23 ..
-rwx------+ 1 ???????? 498 Oct 13 15:36 .classpath
-rwx------+ 1 ???????? 324 Oct 13 15:36 .project
drwx------+ 2 ???????? 0 Oct 13 13:55 .settings
drwx------+ 7 ???????? 0 Oct 13 15:39 .svn
-rwx------+ 1 ???????? 131492 Aug 30 13:44 argparser-1.0.jar
-rwx------+ 1 ???????? 1107 Oct 16 15:53 pom.xml
drwx------+ 4 ???????? 0 Oct 2 15:43 src
drwx------+ 3 ???????? 0 Oct 17 22:21 target
C:\src\workspace\seadac-10-2\console>java -cp .\argparser-1.0.jar -jar
target/comcast-seadac-console-1.0-SNAPSHOT.jar
java -cp .\argparser-1.0.jar -jar
target/comcast-seadac-console-1.0-SNAPSHOT.jar
sea DAC Console APP
Exception in thread "main" java.lang.NoClassDefFoundError:
argparser/StringHolder
at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
C:\src\workspace\seadac-10-2\console>java -cp ./argparser-1.0.jar -jar
target/comcast-seadac-console-1.0-SNAPSHOT.jar
java -cp ./argparser-1.0.jar -jar
target/comcast-seadac-console-1.0-SNAPSHOT.jar
sea DAC Console APP
Exception in thread "main" java.lang.NoClassDefFoundError:
argparser/StringHolder
at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
C:\src\workspace\seadac-10-2\console>java -cp argparser-1.0.jar -jar
target/comcast-seadac-console-1.0-SNAPSHOT.jar
java -cp argparser-1.0.jar -jar target/comcast-seadac-console-1.0-SNAPSHOT.jar
sea DAC Console APP
Exception in thread "main" java.lang.NoClassDefFoundError:
argparser/StringHolder
at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
I realize that this isn't a maven issue, and is java newbie stuff, but
I feel like I've tried everything classpath-wise and the only solution
is to have the jars all in the same directory.
Where am I going wrong?
Thanks.
On 10/16/06, Eduardo Dela Rosa <ed...@gmail.com> wrote:
> Hi,
>
> Perhaps your problem lies on this part of your code:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> argparser/StringHolder
> at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
>
> It may not be only about your classpath; To me it means that you're missing
> a jar file (probably a third party library) that has to be inside your
> "console" module.
>
> Check inside the "ConsoleApp.java" and see what classes you are using and
> check your console module jar if the library that contains that class is
> actually inside
> the console module jar file.
>
> This is because in other cases the "NoClassDefFoundError" indirectly
> pertains to the
> another class which is being used by a class that throws the error.
>
> HTH.
>
> On 10/17/06, Ed Young <ej...@summitbid.com> wrote:
> >
> > Thanks for the reply. I know this is something of a newbie issue, so I
> > appreciate your help. It's really got me blocked.
> >
> > I've tried passing the entire path to the jar file including the
> > filename itself and I get the same error.
> >
> > Here's where argparser lives:
> > c:/Documents and
> > Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0:
> > total 129 free 22717304
> > drwxrwxrwx 2 eyoung2297c root 0 Aug 30 13:45 .
> > drwxrwxrwx 2 eyoung2297c root 0 Aug 30 13:44 ..
> > -rw-rw-rw- 1 eyoung2297c root 131492 Aug 30 13:44 argparser-1.0.jar
> >
> > Here's the command line:
> > C:\src\workspace\seadac-10-2>java -cp "c:/Documents and
> > Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0/argparser-
> > 1.0.jar"
> > -jar console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> > java -cp "c:/Documents and
> > Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0/argparser-
> > 1.0.jar"
> > -jar console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> > sea DAC Console APP
> > Exception in thread "main" java.lang.NoClassDefFoundError:
> > argparser/StringHolder
> > at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
> >
> > Or if I put the jar file in the top level of the project and point to it:
> > C:\src\workspace\seadac-10-2>java -cp ./argparser-1.0.jar -jar
> > console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> > java -cp ./argparser-1.0.jar -jar
> > console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> > sea DAC Console APP
> > Exception in thread "main" java.lang.NoClassDefFoundError:
> > argparser/StringHolder
> > at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
> >
> > Thanks again,
> >
> > Ed
> >
> >
> > On 10/16/06, Wendy Smoak <ws...@gmail.com> wrote:
> > > On 10/16/06, Ed Young <ej...@summitbid.com> wrote:
> > >
> > > > java -cp "c:/Documents and
> > > > Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0" -jar
> > > > console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> > > > sea DAC Console APP
> > > > Exception in thread "main" java.lang.NoClassDefFoundError:
> > > > argparser/StringHolder
> > > > at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java
> > :55)
> > >
> > > Nothing to do with Maven... you haven't added the argparser jar to
> > > your classpath.
> > >
> > > Make sure you give the path all the way down to the filename of any
> > > .jar files that contain classes you need.
> > >
> > > --
> > > Wendy
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
> >
> > --
> > Ed
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Eduardo Dela Rosa
>
>
--
Ed
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: NoClassDefFoundError when running jar
Posted by Eduardo Dela Rosa <ed...@gmail.com>.
Hi,
Perhaps your problem lies on this part of your code:
Exception in thread "main" java.lang.NoClassDefFoundError:
argparser/StringHolder
at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
It may not be only about your classpath; To me it means that you're missing
a jar file (probably a third party library) that has to be inside your
"console" module.
Check inside the "ConsoleApp.java" and see what classes you are using and
check your console module jar if the library that contains that class is
actually inside
the console module jar file.
This is because in other cases the "NoClassDefFoundError" indirectly
pertains to the
another class which is being used by a class that throws the error.
HTH.
On 10/17/06, Ed Young <ej...@summitbid.com> wrote:
>
> Thanks for the reply. I know this is something of a newbie issue, so I
> appreciate your help. It's really got me blocked.
>
> I've tried passing the entire path to the jar file including the
> filename itself and I get the same error.
>
> Here's where argparser lives:
> c:/Documents and
> Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0:
> total 129 free 22717304
> drwxrwxrwx 2 eyoung2297c root 0 Aug 30 13:45 .
> drwxrwxrwx 2 eyoung2297c root 0 Aug 30 13:44 ..
> -rw-rw-rw- 1 eyoung2297c root 131492 Aug 30 13:44 argparser-1.0.jar
>
> Here's the command line:
> C:\src\workspace\seadac-10-2>java -cp "c:/Documents and
> Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0/argparser-
> 1.0.jar"
> -jar console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> java -cp "c:/Documents and
> Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0/argparser-
> 1.0.jar"
> -jar console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> sea DAC Console APP
> Exception in thread "main" java.lang.NoClassDefFoundError:
> argparser/StringHolder
> at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
>
> Or if I put the jar file in the top level of the project and point to it:
> C:\src\workspace\seadac-10-2>java -cp ./argparser-1.0.jar -jar
> console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> java -cp ./argparser-1.0.jar -jar
> console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> sea DAC Console APP
> Exception in thread "main" java.lang.NoClassDefFoundError:
> argparser/StringHolder
> at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
>
> Thanks again,
>
> Ed
>
>
> On 10/16/06, Wendy Smoak <ws...@gmail.com> wrote:
> > On 10/16/06, Ed Young <ej...@summitbid.com> wrote:
> >
> > > java -cp "c:/Documents and
> > > Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0" -jar
> > > console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> > > sea DAC Console APP
> > > Exception in thread "main" java.lang.NoClassDefFoundError:
> > > argparser/StringHolder
> > > at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java
> :55)
> >
> > Nothing to do with Maven... you haven't added the argparser jar to
> > your classpath.
> >
> > Make sure you give the path all the way down to the filename of any
> > .jar files that contain classes you need.
> >
> > --
> > Wendy
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> Ed
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
--
Eduardo Dela Rosa
Re: NoClassDefFoundError when running jar
Posted by Ed Young <ej...@SummitBid.com>.
Thanks for the reply. I know this is something of a newbie issue, so I
appreciate your help. It's really got me blocked.
I've tried passing the entire path to the jar file including the
filename itself and I get the same error.
Here's where argparser lives:
c:/Documents and Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0:
total 129 free 22717304
drwxrwxrwx 2 eyoung2297c root 0 Aug 30 13:45 .
drwxrwxrwx 2 eyoung2297c root 0 Aug 30 13:44 ..
-rw-rw-rw- 1 eyoung2297c root 131492 Aug 30 13:44 argparser-1.0.jar
Here's the command line:
C:\src\workspace\seadac-10-2>java -cp "c:/Documents and
Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0/argparser-1.0.jar"
-jar console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
java -cp "c:/Documents and
Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0/argparser-1.0.jar"
-jar console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
sea DAC Console APP
Exception in thread "main" java.lang.NoClassDefFoundError:
argparser/StringHolder
at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
Or if I put the jar file in the top level of the project and point to it:
C:\src\workspace\seadac-10-2>java -cp ./argparser-1.0.jar -jar
console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
java -cp ./argparser-1.0.jar -jar
console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
sea DAC Console APP
Exception in thread "main" java.lang.NoClassDefFoundError:
argparser/StringHolder
at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
Thanks again,
Ed
On 10/16/06, Wendy Smoak <ws...@gmail.com> wrote:
> On 10/16/06, Ed Young <ej...@summitbid.com> wrote:
>
> > java -cp "c:/Documents and
> > Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0" -jar
> > console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> > sea DAC Console APP
> > Exception in thread "main" java.lang.NoClassDefFoundError:
> > argparser/StringHolder
> > at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
>
> Nothing to do with Maven... you haven't added the argparser jar to
> your classpath.
>
> Make sure you give the path all the way down to the filename of any
> .jar files that contain classes you need.
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
--
Ed
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: NoClassDefFoundError when running jar
Posted by Wendy Smoak <ws...@gmail.com>.
On 10/16/06, Ed Young <ej...@summitbid.com> wrote:
> java -cp "c:/Documents and
> Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0" -jar
> console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> sea DAC Console APP
> Exception in thread "main" java.lang.NoClassDefFoundError:
> argparser/StringHolder
> at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
Nothing to do with Maven... you haven't added the argparser jar to
your classpath.
Make sure you give the path all the way down to the filename of any
.jar files that contain classes you need.
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org