2 Replies Latest reply on Jan 25, 2008 4:08 AM by monsu

    How to deploy resource adapter in JBoss

    ihari2004

      hi frenz,
      I am new to jboss and j2ee, i have to deploy one resource adapter for IMAP and POP3 in jboss, It is bundled in two packages

      org.jboss.seam.mail.ra (has 9 java classes)
      + in which InboundMailResourceAdapter class implements Resource Adapter.

      org.jboss.seam.example.mailer (has one ReceiveEmailExample class)

      and one ra.xml as shown

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

      <connector xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.5">
      <display-name>Incoming Email Resource Adapter</display-name>
      <vendor-name>Peter Muir</vendor-name>
      <eis-type>POP3 and IMAP email</eis-type>
      <resourceadapter-version>1.0</resourceadapter-version>

      <resourceadapter-class>
      org.jboss.seam.mail.ra.InboundMailResourceAdapter
      </resourceadapter-class>
      <inbound-resourceadapter>


      <messagelistener-type>
      org.jboss.seam.mail.ra.InboundMailListener
      </messagelistener-type>

      <activationspec-class>
      org.jboss.seam.mail.ra.InboundMailActivationSpec
      </activationspec-class>
      <required-config-property>
      <config-property-name>
      host
      </config-property-name>
      </required-config-property>
      <required-config-property>
      <config-property-name>
      username
      </config-property-name>
      </required-config-property>
      <required-config-property>
      <config-property-name>
      password
      </config-property-name>
      </required-config-property>
      <required-config-property>
      <config-property-name>
      interval
      </config-property-name>
      </required-config-property>
      <required-config-property>
      <config-property-name>
      type
      </config-property-name>
      </required-config-property>



      </inbound-resourceadapter>




      First i complied all java files in eclipse by providing required jar in path.
      Then i bundled these class files and ra.xml into mail_ra.rar.
      Now to deploy it in JBoss i have written a mail_ds.xml as shown

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE connection-factories PUBLIC
      "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
      "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">

      <connection-factories>

      <no-tx-connection-factory>
      <jndi-name>Incoming Email Resource Adapter</jndi-name>
      <rar-name>mail_ra.rar</rar-name>
      <connection-definition>
      org.jboss.seam.mail.ra.InboundMailResourceAdapter
      </connection-definition>
      <config-property name="RepositoryPath"
      type="java.lang.String">..</config-property>
      </no-tx-connection-factory>

      </connection-factories>


      My queries are the parameter value of <connection-definition> must be a connectionfactory class, but the class i provided is implementing ResourceAdapter.
      Also when i tried to deploy it in JBoss AS 4.2.1, it failed.
      I also decompiled some ra.jars present in deploy folder and verified the java files. The implementation of those files is different with the files i was tying to deploy.
      Could any one suggest me, the process to deploy resource adapter in jboss?
      I have read abt JCA and resource adapters

        • 1. Re: How to deploy resource adapter in JBoss

           

          "ihari2004" wrote:

          My queries are the parameter value of <connection-definition> must be a connectionfactory class, but the class i provided is implementing ResourceAdapter.


          connection-definition is for outbound not inbound. It is the user connection factory,
          e.g. javax.sql.Datasource for jdbc


          Also when i tried to deploy it in JBoss AS 4.2.1, it failed.


          Can't help unless you explain how it failed.


          Could any one suggest me, the process to deploy resource adapter in jboss?
          I have read abt JCA and resource adapters


          What did you read and what didn't you understand? (always looking to understand
          why the documentation isn't useful to some people :-)

          • 2. Multiple cci.connection in one resource adaptor (one ra.xml)
            monsu

            Hi,
            I have scenario as below:
            My application has to connect to 2 different methods present in different cci connection interfaces. Can this be a part of same same resource adaptor (ie ra.xml). How to configure one ra.xml to support two cci connection? Can you give a sample ra.xml file for this.