Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection Problem with Stateful Session Bean

 
Gaurav Chikara
Ranch Hand
Posts: 412
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic