10 Replies Latest reply on Nov 8, 2016 9:31 AM by gsanders

    wildfly10:domain-mode: neither create jdbc-driver nor datasource

    gsanders

      hello chaps,

       

      when I start wildfly10 in domain-mode I am not able to create new jdbc-drivers. Neither as module nor by cli nor web-interface. Has anyone a clue to accomplish it ?

      thanks in advance for any effort !

      gan.

        • 1. Re: wildfly10:domain-mode: either create jdbc-driver nor datasource
          mayerw01

          You provide more information what you are doing and which error messages you get.

          • 2. Re: wildfly10:domain-mode: either create jdbc-driver nor datasource
            gsanders

            dear wolfgang,

             

            thank you very much for replying ! I got different error-messages depending on what I try to do.

            firstly when I start wildfly10 in domain-mode - means starting domain.sh, right? - I want to do a

            "module add" for install a new postgresql-driver. no way.

            secondly I stopped domain-mode and launched standalone-mode. within here I can install

            the driver. Now there exists a folder »postgresql« in wildfly/modules/system/layers/base/org   .

            thirdly I started domain-mode again and tried to create a new datasource in profile/full or

            profile/default. no chance because I can't select the driver in the webinterface and when I try

            to get some informations about it in the CLI : nothing. I only can select or refer to the default

            «h2» which is bind to ExampleDS by default.

            I read a lot postings, mailing-lists, documentations and so on for DAYS ! IMHO it seems noone

            has tried to do just a simple thing like I do.

             

            if you want me to post an error-message, please tell me what I should execute on CLI.

            • 3. Re: wildfly10:domain-mode: either create jdbc-driver nor datasource
              mayerw01

              The module command is not available in domain mode.

              You should install the driver as a module as  described in JDBC Driver / DataSource Setup · HAL Management Console

              As mentioned there the path recommendation had changed. You should now place the modules folder to WILDFLY_HOME/modules instead.

              For postgresql this would be in WILDFLY_HOME/modules/org

              Then you may add the driver via cli like

              /profile=full/subsystem=datasources/jdbc-driver=postgresql:add(driver-name=postgresql,driver-class-name=org.postgresql.Driver,driver-module-name=org.postgresql,driver-xa-datasource-class-name=org.postgresql.xa.PGXADataSource)

              • 4. Re: wildfly10:domain-mode: either create jdbc-driver nor datasource
                gsanders

                dear wolfgang,

                 

                again, exactly I did that what you suggested . no success. have a try yourself just to understand.

                • 5. Re: wildfly10:domain-mode: either create jdbc-driver nor datasource
                  mayerw01

                  I did this just before I wrote this blog and it worked in my environment.

                  • Did you create the module.xml in the WILDFLY_HOME/modules/org/postgresql/main/ folder?

                       It should look like:

                  <module xmlns="urn:jboss:module:1.3" name="org.postgresql">

                  <resources>

                      <resource-root path="postgresql-9.4-1202.jdbc42.jar"/>

                    </resources>

                    <dependencies>

                      <module name="javax.api"/>

                      <module name="javax.transaction.api"/>

                    </dependencies>

                  </module>

                   

                  • Did you copy the postgresql-<version>.jdbc42.jar to this folder?

                  If yes, which messages do you get?

                  • 6. Re: wildfly10:domain-mode: either create jdbc-driver nor datasource
                    gsanders

                    above my posts recently says: "Now there exists a folder »postgresql« in wildfly/modules/system/layers/base/org   ."

                     

                    and secondly your question: yes I already copied the driver-jar INTO the folder in which module.xml exists.

                    • 7. Re: wildfly10:domain-mode: either create jdbc-driver nor datasource
                      mayerw01

                      Again:

                      1. Where exactly did you place the module.xml?
                      2. What is the contents of your  module.xml?
                      3. What is the error message?
                      4. I'd suggest to remove the wildfly/modules/system/layers/base/org/postgresql folder
                      • 8. Re: wildfly10:domain-mode: either create jdbc-driver nor datasource
                        gsanders

                        -- 1. Where exactly did you place the module.xml?

                             WILDFLY_HOME/modules/system/layers/base/org/postgresql/main/

                         

                        -- 2. What is the contents of your  module.xml?

                        <?xml version="1.0" ?>

                        <module xmlns="urn:jboss:module:1.1" name="system.layers.base.org.postgresql" slot="main">

                            <resources>

                                <resource-root path="postgresql-9.4.1208.jre7.jar"/>

                            </resources>

                            <dependencies>

                                <module name="javax.api"/>

                                <module name="javax.transaction.api"/>

                            </dependencies>

                        </module>

                        -- 3.What is the error message?

                             if I start in domain-mode neither the CLI nor the Webinterface recognize the driver.
                              there is no specific error-message, just displayed the default-driver: h2

                         

                        -- I'd suggest to remove the wildfly/modules/system/layers/base/org/postgresql folder

                             I did it all the time since I try to figure out, what and why this issue happen.

                        • 9. Re: wildfly10:domain-mode: either create jdbc-driver nor datasource
                          mayerw01

                          The path is not as suggested and the contents in the module.xml is different.

                          Also the driver needs to be installed via the cli add command as described above.

                          Sorry, I can't help you further if you don't follow my recommendations.

                          • 10. Re: wildfly10:domain-mode: neither create jdbc-driver nor datasource
                            gsanders

                            after playing around I found following solution:

                             

                            #############################

                            # for DOMAIN HOST controller

                            #############################

                            # in DISCONNECTED MODE (just start jboss-cli.sh only)

                            module add --name=org.postgresql --resources=/home/karl/Downloads/postgresql-9.4.1208.jar --dependencies=javax.api,javax.transaction.api

                             

                            (the only point is within the file module.xml : <module xmlns="urn:jboss:module:1.1" name="org.postgresql"> what you've suggested to be 1.3 god knows why. )

                             

                            # after be connected to the controller:

                            /profile=default/subsystem=datasources/jdbc-driver=postgres:add(driver-name=postgres,driver-module-name=org.postgresql,driver-class-name=org.postgresql.Driver)

                            /profile=full/subsystem=datasources/jdbc-driver=postgres:add(driver-name=postgres,driver-module-name=org.postgresql,driver-class-name=org.postgresql.Driver)

                            /profile=full/subsystem=datasources/jdbc-driver=postgresql:add(driver-name=postgresql,driver-class-name=org.postgresql.Driver,driver-module-name=org.postgresql,driver-xa-datasource-class-name=org.postgresql.xa.PGXADataSource)

                            /profile=full-ha/subsystem=datasources/jdbc-driver=postgres:add(driver-name=postgres,driver-module-name=org.postgresql,driver-class-name=org.postgresql.Driver)

                            /profile=full-ha/subsystem=datasources/jdbc-driver=postgresql:add(driver-name=postgresql,driver-class-name=org.postgresql.Driver,driver-module-name=org.postgresql,driver-xa-datasource-class-name=org.postgresql.xa.PGXADataSource)