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
207 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
  • 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
 
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Hyena v12.2 is now available for downloading and is available in English, French, German and Spanish versions.
A Short Story about the Best File Recovery Software – Acronis True Image 2017
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now