9 Replies Latest reply on Jan 19, 2011 4:06 PM by kipper3d

    JBoss As 5.1.0.GA Switch DefaultDS to Oracle DS

      hi all,

      I found many topics about this problem but they can't help me.

      What  I did :

      1. copy oracle jdbc driver.

      2. remove hsqls datasource file from deply. (alos i remove hsql database jars from library)

      3. copy oracle datasource xml file into deploy. this file looks like :

       

      <datasources>                                                                                                                                                                      
          <xa-datasource>                                                                                                                                                                
              <jndi-name>XAOracleDS</jndi-name>                                                                                                                                          
              <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>                                                                                        
              <xa-datasource-property name="URL">jdbc:oracle:thin:@192.168.9.151:1521:DEVSTR</xa-datasource-property>                                                                    
              <xa-datasource-property name="User">jbossadmin</xa-datasource-property>                                                                                                    
              <xa-datasource-property name="Password">jbossadmin</xa-datasource-property>                                                                                                
              <security-domain>OracleDbRealm</security-domain>                                                                                                                           
              <security-domain-and-application>OracleDbRealm</security-domain-and-application>                                                                                           
              <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>                                                    
              <metadata>                                                                                                                                                                 
                      <type-mapping>Oracle9i</type-mapping>                                                                                                                              
              </metadata>                                                                                                                                                                
          </xa-datasource>                                                                                                                                                                                                                                                                                                                                                  
        <mbean code="org.jboss.resource.adapter.jdbc.vendor.OracleXAExceptionFormatter"                                                                                                  
               name="jboss.jca:service=OracleXAExceptionFormatter">                                                                                                                      
          <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>                                                                        
        </mbean>                                                                                                                                                                         
      </datasources>
      

       

       

      4. Remove HsqlDbRealm from login-config.xml

      5. add oracle configuration into login-config.xml

       

       

      <application-policy name="OracleDbRealm">                                                                                                                                        
          <authentication>                                                                                                                                                               
              <login-module code="org.jboss.resource.security.ConfiguredIdentityLoginModule" flag="required">                                                                            
                  <module-option name="principal">jbossadmin</module-option>                                                                                                             
                  <module-option name="userName">jbossadmin</module-option>                                                                                                              
                  <module-option name="password">jbossadmin</module-option>                                                                                                              
                  <module-option name="managedConnectionFactoryName">jboss.jca:service=XATxCM,name=XAOracleDS</module-option>                                                            
              </login-module>                                                                                                                                                            
          </authentication>                                                                                                                                                              
        </application-policy>
      

       

      6. For messaging I remove hsqldb-persistence-service.xml file from server/all/deploy/messaging

      7.copy oracle-persistence-service.xml into server/all/deploy/messaging

      8.I've changed name to "XAOracleDS" into oracle-persistence-service.xml file.

      9.I've also changed file server/all/conf/standardjbosscmp-jdbc.xml.

       

       

      <jbosscmp-jdbc>                                                                                                                                                                    
                                                                                                                                                                                         
         <defaults>                                                                                                                                                                      
            <datasource>java:/XAOracleDS</datasource>                                                                                                                                    
            <datasource-mapping>Oracle9i</datasource-mapping>                                                                                                                            
                                                                                                                                                                                         
            <create-table>true</create-table>
      ...................
      

       

       

      But not success, when jboss started i got an error :

       

      010-04-17 21:11:51,904 WARN  [com.arjuna.ats.jbossatx.jta.TransactionManagerService] (main) XAExceptionFormatters are not supported by the JBossTS Transaction Service - this warn
      2010-04-17 21:11:52,330 INFO  [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] (main) Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=XAOra
      2010-04-17 21:11:56,587 ERROR [org.jboss.messaging.util.ExceptionUtil] (main) org.jboss.messaging.core.jmx.JDBCPersistenceManagerService@f7ad813 startService                      
      java.sql.SQLException: ORA-00942: table or view does not exist                                                                                                                     
                                                                                                                                                                                         
              at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
      
      .........................................
      
      2010-04-17 21:12:00,175 WARN  [org.jboss.ejb.txtimer.DatabasePersistencePolicy] (main) Unable to get timer handles for containerId: jboss.j2ee:jar=profileservice-secured.jar,name=
      java.sql.SQLException: ORA-00942: table or view does not exist
      

       

       

      What I misssed ?

       

       

       

      Any idea ??

       

      How to create Tables into database ? i thik that jboss must create them itself.

       

       

       

      Regards,

      Paata Lominadze.

        • 1. Re: JBoss As 5.1.0.GA Switch DefaultDS to Oracle DS
          kobiianko

          Hi Paata,

          any luck with this?

          I'm tring to do the same thing

          10x,

          Kobi

          • 2. Re: JBoss As 5.1.0.GA Switch DefaultDS to Oracle DS

            Hi,

            I've no any progress on this.

             

            Does anyone has the same problem ?

             

             

            Any idea ?

             

             

            _______________________

            Regards,

            Paata Lominadze.

            • 3. Re: JBoss As 5.1.0.GA Switch DefaultDS to Oracle DS

              Hi again,

              One step forward.

              I've no any problem with postgreSQL or mySQL database, but no success with Oracle

               

               

              _______________________

              Regards,

              Paata Lominadze.

              • 4. Re: JBoss As 5.1.0.GA Switch DefaultDS to Oracle DS
                vickyk

                paata lominadze wrote:

                 

                How to create Tables into database ? i thik that jboss must create them itself.

                You also need to make the changes here

                $JBOSS_HOME/server/default/deploy/uuid-key-generator.sar/META-INF/jboss-service.xml

                 

                Check this entry in the jboss-service.xml

                 

                <depends optional-attribute-name="DataSource">jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>

                 

                This change seem to be missing here too

                http://community.jboss.org/wiki/SetUpMysqlAsDefaultDS#comment-1999

                 

                Try these changes and let us know if things work ok.

                • 5. Re: JBoss As 5.1.0.GA Switch DefaultDS to Oracle DS
                  vickyk

                  paata lominadze wrote:

                   


                  I've no any problem with postgreSQL or mySQL database, but no success with Oracle


                  Can you make sure that the changes made for oracle datasource configured is same as that of postgreSQL/mySQL?

                  • 6. Re: JBoss As 5.1.0.GA Switch DefaultDS to Oracle DS
                    kobiianko

                    hi paata, vicky,

                     

                    it does not work on sybase db also,

                    got this error:

                     

                    15:01:05,264 INFO  [TomcatDeployment] deploy, ctxPath=/
                    15:01:05,529 INFO  [TomcatDeployment] deploy, ctxPath=/jmx-console
                    15:01:05,638 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

                     

                    DEPLOYMENTS MISSING DEPENDENCIES:
                      Deployment "JBossTimerServiceFactory" is missing the following dependencies:
                        Dependency "jboss.ejb:service=EJBTimerService" (should be in state "Create", but is actually in state "Configured")
                      Deployment "jboss.ejb:persistencePolicy=database,service=EJBTimerService" is missing the following dependencies:
                        Dependency "jboss.jdbc:datasource=DefaultDS,service=metadata" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jdb
                    tasource=DefaultDS,service=metadata' **")
                      Deployment "jboss.ejb:service=EJBTimerService" is missing the following dependencies:
                        Dependency "jboss.ejb:persistencePolicy=database,service=EJBTimerService" (should be in state "Create", but is actually in state "Configured")
                      Deployment "jboss.j2ee:jar=profileservice-secured.jar,name=SecureDeploymentManager,service=EJB3" is missing the following dependencies:
                        Dependency "<UNKNOWN jboss.j2ee:jar=profileservice-secured.jar,name=SecureDeploymentManager,service=EJB3>" (should be in state "Described", but is actua
                    in state "** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **")
                      Deployment "jboss.j2ee:jar=profileservice-secured.jar,name=SecureDeploymentManager,service=EJB3_endpoint" is missing the following dependencies:
                        Dependency "jboss.j2ee:jar=profileservice-secured.jar,name=SecureDeploymentManager,service=EJB3" (should be in state "Configured", but is actually in st
                    "PreInstall")
                      Deployment "jboss.j2ee:jar=profileservice-secured.jar,name=SecureManagementView,service=EJB3" is missing the following dependencies:
                        Dependency "<UNKNOWN jboss.j2ee:jar=profileservice-secured.jar,name=SecureManagementView,service=EJB3>" (should be in state "Described", but is actually
                    state "** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **")
                      Deployment "jboss.j2ee:jar=profileservice-secured.jar,name=SecureManagementView,service=EJB3_endpoint" is missing the following dependencies:
                        Dependency "jboss.j2ee:jar=profileservice-secured.jar,name=SecureManagementView,service=EJB3" (should be in state "Configured", but is actually in state
                    eInstall")
                      Deployment "jboss.j2ee:jar=profileservice-secured.jar,name=SecureProfileService,service=EJB3" is missing the following dependencies:
                        Dependency "<UNKNOWN jboss.j2ee:jar=profileservice-secured.jar,name=SecureProfileService,service=EJB3>" (should be in state "Described", but is actually
                    state "** UNRESOLVED Demands 'jboss.ejb:service=EJBTimerService' **")
                        Dependency "<UNKNOWN jboss.j2ee:jar=profileservice-secured.jar,name=SecureProfileService,service=EJB3>" (should be in state "Described", but is actually
                    state "** UNRESOLVED Demands 'jndi:SecureManagementView/remote-org.jboss.deployers.spi.management.ManagementView' **")
                      Deployment "jboss.j2ee:jar=profileservice-secured.jar,name=SecureProfileService,service=EJB3_endpoint" is missing the following dependencies:
                        Dependency "jboss.j2ee:jar=profileservice-secured.jar,name=SecureProfileService,service=EJB3" (should be in state "Configured", but is actually in state
                    eInstall")
                      Deployment "jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory" is missing the following dependencies:
                        Dependency "jboss.messaging:service=PostOffice" (should be in state "Create", but is actually in state "Configured")
                      Deployment "jboss.messaging.connectionfactory:service=ClusteredConnectionFactory" is missing the following dependencies:
                        Dependency "jboss.messaging:service=PostOffice" (should be in state "Create", but is actually in state "Configured")
                      Deployment "jboss.messaging.connectionfactory:service=ConnectionFactory" is missing the following dependencies:
                        Dependency "jboss.messaging:service=PostOffice" (should be in state "Create", but is actually in state "Configured")
                      Deployment "jboss.messaging.destination:name=DLQ,service=Queue" is missing the following dependencies:
                        Dependency "jboss.messaging:service=PostOffice" (should be in state "Create", but is actually in state "Configured")
                      Deployment "jboss.messaging.destination:name=ExpiryQueue,service=Queue" is missing the following dependencies:
                        Dependency "jboss.messaging:service=PostOffice" (should be in state "Create", but is actually in state "Configured")
                      Deployment "jboss.messaging:service=PostOffice" is missing the following dependencies:
                        Dependency "jboss.jgroups:service=ChannelFactory" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jgroups:service
                    nnelFactory' **")

                     

                    DEPLOYMENTS IN ERROR:
                      Deployment "<UNKNOWN jboss.j2ee:jar=profileservice-secured.jar,name=SecureProfileService,service=EJB3>" is in error due to the following reason(s): ** UNR
                    VED Demands 'jboss.ejb:service=EJBTimerService' **, ** UNRESOLVED Demands 'jndi:SecureManagementView/remote-org.jboss.deployers.spi.management.ManagementVie
                    *
                      Deployment "jboss.jgroups:service=ChannelFactory" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.jgroups:service=ChannelFactor
                    *
                      Deployment "<UNKNOWN jboss.j2ee:jar=profileservice-secured.jar,name=SecureManagementView,service=EJB3>" is in error due to the following reason(s): ** UNR
                    VED Demands 'jboss.ejb:service=EJBTimerService' **
                      Deployment "<UNKNOWN jboss.j2ee:jar=profileservice-secured.jar,name=SecureDeploymentManager,service=EJB3>" is in error due to the following reason(s): **
                    SOLVED Demands 'jboss.ejb:service=EJBTimerService' **
                      Deployment "jboss.jdbc:datasource=DefaultDS,service=metadata" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.jdbc:datasource=D
                    ltDS,service=metadata' **

                     

                    15:01:05,654 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
                    15:01:05,669 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
                    15:01:05,669 INFO  [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221053)] Started in 28s:428ms

                    • 7. Re: JBoss As 5.1.0.GA Switch DefaultDS to Oracle DS

                      Kobi,

                       

                      I got the same problem, ant I "solve" it changing my DS name :

                                I let DefaultDS as name...   (it seems more "stable")

                       

                       

                       

                      • 8. Re: JBoss As 5.1.0.GA Switch DefaultDS to Oracle DS
                        kobiianko

                        Hi Martinez,

                        10x for your post,

                         

                        changing our DS name means that you have now 2 active DB.

                        1 DB is you sybase(or mySQL,Oracle...)

                        1 DB is HSQLDB that is used by jboss

                         

                        I'm trying to make it work with only Sybase DB (without HSQLDB), still with no success.

                         

                        for now I've changed my DS name(like you suggested), just to make it work (using 2 DBs).

                         

                        Hopefully, there will be a solution for using only sybase DB without HSQLDB

                        • 9. Re: JBoss As 5.1.0.GA Switch DefaultDS to Oracle DS
                          kipper3d

                          Hello Martinez,

                           

                          Like you I just included DefaultDS entry in the oracle.ds config properties file, but with its own schema called jboss. Do I need to add tables prior or does the startup of jboss do this using standardjbosscmp-jdbc.xml? Its not happening for me - I've granted the user dba privileges.

                           

                          Actually the table called HILOSEQUENCES is being created. But I still get the following error:

                           

                          13:50:34,236 ERROR [ExceptionUtil] org.jboss.messaging.core.jmx.JDBCPersistenceManagerService@5db5889c startService java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist.

                           

                          Im sure Im missing something.

                           

                          I am running jboss-eap-5.0 with ojdbc6.jar. Our application has no problem connecting to the database.

                           

                          Thanks,

                          -Kip