Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The value for the useBean class attribute "..." is invalid.

 
Rekha Pai
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using tomcat 6 and pogresql 9.0.1
I created a java bean in the package "beans" and placed it under
WEB_INF/classes directory. I am accessing the bean in my jsp page
using the following code.

<%@ page import = "beans.*, java.sql.*"%>

<jsp:useBean id="verify" scope="session" class="PasswordEncryptService" />

This is giving me the error as follows.

org.apache.jasper.JasperException: /apps/InfoMgmt/secureNew/VerifyPassword.jsp(11,0) The value for the useBean class attribute PasswordEncryptService is invalid.

Can anybody help me in solving this problem?

Regards,
Rekha
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try beans.PasswordEncryptService.
 
Rekha Pai
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Trying class=beans.PasswordEncryptService also did not work.
Regards,
Rekha
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. class="beans.PasswordEncryptService", not class=beans.PasswordEncryptService
2. WEB-INF, not WEB_INF
3. Does the PasswordEncryptService class have a public non-argument constructor ?
 
Rekha Pai
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Yes it is class="beans.PasswordEncryptService"
It is WEB-INF and not WEB_INF.

The PasswordEncryptService has a no argument constructor.
Here is the code.

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you have WEB-INF/classes/beans/PasswordEncryptService.class ?
 
Rekha Pai
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I have WEB-INF/classes/beans/PasswordEncryptService.class
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mmmh... It's in the same application as your JSP file, isn't it ? Also, did you try to reboot the web container ? Did you check the logs ?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ooohh. Maybe you have an exception happening in your constructor. Please check your logs.
 
Rekha Pai
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I restarted tomcat. And loaded the page again.

This is the catalina.2010-11-12.log

Nov 12, 2010 1:43:08 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /apps/InfoMgmt/secureNew/VerifyPassword.jsp(11,0) The value for the useBean class attribute beans.PasswordEncryptService is invalid.
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1272)
at org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1178)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:495)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
at org.apache.jasper.compiler.Generator.generate(Generator.java:3426)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:216)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:332)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok. Still thinking... Even if an exception was raised in the constructor, you're just dumping the error, so that would not prevent the bean instantiation... I'm running out of gas. Can you show me your complete directory structure ? The one under webapps. Be extra careful to uppercase, lowercase, symbols...
 
Rekha Pai
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
webapps has these many directories
apps examples jsp-examples ROOT webdav
balancer fixPath.sh manager servlets-examples
docs host-manager OpenOfficeDocHandling tomcat-docs
And PasswordEncryptService.java and PasswordEncryptService.class
are in the following directory.

/usr/local/apache-tomcat-6.0.20/webapps/apps/WEB-INF/classes/beans
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you put the Apache Commons library under WEB-INF/lib ?
 
Rekha Pai
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apache commons directory I have not put under WEB-INF/lib.
Right now I have left office. I will work on this issue on Monday
and get back.

Thanks and Regards,
Rekha.
 
Rekha Pai
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have copied all the *.jar files from common/lib to WEB-INF/lib.
Still I am getting the error.

Regards,
Rekha.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic