Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
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
Medium Priority
?
219 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
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 200 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

719 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