Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   After Jar creation, when I call from another project gives me java.lang.NoClassDefFoundError (http://www.velocityreviews.com/forums/t134090-after-jar-creation-when-i-call-from-another-project-gives-me-java-lang-noclassdeffounderror.html)

asfonseca 06-04-2004 09:51 AM

After Jar creation, when I call from another project gives me java.lang.NoClassDefFoundError
 
I'm using WebSphere.
I've create a java project, with one class, that has several methods.
Export it has a jar file. Then in another project add it in libraries has
an external jar file.
When I call methods from that class, it recognizes every method, and
compiles ok. When I try to run it it gives me
"java.lang.NoClassDefFoundError".
Can I create a jar file from a java project?
I'm doing something wrong, it's annoying me, because this jar file is
what's missing me to conclude this project.
Any ideas?
Thanxs
Antonio Fonseca



Davis 06-04-2004 04:53 PM

Re: After Jar creation, when I call from another project gives me java.lang.NoClassDefFoundError
 
"asfonseca" <asfonseca@salvadorcaetano.pt> wrote in message news:<e85913b7593b0ac3833e4996bdfab82e@localhost.t alkaboutprogramming.com>...
> I'm using WebSphere.
> I've create a java project, with one class, that has several methods.
> Export it has a jar file. Then in another project add it in libraries has
> an external jar file.
> When I call methods from that class, it recognizes every method, and
> compiles ok. When I try to run it it gives me
> "java.lang.NoClassDefFoundError".
> Can I create a jar file from a java project?
> I'm doing something wrong, it's annoying me, because this jar file is
> what's missing me to conclude this project.
> Any ideas?
> Thanxs
> Antonio Fonseca


The java.lang.NoClassDefFoundError is the most irritating error you
can get. I have put together a White Paper on the issues using
packages in jar files. You can view it at
http://www.sqlmagic.com/resources/jarfiles.htm. Hope it helps.

Roedy Green 06-04-2004 06:39 PM

Re: After Jar creation, when I call from another project gives me java.lang.NoClassDefFoundError
 
On Fri, 04 Jun 2004 05:51:28 -0400, "asfonseca"
<asfonseca@salvadorcaetano.pt> wrote or quoted :

>NoClassDefFoundError


see
http://mindprod.com/jgloss/errormess...SDEFFOUNDERROR

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

Micha 06-04-2004 09:38 PM

Re: After Jar creation, when I call from another project gives me java.lang.NoClassDefFoundError
 

"asfonseca" <asfonseca@salvadorcaetano.pt> wrote in message
news:e85913b7593b0ac3833e4996bdfab82e@localhost.ta lkaboutprogramming.com...
> I'm using WebSphere.
> I've create a java project, with one class, that has several methods.
> Export it has a jar file. Then in another project add it in libraries has
> an external jar file.
> When I call methods from that class, it recognizes every method, and
> compiles ok. When I try to run it it gives me
> "java.lang.NoClassDefFoundError".
> Can I create a jar file from a java project?
> I'm doing something wrong, it's annoying me, because this jar file is
> what's missing me to conclude this project.
> Any ideas?
> Thanxs
> Antonio Fonseca
>
>

Sounds like you only have set the Java Build Path of your second program. In
WebSphere you also have to set it on the classpath in the Launch
Configuration (if its a java application), on the classpath of the server or
as the Utilies Jar in the Ear.



asfonseca 06-08-2004 12:57 PM

Re: After Jar creation, when I call from another project gives me ja
 
Thanks all, for your reply.
After all it was much more simple, I've drag and drop my jar file, in the
“web content”\”WEB-INF\lib” folder. I thought that by adding the jar as an
external JAR, would do just find, I was wrong.
I don't know if this is the right way, but, i've run several tests, and
everything, seems to work great.
I'll stick with this.
Regards,
AntonioFonseca



All times are GMT. The time now is 12:08 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.