This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Getting Problem in display tag with struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Getting Problem in display tag with struts" Watch "Getting Problem in display tag with struts" New topic
Author

Getting Problem in display tag with struts

Rahman ziaur
Greenhorn

Joined: Mar 30, 2011
Posts: 23

My Struts-config ======



web.xml==============


Java Class-----========


userForm.java===================


userAction.java===============


my user.jsp=============




these all are my file and when i ma running this its giving me error....

exception

root cause




So please anyone help me because i am new in struts...and i am using strust1.3

Thanks in advance
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8833
    
    7

Welcome to the JavaRanch.
In the future, please UseCodeTags. They preserve your indents and make your code easier to read. I have fixed your post above.

Your exception indicates that you are missing a class:



Struts has many dependencies that need to be packaged with your web app. You could go to the Apache Commons project and download this dependency, but you could run into problems with Struts using an earlier version of the library. The easiest thing to do is look in the Struts distribution you downloaded. There should be an apps directory with some example applications. The "struts-blank" application is intended to be the starting point for a new application. All the struts dependencies can be found in the WEB-INF/lib directory of that WAR file.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Rahman ziaur
Greenhorn

Joined: Mar 30, 2011
Posts: 23

thanks for your quick reply but will you tell me which class i am missing?I am having all the neccessary jar file in my lib folder in project.
Lin Lat
Greenhorn

Joined: Mar 30, 2011
Posts: 3
I tested displaytag with struct 1.3.
You will need 5 more jar files in addition to jar files come with struct blank 1.3.
Those jar file are :

commons-collections-2.1.1.jar
commons-lang-2.1.jar
displaytag-1
displaytag-export-poi
displaytag-portlet


Please check whether you already added those.
Rahman ziaur
Greenhorn

Joined: Mar 30, 2011
Posts: 23

lin lat thnx for your response..
i have thes jar file in my web-inf/lib directory..just i dont have struts balnk.jar
commons-collections-1.3.jar
commons-lang-1.2.jar
displaytag-1
displaytag-export-poi
displaytag-portlet


now i will add the struts blank.jar and check..i am using struts1.3.



Rahman ziaur
Greenhorn

Joined: Mar 30, 2011
Posts: 23

Hi Lin Lat where i will have to put my strust-blank.war ..i have putted it in C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps directore but still getting same arror message.
Please help me soon
Lin Lat
Greenhorn

Joined: Mar 30, 2011
Posts: 3
Did your struct application work fine before using displaytag?
If it is working fine before using displaytag, you don't need to add strut blank.war. Just adding 5 jars I mentioned is enough for using display tag. But don't forget to add configure them in project build path too.

If you haven't checked that, please do the following to start a new project.

1. Create a new tomcat project.
2. Extract struct struts-blank-1.3.10.war.
3. Add to the project and override existing files.
5. then add additional 5 jars to WEB-INF/lib and configure to project build path too.
4.Then restart your paging implementation.

Better you refer to the following link for step 4. All things can be done same. Except this sample creates Dynamic Web Project instead of Tomcat Project.
http://viralpatel.net/blogs/2009/06/struts-displaytag-tutorial-sort-pagination-data-displaytag-struts.html

Hope this help you...
Rahman ziaur
Greenhorn

Joined: Mar 30, 2011
Posts: 23

Hi Lin, once again thnx for your quick response.Yes my application rum before using displaytag.
i did aal the things,have added the all 5 jar but still getting same problem.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8833
    
    7

What is the full exception stack trace?
Rahman ziaur
Greenhorn

Joined: Mar 30, 2011
Posts: 23

hi joe ess my fuul exception are----
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/commons/lang/UnhandledException
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause

javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/commons/lang/UnhandledException
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:268)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)
org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause

java.lang.NoClassDefFoundError: org/apache/commons/lang/UnhandledException
java.lang.Class.getDeclaredConstructors0(Native Method)
java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
java.lang.Class.getConstructor0(Unknown Source)
java.lang.Class.newInstance0(Unknown Source)
java.lang.Class.newInstance(Unknown Source)
java.beans.Introspector.instantiate(Unknown Source)
java.beans.Introspector.findExplicitBeanInfo(Unknown Source)
java.beans.Introspector.<init>(Unknown Source)
java.beans.Introspector.getBeanInfo(Unknown Source)
org.apache.jasper.compiler.Generator$TagHandlerInfo.<init>(Generator.java:3888)
org.apache.jasper.compiler.Generator$GenerateVisitor.getTagHandlerInfo(Generator.java:2155)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1628)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417)
org.apache.jasper.compiler.Node$Root.accept(Node.java:495)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
org.apache.jasper.compiler.Generator.generate(Generator.java:3440)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:231)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:347)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)
org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause

java.lang.ClassNotFoundException: org.apache.commons.lang.UnhandledException
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
java.lang.ClassLoader.loadClassInternal(Unknown Source)
java.lang.Class.getDeclaredConstructors0(Native Method)
java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
java.lang.Class.getConstructor0(Unknown Source)
java.lang.Class.newInstance0(Unknown Source)
java.lang.Class.newInstance(Unknown Source)
java.beans.Introspector.instantiate(Unknown Source)
java.beans.Introspector.findExplicitBeanInfo(Unknown Source)
java.beans.Introspector.<init>(Unknown Source)
java.beans.Introspector.getBeanInfo(Unknown Source)
org.apache.jasper.compiler.Generator$TagHandlerInfo.<init>(Generator.java:3888)
org.apache.jasper.compiler.Generator$GenerateVisitor.getTagHandlerInfo(Generator.java:2155)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1628)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1530)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417)
org.apache.jasper.compiler.Node$Root.accept(Node.java:495)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
org.apache.jasper.compiler.Generator.generate(Generator.java:3440)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:231)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:347)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)
org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.29 logs.

Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8833
    
    7

There's two things going on here. First you have the class not found exception. That class is in the Apache Commons Lang library (the commons-lang-1.2.jar included with display tag), so you should have that dependency solved. This draws into question your build and deploy cycle. How are you building your app? Are you certain that the code in Tomcat is your latest version?
Next, what's triggering the exception? Surround your action code with a try-catch.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting Problem in display tag with struts
 
Similar Threads
making of grid using display in struts 1.2
No getter method for property: "userName" of bean: "result"
doen no to the desired page on clicking the button
Struts2 with Display tag issue
SpringMVC 2.5 and DisplayTags