Discussions

EJB programming & troubleshooting: URGENT : Problem in DataSource usage in Client applIcation

  1. URGENT : Problem in DataSource usage in Client applIcation

    Hi ALL
    I have deployed a EJB(Session Bean) in Oracle-OC4J Container.I am using datasources, in my bean as well as in my client

    application.Here Client is deployed along with bean in container.

    I am using "ejb-location"JNDI Name inside Client to get connection.
    (Which is mentioned in datasource element of datasources.xml)

    For this i have configured datasources.xml also.
    If i use "oracle.jdbc.pool.OracleDataSource" in datasources.xml then ClassNotFoundException is coming.
    But i have included classes12.jar in home/lib directory

    STACK TARCE FOR CLASSNOT FOUNDEXCEPTION

    =========================================================================================================================
    javax.naming.NamingException: ClassNotFoundException: oracle.jdbc.pool.OracleDataSource
            at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:125)
            at com.evermind.naming.SubFilterContext.lookup(SubFilterContext.java:56)
            at javax.naming.InitialContext.lookup(InitialContext.java:354)
            at EjbTransaction.client.exRateEJBClient.dbConnection(exRateEJBClient.java:188)
            at EjbTransaction.client.exRateEJBClient.main(exRateEJBClient.java:66)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.evermind.client.applicationlauncher.ApplicationLauncher.startApplication(ApplicationLauncher.java:188)
            at com.evermind.client.applicationlauncher.ApplicationLauncher.main(ApplicationLauncher.java, Compiled Code)
    =========================================================================================================================

    But if i use "com.evermind.sql.ConnectionDataSource" or "com.evermind.sql.DriverManagerDataSource" then i am getting

    connection.But if i do some operations(Even setAutoCommit(false))its giving NULL PointerException.

    STACK TRACE FOR NULLPOINTEREXCEPTION

    =========================================================================================================================
    java.lang.NullPointerException
            at com.evermind.sql.OrionPooledDataSource.addUsedConnection(OrionPooledDataSource.java, Compiled Code)
            at com.evermind.sql.OrionPooledDataSource.getPooledInstance(OrionPooledDataSource.java, Compiled Code)
            at com.evermind.sql.OrionCMTConnection.setConnection(OrionCMTConnection.java:119)
            at com.evermind.sql.OrionCMTConnection.intercept(OrionCMTConnection.java:98)
            at com.evermind.sql.OrionCMTConnection.setAutoCommit(OrionCMTConnection.java:248)
            at EjbTransaction.client.exRateEJBClient.dbConnection(exRateEJBClient.java:200)
            at EjbTransaction.client.exRateEJBClient.main(exRateEJBClient.java:66)
            at java.lang.reflect.Method.invoke(Native Method)
            at com.evermind.client.applicationlauncher.ApplicationLauncher.startApplication(ApplicationLauncher.java:188)
            at com.evermind.client.applicationlauncher.ApplicationLauncher.main(ApplicationLauncher.java, Compiled Code)
    =========================================================================================================================

    In all the above 2 cases i am using ejb-location JNDI name for look up inside client code.


    Why this is happening?




    Thanx in advance

    Venky
  2. Why is this so urgent?
  3. Hello Venkatesh, I am facing the same problem, which you experienced long back. I am trying to deploy a Java application on Oracle Application Server from JDeveloper. I have tried to deploy two application with same steps. One application is working fine, while for the other application I could not perform any database operations. I could establish connection with the database, when I used the EJB JNDI location name, but could not perform any DB operation using that object. It is throwing Null Pointer Exception. Please let me know, if you have found any solution for this problem. Thanks in advance, Shanthi.