2 Replies Latest reply on Nov 12, 2004 7:55 PM by shiraz memon

    i dont know what to do?

    shiraz memon Newbie

      Hi

      I have tried the session bean connecting with hypersonic databse it works well. But i could not make it possible with firebird/interbase. I have paseted firebird-ds.xml at JBOSS_HOME/server/default/deploy and also firebirdsql.rar within the same directory as directed by Jaybird doc. And i also changed the name of referrence in ejb-jar.xml i.e. from java:/DefaultDS to java:/FirebirdDS

      I have set the username, path and database file path in the above mentioned files. For making me clear i am pasting the code of the above files as follows:


      firebird-ds.xml

      <?xml version="1.0" encoding="UTF-8"?>
      
       <!-- ==================================================================== -->
       <!-- New ConnectionManager setup for firebird dbs using jca-jdbc xa driver-->
       <!-- Build jmx-api (build/build.sh all) and view for config documentation -->
       <!-- ==================================================================== -->
      
      <connection-factories>
      
       <!--FBManager can be used to create and drop databases.
       Drop is especially useful during testing, since it
       assures a clean start next time. -->
       <mbean code="org.firebirdsql.management.FBManager" name="jboss.jca:service=FirebirdManager">
       <attribute name="FileName">D:/Program Files/Firebird/Firebird_1_5/examples/TAX.FDB</attribute>
       <attribute name="UserName">sysdba</attribute>
       <attribute name="Password">sa</attribute>
       <attribute name="CreateOnStart">true</attribute>
       <attribute name="DropOnStop">false</attribute>
       </mbean>
      
       <tx-connection-factory>
      
       <jndi-name>FirebirdDS</jndi-name>
      
       <xa-transaction/>
      
       <rar-name>firebirdsql.rar</rar-name>
      
       <adapter-display-name>Firebird Database Connector</adapter-display-name>
      
       <config-property name="Database" type="java.lang.String">localhost/3050:D:/Program Files/Firebird/Firebird_1_5/examples/TAX.FDB</config-property>
      
       <user-name>sysdba</user-name>
      
       <password>sa</password>
      
       additional properties. only use one way of setting tx isolation, please
       <config-property name="TransactionIsolation"></config-property>
       <config-property name="TransactionIsolationName">TRANSACTION_READ_COMMITTED</config-property>
       <config-property name="BlobBufferLength"></config-property>
       <config-property name="Encoding"></config-property>
      
      
       <min-pool-size>0</min-pool-size>
       <!-- sql to call when connection is created
       <new-connection-sql>some arbitrary sql</new-connection-sql>
       -->
      
       <!-- sql to call on an existing pooled connection when it is obtained from pool
       <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
       -->
      
       </tx-connection-factory>
      
      </connection-factories>


      ra.xml (inside the firebirdsql.rar)

      <?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">
      
      
      <connector>
       <display-name>Firebird Database Connector</display-name>
       <vendor-name>Firebird Database</vendor-name>
       <spec-version>1.0</spec-version>
       <eis-type>Relational Database</eis-type>
       <version>1.0</version>
       <resourceadapter>
       <managedconnectionfactory-class>org.firebirdsql.jca.FBManagedConnectionFactory</managedconnectionfactory-class>
       <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
       <connectionfactory-impl-class>org.firebirdsql.jdbc.FBDataSource</connectionfactory-impl-class>
       <connection-interface>java.sql.Connection</connection-interface>
       <connection-impl-class>org.firebirdsql.jdbc.FBConnection</connection-impl-class>
       <transaction-support>XATransaction</transaction-support>
      <!-- TODO: add server and port properties. Right now, you must specify
      them in the Database property like this: <host>/<port>:<path to db file> -->
       <config-property>
       <config-property-name>Database</config-property-name>
       <config-property-type>java.lang.String</config-property-type>
       <config-property-value>localhost/3050:D:/Program Files/Firebird/Firebird_1_5/examples/TAX.FDB</config-property-value>
       </config-property>
       <config-property>
       <config-property-name>TransactionIsolation</config-property-name>
       <config-property-type>java.lang.Integer</config-property-type>
       <config-property-value></config-property-value>
       </config-property>
       <config-property>
       <config-property-name>TransactionIsolationName</config-property-name>
       <config-property-type>java.lang.String</config-property-type>
       <config-property-value>TRANSACTION_READ_COMMITTED</config-property-value>
       </config-property>
       <config-property>
       <config-property-name>UserName</config-property-name>
       <config-property-type>java.lang.String</config-property-type>
       <config-property-value>sysdba</config-property-value>
       </config-property>
       <config-property>
       <config-property-name>Password</config-property-name>
       <config-property-type>java.lang.String</config-property-type>
       <config-property-value>sa</config-property-value>
       </config-property>
       <config-property>
       <config-property-name>BlobBufferLength</config-property-name>
       <config-property-type>java.lang.Integer</config-property-type>
       <config-property-value></config-property-value>
       </config-property>
       <config-property>
       <config-property-name>Encoding</config-property-name>
       <config-property-type>java.lang.String</config-property-type>
       <config-property-value></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>


      ejb-jar.xml

      <?xml version="1.0"?>
      
      <!DOCTYPE ejb-jar PUBLIC
      '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN'
      'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
      
      <ejb-jar>
       <enterprise-beans>
       <session>
       <ejb-name>QueryDB</ejb-name>
       <home>day09.QueryDBHome</home>
       <remote>day09.QueryDB</remote>
       <ejb-class>day09.QueryDBBean</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
       <resource-env-ref>
       <resource-env-ref-name>jdbc/styejbDB</resource-env-ref-name>
       <resource-env-ref-type>javax.sql.DataSource</resource-env-ref-type>
       </resource-env-ref>
       </session>
       </enterprise-beans>
      </ejb-jar>


      jboss.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">
      <jboss>
       <enterprise-beans>
       <session>
       <ejb-name>QueryDB</ejb-name>
       <jndi-name>day09/QueryDBHome</jndi-name>
       <resource-env-ref>
       <resource-env-ref-name>jdbc/styejbDB</resource-env-ref-name>
       <jndi-name>java:/FirebirdDS</jndi-name>
       </resource-env-ref>
       </session>
       </enterprise-beans>
      </jboss>


      When i use DefaultDS(i.e. Hypersonic) it works fine and succesfully got connection with it, but not with FirebirdDS(Firebird database)

      looking forward to get positive reply

      regards
      IshQ




        • 1. Re: i dont know what to do?
          Elias Ross Master


          What are the messages you are seeing in the logs?

          • 2. Re: i dont know what to do?
            shiraz memon Newbie


            Hello

            thanks for considering my problem....

            well!

            when i have deployed the firebird-ds.xml and firebirdsql.jar jboss gives the following message in its context:

            00:32:38,562 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
             MBeans waiting for other MBeans:
             ObjectName: jboss.jca:service=TxCM,name=FirebirdDS
             state: CREATED
             I Depend On: jboss.jca:service=ManagedConnectionPool,name=FirebirdDS
             jboss.jca:service=CachedConnectionManager
             jboss:service=TransactionManager
            
             Depends On Me: jboss.jca:service=ConnectionFactoryBinding,name=FirebirdDS
            
             ObjectName: jboss.jca:service=ManagedConnectionPool,name=FirebirdDS
             state: CREATED
             I Depend On: jboss.jca:service=ManagedConnectionFactory,name=FirebirdDS
            
             Depends On Me: jboss.jca:service=TxCM,name=FirebirdDS
            
             ObjectName: jboss.jca:service=ManagedConnectionFactory,name=FirebirdDS
             state: FAILED
             I Depend On: jboss.jca:service=RARDeployment,name='firebirdsql.rar'
            
             Depends On Me: jboss.jca:service=ManagedConnectionPool,name=FirebirdDS
             org.jboss.deployment.DeploymentException: couldn't get oldRarDeployment! jboss.jca:service=RARDeployment,name='firebirdsql.rar'; - nested throwable: (org.jboss.deployment.DeploymentException: ConnectionDefinition 'null' not found in rar 'firebirdsql.rar')
             ObjectName: jboss.jca:service=ConnectionFactoryBinding,name=FirebirdDS
             state: CREATED
             I Depend On: jboss.jca:service=TxCM,name=FirebirdDS
            
             Depends On Me:
            
             MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
             ObjectName: jboss.jca:service=ManagedConnectionFactory,name=FirebirdDS
             state: FAILED
             I Depend On: jboss.jca:service=RARDeployment,name='firebirdsql.rar'
            
             Depends On Me: jboss.jca:service=ManagedConnectionPool,name=FirebirdDS
             org.jboss.deployment.DeploymentException: couldn't get oldRarDeployment!jboss.jca:service=RARDeployment,name='firebirdsql.rar'; - nested throwable: (org.jboss.deployment.DeploymentException: ConnectionDefinition 'null' not found in rar 'firebirdsql.rar')


            and in addition when i used java:/FirebirdDS in my jboss.xml file i got the follwoing message at jboss server console:

            00:36:43,203 INFO [STDOUT] ejbCreate()
             00:36:43,296 INFO [STDOUT]
             Day 9: Demonstrate the use of JDBC...
             00:36:43,296 INFO [STDOUT] initDB: Get initial context from the JNDI service...
            
             00:36:43,312 INFO [STDOUT] Lookup the DataSource as configured by administrator
             ...
             00:36:43,343 INFO [STDOUT] Exception was thrown: Could not dereference object
             00:36:43,359 INFO [STDOUT] Run some DDL statements:



            But it worked out fine when i used java:/DefaultDS(which is set to hypersonic database) in jboss.xml file and it gives the following message

            00:43:09,656 INFO [STDOUT] ejbCreate()
             00:43:09,796 INFO [STDOUT]
             Day 9: Demonstrate the use of JDBC...
             00:43:09,796 INFO [STDOUT] initDB: Get initial context from the JNDI service...
            
             00:43:09,796 INFO [STDOUT] Lookup the DataSource as configured by administrator
             ...
             00:43:09,812 INFO [STDOUT] Getting a Connection from the pool...
             00:43:09,812 INFO [STDOUT] Connection is obtained...
             00:43:09,828 INFO [STDOUT] Run some DDL statements:
             00:43:09,828 INFO [STDOUT] Query Database Metadata:
             00:43:10,000 INFO [STDOUT] Product Name: HSQL Database Engine
             00:43:10,000 INFO [STDOUT] Driver Name: HSQL Database Engine Driver
             00:43:10,000 INFO [STDOUT] Database Schemas:
             00:43:10,140 INFO [STDOUT] TABLE_SCHEM
             00:43:10,140 INFO [STDOUT] ,
             00:43:10,140 INFO [STDOUT] TABLE_CATALOG
             00:43:10,140 INFO [STDOUT] Printing all Data Tables for Schema: TABLE_SCHEM
             00:43:10,156 INFO [STDOUT] Hello world method called
             00:36:43,375 INFO [STDOUT] Query Database Metadata:
             00:36:43,375 INFO [STDOUT] Exception was thrown: null
             00:36:43,375 INFO [STDOUT] Hello world method called


            you can see the code for bean impleantation class and Client in QueryDBBean.java and Client.java respectively in my last query posted with sender name ishq.

            thanks again for considering my query
            ishq