11 Replies Latest reply on May 17, 2002 12:32 PM by Georg Schmid

    JBoss-2.4.4_Tomcat-4.0.1 & CMP & Oracle

    Gianluca Newbie

      I would to know some things:

      1) JBoss 2.4.4 contains all features of EJB2.0 ?
      In particular: it can manage local interface ?

      2) I've a problem with Oracle 8 e CMP.

      My project has a jaws.xml file in META-INF folder (with other files like ejb-jar.xml and jboss.xml).
      My jaws file is:


      java:/OracleDS
      <type-mapping>Oracle8</type-mapping>


      where OracleDS is defined in a file named oracle-service.xml present in jboss_home/deploy:


      <?xml version="1.0" encoding="UTF-8"?>
      <!-- $Id: oracle-service.xml,v 1.3 2002/03/01 00:02:00 d_jencks Exp $ -->

      <!-- =====================================================================-->
      <!-- oracleds-service.xml -->
      <!-- JBoss v3.0alpha (november 23, 2001) ORACLE thin driver Configuration -->
      <!-- tested against ORACLE v8.x -->
      <!-- ==================================================================== -->
      <!-- -->
      <!-- please put jdbc driver (in this case classes12.zip) in jboss_home/lib/ext -->
      <!-- please put this file (oracleds-service.xml) under jboss_home/deploy -->
      <!-- Contributed by Christian Biasuzzi bic@quinary.com-->
      <!-- ===================================================================== -->





      ConnectionURL=jdbc:oracle:thin:@myserver.com:1521:db1
      DriverClass=oracle.jdbc.driver.OracleDriver

      OracleDS
      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

      #
      #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=myusername
      password=mypassword




      This script, perhaps, is written for JBoss 3.0, i've read.
      Infact error message displayed is:
      Boss-2.4.4_Tomcat-4.0.1/jboss/tmp/deploy/Default/user.ear/, Cause: org.jboss.dep
      loyment.DeploymentException: OracleDS not bound


      What's wrong ?
      Help me please !

        • 1. Re: JBoss-2.4.4_Tomcat-4.0.1 & CMP & Oracle
          Lars Bergmann Newbie

          > 1) JBoss 2.4.4 contains all features of EJB2.0 ?
          no, it does not.

          > In particular: it can manage local interface ?
          not sure: I read about some "patch" making use of local interfaces with 2.4.x; however, you can optimize local (in VM) calls (pass by reference).


          > 2) I've a problem with Oracle 8 e CMP.

          It seems as if you mix up a JBoss 2.4.x installation and JBoss 3.0 configuration? For 2.4.x you would configure the Oracle DS in jboss.jcml:


          <!-- ==================================================================== -->
          <!-- Transactions -->
          <!-- ==================================================================== -->


          300
          oracle.jdbc.xa.OracleXid



          <!-- ==================================================================== -->
          <!-- JDBC -->
          <!-- ==================================================================== -->


          oracle.jdbc.driver.OracleDriver



          OracleProLounge
          org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl

          jdbc:oracle:thin:@xxx.yyy.de:1521:mySID
          xxx
          yyy

          1200000
          10
          false
          false
          false
          true
          120000
          1800000
          false
          false
          1.0
          0





          Lars

          • 2. Re: JBoss-2.4.4_Tomcat-4.0.1 & CMP & Oracle
            Gianluca Newbie

            Ok, i do so and Oracle service start-up !!
            But in version 2.4.4 how can i say to my entity bean that it must use that Oracle pool connection ??

            I changed jaws.xml as above but it continue using old default pool (Hypersonic) ...

            • 3. Re: JBoss-2.4.4_Tomcat-4.0.1 & CMP & Oracle
              Gianluca Newbie

              ok, now it goes on !!

              i've inserted in ejb-jar.xml file


              ...
              <resource-ref>
              <res-ref-name>jdbc/oracledb</res-ref-name>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Container</res-auth>
              </resource-ref>
              ...



              and in jboss.xml:


              <ejb-name>myBean</ejb-name>
              <jndi-name>mybeans/myBean</jndi-name>
              <resource-ref>
              <res-ref-name>jdbc/oracledb</res-ref-name>
              <resource-name>OracleDBRes</resource-name>
              </resource-ref>

              • 4. Re: JBoss-2.4.4_Tomcat-4.0.1 & CMP & Oracle
                Cristian Caprar Newbie

                Hi.

                I configured my Oracle8i DS exactly this way and when starting JBoss2.4.4, it simply hangs up. In the log file or console it says the conection was bound to java:/OracleDS and stops.

                The following setting seems to be the problem:
                org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl

                If the following is used, it starts ok, when deploying the CMP bean the table is created but then I get some nasty XA exceptions and it says the bean was successfully deployed:

                oracle.jdbc.xa.client.OracleXADataSource

                Any ideas what's wrong? Maybe some problem with Oracle?

                Regards,
                Cristian

                • 5. Re: JBoss-2.4.4_Tomcat-4.0.1 & CMP & Oracle
                  Lars Bergmann Newbie

                  > Hi.
                  >
                  > I configured my Oracle8i DS exactly this way and when
                  > starting JBoss2.4.4, it simply hangs up. In the log
                  > file or console it says the conection was bound to
                  > java:/OracleDS and stops.
                  >
                  > The following setting seems to be the problem:
                  > name="DataSourceClass">org.jboss.pool.jdbc.xa.wrapper.
                  > ADataSourceImpl

                  go back to the above settings.
                  you should verify url and credentials:

                  jdbc:oracle:thin:@xxx.yyy.de:1521:mySID
                  xxx
                  yyy

                  invalid settings (e.g. password) here can cause the server hang when trying to connect.


                  Lars

                  > If the following is used, it starts ok, when
                  > deploying the CMP bean the table is created but then
                  > I get some nasty XA exceptions and it says the bean
                  > was successfully deployed:
                  >
                  > name="DataSourceClass">oracle.jdbc.xa.client.OracleXAD
                  > taSource
                  >
                  > Any ideas what's wrong? Maybe some problem with
                  > Oracle?
                  >
                  > Regards,
                  > Cristian

                  • 6. Re: JBoss-2.4.4_Tomcat-4.0.1 & CMP & Oracle
                    Cristian Caprar Newbie

                    I double and triple checked every setting. I tested the same connection from sqlplus. It works ok. JBoss is on the same machine with Oracle8i server.

                    Whenever I tell it to use the XADataSourceImpl wrapper, it hangs when starting up. When setting the DS to oracle.jdbc.xa.client.OracleXADataSource, it starts ok. We tried getting a connection from a session bean and it also works fine. Just when deploying CMP entity beans, we get a very UGLY exception:

                    [ERROR,Default] java.sql.SQLException: ORA-06550: line 1, column 13:
                    PLS-00201: identifier 'JAVA_XA.XA_START_NEW' must be declared
                    ORA-06550: line 1, column 7:
                    PL/SQL: Statement ignored

                    And from what I understood, we need the jBoss XA wrapper only when we don't have an XA compliant DS, which is not the case with Oracle XA DS.

                    More ideas? This problem is getting really bad for us :(
                    Thanks,
                    Cristian

                    • 7. Re: JBoss-2.4.4_Tomcat-4.0.1 & CMP & Oracle
                      Cristian Caprar Newbie

                      Hi.

                      I tried the same from another machine and IT WORKS. With the XA DS wrapper from jBoss. Entity beans deploy ok and jBoss starts ok, connecting to the same DB server.

                      Still I can't understand the error when using Oracle XA DS. It seems it's not really an XA DS ...

                      We'll try to find out why it does not work from the machine where Oracle is installed.

                      Regards,
                      Cristian

                      • 8. Re: JBoss-2.4.4_Tomcat-4.0.1 & CMP & Oracle
                        Christoph Grimm Newbie

                        Problem: Oracle XA does not seem to work
                        when you turn on debugging, you get an error like
                        PLS-00201: identifier 'JAVA_XA.XA_START_NEW' must be declared
                        your bean migtht throw an exception like
                        javax.transaction.TransactionRolledbackException: Transaction marked for rollback, possibly a timeout

                        Cause:
                        as my DBA explained to me JAVA_XA is a plsql-wrapper for some oracle java stuff running on the oracle server
                        the oracle xa-client-driver calls this internally when starting a new transaction
                        as i understood, the oracle client driver calls a
                        plsql-routine called JAVA_XA.xa_start_new and provides a parameter called JAVA_XA.XA_START_NEW
                        if plsql does not find the JAVA_XA stuff because the serverside java is not installed, it comes out with an error.

                        Solution:
                        install the oracle jserver stuff or let your dba install it for you.

                        • 9. Re: JBoss-2.4.4_Tomcat-4.0.1 & CMP & Oracle
                          Cristian Caprar Newbie

                          Thanks, this gives a very good explanation of the Oracle problem. I am sure that I removed all the SQLJ and Java support from the server side of the Oracle installation :) Huh, you never know how things are related. I guess we should thank to your DBA :)

                          As for the problem with the hanging up of JBoss only on one special machine, I finally found it: when the guy developing on that machine modified the config file of JBoss, he somehow copied the drivers section of the file twice. The second appearance was after the config section for OracleDS, and we never looked after that (even if you warned me ... )

                          Thanks again for the help,
                          Cristian
                          iQuest

                          • 10. Re: JBoss-2.4.4_Tomcat-4.0.1 & CMP & Oracle
                            Georg Schmid Newbie

                            Hi,

                            I am getting exactly this same exception,
                            although Oracle announces

                            Oracle
                            Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
                            With the Partitioning option
                            JServer Release 8.1.7.0.0 - Production
                            Oracle JDBC driver 8.1.7.0.0

                            during login.

                            My environment is JBoss3.1.0 (CVS HEAD), Solaris, Oracle 8.1.7.0.0

                            Are there any other configuration task to complete to
                            make XA support work?

                            Thanks in advance.

                            Georg

                            • 11. Re: JBoss-2.4.4_Tomcat-4.0.1 & CMP & Oracle
                              Georg Schmid Newbie


                              I found the solution:
                              The JAVA_XA package must be installed on the Oracle Server.

                              Sorry for the noise.