aspose file tools*
The moose likes Struts and the fly likes Class Not found Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Class Not found Exception" Watch "Class Not found Exception" New topic
Author

Class Not found Exception

Gagan Tiwari
Ranch Hand

Joined: Jun 10, 2008
Posts: 71
Hi All,
I am relatively new to the STRUTS and by the review of books on this forum I have picked up the following book
Struts 2 Design and Programming by Budi Kurniawan.

I have downloaded STRUTS 2.1.6 and I am using Tomcat 5.5 and Java 1.6.

I am making the First Struts Application which is "app02a" in the book. However when I am starting the Tomcat, It is giving me the follwoing error
SEVERE: Exception starting filter Struts2
java.lang.NoClassDefFoundError: org/apache/xalan/processor/TransformerFactoryImpl
at weblogic.xml.jaxp.RegistryTransformerFactory.<init>(RegistryTransformerFactory.java:62)
at weblogic.xml.jaxp.RegistrySAXTransformerFactory.<init>(RegistrySAXTransformerFactory.java:12)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
Now this Class isin XALAN.jar.
So wanted to know that do I need to download this jar or is there anything incorect in the way I am doing the things.

Counting on great help and support from the users.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
You need to download and include the xalan.jar library to your classpath. Simple is that. I am not sure if it comes with the Struts package, it looks like it is not.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Are you sure you have a fresh install of Tomcat? You shouldn't need to download it at all, and it's certainly not part of Struts. I'm running Struts 2 apps on Tomcat 5.5.mumble on three different platforms and didn't need to download anything.

Are you sure you're using Tomcat? Have you mixed libraries across servers? What S2 libraries are you deploying? The following line is puzzling:
Your 'Tomcat' wrote: at weblogic.xml.jaxp.RegistrySAXTransformerFactory.<init>(RegistrySAXTransformerFactory.java:12)


Gagan Tiwari
Ranch Hand

Joined: Jun 10, 2008
Posts: 71
Yes I am using the Tomcat.
Actually it was installed by the local IT support and the path is
D:\Program Files\Apache Software Foundation\Tomcat 5.5
So I suppose the version is 5.5 only.

Regarding the MIXED libraries, I have made a simple JSP and SERVLET application which I kept in
"D:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps" Folder which was working fine.

Now I made the basic struts application with name as "app02a" and kept in webapps folder and when I started the server I got this error in the localhost logs file inside logs folder.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I wrote:What S2 libraries are you deploying?

You shouldn't be seeing a message from a weblogic class, unless maybe Weblogic uses a version of Tomcat and your IT department installed that instead of vanilla tomcat.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
A nice catch of "weblogic" in the trace.
Gagan Tiwari
Ranch Hand

Joined: Jun 10, 2008
Posts: 71
I have the following jars in the lib of the WEB-INF
1.struts2-core-2.1.6.jar
2. xwork-2.1.2.jar
3. xalan.jar

Now after this I am getting the following exception

java.lang.NoClassDefFoundError: org/apache/xml/serializer/TreeWalker
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformerHandler(TransformerFactoryImpl.java:755)
at com.opensymphony.xwork2.util.DomHelper$DOMBuilder.setup(DomHelper.java:198)

I suppose since I downloaded the xalan.jar 2.7 and hence I need the serializable.jar also (Which is seperated or you can say packed as a seperate JAR).

Will try with this JAR in the path and update.
 
 
subject: Class Not found Exception