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

Problem working with Entity Bean 2.0 with Oracle database

 
JavaProb
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to work with Entity beans 2.0 deployed in "Borland Application server"
I have Borland Enterprise 5.2.1 trial version on my machine.
I am facing some problem since the last few days and not able to fix that up.
I am actually trying to set the data source for the Entity bean.
I added a new entry in default-resources.dar file as follows:
=> Using ORACLE datasource:
------------------------------
serial://datasources/EmpOraDatasource
Datasource Type: Oracle
Class name racle.jdbc.pool.OracleConnectionPoolDataSource
driverType: oci8
databaseName: TrialSvc
serverName:ABC
portNumber:1521
user:javatest
password:javatest
networkProtocol:tcp
connectionType irect
dialect racle
------------------------------

I have installed Oracle8.1.7 Client on my machine and I have created a new service by name TrialSvc and the entry in the tnsnames.ora is as follows:
------------------------------
TRIALSVC =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = ABC)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ABCSMK)
)
)
------------------------------

I have the following entries in path as follows:
------------------------------
Path=.;E:\oracle\ora81\bin;E:\oracle\ora81\jdbc\lib\classes12.zip;C:\Program Files\Oracle\jre\1.1.7\bin;E:\JDataStore6\bin;E:\jdk1.3\bin\;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;e:\BES\bin;E:\Ant\apache-ant-1.5.4\bin;
C:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin;
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.py;.pyc;.pyo;.pyw;.pys;.dll;.DLL
Following are the entries in the classpath:
classpath=.;E:\oracle\ora81\jdbc\lib\classes12.zip;E:\oracle\ora81\bin;E:\JDataStore6\lib\jdsserver.jar;E:\JDataStore6\lib\jds.jar;E:\BES\lib\tomcat\common\servlet.jar;E:\jdk1.3\bin;E:\jdk1.3\jre\lib\;E:\BES\lib\axis\axis.jar;E:\BES\lib\axis\axis-ant.jar;E:\BES\lib\axis\axis-bes.jar;E:\BES\lib\axis\commons-discovery.jar;E:\BES\lib\axis\commons-logging.jar;E:\BES\lib\axis\jaxrpc.jar;E:\BES\lib\axis\saaj.jar;E:\BES\lib\axis\wsdl4j.jar;E:\BES\lib\axis\log4j-1.2.8;E:\Ant\apache-ant-1.5.4\bin;


Note: I have added classes12.zip from the oracle directory i.e. from E:\oracle\ora81\jdbc\lib\ directory.
------------------------------

Now I have deployed a web application in Borland Application server and I am trying to create a new entry to the database by
calling the ejbCreate method, and I get the following exception
------------------------------
Throwing System exception for the container-started transaction for method: public abstract com.borland.examples.j2ee.employee.EmpEntity com.borland.examples.j2ee.employee.EmpEntityHome.create(int,java.lang.String,java.lang.String) throws javax.ejb.CreateException
java.lang.UnsatisfiedLinkError: get_env_handle
at oracle.jdbc.oci8.OCIEnv.get_env_handle(Native Method)
at oracle.jdbc.oci8.OCIEnv.getEnvHandle(OCIEnv.java:70)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:359)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:252)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:365)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:111)
at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPhysicalConnection(OracleConnectionPoolDataSource.java:98)
at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:77)
at oracle.jdbc.pool.OracleConnectionPoolDataSource.getPooledConnection(OracleConnectionPoolDataSource.java:61)
at com.inprise.visitransact.jdbc2.PooledConnectionHolder$DirectStrategy.getNewPooledConnection(PooledConnectionHolder.java:853)
at com.inprise.visitransact.jdbc2.PooledConnectionHolder.<init>(PooledConnectionHolder.java:115)
at com.inprise.visitransact.jdbc2.GenericConnectionPool.doCreateNewElement(GenericConnectionPool.java:86)
at com.inprise.visitransact.jdbc2.GenericPool.getPooledObject(GenericPool.java:289)
at com.inprise.visitransact.jdbc2.GenericConnectionPool.getPooledConnection(GenericConnectionPool.java:74)
at com.inprise.visitransact.jdbc2.InpriseDataSource.getConnection(InpriseDataSource.java:298)
at com.inprise.visitransact.jdbc2.InpriseDataSource.getConnection(InpriseDataSource.java:322)
at com.borland.ejb.pm.JdbcResourceContext.open(JdbcResourceContext.java:192)
at com.borland.ejb.pm.TxContext.findResourceContext(TxContext.java:53)
at com.borland.ejb.pm.JdbcEntityManager.initCmpFields(JdbcEntityManager.java:191)
at com.borland.ejb.pm.DataEntityManager.init(DataEntityManager.java:179)
at com.borland.ejb.pm.DataEntityManager.newEntityData(DataEntityManager.java:130)
at com.borland.examples.j2ee.employee.EmpEntityBean_PM.ejbCreate(EmpEntityBean_PM.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.inprise.ejb.ConcreteMethod.invoke(ConcreteMethod.java:32)
at com.inprise.ejb.EJBContext.invoke(EJBContext.java:166)
at com.inprise.ejb.Dispatcher$EntityCreateMethod.invoke(Dispatcher.java:1618)
at com.inprise.ejb.Dispatcher.doInvoke(Dispatcher.java:1299)
at com.inprise.ejb.Dispatcher.invokeSecurityCheck(Dispatcher.java:1023)
at com.inprise.ejb.Dispatcher.invoke(Dispatcher.java:816)
at com.inprise.ejb.Dispatcher.create(Dispatcher.java:630)
at com.inprise.ejb.EntityHome.create(EntityHome.java:98)
at com.inprise.ejb.EJBHome.invoke(EJBHome.java:355)
at com.inprise.ejb.EJBHome.access$300(EJBHome.java:6)
at com.inprise.ejb.EJBHome$LocalStrategyImpl.invoke(EJBHome.java:1091)
at com.borland.examples.j2ee.employee.EmpEntityHomePOAInvokeHandler.create(EmpEntityHomePOAInvokeHandler.java:108)
at com.borland.examples.j2ee.employee.EmpEntityHomePOAInvokeHandler.create(EmpEntityHomePOAInvokeHandler.java:163)
at com.borland.examples.j2ee.employee._EmpEntityHome_Stub.create(_EmpEntityHome_Stub.java:111)
at com.borland.examples.j2ee.employee.EmployeeBean.createEntityEmployee(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.inprise.ejb.ConcreteMethod.invoke(ConcreteMethod.java:32)
at com.inprise.ejb.EJBContext.invoke(EJBContext.java:166)
at com.inprise.ejb.Dispatcher.doInvoke(Dispatcher.java:1301)
at com.inprise.ejb.Dispatcher.invokeSecurityCheck(Dispatcher.java:1023)
at com.inprise.ejb.Dispatcher.invoke(Dispatcher.java:816)
at com.inprise.ejb.Dispatcher.invoke(Dispatcher.java:595)
at com.inprise.ejb.EJBHome.dispatcherInvokeBeanMethod(EJBHome.java:55)
at com.inprise.ejb.EJBHome$ComponentInterfaceMethodCache.invokeDispatcherMethod(EJBHome.java:1502)
at com.inprise.ejb.EJBHome.invokeDispatcherMethod(EJBHome.java:34)
at com.inprise.ejb.Dispatcher.invoke(Dispatcher.java:416)
at com.borland.examples.j2ee.employee.EmployeePOAInvokeHandler.createEntityEmployee(EmployeePOAInvokeHandler.java:109)
at com.borland.examples.j2ee.employee.EmployeePOAInvokeHandler.createEntityEmployee(EmployeePOAInvokeHandler.java:246)
at com.borland.examples.j2ee.employee._Employee_Stub.createEntityEmployee(_Employee_Stub.java:325)
at com.borland.examples.j2ee.employee.EmployeeServlet.doPost(Unknown Source)
at com.borland.examples.j2ee.employee.EmployeeServlet.doGet(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2489)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngine.invoke(StandardEngine.java:376)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:224)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:413)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:537)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
at java.lang.Thread.run(Thread.java:536)
<<<< EJB LOG <<<<
>>>> EJB LOG >>>>
javax.ejb.EJBException: java.lang.UnsatisfiedLinkError: get_env_handle
at com.inprise.ejb.EJBHome$LocalStrategyImpl.getSystemException(EJBHome.java:1258)
at com.inprise.ejb.Dispatcher.doInvoke(Dispatcher.java:1407)
at com.inprise.ejb.Dispatcher.invokeSecurityCheck(Dispatcher.java:1023)
at com.inprise.ejb.Dispatcher.invoke(Dispatcher.java:816)
at com.inprise.ejb.Dispatcher.create(Dispatcher.java:630)
at com.inprise.ejb.EntityHome.create(EntityHome.java:98)
at com.inprise.ejb.EJBHome.invoke(EJBHome.java:355)
at com.inprise.ejb.EJBHome.access$300(EJBHome.java:6)
at com.inprise.ejb.EJBHome$LocalStrategyImpl.invoke(EJBHome.java:1091)
at com.borland.examples.j2ee.employee.EmpEntityHomePOAInvokeHandler.create(EmpEntityHomePOAInvokeHandler.java:108)
at com.borland.examples.j2ee.employee.EmpEntityHomePOAInvokeHandler.create(EmpEntityHomePOAInvokeHandler.java:163)
at com.borland.examples.j2ee.employee._EmpEntityHome_Stub.create(_EmpEntityHome_Stub.java:111)
at com.borland.examples.j2ee.employee.EmployeeBean.createEntityEmployee(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.inprise.ejb.ConcreteMethod.invoke(ConcreteMethod.java:32)
at com.inprise.ejb.EJBContext.invoke(EJBContext.java:166)
at com.inprise.ejb.Dispatcher.doInvoke(Dispatcher.java:1301)
at com.inprise.ejb.Dispatcher.invokeSecurityCheck(Dispatcher.java:1023)
at com.inprise.ejb.Dispatcher.invoke(Dispatcher.java:816)
at com.inprise.ejb.Dispatcher.invoke(Dispatcher.java:595)
at com.inprise.ejb.EJBHome.dispatcherInvokeBeanMethod(EJBHome.java:55)
at com.inprise.ejb.EJBHome$ComponentInterfaceMethodCache.invokeDispatcherMethod(EJBHome.java:1502)
at com.inprise.ejb.EJBHome.invokeDispatcherMethod(EJBHome.java:34)
at com.inprise.ejb.Dispatcher.invoke(Dispatcher.java:416)
at com.borland.examples.j2ee.employee.EmployeePOAInvokeHandler.createEntityEmployee(EmployeePOAInvokeHandler.java:109)
at com.borland.examples.j2ee.employee.EmployeePOAInvokeHandler.createEntityEmployee(EmployeePOAInvokeHandler.java:246)
at com.borland.examples.j2ee.employee._Employee_Stub.createEntityEmployee(_Employee_Stub.java:325)
at com.borland.examples.j2ee.employee.EmployeeServlet.doPost(Unknown Source)
at com.borland.examples.j2ee.employee.EmployeeServlet.doGet(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2489)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngine.invoke(StandardEngine.java:376)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:224)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:413)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:537)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
at java.lang.Thread.run(Thread.java:536)
------------------------------
Previously it was giving some other exception .. that the ocijdbc8.dll is not found in the java library path.
I added an entry to the JVM in the server.config as..
vmparam -Djava.library.path=.;E:\oracle\ora81\bin;E:\oracle\ora81\jdbc\lib\classes12.zip;
so that error vanished and then I started getting the above specified error.

Instead of Entity beans I tried to do the same work using session bean by opening a connection explicitly and inserting a record and that works fine.
Also tried with a simple java application which also works fine.. with values as follows:
String DRIVER = "oracle.jdbc.driver.OracleDriver";
Class.forName(DRIVER);
con = DriverManager.getConnection("jdbc racle ci8:@TrialSvc", "javatest", "javatest");

The only problem is while working with Entity beans..and that too setting the datasource in the Borland application server I guess.

If anybody has some clue about this problem..or have worked with Entity beans in Borland Application server then pleaseee help me out to solve this problem..
It's a bit urgent..

Thanks in advance!
Java developer.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic