Hi experts,
I am doing Oracle DB application with EJB. I have written in following connection method in EJB. I am using stateless session bean
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("jdbc:oracle:thin:@<>:<>:<>", "<>","<>");
While calling this method in webdynpro controller i got a following exception
com.sap.engine.services.rmi_p4.exception.P4BaseRuntimeException: I/O operation failed : java.io.NotSerializableException: com.sap.engine.services.dbpool.cci.ConnectionHandle :
I have added project reference as well as webdynpro references!!!
I am calling the connection method in controller
String lookupString ="sap.com/<sampleBean>/<sampleEAR>"; Object obj = ctx.lookup(lookupString); sampleHome ejbHome =(sampleHome ) javax.rmi.PortableRemoteObject.narrow(obj,sampleHome .class); sampleHome simpleEjb = ejbHome.connection ();
The same scenario I successfully done in webdynpro itself.If i execute the above connection method in Webdynpro, it is successfully executed and access the Oracle DB!!
If i Use EJB i got a above exception? how to resolve this issue? give your solutions!!
Regards,
Manivannan P