This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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


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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Connection Problem with Stateful Session Bean