12 Replies Latest reply on Jan 8, 2002 11:46 AM by davidjencks

    Oracle with JBoss 3.0

    olekg

      Hello

      I downloaded jboss-all and compiled to obtain JBoss 3.0.0 alpha.

      I can see that Hypersonic database is run together with JBoss. I would like to try Oracle that I did with JBoss 2.4.1.

      Why jboss.jcml is no longer present under conf directory ?

      How to configure Oracle DataSource under JBoss 3.0 ?

      Are there any commnets on 3.0 changes ?

        • 1. Re: Oracle with JBoss 3.0
          olekg

          I have already configured DefaultDS as an Oracle connection pool. But when I deploy the CMP bean the table is not created like for hsql. Anybody knows ?

          • 2. Re: Oracle with JBoss 3.0
            luditas

            You're not alone...

            I don't get any Oracle connection message either.

            And it keeps using Hypersonic after changing the defaultDS...

            • 3. Re: Oracle with JBoss 3.0
              kaikailo

              Can anybody tell me what is wrong !

              I have created an oracleds-service.xml as mentioned in the manual. But I got an error message shown below :

              [ContainerFactory,ERROR] Could not deploy file:/jboss-3.0.0alpha/deploy/Default/cd.jar
              org.jboss.ejb.DeploymentException: OracleDS not bound


              • 4. Re: Oracle with JBoss 3.0
                davidjencks

                Without quoting your exact oracle-service.xml and telling us exactly which jboss 3 you are using how do you expect any useful help? Be sure to read the comments in the manual about versions

                • 5. Re: Oracle with JBoss 3.0
                  kaikailo

                  I am using JBoss-3.0.0.zip alpha released at November 21, 2001 and have tried the following oracleds-service.xml

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




                  ConnectionURL=jdbc:oracle:thin:@computer:1521:ORCL DriverClass=oracle.jdbc.driver.OracleDriver

                  OracleDS
                  java:/TransactionManager
                  <mbean-ref>JBOSS-ORACLE:service=Oracle</mbean-ref>
                  <depends optional-attribute-name="ResourceAdapterName">JCA:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter
                  <depends optional-attribute-name="ConnectionManagerFactoryLoaderName">JCA:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory
                  #
                  #Wed Aug 15 16:17:29 EDT 2001
                  BlockingTimeoutMillis=50000
                  IdleTimeoutMinutes=30
                  MaxSize=10
                  CleanupIntervalMinutes=10
                  MinSize=0
                  MaxIdleTimeoutPercent=1.0


                  org.jboss.resource.security.ManyToOnePrincipalMapping

                  userName=scott
                  password=tiger



                  But I got an error message shown below :

                  [ContainerFactory,ERROR] Could not deploy file:/jboss-3.0.0alpha/deploy/Default/cd.jar
                  org.jboss.ejb.DeploymentException: OracleDS not bound

                  Please help !

                  • 6. Re: Oracle with JBoss 3.0
                    marc.fleury

                    You are mixing depends references that are in the current CVS codebase but not in the 3.0 alpha.

                    I wouldn't expect to throw off the rest of the parsing though so something else is screwed up in your configuration. Try to pay attention to the messages as JBoss boots up and deploys your connection, since your depends are screwed up maybe it doesn't get deployed?

                    marcf

                    • 7. Re: Oracle with JBoss 3.0
                      juergenheidak

                      Here's the configuration that works for me in the current (cvs) version of JBoss 3.0.
                      Be sure to place the file containing the oracle jdbc driver under lib/ext directory of your jboss installation.

                      Hope this helps.


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

                      JBOSS-SYSTEM:service=Naming
                      JBOSS-SYSTEM:service=TransactionManager
                      JCA:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory
                      JCA:service=RARDeployer

                      <!-- ==================================================================== -->
                      <!-- JDBC - Initialize the databases -->
                      <!-- to ConnectionFactoryLoader -->
                      <!-- ==================================================================== -->


                      ConnectionURL=jdbc:oracle:thin:@192.168.10.2:1521:test
                      DriverClass=oracle.jdbc.driver.OracleDriver
                      UserName=YourName
                      Password=YourPassword

                      OracleDS
                      java:/TransactionManager
                      Minerva JDBC LocalTransaction ResourceAdapter
                      JCA:service=RARDeployer
                      MinervaSharedLocalCMFactory

                      #Wed Aug 15 16:17:29 EDT 2001
                      InvalidateOnError=false
                      BlockingTimeoutMillis=500000
                      IdleTimeoutMillis=1800000
                      MaxSize=10
                      TimestampUsed=false
                      IdleTimeoutEnabled=false
                      CleanupIntervalMillis=120000
                      MinSize=0
                      GCMinIdleMillis=1200000
                      GCEnabled=false
                      MaxIdleTimeoutPercent=1.0


                      org.jboss.resource.security.ManyToOnePrincipalMapping

                      UserName=YourName Password=YourPassword


                      • 8. Re: Oracle with JBoss 3.0
                        giorgio42


                        I keep having the same problem. The effect is quite interesting: my EBs deploy, and even my JUnit testcase works perfectly well, although there are no tables in my Oracle database. Spooky.

                        The reason is, of course, that the Hypersonic DefaultDS is used all the time. It is not possible to tell from the debug log, which datasource an EJB is bound to.

                        My configuration:

                        oracledb-service.xml file (Oracle configuration "anonymized")



                        <!-- Need the Oracle JDBC Thin Client Driver -->





                        ConnectionURL=jdbc:oracle:thin:@some.oracle.host:1521:sid
                        DriverClass=oracle.jdbc.driver.OracleDriver
                        UserName=me
                        Password=too

                        PMSystemDB
                        java:/TransactionManager

                        <depends optional-attribute-name="ResourceAdapterName">
                        jboss.jca:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter

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



                        MinSize=0
                        MaxSize=10
                        BlockingTimeoutMillis=5000
                        IdleTimeoutMinutes=30
                        CleanupIntervalMinutes=10
                        MaxIdleTimeoutPercent=1.0


                        org.jboss.resource.security.ManyToOnePrincipalMapping


                        <!-- Not supported by Oracle JDBC Thin Client Driver , gives me a java.sql.Exception saying just that (??) -->

                        UserName=me
                        Password=too

                        -->





                        This datasource is visible in the JNDI view.

                        The ejb-jar.xml:
                        <ejb-jar>
                        <display-name>FFAB Core Persistent Entities</display-name>
                        FFAB Core Persistent Entities

                        <enterprise-beans>


                        FFAB Generic Persistent Entity
                        <ejb-name>EntityEB</ejb-name>
                        com.ti.sc.ffab.j2ee.interfaces.Entity
                        com.ti.sc.ffab.j2ee.interfaces.EntityHome
                        <ejb-class>com.ti.sc.ffab.j2ee.ejb.EntityEB</ejb-class>
                        <persistence-type>Container</persistence-type>
                        <prim-key-class>java.lang.String</prim-key-class>
                        false
                        <cmp-version>2.x</cmp-version>
                        <abstract-schema-name>EntityTable</abstract-schema-name>
                        <cmp-field><field-name>id</field-name></cmp-field>
                        <cmp-field><field-name>name</field-name></cmp-field>
                        <primkey-field>id</primkey-field>



                        FFAB Persistent Document
                        <ejb-name>DocumentEB</ejb-name>
                        com.ti.sc.ffab.j2ee.interfaces.Document
                        com.ti.sc.ffab.j2ee.interfaces.DocumentHome
                        <ejb-class>com.ti.sc.ffab.j2ee.ejb.DocumentEB</ejb-class>
                        <persistence-type>Container</persistence-type>
                        <prim-key-class>java.lang.String</prim-key-class>
                        false
                        <cmp-version>2.x</cmp-version>
                        <abstract-schema-name>DocumentTable</abstract-schema-name>
                        <cmp-field><field-name>id</field-name></cmp-field>
                        <cmp-field><field-name>name</field-name></cmp-field>
                        <primkey-field>id</primkey-field>


                        </enterprise-beans>

                        <assembly-descriptor>

                        <container-transaction>


                        <ejb-name>EntityEB</ejb-name>
                        <method-name>*</method-name>



                        <ejb-name>DocumentEB</ejb-name>
                        <method-name>*</method-name>


                        <trans-attribute>Required</trans-attribute>

                        </container-transaction>

                        </assembly-descriptor>

                        </ejb-jar>


                        jaws.xml:


                        PMSystemDB
                        <type-mapping>Oracle8</type-mapping>
                        <create-table>true</create-table>
                        <remove-table>true</remove-table>
                        <tuned-updates>false</tuned-updates>
                        <read-only>false</read-only>
                        <time-out>300</time-out>
                        <select-for-update>false</select-for-update>

                        <enterprise-beans>

                        <!-- EntityEB to ENTITY table mapping -->

                        <ejb-name>EntityEB</ejb-name>
                        <table-name>ENTITY</table-name>
                        <cmp-field>
                        <field-name>id</field-name>
                        <column-name>ID</column-name>
                        <jdbc-type>VARCHAR</jdbc-type>
                        <sql-type>VARCHAR(16)</sql-type>
                        </cmp-field>
                        <cmp-field>
                        <field-name>name</field-name>
                        <column-name>NAME</column-name>
                        <jdbc-type>VARCHAR</jdbc-type>
                        <sql-type>VARCHAR(40)</sql-type>
                        </cmp-field>



                        <ejb-name>DocumentEB</ejb-name>
                        <table-name>DOCUMENTS</table-name>
                        <cmp-field>
                        <field-name>id</field-name>
                        <column-name>ID</column-name>
                        <jdbc-type>VARCHAR</jdbc-type>
                        <sql-type>VARCHAR(16)</sql-type>
                        </cmp-field>
                        <cmp-field>
                        <field-name>name</field-name>
                        <column-name>NAME</column-name>
                        <jdbc-type>VARCHAR</jdbc-type>
                        <sql-type>VARCHAR(40)</sql-type>
                        </cmp-field>


                        </enterprise-beans>



                        The names of the datasources in the oracledb-service.xml and jaws.xml are obviously identical.

                        The greeting from the log after deploying the beans:

                        16:37:20,457 INFO [J2eeDeployer#Default] Deployed J2EE application: file:/home/georg/services/deploy/core-eb-ejb.jar
                        Everybody seems to be happy, the SQL statements are created etc... but the tables are created in hypersonic (from default.script):

                        CREATE TABLE DOCUMENTEB(ID VARCHAR,NAME VARCHAR,UNIQUE(ID))^M
                        CREATE UNIQUE INDEX PK_DOCUMENTEB ON DOCUMENTEB(ID)^M
                        CREATE TABLE ENTITYEB(ID VARCHAR,NAME VARCHAR,UNIQUE(ID))^M
                        CREATE UNIQUE INDEX PK_ENTITYEB ON ENTITYEB(ID)^M
                        And moreover, instead of using the table names from jaws.xml, the entity bean names are used as table names.

                        (used to work with 2.4.4 and EJB 1.1).

                        Tell me, if you need more info, or better, what I've been missing all the time...



                        Thanks and cheers,
                        Georg

                        • 9. Re: Oracle with JBoss 3.0
                          giorgio42

                          Sorry, I forgot the JBoss version in my previous post (built from cvs co jboss-all two days ago):

                          INFO JBoss (MX MicroKernel) 3.0.0alpha(200201051920) [RABBIT-HOLE]
                          INFO Starting General Purpose Architecture (GPA)...
                          INFO ClassLoaders and ServiceLibraries initialized
                          etc.
                          Sparc Solaris8, Oracle 8.1.7.
                          Same effect on Win2k, Oracle 8.1.7.
                          Cheers,
                          Georg

                          • 10. Re: Oracle with JBoss 3.0
                            giorgio42


                            Ok, I have been able to solve my problems so far. It was all my fault:

                            - Switching from EJB1.1 to EJB2.0 requires usage of jbosscmp-jdbc.xml instead of jaws.xml.
                            - After I put the configuration settings in jbosscmp-jdbc.xml inside a tag, everything started to work as expected.

                            I found this by scrutinizing the logs and the source code. Did I miss a section on what to change when moving from JBoss2.4.x to JBoss3.x in the online manuals?

                            Cheers,
                            Georg

                            • 11. Re: Oracle with JBoss 3.0
                              juergenheidak

                              AFAIK the online manual is not up to date in all points.

                              You can purchase an actual version from www.flashline.com (see links under the documentation section).

                              • 12. Re: Oracle with JBoss 3.0
                                davidjencks

                                Online manual - only ch3 ("enterprise resources..") applies to jboss 3

                                Main for $ jboss docs apply to 2.4.x (4?)

                                for $ CMP2 docs and cluster docs apply only to 3.0