1 2 Previous Next 15 Replies Latest reply on Aug 2, 2002 9:16 AM by vickyk

    OracleDS not bound

    xcopy

      I put the file oracle-service.xml to the deploy dir and the jobss show this message

      09:11:57,720 INFO [OracleDS] Bound connection factory for resource adapter 'JBo
      ss LocalTransaction JDBC Wrapper' to JNDI name 'java:/OracleDS'

      i use that statements to get the DataSouirceObj

      InitialContext jndiContext = new InitialContext();
      DataSource ds=(DataSource)jndiContext.lookup("java:/OracleDS");

      but got this exception

      javax.naming.NameNotFoundException: OracleDS not bound

      what's the problem ? anyone help me!
      regards!!

        • 1. Re: OracleDS not bound
          davidjencks

          usually this is caused by trying to look up something in the java: context from a different vm or fooling jndi into thinking you are in a different vm by supplying jndi properties that force it to go through an external socket connection.

          • 2. Re: OracleDS not bound
            xcopy

            java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
            java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
            java.naming.provider.url=localhost

            is that right?

            • 3. Re: OracleDS not bound
              seanx

              I had the exact same problem. In my case it is SybaseDS not found.

              • 4. Re: OracleDS not bound
                baughman29

                I am having the same problem getting a connection to my Oracle database. Does the reply below mean that a pool connection can only be obtained within a bean that is deployed in Jboss? I am trying to do this from a client-type class. It runs on the same server as JBoss, and even has the same userid running it.

                Thanks for your help from a real newbie.

                • 5. Re: OracleDS not bound
                  baughman29

                  I have looked everywhere for documentation on how to get and close a connection from the JBoss connection pool for a datasource. I've searched Marc Fleury's book, the online documentation, and google.net. All I see is that the connection pool is used with CMP.

                  Can a connection pool connection be used outside of its use by CMP? If it can, how about some sample code on how to get a pool connection and then return it to the pool? How about examples of when the connection pool is available and when it's not available?

                  A URL would suffice, and I can go play again.

                  TIA.

                  • 6. Re: OracleDS not bound
                    davidjencks

                    Only jndi.properties files with these contents should be included in anything deployed in jboss, unless you want the consequences indicated (This is the one used if you DON'T include one of your own--relying on this one is highly recommended)

                    java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
                    java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
                    # Do NOT uncomment this line as it causes in VM calls to go over
                    # RMI!
                    #java.naming.provider.url=localhost


                    I'll repeat, java:/ context is accessible ONLY within the jboss vm. This does not include any other process running anywhere, even on the same machine with the same userid.

                    Any standard bmp example should work fine, as does looking up datasources in mbeans, servlets (running in an integrated container), static initializers of classes you managed to deploy in jboss, etc etc. Just follow the guidelines to not confuse jndi. There are zillions of examples in the testsuite.

                    • 7. Re: OracleDS not bound
                      vickyk

                      Hi,
                      I have been waiting for the forums to come up from last couple of months.In fact it got down when I started evaualating the jboss.
                      I have understood from you that you cannot access the JNDI from different Jvm.I have an Oracle9i and i have configured the Datasource as
                      1)Configured the oracle-services.xml as mentioned in many references
                      2)Checked the entry corresponding to 9i in the standardjboss-cmp.xml
                      I get an error once I run the JSP when I try to access the DataSource.....It says OracleDS not bound...
                      Please help me it is very urgent,I will be highly obliged if someone who have done the same configuration come forward amd try to sort it fast(If possible today),I will be viewing the forums continously.....
                      regards vickyk

                      • 8. Re: OracleDS not bound
                        davidjencks

                        If your servlet container is running in the same vm as jboss, then this problem is almost certainly caused by either code that sets up properties for your initial context or having an incorrect jndi.properties somewhere in the classpath accessible to your compiled jsp. (this assumes you are looking up the datasource with the correct name. Look in jndi view to see exactly what it is bound under)

                        • 9. Re: OracleDS not bound
                          vickyk

                          Hi,
                          I have tried all the options but failed,I will be thankful to you if you could answer this
                          1)Can jboss3 be configured with Oracle9i
                          If so can you send be the appropriate form of oracle-service.xml file ,classes12.jar I can get ......
                          I have been configuring the three mbeans which have been specified by the docs but get the Null pointer exception in the console refeerring to Launcher failure.......Also the classes 12.jar are placed in the jboss/lib not in the ext of jdk1.3
                          regads vicky

                          • 10. Re: OracleDS not bound
                            vickyk

                            Hi,
                            Also i am able to access the DefautDS from the JSP but the OracleDS is not getting bound at all, so here every thing is working in one JVM..
                            regards vicky

                            • 11. Re: OracleDS not bound
                              vickyk

                              Hi,
                              My oracle-service.xml file contains
                              #######################################
                              <?xml version="1.0" encoding="UTF-8"?>

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

                              <!-- $Id: oracle-service.xml,v 1.2 2002/04/14 04:31:56 d_jencks Exp $ -->



                              <!-- ==================================================================== -->
                              <!-- Oracle Data Source SetUp-->
                              <!-- ==================================================================== -->


                              <!--make the rar deploy! hack till better deployment-->
                              jboss.jca:service=RARDeployer
                              <depends optional-attribute-name="ManagedConnectionFactoryName">
                              <!--embedded mbean-->

                              OracleDS


                              <config-property>
                              <config-property-name>ConnectionURL</config-property-name>
                              <config-property-type>java.lang.String</config-property-type>
                              <config-property-value>jdbc:oracle:thin@192.168.0.25:1521:ORCL</config-property-value>
                              </config-property>
                              <config-property>
                              <config-property-name>DriverClass</config-property-name>
                              <config-property-type>java.lang.String</config-property-type>
                              <config-property-value>oracle.jdbc.driver.OracleDriver</config-property-value>
                              </config-property>
                              <config-property>
                              <config-property-name>UserName</config-property-name>
                              <config-property-type>java.lang.String</config-property-type>
                              <config-property-value>procare</config-property-value>
                              </config-property>
                              <config-property>
                              <config-property-name>Password</config-property-name>
                              <config-property-type>java.lang.String</config-property-type>
                              <config-property-value>fesprocare</config-property-value>
                              </config-property>




                              <depends optional-attribute-name="ManagedConnectionPool">
                              <!--embedded mbean-->

                              0
                              50
                              5000
                              15
                              <!--criteria indicates if Subject (from security domain) or app supplied
                              parameters (such as from getConnection(user, pw)) are used to distinguish
                              connections in the pool. Choices are
                              ByContainerAndApplication (use both),
                              ByContainer (use Subject),
                              ByApplication (use app supplied params only),
                              ByNothing (all connections are equivalent, usually if adapter supports
                              reauthentication)-->
                              ByContainer


                              <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager
                              <!-- attribute name="SecurityDomainJndiName">java:/jaas/HsqlDbRealm</attribute -->
                              java:/TransactionManager
                              jboss.jca:service=RARDeployer



                              #######################################
                              The error it generates during deployment is as
                              ###########2002-08-02 11:42:27,609 DEBUG [org.jboss.system.ServiceController] waiting in start jboss.jca:service=LocalTxCM,name=OracleDS on jboss.jca:service=LocalTxDS,name=OracleDS
                              2002-08-02 11:42:27,609 DEBUG [org.jboss.system.ServiceController] waiting in start jboss.jca:service=LocalTxCM,name=OracleDS on jboss.jca:service=LocalTxPool,name=OracleDS
                              2002-08-02 11:42:27,609 INFO [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Starting
                              2002-08-02 11:42:27,609 INFO [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Started
                              2002-08-02 11:42:27,609 INFO [org.jboss.resource.connectionmanager.LocalTxConnectionManager] Starting
                              2002-08-02 11:42:27,625 ERROR [org.jboss.resource.connectionmanager.LocalTxConnectionManager] Starting failed
                              java.lang.NullPointerException
                              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:279)
                              at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
                              at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
                              at org.jboss.mx.loading.UnifiedClassLoader.loadClassLocally(UnifiedClassLoader.java:180)
                              at org.jboss.mx.loading.UnifiedLoaderRepository.loadClass(UnifiedLoaderRepository.java:159)
                              at org.jboss.mx.loading.UnifiedClassLoader.loadClass(UnifiedClassLoader.java:217)
                              at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
                              at org.jboss.resource.connectionmanager.RARDeployment.startManagedConnectionFactory(RARDeployment.java:534)
                              at java.lang.reflect.Method.invoke(Native Method)
                              at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                              at org.jboss.resource.connectionmanager.BaseConnectionManager2.startService(BaseConnectionManager2.java:286)
                              at org.jboss.resource.connectionmanager.LocalTxConnectionManager.startService(LocalTxConnectionManager.java:180)
                              at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:162)
                              at java.lang.reflect.Method.invoke(Native Method)
                              at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                              at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:867)
                              at $Proxy0.start(Unknown Source)
                              at org.jboss.system.ServiceController.start(ServiceController.java:341)
                              at org.jboss.system.ServiceController.start(ServiceController.java:359)
                              at java.lang.reflect.Method.invoke(Native Method)
                              at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                              at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                              at $Proxy3.start(Unknown Source)
                              at org.jboss.deployment.SARDeployer.start(SARDeployer.java:281)
                              at org.jboss.deployment.MainDeployer.start(MainDeployer.java:665)
                              at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:507)
                              at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:470)
                              at java.lang.reflect.Method.invoke(Native Method)
                              at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                              at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
                              at $Proxy4.deploy(Unknown Source)
                              at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:350)
                              at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:530)
                              at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:410)
                              at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:237)
                              at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:162)
                              at java.lang.reflect.Method.invoke(Native Method)
                              at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
                              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
                              at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:867)
                              at $Proxy0.start(Unknown Source)
                              at org.jboss.system.ServiceController.start(ServiceController.java:341)
                              at ja############################

                              #######################################
                              Hope I get the solution now.....I am attaching the entire log file also....
                              regards vicky

                              • 12. Re: OracleDS not bound
                                fuweweu

                                My Oracle-service.xml throws an Exception saying "OracleDS not bound"...

                                Where can I get samples of any database service (blabla-service.xml) except the Hypersonic (that is started from a jboss plugin)?


                                Thanks

                                • 13. Re: OracleDS not bound
                                  larsinge

                                  If you are running JBoss 3.0, take a look at this.

                                  Note! This does NOT work with the latest JBoss3.1 alpha

                                  http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/ using JBoss 3.0 with oracle 9i with both CMP (ejb1.1/2.0) and Bean-MP. Yes it works...


                                  If anyone have instructions on how to set up Oracle 9i and JBoss 3.1 alpha, please post a reply. =:o)

                                  • 14. Re: OracleDS not bound
                                    larsinge

                                    If you need a DataSource to OracleDS inside a bean, you could do something like this (Bean Managed, not Container managed) :

                                    import java.sql.Connection;
                                    import java.sql.DataSource;
                                    import java.sql.SQLException;
                                    import javax.naming.Context;
                                    import javax.naming.InitialContext;
                                    import javax.naming.NamingException;
                                    import java.util.Properties;
                                    import more??...mmm... You can find this out... :-)


                                    private Connection getConnection() throws SQLException {
                                    try {
                                    Properties env = new Properties();
                                    env.setProperty("java.factory.initial", "org.jnp.interface.NamingContextFactory");
                                    env.setProperty("java.naming.provider.url", "localhost:1099");
                                    env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
                                    Context jndiContext = new InitialContext(env);
                                    DataSource datasource = (DataSource)jndiContext.lookup("java:/OracleDS");
                                    return datasource.getConnection();
                                    } catch(NamingException name) { throw new EJBException( name); }
                                    }


                                    Connection con = this.getConnection();
                                    PreparedStatement statemend = con.prepareStatement(" SQL");
                                    blablablabla..


                                    I did not copy & paste this code, so there could be some typing errors.

                                    1 2 Previous Next