0

I was struggling with my webapp (wsesupport) on Openshift with Wildfly 10 and MySQL 5.5. Each time I published from within eclipse, (In server view, right click on wsesupport at Openshift) my project was not deployed, and in the log files I could find the error message:

2016-03-10 17:32:56,740 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "ROOT.war")]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => [ "jboss.persistenceunit.\"ROOT.war#wsesupport\".__FIRST__PHASE__ is missing [jboss.naming.context.java.wsesupport]", "jboss.persistenceunit.\"ROOT.war#wsesupport\" is missing [jboss.naming.context.java.wsesupport]"

I re-added many times my datasource online through the admin console of myapp. I did this through the rhc port-forward wsesupport command and then in the browser localhost:9990. I noticed after the publishing, the entry I made in the Non XA datasources always disapeared.

onderbewustzijn
  • 935
  • 7
  • 32

1 Answers1

0

In Mac, i searched for Resources (cmd-shift-r) and searched for standalone.xml. I did this because in the past I remembered I could deploy the standalone.xml with my web app and the config would be added to the default Wildlfy config (or something like that). So i thought to give it a try, maybe I was unaware of such a file in the project...

Surprisingly, it found it in an hidden openshift folder. If you are using eclipse (for sure) and the openshift plugin it will find it right away. There I copied the current MySqlDS configuration like this:

            <datasource jndi-name="java:/wsesupport" enabled="true"
                use-java-context="true" pool-name="wsesupport" use-ccm="true">
                <connection-url>jdbc:mysql://${env.OPENSHIFT_MYSQL_DB_HOST}:${env.OPENSHIFT_MYSQL_DB_PORT}/wsesupport
                </connection-url>
                <driver>mysql</driver>
                <security>
                    <user-name>${env.OPENSHIFT_MYSQL_DB_USERNAME}</user-name>
                    <password>${env.OPENSHIFT_MYSQL_DB_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>
                    <!--<validate-on-match>true</validate-on-match> -->
                </validation>
                <pool>
                    <flush-strategy>IdleConnections</flush-strategy>
                </pool>
            </datasource>  

I then published my project again and it was working!

PS do not delete the ExampleDS! WildFly apparently needs it!
PS2 do not format the standalone.xml within Eclipse! When i did it, I received this weird error: java.lang.IllegalStateException: You have to start the service first!

Good luck!

onderbewustzijn
  • 935
  • 7
  • 32