1 Reply Latest reply on Sep 21, 2015 1:09 AM by lylewang

    Creating a datasource using jboss-cli only

    jochen.laser

      Dear all

       

      I want to create a docker container running wildfly-9 domain.

      Once the  container is started, the container's setup process should  start wildlfly running domain.sh

      and then, when the server is up run jboss-cli.sh  to

      (1) Deploy the database driver

      (2) Create the Datasource

      (3) Deploy the application (in a war file)

       

      I do the first two steps in jboss-cli like so:

       

      (1)  deploy  --all-server-groups  --name=com.oracle.jdbc  ojdbc6_g.jar

      (2)  /profile=default/subsystem=datasources/data-source="objkat":add(jndi-name="java:jboss/jdbc/gefa/objektkatalog/main-data-source",max-pool-size=10,min-pool-size=5,driver-name="OracleJDBCDriver",connection-url="jdbc:oracle:thin:@eapp12.it.gefa.de:1521:eora",user-name="objkat",password="******")

       

      After that, I can see the Datasource in the web management console in profile=default, -> configuration, ->datasources.

      with the check for "enabled" beeing set.

       

      Also, I can see the datasource element in domain xml:

       

      <datasource jndi-name="java:jboss/datasources/gefa/objektkatalog/main-data-source" pool-name="objkat" enabled="true">

                              <connection-url>jdbc:oracle:thin:@eapp12.it.gefa.de:1521:eora</connection-url>

                              <driver>OracleJDBCDriver</driver>

                              <pool>

                                  <min-pool-size>5</min-pool-size>

                                  <max-pool-size>10</max-pool-size>

                              </pool>

                              <security>

                                  <user-name>objkat</user-name>

                                  <password>********</password>

                              </security>

                          </datasource>

       

       

      However, when started up the application (of which I have a *.war only, and no source code) complains about the

      datasource not beeing accessible in via jndi.

      If I try to look it up in the web administration console's runtime->jndi view, I cannot find it.

       

       

      It seems that I am missing  some step in creating the datasource,  but what?

       

      THX in advance:

       

      --jochen