OK, I searched the entire system for struts JAR files. The only
difference I found betw. this project and the one that works is that
WEB-INF/lib contained struts-legacy.jar. So, I moved that out, tried
again, same problem. I checked the struts.jar and struts-el.jar files
for an instance of PropertyMessageResourcesFactory and found that
struts.jar did in fact contain this.
I'm at a loss. The class is there, the JAR files in WEB-INF/lib are
included in the jspc.classpath for the jasper taskdef. And I keep coming
back to the fact that this works against the tomcat4 libs and not
against the tomcat5 libs! Here's my taskdef:
<taskdef classname="org.apache.jasper.JspC"
name="jasper2">
<classpath id="jspc.classpath">
<fileset
dir="${tomcat.home}/common/lib">
<include name="*jasper*.jar"/>
<include name="*jsp*.jar"/>
<include name="*servlet*.jar"/>
<include
name="*commons-el*.jar"/>
</fileset>
<fileset dir="${webroot}/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
<pathelement path="${build.dir}"/>
<pathelement
location="${env.JAVA_HOME}/lib/tools.jar"/>
</classpath>
</taskdef>
In the fileset for /common/lib, I was including *.jar, but I thought
that something in there may be conflicting, so I enumerated just the
ones I figured it needed. You can see, "*.jar" from WEB-INF/lib is
included in the CLASSPATH. As mentioned previously, the JDK is IBM's,
1.4.2 - so JAVA_HOME is /usr/lib/jvm/java-1.4.2-ibm.
Help?!
-----Original Message-----
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Friday, April 01, 2005 12:36 PM
To: Tomcat Users List
Subject: Re: Jasper throws ExceptionInInitializerError?!
It could be conflicting versions of struts.
-Tim
Ruth, Brice wrote:
> More info.
>
> Finally got Eclipse to attach to the Ant build process. Now, I find
> that the root problem (after stepping through a few levels) is a
> ClassNotFoundException for
> org.apache.struts.util.PropertyMessageResourcesFactory.
>
> How odd ... yet against tomcat4, this works fine, but tomcat5, it
fails.
>
> What the heck?! Is this a classloader issue?!
>
> -----Original Message-----
> From: Ruth, Brice [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 01, 2005 11:57 AM
> To: Tomcat Users List
> Subject: RE: Jasper throws ExceptionInInitializerError?!
>
> One thing I forgot to mention - when I do turn on debug for Ant, the
> root cause that's shown is a NullPointerException.
>
> java.lang.ExceptionInInitializerError
> at java.lang.Class.forName1(Native Method)
> at java.lang.Class.forName(Class.java:180)
> at
> org.apache.strutsel.taglib.html.ELHtmlTagBeanInfo.class$(ELHtmlTagBean
> In
> fo.java:88)
> at
> org.apache.strutsel.taglib.html.ELHtmlTagBeanInfo.getPropertyDescripto
> rs
> (ELHtmlTagBeanInfo.java:88)
> at
> java.beans.Introspector.getTargetPropertyInfo(Introspector.java:477)
> at java.beans.Introspector.getBeanInfo(Introspector.java:390)
> at java.beans.Introspector.getBeanInfo(Introspector.java:159)
> at
> org.apache.jasper.compiler.Generator$TagHandlerInfo.<init>(Generator.j
> av
> a:3684)
> at
> org.apache.jasper.compiler.Generator$GenerateVisitor.getTagHandlerInfo
> (G
> enerator.java:2102)
> at
> org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.j
> av
> a:1583)
> at
> org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
> ...
> Caused by: java.lang.NullPointerException
> at
> org.apache.struts.util.MessageResources.getMessageResources(MessageRes
> ou
> rces.java:577)
> at
> org.apache.struts.taglib.html.HtmlTag.<clinit>(HtmlTag.java:96)
>
> Googling on getMessageResources and NullPointerException gets me a
> bunch of hits about Struts not being configured right, etc. Basically,
> that Struts can't find the Resources bundle configured in
struts-config.xml.
>
> Yet, if that were truly a config problem, then it wouldn't work when
> compiling against Tomcat4, right? And it wouldn't compile correctly on
> my G5 w/ Tomcat 5.0.28, right? That's my train of thought, at least
...
>
> I've gone through the source now, starting with ELHtmlTagBeanInfo as
> well as MessageResources.getMessageResources - stepping back through
> other source as needed, and I haven't come across anything that would
> appear to be a smoking gun.
>
> Please advise!
>
> Best,
> Brice Ruth
>
> -----Original Message-----
> From: Ruth, Brice [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 01, 2005 11:21 AM
> To: [email protected]
> Subject: Jasper throws ExceptionInInitializerError?!
>
> Good morning,
>
> I am migrating an automated build process from a Windows 2K system to
> a RedHat EL 3 system, with some trouble. When I run a particular build
> via Ant, that uses the JSP precompiling task (jasper2), it fails, but
> somehow, not immediately. When I go into the output or destination
> directory for the jasper task, the first .java file is created ... it
> bombs out, though, at the place in the JSP where the Struts html:html
> tag is first encountered.
>
> What's more frustrating, is that on the RHEL3 system, I have tomcat4
> and
> tomcat5 installed (4.1.31 and 5.0.30). When I provide a tomcat.home
> property that points to Tomcat4 (so the common/lib JARs from tomcat4
> are used), it builds fine. When I specify a tomcat.home pointing to
> tomcat5, it fails.
>
> The Tomcat packages were installed from the JPackage project and are
> running against IBM's 1.4.2 JDK (Intel/x86).
>
> I've spent many hours on this, tried a variety of things, all with no
> success. It seems that either (a) something is missing from a
> CLASSPATH or (b) there is a conflict somehow. Note, the project (with
> the same build.xml file) runs just fine on our local systems ... my
> local development platform is a dual G5 (Mac) w/ Tomcat 5.0.28 - no
> problems here. We also use the MyEclipse plug-in to Eclipse which
> pre-compiles JSPs in the background for syntax checking, and it
> doesn't have any problem with the project configuration. Moreover, on
> the Win 2K box, this was all working fine, albeit compiling for a
> Tomcat4 target, not Tomcat5.
>
> I am at my wits end here. Any help or pointers would be most
> appreciated.
>
> Here's the error from the Ant build:
>
> jspc:
> [copy] Copying 1 file to
> /opt/build/checkout/Imagebank/WebRoot/WEB-INF
> [jasper2] log4j:WARN No appenders could be found for logger
> (org.apache.jasper.compiler.JspRuntimeContext).
> [jasper2] log4j:WARN Please initialize the log4j system properly.
>
> BUILD FAILED
> /opt/build/build-Imagebank.xml:9: The following error occurred while
> executing this line:
> /opt/build/checkout/Imagebank/build.xml:201:
> java.lang.ExceptionInInitializerError
>
> I can turn on the debugging output for Ant if more verbosity is
> necessary.
>
> p.s. Another project builds just fine on this platform, against
> tomcat5, using the same frameworks (Struts, etc.).
>
> Brice D. Ruth
> Sr. IT Analyst
> Fiskars Brands, Inc.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]