7 Replies Latest reply on May 16, 2002 8:07 PM by colinc

    problems with Castor JCA

    mattbaird

      my Castor JCA is being listed under jboss.jca as:
      service=RARDeployment,name=Castor

      when I click on it I get:

      MBean View [JMX RI/1.0]

      MBean Name: jboss.jca:service=RARDeployment,name=Castor
      MBean Java Class: org.jboss.resource.RARDeployment
      Back to Agent View Reload Period in seconds:




      --------------------------------------------------------------------------------

      MBean description:
      Description of a deployed Resource Adapter



      --------------------------------------------------------------------------------

      List of MBean attributes:
      Name Type Access Value
      AuthMechType java.lang.String RO BasicPassword
      AutoStore java.lang.Boolean RO false
      CommonClassPath java.lang.Boolean RO false
      Configuration java.lang.String RO file:../server/default/conf/database.xml
      DisplayName java.lang.String RO Castor
      JndiName java.lang.String RO jdo/Motiva8JDO
      LockTimeout java.lang.Integer RO 30
      LoggingEnabled java.lang.Boolean RO true
      ManagedConnectionFactoryClass java.lang.String RO org.exolab.castor.jdo.connector.CastorManagedConnectionFactory
      ReauthenticationSupport java.lang.boolean RO false
      TransactionSupport java.lang.Integer RO 1


      But when i try to look it up from a client, it doesn't work: I tried to look it up in JNDI as:
      java:comp/env/jdo/Motiva8JDO
      java:comp/jdo/Motiva8JDO
      java:jdo/Motiva8JDO
      java:/jdo/Motiva8JDO
      jdo/Motiva8JDO
      /jdo/Motiva8JDO

      I've even played with different names like just Motiva8JDO and stuff like that. No go.

      I get errors like:
      13:15:40,548 INFO [STDOUT] jdo not bound
      javax.naming.NameNotFoundException: jdo 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:253)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:365)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:349)
      at javax.naming.InitialContext.lookup(InitialContext.java:350)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:437)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:473)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:349)
      at javax.naming.InitialContext.lookup(InitialContext.java:350)

      when I try to look it up. client code just calls new InitialContext() then does the lookup.


      ENCLOSED: castor-service.xml and ra.xml

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




      jboss.jca:service=RARDeployer
      jdo/Motiva8JDO
      java:/TransactionManager

      <depends optional-attribute-name="ResourceAdapterName">jboss.jca:service=RARDeployment,name=Motiva8JDO
      <depends optional-attribute-name="ConnectionManagerFactoryLoaderName">jboss.jca:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory



      <config-property>
      <config-property-name>Configuration</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>file:../server/default/conf/database.xml</config-property-value>
      </config-property>

      <config-property>
      <config-property-name>JndiName</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>jdo/Motiva8JDO</config-property-value>
      </config-property>

      <config-property>
      <config-property-name>LockTimeout</config-property-name>
      <config-property-type>java.lang.Integer</config-property-type>
      <config-property-value>30</config-property-value>
      </config-property>

      <config-property>
      <config-property-name>LoggingEnabled</config-property-name>
      <config-property-type>java.lang.Boolean</config-property-type>
      <config-property-value>true</config-property-value>
      </config-property>

      <config-property>
      <config-property-name>CommonClassPath</config-property-name>
      <config-property-type>java.lang.Boolean</config-property-type>
      <config-property-value>false</config-property-value>
      </config-property>

      <config-property>
      <config-property-name>AutoStore</config-property-name>
      <config-property-type>java.lang.Boolean</config-property-type>
      <config-property-value>false</config-property-value>
      </config-property>



      org.jboss.resource.security.ManyToOnePrincipalMapping







      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE connector PUBLIC
      '-//Sun Microsystems, Inc.//DTD Connector 1.0//EN'
      'http://java.sun.com/dtd/connector_1_0.dtd'>
      <!--
      Resource adaptor descriptor for using Castor in a managed environment.
      -->

      <display-name>Castor</display-name>
      <vendor-name>Exolab</vendor-name>
      <spec-version>1.0</spec-version>
      <eis-type>JDO</eis-type>
      1.0


      See http://castor.exolab.org for terms and license conditions.

      <license-required>false</license-required>


      <managedconnectionfactory-class>org.exolab.castor.jdo.connector.CastorManagedConnectionFactory</managedconnectionfactory-class>

      <connectionfactory-interface>org.exolab.castor.jdo.connector.CastorConnectionFactory</connectionfactory-interface>
      <connectionfactory-impl-class>org.exolab.castor.jdo.connector.CastorConnectionFactoryImpl</connectionfactory-impl-class>

      <connection-interface>org.exolab.castor.jdo.Database</connection-interface>
      <connection-impl-class>org.exolab.castor.jdo.engine.DatabaseProxy</connection-impl-class>

      <transaction-support>LocalTransaction</transaction-support>
      <config-property>
      the url to the OJB configuration file
      <config-property-name>Configuration</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>file:../server/default/conf/database.xml</config-property-value>
      </config-property>

      <config-property>
      the url to the OJB configuration file
      <config-property-name>JndiName</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>jdo/Motiva8JDO</config-property-value>
      </config-property>

      <config-property>
      transaction timeout
      <config-property-name>LockTimeout</config-property-name>
      <config-property-type>java.lang.Integer</config-property-type>
      <config-property-value>30</config-property-value>
      </config-property>

      <config-property>
      the url to the OJB configuration file
      <config-property-name>LoggingEnabled</config-property-name>
      <config-property-type>java.lang.Boolean</config-property-type>
      <config-property-value>true</config-property-value>
      </config-property>

      <config-property>
      class path settings
      <config-property-name>CommonClassPath</config-property-name>
      <config-property-type>java.lang.Boolean</config-property-type>
      <config-property-value>false</config-property-value>
      </config-property>

      <config-property>
      use autostore
      <config-property-name>AutoStore</config-property-name>
      <config-property-type>java.lang.Boolean</config-property-type>
      <config-property-value>false</config-property-value>
      </config-property>


      <authentication-mechanism>
      <authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
      <credential-interface>javax.resource.security.PasswordCredential</credential-interface>
      </authentication-mechanism>
      <reauthentication-support>false</reauthentication-support>




        • 1. Re: problems with Castor JCA
          davidjencks

          How did you come up with this castor-service.xml? It looks to me as if you mixed the new style with the old? Which version of jboss are you using? Do you know when castor added jca support? Which version of castor are you using? I'll try to take a look, but it would be helpful to know what castor version to aim for.

          The closest example to what you need is the one for firebird, since that also is not a wrapper.

          • 2. Re: problems with Castor JCA
            mattbaird

            where do I get the definitive format for the x-service.xml file?

            • 3. Re: problems with Castor JCA
              mattbaird

              i found if you leave out

              java:/jaas/HsqlDbRealm
              java:/TransactionManager

              these types of attributes your jca won't deploy. Is this a known issue? Is there a workaround?

              • 4. Re: problems with Castor JCA
                davidjencks

                First, see
                http://jboss.org/forums/thread.jsp?forum=67&thread=13366

                Second, what are you trying to do and why don't you answer any of my questions? You think I'm asking them for my own amusement?

                If you don't have a jdk installed, running a java prograom won't work very well either, is this a known issue? do you have a workaround for that?

                • 5. Re: problems with Castor JCA
                  mattbaird

                  Ouch David. No need to flame, we're all just trying to keep up and learn.

                  I finally found the "HELP! My DataSource Is Broken in 3.0 RC1!" thread that you referenced and got my resource to deploy properly. I initially searched the Forums and couldn't find much because I didn't think my JCA was a datasource. I didn't make the connection.

                  How did you come up with this castor-service.xml?

                  > I wrote it based on the beta jboss 3.0 style.

                  Which version of jboss are you using?

                  > 3.0 RC1

                  Do you know when castor added jca support?

                  > They didn't I did.

                  Which version of castor are you using?

                  > Custom version based on 0.9.3

                  I *kinda* got it to work, but the transactional support is messed up, it keeps complaining about preparing a transaction but getting the wrong semantics. I don't have the exact error message available.

                  I'm currently working on both Castor and OJB services for JBoss 3.0 which I would like to contribute when I get them done. My OJB was working until the rc1 release :)

                  I have some comments on the configuration policy which I have written down at home, I will post them tonight.

                  • 6. Re: problems with Castor JCA
                    davidjencks

                    I'd really like to see what you've come up with and get the config into the examples directory, especially if you can get the castor mods into castor. If not maybe we'll find a way to keep them here.

                    I labeled the FAQ entry with datasources since I thought most people wouldn't know what jca was;-) so I messed up the experts instead, sorry.

                    If you are using a local tx adapter and getting the "you aren't getting the semantics you expect" message it means the tx manager thinks there is more than one resource manager in a transaction and is telling you. If failure occurs in the commit your resource managers may be left in an inconsistent state with automatic recover not possible.

                    Usually this happens when you use jms and a datasource in one tx.

                    Maybe its time for a FAQ on this one too.

                    • 7. Re: problems with Castor JCA
                      colinc

                      Could you post the end result if you got it all working?

                      This is exactly what I am trying to achieve and a few other people from various posts around. It is very hard to work out exactly what to put in the configuration files are some of the example ones are in old style and some are in new...

                      Heaps of in between steps to understand and get right !


                      Thanks Colin