1 Reply Latest reply on Sep 7, 2005 11:38 AM by rsuffling

    javax.naming.NameNotFoundException: jdbc not bound

    Hugo Serna Newbie

      Hi !

      I've a application deployed with JBoss 4.0.2 Solaris 2.8, I've create a Oracle DS, when I try to read data from a database throw DS works fine, but when I try to insert, delete or update records from database the jboss show the next error.

      2005-09-07 09:17:55,662 ERROR [org.jboss.ejb.plugins.LogInterceptor] Transaction
      RolledbackLocalException in method: public abstract int com.soluzionasf.arqw10.g
      c.cmp.OracleSequenceSessionLocal.getNextSequenceNumber(java.lang.String) throws
      javax.ejb.FinderException, causedBy:
      javax.naming.NameNotFoundException: jdbc not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
      at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:249)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at com.soluzionasf.arqw10.gc.cmp.OracleSequenceSessionBean.getConnection
      (OracleSequenceSessionBean.java:76)
      at com.soluzionasf.arqw10.gc.cmp.OracleSequenceSessionBean.getNextSequen
      ceNumber(OracleSequenceSessionBean.java:46)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S
      tatelessSessionContainer.java:214)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
      ke(CachedConnectionInterceptor.java:185)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
      elessSessionInstanceInterceptor.java:130)
      at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(Service
      EndpointInterceptor.java:51)
      at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidation
      Interceptor.java:48)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
      rceptor.java:105)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
      torCMT.java:335)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
      66)


      This is my DS definition

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

      <local-tx-datasource>
      <jndi-name>jdbc/OracleDS</jndi-name>
      <connection-url>jdbc:oracle:thin:@10.98.10.42:1532:orcl28</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>evo_adminis</user-name>
      evo_adminis1
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>

      <type-mapping>Oracle9i</type-mapping>

      </local-tx-datasource>



      Who knows the solutions for my problem

      Thanks for advance

        • 1. Re: javax.naming.NameNotFoundException: jdbc not bound
          rsuffling Newbie

          From your error message it's clear that your CMP entity bean is failing to get the next Oracle generated sequence number. Here are some things to check:

          1) Check that the Oracle Sequence your using is setup and working as expected (Use SQLPLUS)

          2)Your jbosscmp-jdbc.xml file should have the following element against each entity bean that uses a sequence for its PK.
          <entity-command name="oraclel-sequnce"/>

          3) Your database is local as the RETUNING clause (used to return the sequence number) in the SQL INSERT statement is not supported for remote databases [as far as I remember ;-) You'll have to check this out.

          Hope this helps.

          Roger