wood burning stoves 2.0
The moose likes JBoss/WildFly and the fly likes <jsp:useBean> error with JBoss 7.1.1.Final Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "<jsp:useBean> error with JBoss 7.1.1.Final" Watch "<jsp:useBean> error with JBoss 7.1.1.Final" New topic

<jsp:useBean> error with JBoss 7.1.1.Final

Bryan Brown

Joined: Mar 27, 2013
Posts: 4
I'm currently trying to upgrade my company's application from JBoss 4.2 to JBoss 7.1.1.Final. I have gotten most areas to work except for a section of code that is using <jsp:useBean>. The error that i'm getting is:

2013-03-27 14:00:22: ERROR ApplicationDispatcher->invoke: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 2 in the jsp file: /ChooseReport.jsp
orderreportgateway cannot be resolved to a type
1: <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
2: <jsp:useBean id="reportList" scope="request" class="orderreportgateway.beans.ReportListBean" />
3: <html>
4: <head>
5: <link rel="stylesheet" type="text/css" href="/images/newEclipse.css">

at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:446)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:362)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:607)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:312)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:840)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:622)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:560)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:488)
at OrderReportGateway.forward(OrderReportGateway.java:441)
at OrderReportGateway.chooseReport(OrderReportGateway.java:370)
at OrderReportGateway.process(OrderReportGateway.java:138)
at OrderReportGateway.doGet(OrderReportGateway.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
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:368)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
at java.lang.Thread.run(Thread.java:662)

My bean is located in the package "orderreportgateway.beans". My jsp is located in the root web folder. My file structure is as follows:

Project.war -> ChooseReport.jsp

Project.war -> WEB-INF -> classes -> orderreportgateway -> beans -> ReportListBean.class

I have all ready tried changing class="" to type="". I have also made sure that my bean has a default constructor that doesn't have any input parameters. My bean is not in the default package either. I don't understand why it is telling my that my first package name can't be resolved to a type. I don't think that it should be trying to validate it as a type since it is a package. When I redeploy this exact same code in JBoss 4.2, it works perfectly.

I guess another thing i should mention is that my JBoss 4.2 server is justing Java 5 and my JBoss 7.1.1.Final server is using Java 6. The JBoss 4.2 server is running on both Windows 7 (my development instance) and Unix. My JBoss 7.1.1.Final server is only running on Windows 7 (my development instance) until I get the last few problems solved. Then it will be moved to Unix.

My JSP is as follows (ChooseReport.jsp)

My bean is as follows (ReportListBean.java)

Any help would be greatly appreciated.
Bryan Brown

Joined: Mar 27, 2013
Posts: 4
I still haven't solved this problem. I have gone over every piece of code with a fine toothed comb checking it. All of the spelling is correct and all of my folder structures are correct. I even checked to make sure I didn't have any leading or trailing white space on any of the names or folders. Any help would be greatly appreciated.
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10430

By any chance do you have a class named orderreportgateway (with some different case) in that application?

[My Blog] [JavaRanch Journal]
Bryan Brown

Joined: Mar 27, 2013
Posts: 4
I do. In the default package there is a servlet with the name OrderReportGateway.java. It is the main entry point into the application.
James Boswell

Joined: Nov 09, 2011
Posts: 1051


I suggest moving this servlet from the default package to some other custom package which you should create beforehand.
Bryan Brown

Joined: Mar 27, 2013
Posts: 4
That did the trick. I moved OrderReportGateway.java into a new package called orderreportgateway and everything started working again. I didn't even think about doing this because I thought java was case sensative. When it kept telling me that orderreportgateway could not be resolved as a type, I kept looking at the package name and not an unrelated class. Thank you for your help. This problem has been consuming me for a few days now.
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10430

Actually, it's a known bug involving Windows OS:

I agree. Here's the link: http://aspose.com/file-tools
subject: <jsp:useBean> error with JBoss 7.1.1.Final