2 Replies Latest reply on May 13, 2017 2:37 AM by Joseph Hwang

    How to set default data-source of ee subsystem of wildfly on openshift 3

    Joseph Hwang Novice

      These are my OPENSHIFT environment variables of openshift v3

       

      OPENSHIFT_MYSQL_DB_HOST  172.31.52.98
      OPENSHIFT_MYSQL_DATASOURCE 
      MySQLDS
      OPENSHIFT_MYSQL_DB_PORT 
      3306
      OPENSHIFT_MYSQL_DB_URL jdbc
      :mysql://172.31.52.98:3306/testdb?Unicode=true&characterEncoding=UTF-8

       

      So the modified standalone.xml is generated like below,

       

      <subsystem xmlns="urn:jboss:domain:datasources:4.0">  
        
      <datasources>  
        
      <datasource jndi-name="java:jboss/datasources/MySQLDS" pool-name="MySQLDS" enabled="false" use-
        
      <connection-url>
        jdbc
      :mysql://172.31.52.98:3306/${env.OPENSHIFT_MYSQL_DB_NAME}
        
      </connection-url>
        
      <driver>mysql</driver>  
        
      <pool>  
        
      <flush-strategy>IdleConnections</flush-strategy>  
        
      </pool>
        
      <security>
        
      <user-name>jhwang</user-name>  
        
      <password>password</password>  
        
      </security>  
        
      <validation>  
        
      <check-valid-connection-sql>
        SELECT
      1
        
      </check-valid-connection-sql>
        
      <background-validation>true</background-validation>  
        
      <background-validation-millis>
        
      60000
        
      </background-validation-millis>
        
      </validation>  
        
      </datasource>
      ....
      ....
      <subsystem xmlns="urn:jboss:domain:ee:4.0">
      ....
      <default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:jboss/datasources/ExampleDS" ...

       

      However I can not modify ee subsystem default datasource from ExampleDS to MySQLDS. Is there another OPENSHIFT environment variables to set default datasource of ee subsystem? Pls, check these exceptions of wildfly pod log

       

      08:01:18,693 ERROR [stderr] (default task-1) javax.naming.NameNotFoundException: datasources/MySQLDS -- service jboss.naming.context.java.jboss.datasources.MySQLDS
      08:01:18,694 ERROR [stderr] (default task-1)  at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:106)
      08:01:18,694 ERROR [stderr] (default task-1)  at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:207)
      08:01:18,694 ERROR [stderr] (default task-1)  at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:184)
      08:01:18,694 ERROR [stderr] (default task-1)  at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:237)
      08:01:18,695 ERROR [stderr] (default task-1)  at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:193)
      08:01:18,695 ERROR [stderr] (default task-1)  at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:189)
      08:01:18,695 ERROR [stderr] (default task-1)  at javax.naming.InitialContext.lookup(InitialContext.java:417)
      08:01:18,695 ERROR [stderr] (default task-1)  at javax.naming.InitialContext.lookup(InitialContext.java:417)
      08:01:18,696 ERROR [stderr] (default task-1)  at org.apache.jsp.index_jsp._jspService(index_jsp.java:134)

       

      I tried to modify with vi on openshift web console terminal. But I could not.

      And one more thing! On openshift web console I can use "Add storage" option on wildfly pod. But on Jboss Tools, I can not find the "Add storage" option or link.

      openshift_101.jpg

       

      Your any information will be deeply appreciated! Thanks in advance