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
213 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Adults who share images on social media aren’t the only ones who need to worry about their privacy. Our culture’s tendency to share every move and celebration affects the privacy of our children, too.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

679 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