tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: Duplicate Class Names in JSP Question
Date Thu, 15 Nov 2001 03:35:03 GMT
The generated Java class for your JSP page is required to be legal Java
code -- and it's not legal to import both of these names in the same
source file.  Therefore, your program is in error.

Craig


On Wed, 14 Nov 2001, Thomas Burns wrote:

> Date: Wed, 14 Nov 2001 21:36:21 -0600
> From: Thomas Burns <tburns@67systems.com>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>,
>      Thomas Burns <tburns@67systems.com>
> To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> Subject: Duplicate Class Names in JSP Question
>
> I have the following code in one of my .jsp files.
> <%@ page import="com.redsoft.ems.beans.app.User" %>
> <%@ page import="com.redsoft.ems.tags.app.User" %>
>
> It causes the errors listed below. Interestingly, if I comment out either page directive,
I don't get the error. I also verified through testing that the problems seems to be related
to the ending classname being the same (ie. User). I created two classes with the same class
name, but in different packages and still had the same problem. I did verify that the two
.User classes don't have overlapping names and have package statments that are correct.
>
> Brief searches in the bug database did not yield suggestions or bug reports. Am I missing
something?
>
> Thoughts?
> Thanks,
> -Tom
> Houston, TX
>
>
> ---------------------------------------------------
>
>
>
> A Servlet Exception Has Occurred
> Exception Report:
> javax.servlet.ServletException: Unable to compile class for JSPimport com.redsoft.ems.tags.app.User;
>        ^
> import com.redsoft.ems.tags.app.User;
>        ^
> 2 errors
>
> 	at com.redsoft.ems.ActionServlet.routeAction(ActionServlet.java:115)
> 	at com.redsoft.ems.ActionServlet.service(ActionServlet.java:72)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown Source)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
> 	at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
> 	at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
> 	at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
> 	at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
> 	at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
> 	at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
> 	at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
> 	at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
> 	at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
> 	at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
> 	at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
> 	at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
> 	at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
> 	at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
> 	at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
> 	at org.apache.catalina.connector.warp.WarpRequestHandler.handle(Unknown Source)
> 	at org.apache.catalina.connector.warp.WarpConnection.run(Unknown Source)
> 	at java.lang.Thread.run(Thread.java:484)
>
> Root Cause:
> org.apache.jasper.JasperException: Unable to compile class for JSPimport com.redsoft.ems.tags.app.User;
>        ^
> import com.redsoft.ems.tags.app.User;
>        ^
> 2 errors
>
> 	at org.apache.jasper.compiler.Compiler.compile(Unknown Source)
> 	at org.apache.jasper.servlet.JspServlet.loadJSP(Unknown Source)
> 	at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(Unknown Source)
> 	at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Unknown Source)
> 	at org.apache.jasper.servlet.JspServlet.serviceJspFile(Unknown Source)
> 	at org.apache.jasper.servlet.JspServlet.service(Unknown Source)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at org.apache.catalina.core.ApplicationDispatcher.invoke(Unknown Source)
> 	at org.apache.catalina.core.ApplicationDispatcher.doForward(Unknown Source)
> 	at org.apache.catalina.core.ApplicationDispatcher.forward(Unknown Source)
> 	at com.redsoft.ems.action.ActionRouter.route(ActionRouter.java:45)
> 	at com.redsoft.ems.ActionServlet.routeAction(ActionServlet.java:112)
> 	at com.redsoft.ems.ActionServlet.service(ActionServlet.java:72)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown Source)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
> 	at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
> 	at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
> 	at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
> 	at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
> 	at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
> 	at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
> 	at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
> 	at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
> 	at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
> 	at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
> 	at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
> 	at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
> 	at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
> 	at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
> 	at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
> 	at org.apache.catalina.connector.warp.WarpRequestHandler.handle(Unknown Source)
> 	at org.apache.catalina.connector.warp.WarpConnection.run(Unknown Source)
> 	at java.lang.Thread.run(Thread.java:484)
>
>
>


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message