• Post Reply Bookmark Topic Watch Topic
  • New Topic

JavaBean problem

 
Steven Farthing
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to JSP and javaBeans, but I have been numerous JavaBean tutorials step by step and I have gotton none to work. Currently, I am running Apache Tomcat/5.5.23 on a windows xp sp2 machine (though I have changed versions several times in an attempt to get JavaBeans working).

I copied activation.jar to \common\lib. The JAR file contains the classes that make up JavaBeans(tm) Activation Framework.

I wrote the most Straight Forward javabean ...

I compilied with java 1.6 and placed the .class file in the root/WEB-INF/classes/test folder.

I then wrote testBean.jsp:


Then when I access testBean.jsp I get
type Exception report

message

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

exception

org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:599)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:141)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause

java.lang.ClassNotFoundException: org.apache.jsp.testBean_jsp
java.net.URLClassLoader$1.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(Unknown Source)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:597)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:141)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.23 logs.
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the invoker servlet is disabled by default in this version of tomcat. So, you have to deploy as an app. Try searching thte for invoker servlet.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As the OP makes no mention of a servlet, I'm not sure how the Invoker comes into play.
 
Suman Sharma
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
testBean.jsp

Try using the import attribute in the page directive.

<%@ page language="java" import="test.testBean" %><jsp:useBean id="testBean" class="test.testBean" scope="session"></jsp:useBean>
 
Steven Farthing
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! it works finally
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!