2 Replies Latest reply on Sep 26, 2002 8:55 AM by jguru2001

    service.xml help!!

    begram

       

      "begram" wrote:
      I’m a newbe in JCA development and to use JBOSS. The problem is probably that I not understand the *-service.xml file. I have used a JCA example code. I have tried to create a *-service.xml file but it will not work. The main problem is that I don’t know what JNDI name the client should look for.

      My ra.xml:

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

      <!DOCTYPE connector PUBLIC '-//Sun Microsystems, Inc.//DTD Connector 1.0//EN' 'http://java.sun.com/j2ee/dtds/connector_1_0.dtd'>

      <connector>
      <display-name>MPS Connector</display-name>
      <vendor-name>FOO</vendor-name>
      <spec-version>1.0</spec-version>
      <eis-type>Many Penny Systems</eis-type>
      <version>1.0</version>
      <resourceadapter>
      <managedconnectionfactory-class>com.mps.ManagedLocConnectionFactory</managedconnectionfactory-class>
      <connectionfactory-interface>com.mps.ConnectionFactory</connectionfactory-interface>
      <connectionfactory-impl-class>com.mps.LocConnectionFactory</connectionfactory-impl-class>
      <connection-interface>com.mps.Connection</connection-interface>
      <connection-impl-class>com.mps.LocConnection</connection-impl-class>
      <transaction-support>NoTransaction</transaction-support>
      <config-property>
      <config-property-name>primaryURL</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>http://127.0.0.1:8080/prim</config-property-value>
      </config-property>
      <config-property>
      <config-property-name>secondaryURL</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>http://127.0.0.1:8080/sec</config-property-value>
      </config-property>
      <config-property>
      <config-property-name>LogLevel</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>DEBUG</config-property-value>
      </config-property>
      <config-property>
      <config-property-name>LogDestination</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>org.jboss.logging.appender.FileAppender</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>
      </resourceadapter>
      </connector>



      My mps-service.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <server>
      <mbean code="org.jboss.resource.connectionmanager.LocalTxConnectionManager" name="jboss.jca:service=LocalTxCM,name=MPS Connector">
      <depends optional-attribute-name="ManagedConnectionFactoryName">
      <mbean code="org.jboss.resource.connectionmanager.RARDeployment" name="jboss.jca:service=LocalTxDS,name=MPS Connector">
      <attribute name="JndiName">mps</attribute>
      <attribute name="ManagedConnectionFactoryProperties">
      <properties>
      <config-property name="DataSourceName" type="java.lang.String">java:/DefaultDS</config-property>
      </properties>
      </attribute>
      <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=MPS Connector</depends>
      </mbean>
      </depends>
      <depends optional-attribute-name="ManagedConnectionPool">
      <mbean code="org.jboss.resource.connectionmanager.JBossManagedConnectionPool" name="jboss.jca:service=LocalTxPool,name=MPS Connector">
      <attribute name="MinSize">0</attribute>
      <attribute name="MaxSize">10</attribute>
      <attribute name="BlockingTimeoutMillis">5000</attribute>
      <attribute name="IdleTimeoutMinutes">15</attribute>
      <attribute name="Criteria">ByContainer</attribute>
      </mbean>
      </depends>
      <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager</depends>
      <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:name=JaasSecurityManager</depends>
      <attribute name="TransactionManager">java:/TransactionManager</attribute>
      <depends>jboss.jca:service=RARDeployer</depends>
      </mbean>
      </server>


      I have created a test client that will use the JCA resource. I can reach the client from an external client, but my local client can not access my JCA resource.
      NOTE: The resource reference name “mps” is not working since it not exists in the JNDI context.
      My local client ejb-jar.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <ejb-jar>
      <description>MPS EJB Test Client</description>
      <display-name>MpsEjb</display-name>
      <enterprise-beans>
      <session>
      <ejb-name>MpsClient</ejb-name>
      <home>mpsclient.ClientHome</home>
      <remote>mpsclient.Client</remote>
      <ejb-class>mpsclient.ClientBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Bean</transaction-type>
      <resource-ref>
      <res-ref-name>mps</res-ref-name>
      <res-type>com.mps.ConnectionFactory</res-type>
      <res-auth>Container</res-auth>
      <res-sharing-scope>Shareable</res-sharing-scope>
      </resource-ref>
      </session>
      </enterprise-beans>
      </ejb-jar>


      What is wrong?


        • 1. Re: service.xml help!!
          davidjencks

          I don't see anything obviously wrong. I'd use the NoTxConnectionManager if your adapter really has No Transaction support.

          Your ConnectionFactory should be bound under java:/mps. You will only be able to access it within the jboss vm. I would try looking for it directly

          cf = (connecitonfactory)new InitialContext().lookup("java:/mps");

          before trying to use the local naming context indirection stuff.

          Have you looked in jndiview to see if it got deployed and bound?

          • 2. Re: service.xml help!!
            jguru2001

            Hi,

            I am also getting error in client whish says jndi is not bound.

            also how to check is jboss, that how many JNDI's are currently bound.

            Ur help is highly appriciated.

            Thanks,
            Mahesh