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
210 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
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…

809 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