8 Replies Latest reply on Dec 15, 2009 6:45 AM by kukeltje

    Example File System RA

    maroni

      I tried to deploy the JCA example of JBOSS Administration and Development book chapter 7 (File System Adapter) for JBoss 3.2.3, but I always get an Exception.

      This is what I did:
      I put the following files (generated by the delivered build.xml) into the deploy directory:
      chap7-ex1.jar (EJB)
      chap7-ex1.rar (Resource Adapter)
      jboss-service.xml
      notxfs-ds.xml

      But I always get the following exeption:

      [MainDeployer] Starting deployment of package: file:/W:/java/jboss-3.2.3/server/default/deploy/jboss-service.xml
      [ServiceConfigurator] Problem configuring service jboss.jca:service=NoTxFS,name=filesystem
      org.jboss.deployment.DeploymentException: No Attribute found with name: JndiName
      at org.jboss.system.ServiceConfigurator.configure(ServiceConfigurator.java:334)
      at .....

      It seems as if something is wrong with the jboss-service.xml file. But that´s the example file of the book. I didn´t change it. I didn´t change any of the delivered files.

      Can anybody tell me what went wrong?

        • 1. Re: Example File System RA

          The -ds.xml is for 3.2.x,
          the -service.xml is for 3.0.x

          • 2. Re: Example File System RA
            jinesh4all

            Hi,

            I am using Jboss 4.2.2 GA, can any one give me an example for FileSystem as Resource? I am new to Connectors.. :(

            Thanks in advance.

            • 3. Re: Example File System RA
              vickyk

               

              "jinesh4all" wrote:

              I am using Jboss 4.2.2 GA, can any one give me an example for FileSystem as Resource? I am new to Connectors.. :(

              Read this
              http://docs.jboss.org/jbossas/jboss4guide/r5/html/ch7.chapt.html
              and try downloading the sample application from here
              http://docs.jboss.org/jbossas/jboss4guide/r5/

              • 4. Re: Example File System RA
                kukeltje

                I've read the documentation Vicky pointed out and also came across http://wernli.nine.ch/web/guest/52
                The latter is transactional, but misses a jboss-service.xm file (if it is needed, no idea yet). The former is not transactional. So I was wondering if someone could give me a quick hint on whether the JBoss example still runs (maybe slightly adapted) on JBoss AS 5.x (the example is seems to be deleted from the 5 docs in svn) or do I need to start from scratch or ...

                • 5. Re: Example File System RA
                  vickyk

                   

                  "kukeltje" wrote:
                  but misses a jboss-service.xm file (if it is needed, no idea yet). The former is not transactional. So I was wondering if someone could give me a quick hint on whether the JBoss example still runs (maybe slightly adapted) on JBoss AS 5.x (the example is seems to be deleted from the 5 docs in svn) or do I need to start from scratch or ...


                  Why do you think that you need jboss-service.xml file?
                  JBoss5 should be able to deploy the jca ra which are deployable on older versions, it is backward compatible and should support the older rar deployments too.
                  Go ahead and deploy the older rars in JB5, let us know if there are any issues.


                  • 6. Re: Example File System RA
                    kukeltje

                    The reason I thought I needed a jboss-service.xml file is because I got the impression that it is needed to have pooling. In the jboss books example rar for a non-tx fs jca implementation it is there for this reason.

                    My rar (if I'm allowed to use it) is new (jca 1.5 compliant). The rar itself deploys, no problem. Not sure how a ds should look like if I have no service.xml file but do want to have pooling...

                    But I'll try to find out more... thanks for the response and help so far.

                    • 7. Re: Example File System RA
                      vickyk

                       

                      "kukeltje" wrote:
                      Not sure how a ds should look like if I have no service.xml file but do want to have pooling...


                      Please read this one
                      http://docs.jboss.org/jbossas/jboss4guide/r5/html/ch7.chapt.html
                      You should understand how the -ds.xml for JCA file rar is configured, these contents gets embedded in the the generated xml by xsl transformation in Jboss4.*
                      <!DOCTYPE connection-factories PUBLIC
                       "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
                       "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
                      <!--
                       The non-transaction FileSystem resource adaptor service configuration
                      -->
                      <connection-factories>
                       <no-tx-connection-factory>
                       <jndi-name>NoTransFS</jndi-name>
                       <rar-name>chap7-ex1.rar</rar-name>
                       <connection-definition>
                       org.jboss.chap7.ex1.ra.DirContextFactory
                       </connection-definition>
                       <config-property name="FileSystemRootDir"
                       type="java.lang.String">/tmp/db/fs_store</config-property>
                       </no-tx-connection-factory>
                      </connection-factories>



                      • 8. Re: Example File System RA
                        kukeltje

                        I got it working. In the end it is much simpler then I thought. The TxFile RA I found can not be used (as is) due to licensing reasons. I've been in contact with the author though and in the not so distant future a project will be started where (refactored) code will be published. This hopefully will help many others.