You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by bill milbratz <mi...@neodesic.com> on 2001/09/12 17:36:50 UTC

Strut-by-strut adaptation /classpath (validator.jar) problem

Hello,

This is a repost. I posted a question about this the other day, but never 
saw it in the email list. (I was transitioning from the digest to the 
regular subscription so probably missed it).

I'm adapting the strut-by-strut example and found an odd-ish classpath / 
jsp-compilation problem.

I get this message on the jsp page:

    java.lang.NoClassDefFoundError: 
com/wintecinc/struts/action/ValidatorForm 
at    java.lang.ClassLoader.defineClass0(Native Method) 
at   java.lang.ClassLoader.defineClass(Unknown Source)

I use our projects standard "ant" script to compile and build the application.

My web-inf/lib directory (in the war file) has:
struts.jar
jakarta-regexp.jar
validator.jar

Since this directory contains both struts.jar and validator.jar,  the jsp 
page should find the validator.jar classes. (I confirmed that validator.jar 
contains the class it's looking for.)

I noted that our build.xml copies the all the web-application libraries 
into to *both* the ear's and the war's lib directories. i.e., the ear file 
*also* contains a lib directory with these files 
(struts.jar,jakarta-regexp.jar, validator.jar).

I've read about class not found exceptions occuring if struts.jar is 
deployed in wrong library.

any suggestions?  Thanks.


bill


Re: Strut-by-strut adaptation /classpath (validator.jar) problem

Posted by Ted Husted <hu...@apache.org>.
It may be that there are multiple copies of the jar on your server's
path now, which, ironically, can cause NoClassDefFoundErrors. 

bill milbratz wrote:
> 
> Hello,
> 
> This is a repost. I posted a question about this the other day, but never
> saw it in the email list. (I was transitioning from the digest to the
> regular subscription so probably missed it).
> 
> I'm adapting the strut-by-strut example and found an odd-ish classpath /
> jsp-compilation problem.
> 
> I get this message on the jsp page:
> 
>     java.lang.NoClassDefFoundError:
> com/wintecinc/struts/action/ValidatorForm
> at    java.lang.ClassLoader.defineClass0(Native Method)
> at   java.lang.ClassLoader.defineClass(Unknown Source)
> 
> I use our projects standard "ant" script to compile and build the application.
> 
> My web-inf/lib directory (in the war file) has:
> struts.jar
> jakarta-regexp.jar
> validator.jar
> 
> Since this directory contains both struts.jar and validator.jar,  the jsp
> page should find the validator.jar classes. (I confirmed that validator.jar
> contains the class it's looking for.)
> 
> I noted that our build.xml copies the all the web-application libraries
> into to *both* the ear's and the war's lib directories. i.e., the ear file
> *also* contains a lib directory with these files
> (struts.jar,jakarta-regexp.jar, validator.jar).
> 
> I've read about class not found exceptions occuring if struts.jar is
> deployed in wrong library.
> 
> any suggestions?  Thanks.
> 
> bill