aspose file tools*
The moose likes Struts and the fly likes java lang NoClassDefFoundError : javax/ servlet/ jsp/ tagext/ TagExtraInfo Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "java lang NoClassDefFoundError : javax/ servlet/ jsp/ tagext/ TagExtraInfo " Watch "java lang NoClassDefFoundError : javax/ servlet/ jsp/ tagext/ TagExtraInfo " New topic
Author

java lang NoClassDefFoundError : javax/ servlet/ jsp/ tagext/ TagExtraInfo

Sudha Joish
Greenhorn

Joined: Nov 07, 2003
Posts: 12
hi pple
i have an application written using JSPs and Servlets. my next step is to use Struts and modify it.
this is my first try at struts and tied to run my first sample application from:
http://www.javaranch.com/newsletter/Mar2002/newslettermar2002.jsp#struts
am using struts 1.0.2, Tomcat 5.0.12
this is what i did:
i placed:
-- struts.jar in the C:\Tomcat_5.0\webapps\struts\WEB-INF\lib folder
-- all .tld files in the C:\Tomcat_5.0\webapps\struts\WEB-INF folder
-- servlet-api.jar and struts.jar in C:\j2sdk1.4.2\jre\lib\ext folder
i have a LoginBean.java, LoginAction.java and LoginForm.java from the URL. i have merely compiled them and placed them along with the
MessageResources.properties file in the:
C:\Tomcat_5.0\webapps\struts\WEB-INF\classes\test\struts folder.
i have placed LoginView.jsp and MainMenu.jsp in:
C:\Tomcat_5.0\webapps\struts\jsp folder.
i have reallly followed all the instructions!!
i started Tomcat 5.0 server and when i request for:
http://127.0.0.1:8080/struts/jsp/LoginView.jsp in my browser, i get the
following error message:


And i tried out another sample frm:
http://www.reumann.net/do/struts/lesson1
its the same error again.
so, what am i missing here?
i cant start my own stuff when i cant get a sample tutorial version working!
please help.
thanks
-- $uDhA
Loren Rosen
Ranch Hand

Joined: Feb 12, 2003
Posts: 156
Struts needs a number of other non-struts java classes when it runs. You'll need most if not all of the jar files that are in your struts distribution's lib directory.
Sudha Joish
Greenhorn

Joined: Nov 07, 2003
Posts: 12
thanks for the reply.
i shall try placing all the other jar files in the lib directory.
but the .war file that i downloaded frm the 2nd link DID indeed have all the files - when i extracted it. i wonder why even that gave me the same error!
any thoughts on that?
thanks
-- $uDhA
Loren Rosen
Ranch Hand

Joined: Feb 12, 2003
Posts: 156
TagExtra info is in j2ee.jar, which is part of the J2EE SDK which you can get from java.sun.com. You'll need to put it in the lib directory as well. My guess is that whoever wrote the tutorial you're trying used an appserver that already had this installed.
Sudha Joish
Greenhorn

Joined: Nov 07, 2003
Posts: 12
Thanks for the response.
I removed the copy of struts.jar from java_home/jre/lib/ext directory.
After I did that, I get a new error now:

for the sample at
JavaRanch Tutorial
But after I did that, I could get the other sample at
Other Tutorial
working like a champ.
Thats crazy!! Any clues on that?
Thanks
-- $uDhA
Sudha Joish
Greenhorn

Joined: Nov 07, 2003
Posts: 12
Missed out mentioning in the previous post:
Both tutorials are supposed to be working samples.
And the only difference I see is that the JavaRanch tutorial uses Struts 1.0.2 and the other tutorial uses Struts 1.1.
Thanks
-- $uDhA
Loren Rosen
Ranch Hand

Joined: Feb 12, 2003
Posts: 156
What happens depends on precisely how your classpath is set up. This may or may not be a simple question of what your CLASSPATH variable is set to. You're probably starting tomcat (or whatever servlet container you're using) via some startup script which may set its own classpath. Also, many containers do special things with classloaders, which can complicate matters.
Anyway, as you can see here, putting extra stuff into your java home is something to be careful about. On the whole its better to to have a jar file not be in the class path (so you get a simple error about not finding something) than to have multiple versions of it in the class path (and have confusion about which one is actually being used).
 
Consider Paul's rocket mass heater.
 
subject: java lang NoClassDefFoundError : javax/ servlet/ jsp/ tagext/ TagExtraInfo