Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Strange Problem

 
Pawan Ramchandani
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

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
website above. 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 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:


[error-code]

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

javax.servlet.ServletException: javax/servlet/jsp/tagext/TagExtraInfo
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:256)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


root cause

java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagExtraInfo
java.lang.ClassLoader.defineClass0(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:537)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
java.net.URLClassLoader.access$100(URLClassLoader.java:55)
java.net.URLClassLoader$1.run(URLClassLoader.java:194)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:187)
java.lang.ClassLoader.loadClass(ClassLoader.java:289)
java.lang.ClassLoader.loadClass(ClassLoader.java:282)
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
java.lang.ClassLoader.loadClass(ClassLoader.java:235)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1278)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1212)
org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:455)
org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:295)
org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:204)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:460)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:525)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1625)
org.apache.jasper.compiler.Parser.parse(Parser.java:173)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:247)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:149)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:135)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:243)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:437)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:555)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


note The full stack trace of the root cause is available in the Tomcat logs.

[/error-code]




what am i missing here?

thanks
 
Pankaj Narang
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Pawan

In loginView.Jsp wat is ur form action if it is loginaction is it defined in Struts-config file check the mappings of ur action file in action mapping of ur struts-config and also the form u r using .

This may solve the problem

Best regards
Pankaj
 
Pankaj Narang
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear pawan

Also check the enteries u have done for tld's in Web.xml

Best Regards
Pankaj
 
Pankaj Narang
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear pawan

Also check the enteries u have done for tld's in Web.xml

Best Regards
Pankaj
 
Pawan Ramchandani
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Pankaj,

Thanks a lot to reply,i have checked al which you suggested me this the discription of config

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">

<struts-config>

<!-- ========== Form Bean Definitions ============ -->
<form-beans>
<form-bean name="login" type="test.struts.LoginForm" />
</form-beans>


<!-- ========== Global Forward Definitions ========= -->
<global-forwards>
</global-forwards>


<!-- ========== Action Mapping Definitions ======== -->
<action-mappings>
<action
path="/login"
type="test.struts.LoginAction"
name="login"
input="/jsp/LoginView.jsp"
validate="true">

<forward name="valid" path="/jsp/MainMenu.jsp" />
<forward name="invalid" path="/jsp/LoginView.jsp" />
</action>
</action-mappings>

</struts-config>



There is one class file called "TagExtraInfo.clsass" in servlet.jar tomcat is unable to read this class this is the problem.
[ June 08, 2004: Message edited by: Pawan Ramchandani ]
 
Pawan Ramchandani
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
help needed!
 
Pankaj Narang
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear pawan

Ur struts config is correct , did u chck the Tag LIb enteries in web.xml and try replacing servlet .jar with a new one.

This may work


Best Regards Pankaj
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic