Solved

STRUTS: when i first open my page in browser it throws java.lang.NoClassDefFoundError: org.apache.struts.taglib.html.ImgTag

Posted on 2004-08-19
12
216 Views
Last Modified: 2010-04-01
Hi

I am developing a webapp using Struts framework...
When i first open my page in browser it throws java.lang.NoClassDefFoundError: org.apache.struts.taglib.html.ImgTag .. but when i hit refresh this goes away!  I am not sure why... I saw the struts.jar ofcourse it has this ImgTag class!  



root cause

java.lang.NoClassDefFoundError: org.apache.struts.taglib.html.ImgTag
      org.apache.jsp.dashboard_005fleft_jsp.class$(dashboard_005fleft_jsp.java:95)
      org.apache.jsp.dashboard_005fleft_jsp._jspx_meth_html_img_0(dashboard_005fleft_jsp.java:425)
      org.apache.jsp.dashboard_005fleft_jsp._jspService(dashboard_005fleft_jsp.java:134)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

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

thanks in advance,
venkk.
0
Comment
Question by:venkks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
12 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 11840859
is this the first time after a reboot?  or everytime you go to the site?
0
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11842526
Make sure that your servlet container can see struts.jar.
I recommend you to copy struts.jar to the folder
/WEB-INF/lib/struts.jar

and restart server and test it again. every thing should run fine.

Best luck
0
 

Author Comment

by:venkks
ID: 11843649
yep ofcourse its copied there in /WEB-INF/lib/struts.jar otherwise it wudnt load the second time when i refresh...
0
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
LVL 35

Expert Comment

by:TimYates
ID: 11843926
is this the first time after a reboot?  or everytime you go to the site?
0
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11843943
It may be a cache on that page. try to clear caching data in web browser.
0
 

Author Comment

by:venkks
ID: 11844489
TimeYates,

Its only the first time after Tomcat startup... second-time it works fine...
0
 
LVL 3

Expert Comment

by:ss_p
ID: 11850657
make sure that the struts.jar very first in Tomcat's classpath?

In case if it is not

make struts.jar the first one in Tomcat's classpath?

stop the server.

Restart it once again

Cee if this work

prasannaa
0
 

Author Comment

by:venkks
ID: 11850677
prasannna,

I said its in WEB-INF/lib then ofcourse its in CLASSPATH.. Moreover if I have mentioned if refreshed the page is displayed... that clearly means that is in CLASSPATH right?

venkk.
0
 
LVL 3

Expert Comment

by:ss_p
ID: 11850692
yes

want i want to make sure is if the classpath of struts.jar is first parameter set.

"make struts.jar the first one in Tomcat's classpath? "

this was my reply. i did not say that struts.jar is not in the classpath.

Since while tomcat satrting up it will look on to the classpath.

make sure that the classpath is the correct one that tomcat is using.

bcoz tomcat might look into another place.

just make sure if it is the first which tomcat looks for the classes of ImgTag class.


i think this might be one reason


Prasannaa
0
 
LVL 35

Accepted Solution

by:
TimYates earned 50 total points
ID: 11851407
> Its only the first time after Tomcat startup... second-time it works fine...

Yeah, it may be you are accessing the webapp too quickly after the start of tomcat, while it is still deploying the app...
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's take a look back at the commercialization of the internet to understand why keeping it open and neutral is in our best interest as a society.
Let's recap what we learned from yesterday's Skyport Systems webinar.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question