0
votes

I am facing an error after moved my site from one server to other.

My problem is java bean is working fine if page is at root folder. for example "mydomain.com/page1.jsp" is working fine BUT if I put the page in folder then it's give me below error. for example "mydomain.com/test/page1.jsp" is give me error.

Error is :

org.apache.jasper.JasperException: /office_listing.jsp(29,0) The value for the useBean class attribute com.realtor.website.WebdbBean is invalid. org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148) org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1204) org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1117) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2166) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2216) org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2222) org.apache.jasper.compiler.Node$Root.accept(Node.java:457) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2166) org.apache.jasper.compiler.Generator.generate(Generator.java:3384) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:207) org.apache.jasper.compiler.Compiler.compile(Compiler.java:326) org.apache.jasper.compiler.Compiler.compile(Compiler.java:307) org.apache.jasper.compiler.Compiler.compile(Compiler.java:295) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:565) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:309) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259) javax.servlet.http.HttpServlet.service(HttpServlet.java:729)


JSP code is :

    <%@page contentType="text/html; charset=iso-8859-1" language="java"     import="java.sql.*,java.lang.*" import="java.text.*" import="java.util.*" errorPage="" %>

    <jsp:useBean class="com.realtor.website.WebdbBean" id="webdb" scope="session"/>

Can anyone guide me what can be the problem. OR do I need to take care anything specially when I change my server? Earlier and now, both time there is linux server Apache tomcat 5.5.

2

2 Answers

0
votes

Where is WebdbBean class? The WebdbBean.class must be at WEB-INF/classes/com/realtor/website

0
votes

This error basically means that the following

WebdbBean webdb = new WebdbBean(); 

has failed. Given the fact that it works fine in another page (and that you didn't typo'ed the class attribute), it's definitely in the classpath, so a possible cause of ClassNotFoundException can be scratched. Left behind that the bean's construction has plain failed. Apparently you're doing something in the default constructor which can possibly throw an unhandled exception. Its stacktrace should then be visible in the server logs. Read it and fix the root cause accordingly.