2 Replies Latest reply on Sep 2, 2003 10:38 AM by rlaenen

    Configure with Oracle

    edwinherald Newbie

      Dear sir,

      I have created an Entity bean which will communicate with Oracle.

      I have changed the example which as given in
      http://iris.cs.byu.edu/tim/462/tutorial/tutorial.html

      with oracle database .

      I have configured jbosscmp-jdbc.xml file with OracleDS

      and mysql-service.xml with connectionurl and driven class oracle.jdbc.driver.OracleDriver.

      but when i deployed it is giving the error like this

      11:47:44,565 WARN [ServiceController] Problem starting service jboss.j2ee:jnd
      ame=MyContractBean,service=EJB
      org.jboss.deployment.DeploymentException: Error: can't find data source: java:
      racleDS; - nested throwable: (javax.naming.NameNotFoundException: OracleDS not
      ound)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.(JDBCE
      ityBridge.java:99)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JD
      StoreManager.java:397)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreMana
      r.java:339)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceMan
      er.java:198)
      at org.jboss.ejb.EntityContainer.start(EntityContainer.java:376)
      at org.jboss.ejb.Container.invoke(Container.java:782)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1058)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceContr
      ler.java:1003)
      at $Proxy5.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:413
      at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMB
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy51.start(Unknown Source)
      at org.jboss.ejb.EjbModule.startService(EjbModule.java:404)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java
      65)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImp
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMB
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceContr
      ler.java:1003)
      at $Proxy5.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:413
      at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMB
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy10.start(Unknown Source)
      at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:395)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:814)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:627)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:591)
      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMB
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy3.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploym
      tScanner.java:435)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URL
      ploymentScanner.java:656)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymen
      canner.java:507)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThrea
      doScan(AbstractDeploymentScanner.java:217)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThrea
      loop(AbstractDeploymentScanner.java:230)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThrea
      run(AbstractDeploymentScanner.java:207)
      Caused by: javax.naming.NameNotFoundException: OracleDS not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
      at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:493)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:472)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.(JDBCE
      ityBridge.java:96)
      ... 52 more
      11:47:44,575 INFO [EjbModule] Started
      11:47:44,575 INFO [MainDeployer] Deployed package: file:/C:/jboss-3.0.8tomcat
      erver/default/deploy/RealtorV1.jar
      11:47:44,585 ERROR [URLDeploymentScanner] MBeanException: Exception in MBean o
      ration 'checkIncompleteDeployments()'
      Cause: Incomplete Deployment listing:
      Packages waiting for a deployer:

      Incompletely deployed packages:
      [org.jboss.deployment.DeploymentInfo@94448215 { url=file:/C:/jboss-3.0.8tomcat
      erver/default/deploy/mysql-service.xml }
      deployer: org.jboss.deployment.SARDeployer@97a560
      status: Deployment FAILED reason: jboss.jca:service=ConnectionFactoryLoader,
      me=OracleDS is not registered.; - nested throwable: (javax.management.Instance
      tFoundException: jboss.jca:service=ConnectionFactoryLoader,name=OracleDS is no
      registered.)
      state: FAILED
      watch: file:/C:/jboss-3.0.8tomcat/server/default/deploy/mysql-service.xml
      lastDeployed: 1062397063864
      lastModified: 1062397064000
      mbeans:
      jboss.jca:service=ConnectionFactoryLoader,name=OracleDS (state not availab
      )
      ]MBeans waiting for classes:

      MBeans waiting for other MBeans:
      [ObjectName: jboss.jca:service=ConnectionFactoryLoader,name=oracleDS
      state: NOTYETINSTALLED
      I Depend On:
      Depends On Me: , ObjectName: jboss.jca:service=ConnectionFactoryLoader,name=o
      cleDS
      state: NOTYETINSTALLED
      I Depend On:
      Depends On Me: , ObjectName: jboss.jca:service=ConnectionFactoryLoader,name=o
      cleDS
      state: NOTYETINSTALLED
      I Depend On:
      Depends On Me: , ObjectName: jboss.jca:service=ConnectionFactoryLoader,name=O
      cleDS
      state: NOTYETINSTALLED
      I Depend On:
      Depends On Me: , ObjectName: jboss.jca:service=ConnectionFactoryLoader,name=O
      cleDS
      state: NOTYETINSTALLED
      I Depend On:
      Depends On Me: , ObjectName: jboss.j2ee:jndiName=MyContractBean,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: org.jboss.deployment.DeploymentException: Error: can't find da
      source: java:/OracleDS; - nested throwable: (javax.naming.NameNotFoundExcepti
      : OracleDS not bound)]

      What's the problem or anybody can send the steps

      with small example Entity bean with Oracle .

      Please do help for me....its urgent.

      Thanks & reg
      Edwin

        • 1. Re: Configure with Oracle
          Raja Master

          CAn you post your oracle-service.xml?
          What is the value under the

          (This tag would be under
          <depends optional-attribute-name="ManagedConnectionFactoryName">

          This value should be OracleDS for your example.

          -Raj

          • 2. Re: Configure with Oracle
            rlaenen Newbie

            Edwin,

            Here is an example datasource file for Oracle (of course you have to change the connection url).
            BEWARE : The filename has to end with -ds.xml and NOT
            -service.xml (supposing you are using jBoss 3.2.x)

            <?xml version="1.0" encoding="UTF-8"?>

            <!-- ===================================================================== -->
            <!-- -->
            <!-- JBoss Server Configuration -->
            <!-- -->
            <!-- ===================================================================== -->

            <!-- $Id: oracle-ds.xml,v 1.1.2.2 2003/04/01 04:51:12 d_jencks Exp $ -->
            <!-- ==================================================================== -->
            <!-- Datasource config for Oracle originally from Steven Coy -->
            <!-- ==================================================================== -->



            <local-tx-datasource>
            <jndi-name>OracleDS</jndi-name>
            <connection-url>jdbc:oracle:thin:@localhost:1521:L92011</connection-url>
            <!--

            Here are a couple of the possible OCI configurations.
            For more information, see http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96654/toc.htm

            <connection-url>jdbc:oracle:oci:@youroracle-tns-name</connection-url>
            or
            <connection-url>jdbc:oracle:oci:@(description=(address=(host=youroraclehost)(protocol=tcp)(port=1521))(connect_data=(SERVICE_NAME=yourservicename)))</connection-url>

            Clearly, its better to have TNS set up properly.
            -->
            <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
            <user-name>scott</user-name>
            tiger
            <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
            </local-tx-datasource>



            Regards,

            Roger