9 Replies Latest reply on May 23, 2002 12:57 PM by wcn00

    JNDI Pool Name

    hamish

      Hello David,

      Thank you for your advice to use pooling to manage socket connections to a legacy system. (http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/ I am using 3.0.0, the latest release.

      I wrote a rar as suggested but I cannot seem to find its JNDI bound name.

      When I look it up
      ds = (BahnDataSource)initCtx.lookup(BahnSourceName);

      I get the exception
      javax.naming.NameNotFoundException: Bahn not bound


      Here is the deployment messages
      17:00:05,867 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss3/server/default/deploy/Bahn.rar
      17:00:05,897 INFO [RARMetaData] Loading Databahn Resource Adapter
      17:00:05,917 WARN [ServiceController] jboss.jca:service=RARDeployment,name=Bahn does not implement any Service methods
      17:00:05,937 INFO [MainDeployer] Successfully completed deployment of package: file:/C:/jboss3/server/default/deploy/Bahn.rar
      17:00:10,954 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss3/server/default/deploy/bahn-service.xml
      17:00:11,245 WARN [ServiceController] jboss.jca:service=LocalTxDS,name=Bahn does not implement any Service methods
      17:00:11,245 INFO [JBossManagedConnectionPool] Creating
      17:00:11,245 INFO [JBossManagedConnectionPool] Created
      17:00:11,255 INFO [JBossManagedConnectionPool] Starting
      17:00:11,255 INFO [JBossManagedConnectionPool] Started
      17:00:11,255 INFO [MainDeployer] Successfully completed deployment of package: file:/C:/jboss3/server/default/deploy/bahn-service.xml

      I think I have lost my way...

        • 1. Re: JNDI Pool Name
          davidjencks

          I am ashamed to say, I was just to lazy to look more closely. I went back to the example in the JBoss book. Got it working, then used it to find my problem.

          The name of the RA in my ***-service.xml file was not matching the description name in my RA.

          sorry David

          • 2. Re: JNDI Pool Name
            davidjencks

            You should see more... including something like "bound ... to java:/..."

            You have 3 mbeans in your bahn-service.xml, similar to the examples (but with your rar, of course)?

            Is there any more info in the log file on startup?

            • 3. Re: JNDI Pool Name
              hamish

              There is no more information in the log file, no JNDI message like "bound ... to java:/..." .

              I have not written any mbeans. I just copied the JDBC rar(managedconnectionfactory, managed connection etc) from jboss-all.zip, made changes to and renamed the hsqldb-service.xml and deployed.

              I was thinking this would create a pool of connections which were just holding sockets and I could then use a reference to the connection to access the socket. It looks like I do not understand the whole picture.

              The examples you are talking about, did you mean the JDBC ra?

              • 4. Re: JNDI Pool Name
                davidjencks

                hsqldb-service.xml is one of the examples. that one is odd: most of the others contain configuration for 3 mbeans, although it may not be obvious because the configurations are nested. Deploying one of these creates 3 mbeans: a connection manager, one to hold onto and configure the ManagedConnectionFactory, and a pool.

                From your description I don't really understand what your adapter is or its relation to a jca-jdbc wrapper. I would expect an adapter to sockets would have a rather different interface than jdbc.

                If you are adapting or starting from one of the jdbc wrappers I strongly suggest you start with the jboss 3 rc2 Local wrapper, since the minerva wrappers have many problems.

                • 5. Re: JNDI Pool Name
                  wcn00

                  I think I'm at this point too. I've created and deployed
                  the adapter, but I don't get a message indicating that it
                  has been bound to a jndi context/name as do the adapters
                  shipped with jboss.

                  So I have to create something like /jboss/server/default/deploy/myAdapter-service.xml
                  and use that to get the jndi bindings done?

                  Forgive me if this is a stupid question, but I'm finding
                  jboss 3.0 docs hard to come by.
                  wcn

                  • 6. Re: JNDI Pool Name
                    davidjencks

                    Yes. I'm afraid I have been doing this so long I don't recognize the simple parts any more:-(.

                    Write your adapter, packaging it properly with a classes.jar inside a .rar with META-INF/ra.xml and deploy it in the deploy dir. This should generate some deployment activity and there should be a RARDeployment mbean showing you some of what is in the ra.xml. This part basically makes the adapter available to the rest of the system, but it can't be used until you supply the ***-service.xml with the ConnectionManager, pool, and (another, different) RARDeployment mbean specifying all the properties of an instance of your adapter.

                    Deploying the ***-service.xml should result in your connection factory being bound in jndi and 3 more mbeans being visible.

                    The best model for a non-jdbc adapter ***-service.xml is the firebird-service.xml since that is not a wrapped jdbc driver but a natively jca adapter that happens to have a DataSource as its ConnectionFactory.

                    • 7. Re: JNDI Pool Name
                      jcordonn

                      Hi !

                      Were can i found the firebird-service.xml ? Is it bundle with the firebird SQL packages ? I have search for it in JBoss-RC2 and in cvs...without success.

                      Thanks
                      Joel

                      • 8. 3723459
                        hamish

                        I am ashamed to say, I was just to lazy to look more closely. I went back to the example in the JBoss book. Got it working, then used it to find my problem.

                        The name of the RA in my ***-service.xml file was not matching the description name in my RA.

                        sorry David

                        • 9. Re: JNDI Pool Name
                          wcn00

                          Can you post an example of what a very simple -service.xml file should look like?
                          I can't find any doc on that..
                          wcn