Hi all,
While lookingup EJB from JSP, I am getting the ClassCastException. I am using Sun ONE Application server 7.0 on Win2K machine with JDK1.4. The web module and ejb module are deployed separately as war and jar (not as ear).
Below is my part of code
InitialContext context = null;
try
{
context = new InitialContext();
Object homeObj = context.lookup("java:comp/env/ejb/Gateway");
GatewayHome gatewayHome = (GatewayHome) javax.rmi.PortableRemoteObject.narrow(homeObj, GatewayHome.class);
Gateway gateway = gatewayHome.create();
msg = gateway.process();
} catch( Exception ex )
{
ex.printStackTrace();
}
And below is the exception i am getting
[07/Nov/2002:20:13:41] INFO ( 1784): CORE3282: stdout: hObj = com.sun.corba.ee.internal.iiop.CDRInputStream_1_0$1
[07/Nov/2002:20:13:41] INFO ( 1784): CORE3282: stdout: Exception com.sun.corba.ee.internal.iiop.CDRInputStream_1_0$1
[07/Nov/2002:20:13:41] WARNING ( 1784): CORE3283: stderr: java.lang.ClassCastException: com.sun.corba.ee.internal.iiop.CDRInputStream_1_0$1
[07/Nov/2002:20:13:41] WARNING ( 1784): CORE3283: stderr: at _jasper._MyTest_jsp._jspService(_MyTest_jsp.java:94)
[07/Nov/2002:20:13:41] WARNING ( 1784): CORE3283: stderr: at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
[07/Nov/2002:20:13:41] WARNING ( 1784): CORE3283: stderr: at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
[07/Nov/2002:20:13:41] WARNING ( 1784): CORE3283: stderr: at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:552)
Can anybody help me.
Thanks in advance.
Regards,
Jai.
Discussions
EJB programming & troubleshooting: ClassCastException while lookingup EJB - Sun ONE App server 7.0
-
ClassCastException while lookingup EJB - Sun ONE App server 7.0 (4 messages)
- Posted by: Jayakumar Gopalan
- Posted on: November 07 2002 10:19 EST
Threaded Messages (4)
- ClassCastException while lookingup EJB - Sun ONE App server 7.0 by Web Master on November 07 2002 14:43 EST
- ClassCastException while lookingup EJB - Sun ONE App server 7.0 by Jayakumar Gopalan on November 08 2002 00:45 EST
- ClassCastException while lookingup EJB - Sun ONE App server 7.0 by Web Master on November 08 2002 09:52 EST
- ClassCastException while lookingup EJB - Sun ONE App server 7.0 by Jayakumar Gopalan on November 08 2002 00:45 EST
- ClassCastException while lookingup EJB - Sun ONE App server 7.0 by Ferhat SAVCI on November 11 2002 13:41 EST
-
ClassCastException while lookingup EJB - Sun ONE App server 7.0[ Go to top ]
- Posted by: Web Master
- Posted on: November 07 2002 14:43 EST
- in response to Jayakumar Gopalan
It looks since you are running in two separate virtual Machines, may be you need to populate properties and pass to the InitialContext(). The factory and the url. -
ClassCastException while lookingup EJB - Sun ONE App server 7.0[ Go to top ]
- Posted by: Jayakumar Gopalan
- Posted on: November 08 2002 00:45 EST
- in response to Web Master
Hi
Those modules are not deployed on two different machines / JVM. Those are deployed as independent modules in the same app. servers. -
ClassCastException while lookingup EJB - Sun ONE App server 7.0[ Go to top ]
- Posted by: Web Master
- Posted on: November 08 2002 09:52 EST
- in response to Jayakumar Gopalan
You might be runing Two JVM in the same box. Create 1 EAR file(include the ejb jars and the war files in it).then deploy that ear -
ClassCastException while lookingup EJB - Sun ONE App server 7.0[ Go to top ]
- Posted by: Ferhat SAVCI
- Posted on: November 11 2002 13:41 EST
- in response to Jayakumar Gopalan
com.sun.corba.ee.internal.iiop.CDRInputStream_1_0? Hmmm... RMI/IIOP cannot deserialize the stream, most probably because the class for the object is not on the classpath.
Do you generate the client jar while deploying the EJB jar and package and deploy it with the WAR?