Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Class Not found Exception

 
Gagan Tiwari
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A nice catch of "weblogic" in the trace.
 
Gagan Tiwari
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic