Julian,
Thanks for the reply. I think I've got the problem pinned. I notice by going through the source that the architecture of the "Jetty-Service" changed quite a bit and I think this is where the problem is coming from. The problem can be summarized as follows:
1) If I deploy an ejb-jar in JBoss and then deploy a war file in Jetty, the "war" file must
include the ejb's interface classes or I get a ClassNotFound exception.
2) BUT if I include the interface files in the "war" then the JVM throws a
ClassCastException when I lookup and cast the home interface because
the ejb's home interface class appear stwice in the classpath (once from the war loaded by Jetty
and once for the ejb-jar loaded by JBoss)
3) The only way I can get it to work is to deploy as an "ear file" but then I can't use virtual hosting which is an attractive feature of Jetty(or can I?)
This is a nice little catch 22. Deploy without interfaces in the "war" and get a ClassNotFoundException when a JSP/servlet tries to load an EJB home. Deploy with interfaces in the "war" and get a ClassCastException. Hope you can figure out the problem with this info. Again, I'm leaning towards the new jetty-service architecture.
-----Original Message-----
From: Julian Gosnell [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 18, 2001 7:21 PM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] ClassCastException when getting Home Interface
from within Servlet (Jetty)
Matt ,
I'm afraid I'm going to have to ask you to try running this up in the
latest JBoss-TomCat.
So much ServletContainer integration code has now become shared that I
would be surprised if it didn't share exactly the same problem. If you
find that it does then you will substantially increase the number of
people who are interested in helping you, and you will give us a much
better idea of where the problem lies.
If you are deploying an EAR then you should be able to deploy it in
exactly the same way (I think).
Let me know how it goes,
<CHEESY> Thanks for using Jetty !!! <CHEESY>
Jules
"Tilchen, Matt" wrote:
>
>
> Hello all,
>
> I am running JBoss 2.2.2 and Jetty3.1 RC5. I am getting the
> following stacktrace after using PortableRemoteObject.narrow() and
> casting the return value to the expected home interface.
>
> **************************************************************
>
> [Jetty] java.lang.ClassCastException: $Proxy6
> [Jetty] at
> main._0002fmain_0002findex_0002ejspindex_jsp_0._jspService(_0002fmain_0002findex_0002ejspindex_jsp_0.java:109)
>
> [Jetty] at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
> [Jetty] at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> [Jetty] at
> org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:176)
>
> [Jetty] at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:307)
>
> [Jetty] at
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
> [Jetty] at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> [Jetty] at
> com.mortbay.Jetty.Servlet.ServletHolder.handle(ServletHolder.java:488)
>
> [Jetty] at
> com.mortbay.Jetty.Servlet.ServletHandler.handle(ServletHandler.java:488)
>
> [Jetty] at
> com.mortbay.Jetty.Servlet.ServletHandler.handle(ServletHandler.java:317)
>
> [Jetty] at
> com.mortbay.HTTP.HandlerContext.handle(HandlerContext.java:956)
> [Jetty] at
> com.mortbay.HTTP.HandlerContext.handle(HandlerContext.java:913)
> [Jetty] at
> com.mortbay.HTTP.Handler.ResourceHandler.handleGet(ResourceHandler.java:361)
>
> [Jetty] at
> com.mortbay.HTTP.Handler.ResourceHandler.handle(ResourceHandler.java:265)
>
> [Jetty] at
> com.mortbay.HTTP.HandlerContext.handle(HandlerContext.java:956)
> [Jetty] at
> com.mortbay.HTTP.HandlerContext.handle(HandlerContext.java:913)
> [Jetty] at
> com.mortbay.HTTP.HttpServer.service(HttpServer.java:703)
> [Jetty] at
> com.mortbay.HTTP.HttpConnection.service(HttpConnection.java:508)
> [Jetty] at
> com.mortbay.HTTP.HttpConnection.handle(HttpConnection.java:347)
> [Jetty] at
> com.mortbay.HTTP.SocketListener.handleConnection(SocketListener.java:107)
>
> [Jetty] at
> com.mortbay.Util.ThreadedServer.handle(ThreadedServer.java:294)
> [Jetty] at
> com.mortbay.Util.ThreadPool$PoolThreadRunnable.run(ThreadPool.java:613)
>
> [Jetty] at java.lang.Thread.run(Thread.java:484)
>
>
> **************************************************************************
>
> So I'm getting back the class "$Proxy6" which I'm assuming is the
> stub for the JBoss implementation of my home interface. This "$Proxy6"
> class is also what is bound in the JNDI tree to the name declared in
> jboss.xml.
>
> Here is a clue. When I try to execute the same code from a remote
> client through the network I have no problem. I'm thinking that this
> may have something to do with JBoss and Jetty living in the same JVM.
> What do you all think?
>
> I know you all are as busy as I am and I appreciate your time. Kudos
> to those who work on this excellent app server!!!
>
> -Matt Tilchen
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user
