1 2 Previous Next 18 Replies Latest reply on Jun 8, 2018 9:47 AM by claudio4j

    WildFly 13: How to create XA-DataSource?

    mayerw01

      When I try to create an XA DataSouce via console I do not have an entry for the database property key.

      When I enter a key/value pair like below I get an error

      "WFLYJCA0069: At least one xa-datasource-property is required for an xa-datasource"

       

      So what is the correct format? Do you have any examples?

       

        • 1. Re: WildFly 13: How to create XA-DataSource?
          claudio4j

          After you type the string, press enter key for each property=value, so the list of properties will be displayed under the textbox.

          • 2. Re: WildFly 13: How to create XA-DataSource?
            mayerw01

            Thanks Claudio.

            So what exactly should I enter as 'value' in the above example 'URL' or 'URL='?

            I tried both as well under Firefox as under Chromium.

            But nothing happens when I press the enter-Key

            • 3. Re: WildFly 13: How to create XA-DataSource?
              claudio4j

              See this short video sample Imgur: The magic of the Internet

               

              The properties are specific to each xa datasource class implementation, for oracle they are:

              DataSourceName DatabaseName ServerName URL User Password Description NetworkProtocol PortNumber ConnectionProperties MaxStatements ImplicitCachingEnabled ExplicitCachingEnabled RoleName

               

              I think the minimum would be URL, Username, Password.

              • 4. Re: WildFly 13: How to create XA-DataSource?
                mayerw01

                Unfortunately this does not work in my environment. The 'enter-key' does nothing. Neither under Chromium, nor Firefox nor Opera. I have no idea why?

                • 5. Re: WildFly 13: How to create XA-DataSource?
                  claudio4j

                  Can you check the browser console for possible error messages ?

                  • 6. Re: WildFly 13: How to create XA-DataSource?
                    andey

                    You can add the xa-datasource by editing the xml.

                     

                    Register the Oracle JDBC driver.

                     

                    /subsystem=datasources/jdbc-driver=oracle:add(driver-name=oracle,driver-module-name=com.oracle,driver-xa-datasource-class-name=oracle.jdbc.xa.client.OracleXADataSource)

                     

                    Add the Oracle XA datasource:

                     

                    xa-data-source add --name=OracleXADS --jndi-name=java:jboss/OracleXADS --driver-name=oracle --user-name=admin --password=admin --validate-on-match=true --background-validation=false --valid-connection-checker-class-name=org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker --exception-sorter-class-name=org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter --stale-connection-checker-class-name=org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker --same-rm-override=false --xa-datasource-properties={"URL"=>"jdbc:oracle:thin:@oracleHostName:1521:orcl"}

                     

                    also If you try to use your approach you need to handle it as a batch:

                     

                    batch

                    /subsystem=datasources/xa-data-source="OracleXADS":add(xa-datasource-class=oracle.jdbc.xa.client.OracleXADataSource,jndi-name="java:/OracleXADS",driver-name="mysql")

                    /subsystem=datasources/xa-data-source="OracleXADS"/xa-datasource-properties=ServerName:add(value="localhost")

                    /subsystem=datasources/xa-data-source="OracleXADS"/xa-datasource-properties=DatabaseName:add(value="mydb")

                    run-batch

                     

                    • 7. Re: WildFly 13: How to create XA-DataSource?
                      mayerw01

                      The approach via jboss-cli does not work as well.

                       

                      I tried this:

                       

                      batch

                      /subsystem=datasources/xa-data-source=OracleXATicket2RockDS:add(driver-name=oracle,jndi-name=java:jboss/datasources/OracleXATicket2RockDS,xa-datasource-class=oracle.jdbc.xa.client.OracleXADataSource)

                      /subsystem=datasources/xa-data-source=OracleXATicket2RockDS/xa-datasource-properties=URL:add(value="jdbc:oracle:thin:@gigabyte:1521:XE")

                      run-batch

                       

                      The batch executed successfully

                       

                      But the connection fails with the message that the Oracle-URL is invalid.

                       

                      /subsystem=datasources/xa-data-source=OracleXATicket2RockDS:read-resource

                       

                      {

                          "outcome" => "success",

                          "result" => {

                              "allocation-retry" => undefined,

                       

                      ....

                       

                        },

                              "xa-datasource-properties" => {"URL" => undefined}

                          }

                      }

                       

                      Finally I copied the xa-datasource from a previous WildFly version.

                      The connection works now but I don't think this should be the preferred approach..

                       

                       

                      • 8. Re: WildFly 13: How to create XA-DataSource?
                        claudio4j

                        You should add the "recursive=true" option, as in :read-resource(recursive=true), because the xa properties is under a sub-resource of xa-data-source

                        You can also test the connection with the following operation, if there is any error, see the server log.

                         

                        /subsystem=datasources/xa-data-source=OracleXATicket2RockDS:test-connection-in-pool

                         

                        Regarding to web console, I tested with firefox, chrome, it worked, that is why I asked to check the browser console.

                        • 9. Re: WildFly 13: How to create XA-DataSource?
                          mayerw01

                          Connection works when I copy the xa-datasource section from the WildFly-10 configuration.

                          I do not see any error in the firefox log.

                          Did you install any add-on to get this work?

                          • 10. Re: WildFly 13: How to create XA-DataSource?
                            claudio4j

                            > Did you install any add-on to get this work?

                             

                            No, it should work with no extensions.

                            • 11. Re: WildFly 13: How to create XA-DataSource?
                              mayerw01

                              I've tried this also in Windows 7 (Firefox, Chrome, IE). Does not work as well.

                              • 12. Re: WildFly 13: How to create XA-DataSource?
                                claudio4j

                                Can you record a video of it (with the developer console open) ? I am really curious why it doesn't work.

                                • 13. Re: WildFly 13: How to create XA-DataSource?
                                  mayerw01

                                  I am not sure what you expect to see.

                                  But the enter key just does nothing

                                  • 14. Re: WildFly 13: How to create XA-DataSource?
                                    mayerw01

                                    Hi Claudio,

                                     

                                    I am not sure what you expect to see.But the enter key just does nothing

                                     

                                    Regards

                                    Wolfgang

                                     

                                     

                                     

                                     

                                     

                                    Am Donnerstag, 7. Juni 2018, 12:44:23 CEST schrieb claudio4j:

                                    Claudio Miranda

                                    claudio4j

                                    replied to the discussion "WildFly 13: How to create XA-DataSource?"

                                     

                                    To view the discussion, visit:

                                    https://developer.jboss.org/message/983213?et=watches.email.thread#983213

                                    >

                                    1 2 Previous Next