File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Connection Problem with Stateful Session Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Connection Problem with Stateful Session Bean" Watch "Connection Problem with Stateful Session Bean" New topic
Author

Connection Problem with Stateful Session Bean

Gaurav Chikara
Ranch Hand

Joined: Jun 09, 2000
Posts: 410
If i try to connect by using a Driver in Staeless session bean like this
public void setSessionContext(SessionContext sessionContext) throws RemoteException {
this.sessionContext = sessionContext;
System.out.println("setSessionContext called from EmpAtmDepostEJB ...");
try {
DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
connection=DriverManager.getConnection("jdbc dbc:Gaurav","javateam","password");
}
catch(SQLException sql)
{
System.out.println(sql.getMessage());
}
}
then it runs fine
but if i convert it into stateful session bean
then
it gives the following error
org.omg.CORBA.MARSHAL: Could not cast connection of class invoice.InvoiceProcessSFBean to java.io.Serializab
at com.inprise.vbroker.rmi.CORBA.FieldWriter.writeFields(FieldWriter.java:592)
at com.inprise.vbroker.rmi.CORBA.ValueHandlerImpl.writeThisValue(ValueHandlerImpl.java:156)
at com.inprise.vbroker.rmi.CORBA.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:111)
at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.octets(CDROutputStream.java:1101)
at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.state(CDROutputStream.java:995)
at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.value(CDROutputStream.java:875)
at com.inprise.vbroker.orb.CDROutputStream.writeValueType(CDROutputStream.java:1223)
at com.inprise.vbroker.orb.CDROutputStream.write_value(CDROutputStream.java:1522)
at com.inprise.vbroker.orb.CDROutputStream.write_abstract_interface(CDROutputStream.java:1550)
at com.inprise.vbroker.rmi.CORBA.FieldWriter.writeFields(FieldWriter.java:579)
at com.inprise.vbroker.rmi.CORBA.ValueHandlerImpl.writeThisValue(ValueHandlerImpl.java:156)
at com.inprise.vbroker.rmi.CORBA.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:111)
at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.octets(CDROutputStream.java:1101)
at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.state(CDROutputStream.java:995)
at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.value(CDROutputStream.java:875)
at com.inprise.vbroker.orb.CDROutputStream.writeValueType(CDROutputStream.java:1223)
at com.inprise.vbroker.orb.CDROutputStream.write_value(CDROutputStream.java:1516)
at com.inprise.vbroker.rmi.CORBA.FieldWriter.writeFields(FieldWriter.java:595)
at com.inprise.vbroker.rmi.CORBA.ValueHandlerImpl.writeThisValue(ValueHandlerImpl.java:156)
at com.inprise.vbroker.rmi.CORBA.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:111)
at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.octets(CDROutputStream.java:1101)
at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.state(CDROutputStream.java:995)
at com.inprise.vbroker.orb.CDROutputStream$ValueTypeWriter.value(CDROutputStream.java:875)
at com.inprise.vbroker.orb.CDROutputStream.writeValueType(CDROutputStream.java:1223)
at com.inprise.vbroker.orb.CDROutputStream.write_value(CDROutputStream.java:1516)
at com.inprise.ejb.Global.writeObject(Global.java:259)
at com.inprise.ejb.StatefulSessionHome$ServantActivator.etherealize(StatefulSessionHome.java:244)
at com.inprise.vbroker.poa.POAImpl$Etherealizer.run(POAImpl.java:1541)
at com.inprise.vbroker.orb.ThreadPool$PoolWorker.run(ThreadPool.java:76)
I am using Borland Application Server 4.5
can anyone pls tell me why this happens
is it a general problem
or application server specific



SCJP,SCWCD,SCBCD<br />If Opportunity doesn't knock then build the door
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connection Problem with Stateful Session Bean