-
1. Re: Wildfly Database Connectivity... jboss.naming.context.java.module. missing
mayerw01 Jul 13, 2015 5:37 AM (in response to ejpamin21)You configured your PU with 'Table Generation Strategy: Create'. But the table 'facility' exists already. That's why the exception: "com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'facility' already exists" is thrown.
Which datasource do you miss? I can see the ExampleDS in your Netbeans printout?
-
2. Re: Wildfly Database Connectivity... jboss.naming.context.java.module. missing
ejpamin21 Jul 13, 2015 10:50 AM (in response to mayerw01)Hello Wolfgang, thanks for the response. I think the exception is thrown from a missing dependency. This web app runs well in Glassfish, however, when deployed to Wildfly I get this result...
I'm not sure how I can get this dependency resolved. Also, when I create a new web app and try to create a PU in it, I only get the ExampleDS listed on the dropbox, but not the java:jboss/datasources/HST3. I guess my main question would be, how do you get Netbeans IDE 8.0.2 to recognize the datasources configured on Wildfly? Thanks again!
-
3. Re: Wildfly Database Connectivity... jboss.naming.context.java.module. missing
mayerw01 Jul 13, 2015 12:29 PM (in response to ejpamin21)1 of 1 people found this helpfulErniel,
this usually indicates that the configuration in WildFly is not correct.
Did you configure the jdbc-driver? You may check this via jboss-cli. If you enter in standalone mode:
/subsystem=datasources/jdbc-driver=mysql:read-resource
you should get a feedback like
"outcome" => "success",
"result" => {
"deployment-name" => undefined,
"driver-class-name" => "com.mysql.jdbc.Driver",
"driver-datasource-class-name" => undefined,
"driver-major-version" => undefined,
"driver-minor-version" => undefined,
"driver-module-name" => "com.mysql",
"driver-name" => "mysql",
"driver-xa-datasource-class-name" => undefined,
"jdbc-compliant" => undefined,
"module-slot" => undefined,
"xa-datasource-class" => "com.mysql.jdbc.jdbc2.optional.MysqlXADataSource"
A command like:
/subsystem=datasources/data-source=mysql:test-connection-in-pool
should also provide more details to the root cause of your issue.
The WildFly documentation (Documentation - WildFly 8 - Project Documentation Editor) provides more details
-
4. Re: Wildfly Database Connectivity... jboss.naming.context.java.module. missing
ejpamin21 Jul 13, 2015 12:53 PM (in response to mayerw01)Hello Wolfgang,
Thank you again for the response. Here's what I'm getting the with the commands you suggested...
And the second command...
I guess there's something wrong with the mysql configuration? Here's what my Wildfly admin console is showing...
I'm going to look into the documentation more, but what do think is missing? Thanks again!
-
5. Re: Wildfly Database Connectivity... jboss.naming.context.java.module. missing
mayerw01 Jul 13, 2015 12:56 PM (in response to ejpamin21)Sorry, I meant to replace 'mysql' with the actual datasource. So in your case the command should be:
/subsystem=datasources/data-source=HST3Pool:test-connection-in-pool
-
7. Re: Wildfly Database Connectivity... jboss.naming.context.java.module. missing
mayerw01 Jul 14, 2015 4:33 AM (in response to ejpamin21)So you Datasource connection is working.
And you get this message during deployment of your application, correct?
WildFly is complaining some configuration in your PU.
I'd suggest to check the persistence.xml in the Source view.
Is your Datasource still pointing to the ExampleDS as shown above? But now I understand you'd like to connect to HST3Pool.
Did you check your server.log after the failure? This might also provide more details to the root cause.
-
8. Re: Wildfly Database Connectivity... jboss.naming.context.java.module. missing
smarlow Jul 14, 2015 9:03 AM (in response to ejpamin21)You should look at the inner exception to (better) understand the cause of this confusing problem. The error that you should solve is the:
Caused by: javax.persistence.PersistenceException: Unable to execute JPA schema generation create command [create table facility (fID integer not null auto_increment, facilityDesc varchar(100), facilityName varchar(50) not null, Organization_oID integer not null, primary key (fID))]
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'facility' already exists"},
I agree with Wolfgang, that you should look at the persistence.xml to see if you caused this. You can also show us the contents of your persistence.xml. If you are running the MySQL database on Windows, I think the 'facility table name is stored as 'FACILITY' which could cause some confusion.
You can also enable TRACE logging for the org.jboss.as.jpa and org.hibernate categories which gives more information in the application server console. Instructions are here.
Scott
-
9. Re: Wildfly Database Connectivity... jboss.naming.context.java.module. missing
ejpamin21 Jul 15, 2015 1:23 PM (in response to smarlow)Thank you Lord I finally got it to work. The problem was with my web.xml file... Here's the resource name of my Wildfly to MySQL connection...
My web.xml file was using the old resource name which was "jdbc/hst3" when deployed under the Glassfish server. The web.xml file should use the Wildfly resource name "HST3POOL" under the Wildfly server as follows...
When the web app apparently looks up the "jdbc/hst3" resource name on the Wildfly it doesn't find it, thus giving me the error. But when I changed the web.xml to use the "HST3POOL" resource name on the Wildfly, the application is able to look it up and make the connection. Thank you guys for all your help, I guess we'll be happy sailing for now!
-
10. Re: Wildfly Database Connectivity... jboss.naming.context.java.module. missing
mayerw01 Jul 16, 2015 4:27 AM (in response to ejpamin21)I'd not recommend to use web.xml for your jpa datasources. Those definitions should rather be placed in the persistence.xml