During deployment I'm getting the following errors. I use wildfly 8.x.
When it loads the server i get 404 error page.
04:39:07,010 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-11) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./projectTeam2v2.UndertowDeploymentInfoService: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./projectTeam2v2.UndertowDeploymentInfoService: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_73]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_73]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_73]
Caused by: java.lang.IllegalArgumentException: JBAS017354: Could not find the port number listening for protocol javax.ws.rs.core.Application
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:648)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.start(UndertowDeploymentInfoService.java:256)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
... 3 more
+
04:39:14,333 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "projectTeam2v2.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.undertow.deployment.default-server.default-host./projectTeam2v2.UndertowDeploymentInfoService" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./projectTeam2v2.UndertowDeploymentInfoService: Failed to start service
Caused by: java.lang.IllegalArgumentException: JBAS017354: Could not find the port number listening for protocol javax.ws.rs.core.Application"}}
+
JBAS014777: Services which failed to start: service jboss.undertow.deployment.default-server.default-host./projectTeam2v2.UndertowDeploymentInfoService: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./projectTeam2v2.UndertowDeploymentInfoService: Failed to start service
+
JBAS014775: New missing/unsatisfied dependencies:
service jboss.deployment.unit."projectTeam2v2.war".component."com.ibm.controller.CDController".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./projectTeam2v2, service jboss.deployment.unit."projectTeam2v2.war".deploymentCompleteService]
service jboss.deployment.unit."projectTeam2v2.war".component."com.sun.faces.config.ConfigureListener".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./projectTeam2v2, service jboss.deployment.unit."projectTeam2v2.war".deploymentCompleteService]
service jboss.deployment.unit."projectTeam2v2.war".component."javax.faces.webapp.FacetTag".START (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./projectTeam2v2, service jboss.deployment.unit."projectTeam2v2.war".deploymentCompleteService]
service jboss.deployment.unit."projectTeam2v2.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START (missing) dependents: [service jboss.deployment.unit."projectTeam2v2.war".deploymentCompleteService]
service jboss.undertow.deployment.default-server.default-host./projectTeam2v2 (missing) dependents: [service jboss.deployment.unit."projectTeam2v2.war".deploymentCompleteService]
service jboss.undertow.deployment.default-server.default-host./projectTeam2v2.UndertowDeploymentInfoService (missing) dependents: [service jboss.undertow.deployment.default-server.default-host./projectTeam2v2]
JBAS014777: Services which failed to start: service jboss.undertow.deployment.default-server.default-host./projectTeam2v2.UndertowDeploymentInfoService
+
JBAS014776: Newly corrected services:
service jboss.deployment.unit."projectTeam2v2.war".component."com.ibm.controller.CDController".START (no longer required)
service jboss.deployment.unit."projectTeam2v2.war".component."com.sun.faces.config.ConfigureListener".START (no longer required)
service jboss.deployment.unit."projectTeam2v2.war".component."javax.faces.webapp.FacetTag".START (no longer required)
service jboss.deployment.unit."projectTeam2v2.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START (no longer required)
service jboss.undertow.deployment.default-server.default-host./projectTeam2v2 (no longer required)
service jboss.undertow.deployment.default-server.default-host./projectTeam2v2.UndertowDeploymentInfoService (no longer required)
+
04:46:20,148 ERROR [stderr] (xnio-file-watcher[Watcher for C:\Users\IMC\wildfly-8.2.1.Final\standalone\deployments\SpringMVC.war/]-0) Exception in thread "xnio-file-watcher[Watcher for C:\Users\IMC\wildfly-8.2.1.Final\standalone\deployments\SpringMVC.war/]-0" java.nio.file.ClosedWatchServiceException
04:46:20,149 ERROR [stderr] (xnio-file-watcher[Watcher for C:\Users\IMC\wildfly-8.2.1.Final\standalone\deployments\SpringMVC.war/]-0) at sun.nio.fs.AbstractWatchService.checkOpen(AbstractWatchService.java:80)
04:46:20,149 ERROR [stderr] (xnio-file-watcher[Watcher for C:\Users\IMC\wildfly-8.2.1.Final\standalone\deployments\SpringMVC.war/]-0) at sun.nio.fs.AbstractWatchService.checkKey(AbstractWatchService.java:92)
04:46:20,149 ERROR [stderr] (xnio-file-watcher[Watcher for C:\Users\IMC\wildfly-8.2.1.Final\standalone\deployments\SpringMVC.war/]-0) at sun.nio.fs.AbstractWatchService.take(AbstractWatchService.java:119)
04:46:20,149 ERROR [stderr] (xnio-file-watcher[Watcher for C:\Users\IMC\wildfly-8.2.1.Final\standalone\deployments\SpringMVC.war/]-0) at org.xnio.nio.WatchServiceFileSystemWatcher.run(WatchServiceFileSystemWatcher.java:85)
04:46:20,150 ERROR [stderr] (xnio-file-watcher[Watcher for C:\Users\IMC\wildfly-8.2.1.Final\standalone\deployments\SpringMVC.war/]-0) at java.lang.Thread.run(Thread.java:745)
In the web.xml i don't have mysql dependency. Could this be the problem?
Thank you for your time :).
i removed web.xml and it works now. can any1 explain me why?
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<display-name>Integration CRUD JSP Project</display-name>
<servlet>
<servlet-name>javax.ws.rs.core.Application</servlet-name>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>javax.ws.rs.core.Application</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>lang</param-value>
</context-param>
<servlet>
<servlet-name>CDController</servlet-name>
<servlet-class>com.ibm.controller.CDController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>CDController</servlet-name>
<url-pattern>/CDController</url-pattern>
</servlet-mapping>
</web-app>
this is the web.xml
Related
Below "Unknown error" occurs If I try to create a new JDBC (datasource) using wildfly-10.1.0.Final Web Management interface.
> **Unknown error**
>
> Unexpected HTTP response: 500
>
> Request {
> "name" => "PostgresDS",
> "jta" => true,
> "enabled" => true,
> "user-name" => "postgres",
> "password" => "admin",
> "jndi-name" => "java:/PostgresDS/School",
> "use-ccm" => true,
> "valid-connection-checker-class-name" => "org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker",
> "pool-name" => "PostgresDS_Pool",
> "connection-url" => "jdbc:postgresql://localhost:5432/School",
> "driver-class" => "org.postgresql.Driver",
> "driver-name" => "postgresql",
> "background-validation" => true,
> "exception-sorter-class-name" => "org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter",
> "operation" => "add",
> "address" => [
> ("subsystem" => "datasources"),
> ("data-source" => "PostgresDS")
> ] }
>
Then I tried to do it manually by editing standalone.xml file as
<datasource jndi-name="java:jboss/datasources/PostgreSQLDS"
pool-name="PostgreSQLDS" enabled="true" use-java-context="true">
<connection-url>jdbc:postgresql://localhost:5432/School</connection-url>
<driver>postgresql</driver>
<pool>
<min-pool-size>10</min-pool-size>
<initial-pool-size>10</initial-pool-size>
<max-pool-size>100</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>postgres</user-name>
<password>admin</password>
</security>
</datasource>
<datasource jta="true" jndi-name="java:jboss/datasources/mysqlschool" pool-name="MySQL" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:mysql://localhost:3306/school</connection-url>
<driver>mysql</driver>
<security>
<user-name>root</user-name>
</security>
<statement>
<prepared-statement-cache-size>100</prepared-statement-cache-size>
<share-prepared-statements>true</share-prepared-statements>
</statement>
</datasource>
...
<drivers>
<driver name="postgres" module="org.postgresql">
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
<datasource-class>org.postgresql.Driver</datasource-class>
</driver>
...
<driver name="mysql" module="com.mysql.driver">
<driver-class>com.mysql.jdbc.Driver</driver-class>
</driver>
...
By adding it manually, Now a WildFly Web Management Console shows newly created postgress data source. But by clicking Test Connection button in WildFLy Web Management Console, it popups below error message:
> Failed to create JDBC connection. An internal error occurred. Details
>
> Unexpected HTTP response: 500
>
> Request {
> "address" => [
> ("subsystem" => "datasources"),
> ("data-source" => "PostgreSQLDS")
> ],
> "operation" => "test-connection-in-pool" }
>
> Response
>
> Internal Server Error {
> "outcome" => "failed",
> "failure-description" => "WFLYJCA0040: failed to invoke operation: WFLYJCA0042: failed to match pool. Check JndiName:
> java:jboss/datasources/PostgreSQLDS",
> "rolled-back" => true
I had copied postgress jdbc driver postgresql-9.4.1210.jre7.jar file to:
C:\wildfly-10.1.0.Final\wildfly-10.1.0.Final\modules\system\layers\base\org\postgresql\main
and module.xml file is also located in the same directory, and is edited as:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="org.postgresql">
<resources>
<resource-root path="postgresql-9.4.1210.jre7.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
my postgrsql database name is School and connection limit is set as -1
after being unsuccessful using postgres I also tried mysql but I got exactly same error messages given above while creating mysql datasource from wilefly web interface as well as by manually editing standalone.xml.
mysql driver "mysql-connector-java-5.1.39-bin.jar" is located at
C:\wildfly-10.1.0.Final\wildfly-10.1.0.Final\modules\system\layers\base\com\mysql\driver\main
and at the same location module.xml file is created as:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="com.mysql.driver">
<resources>
<resource-root path="mysql-connector-java-5.1.39-bin.jar" />
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
===================================
Wildfly log is as below:
2016-09-20 22:37:08,020 ERROR [org.jboss.as.controller.management-operation] (External Management Request Threads -- 5) WFLYCTL0013: Operation ("test-connection-in-pool") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "PostgreSQLDS")
]) - failure description: "WFLYJCA0040: failed to invoke operation: WFLYJCA0042: failed to match pool. Check JndiName: java:jboss/datasources/PostgreSQLDS"
and in eclipse console shows:
18:24:26,178 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "PostgreSQLDS")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.postgresql"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"org.wildfly.data-source.PostgreSQLDS is missing [jboss.jdbc-driver.postgresql]",
"jboss.driver-demander.java:jboss/datasources/PostgreSQLDS is missing [jboss.jdbc-driver.postgresql]"
]
}
18:24:26,180 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "PostgreSQLDS")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => [
"jboss.jdbc-driver.postgresql",
"jboss.jdbc-driver.postgresql"
],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"org.wildfly.data-source.PostgreSQLDS is missing [jboss.jdbc-driver.postgresql]",
"jboss.driver-demander.java:jboss/datasources/PostgreSQLDS is missing [jboss.jdbc-driver.postgresql]",
"org.wildfly.data-source.PostgreSQLDS is missing [jboss.jdbc-driver.postgresql]"
]
}
18:24:26,197 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "hello1.war" (runtime-name : "hello1.war")
18:24:26,197 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "DemoEAR.ear" (runtime-name : "DemoEAR.ear")
18:24:26,199 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.jdbc-driver.postgresql (missing) dependents: [service org.wildfly.data-source.PostgreSQLDS, service jboss.driver-demander.java:jboss/datasources/PostgreSQLDS]
18:24:26,288 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
18:24:26,289 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
18:24:26,289 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started (with errors) in 5760ms - Started 573 of 844 services (4 services failed or missing dependencies, 433 services are lazy, passive or on-demand)
18:25:20,644 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (External Management Request Threads -- 1) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: IJ031084: Unable to create connection
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:345)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:352)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:287)
at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.createConnectionEventListener(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:1320)
at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.getConnection(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:496)
at org.jboss.jca.core.connectionmanager.pool.AbstractPool.internalTestConnection(AbstractPool.java:1052)
at org.jboss.jca.core.connectionmanager.pool.strategy.OnePool.testConnection(OnePool.java:93)
at org.jboss.as.connector.subsystems.common.pool.PoolOperations$TestConnectionInPool.invokeCommandOn(PoolOperations.java:234)
at org.jboss.as.connector.subsystems.common.pool.PoolOperations$1.execute(PoolOperations.java:90)
at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:890)
at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:659)
at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:370)
at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1329)
at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:400)
at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:222)
at org.jboss.as.domain.http.server.DomainApiHandler.handleRequest(DomainApiHandler.java:219)
at io.undertow.server.handlers.encoding.EncodingHandler.handleRequest(EncodingHandler.java:72)
at org.jboss.as.domain.http.server.security.SubjectDoAsHandler$1.run(SubjectDoAsHandler.java:72)
at org.jboss.as.domain.http.server.security.SubjectDoAsHandler$1.run(SubjectDoAsHandler.java:68)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Unknown Source)
at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:149)
at org.jboss.as.domain.http.server.security.SubjectDoAsHandler.handleRequest(SubjectDoAsHandler.java:68)
at org.jboss.as.domain.http.server.security.SubjectDoAsHandler.handleRequest(SubjectDoAsHandler.java:63)
at io.undertow.server.handlers.BlockingHandler.handleRequest(BlockingHandler.java:56)
at org.jboss.as.domain.http.server.DomainApiCheckHandler.handleRequest(DomainApiCheckHandler.java:95)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:988)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:341)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2251)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2284)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2083)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:806)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:410)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:328)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:321)
... 31 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:300)
... 44 more
18:25:20,646 ERROR [org.jboss.as.controller.management-operation] (External Management Request Threads -- 1) WFLYCTL0013: Operation ("test-connection-in-pool") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "MySQL")
]) - failure description: "WFLYJCA0040: failed to invoke operation: WFLYJCA0047: Connection is not valid"
18:26:06,518 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (External Management Request Threads -- 4) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: IJ031084: Unable to create connection
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:345)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:352)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:287)
at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.createConnectionEventListener(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:1320)
at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.getConnection(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:496)
at org.jboss.jca.core.connectionmanager.pool.AbstractPool.internalTestConnection(AbstractPool.java:1052)
at org.jboss.jca.core.connectionmanager.pool.strategy.OnePool.testConnection(OnePool.java:93)
at org.jboss.as.connector.subsystems.common.pool.PoolOperations$TestConnectionInPool.invokeCommandOn(PoolOperations.java:234)
at org.jboss.as.connector.subsystems.common.pool.PoolOperations$1.execute(PoolOperations.java:90)
at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:890)
at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:659)
at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:370)
at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1329)
at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:400)
at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:222)
at org.jboss.as.domain.http.server.DomainApiHandler.handleRequest(DomainApiHandler.java:219)
at io.undertow.server.handlers.encoding.EncodingHandler.handleRequest(EncodingHandler.java:72)
at org.jboss.as.domain.http.server.security.SubjectDoAsHandler$1.run(SubjectDoAsHandler.java:72)
at org.jboss.as.domain.http.server.security.SubjectDoAsHandler$1.run(SubjectDoAsHandler.java:68)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Unknown Source)
at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:149)
at org.jboss.as.domain.http.server.security.SubjectDoAsHandler.handleRequest(SubjectDoAsHandler.java:68)
at org.jboss.as.domain.http.server.security.SubjectDoAsHandler.handleRequest(SubjectDoAsHandler.java:63)
at io.undertow.server.handlers.BlockingHandler.handleRequest(BlockingHandler.java:56)
at org.jboss.as.domain.http.server.DomainApiCheckHandler.handleRequest(DomainApiCheckHandler.java:95)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:805)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:988)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:341)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2251)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2284)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2083)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:806)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:410)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:328)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:321)
... 31 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:300)
... 44 more
18:26:06,521 ERROR [org.jboss.as.controller.management-operation] (External Management Request Threads -- 4) WFLYCTL0013: Operation ("test-connection-in-pool") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "MySQL")
]) - failure description: "WFLYJCA0040: failed to invoke operation: WFLYJCA0047: Connection is not valid"
Please if somebody could guideme to fix the problem ... I would be great-full
I'm trying to connect with database while deploying, but I got some trouble with that, here is a code and stacktrace:
02:19:32,740 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 45) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("jdbc-driver" => "mysql")
]) - failure description: "WFLYJCA0041: Failed to load module for driver [org.mysql]"
02:19:32,814 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 55) WFLYUT0014: Creating file handler for path 'C:\Users \Damian\wildfly-10.0.0.Final/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
02:19:32,839 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0012: Started server default-server.
02:19:32,840 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0018: Host default-host starting
02:19:32,925 INFO [org.jboss.as.ejb3] (MSC service thread 1-5) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 64 (per class), which is derived from thread worker pool sizing.
02:19:32,925 INFO [org.jboss.as.ejb3] (MSC service thread 1-2) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 16 (per class), which is derived from the number of CPUs on this host.
02:19:33,157 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0027: Starting deployment of "FiranyCRM.war" (runtime-name: "FiranyCRM.war")
02:19:33,171 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0027: Starting deployment of "mysql-connector-java-5.1.37.jar" (runtime-name: "mysql-connector-java-5.1.37.jar")
02:19:33,186 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-5) WFLYDS0013: Started FileSystemDeploymentService for directory C:\Users\Damian\wildfly-10.0.0.Final\standalone\deployments
02:19:33,232 INFO [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-6) ISPN000128: Infinispan version: Infinispan 'Mahou' 8.1.0.Final
02:19:33,506 INFO [org.wildfly.extension.undertow] (MSC service thread 1-8) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080
02:19:33,771 INFO [org.jboss.ws.common.management] (MSC service thread 1-8) JBWS022052: Starting JBossWS 5.1.3.Final (Apache CXF 3.1.4)
02:19:33,827 INFO [org.jboss.as.jpa] (MSC service thread 1-8) WFLYJPA0002: Read persistence.xml for firanyDS
02:19:33,880 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
02:19:33,882 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.fabric.jdbc.FabricMySQLDriver (version 5.1)
02:19:33,916 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) WFLYJCA0018: Started Driver service with driver-name = mysql-connector-java-5.1.37.jar_com.mysql.jdbc.Driver_5_1
02:19:33,917 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) WFLYJCA0018: Started Driver service with driver-name = mysql-connector-java-5.1.37.jar_com.mysql.fabric.jdbc.FabricMySQLDriver_5_1
02:19:34,213 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "FiranyCRM.war")]) - failure description: {
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.persistenceunit.\"FiranyCRM.war#firanyDS\".__FIRST_PHASE__ is missing [jboss.naming.context.java.jdbc.firanyDS]",
"jboss.persistenceunit.\"FiranyCRM.war#firanyDS\" is missing [jboss.naming.context.java.jdbc.firanyDS]"
],
"WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {
"Services that were unable to start:" => [
"jboss.deployment.unit.\"FiranyCRM.war\".component.\"com.sun.faces.config.ConfigureListener\".START",
"jboss.deployment.unit.\"FiranyCRM.war\".component.\"javax.faces.webapp.FacesServlet\".START",
"jboss.deployment.unit.\"FiranyCRM.war\".component.\"javax.faces.webapp.FacetTag\".START",
"jboss.deployment.unit.\"FiranyCRM.war\".component.\"javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV\".START",
"jboss.deployment.unit.\"FiranyCRM.war\".component.\"javax.servlet.jsp.jstl.tlv.ScriptFreeTLV\".START",
"jboss.deployment.unit.\"FiranyCRM.war\".component.\"managed-bean.com.firanycrm.controller.CurtainBean\".START",
"jboss.deployment.unit.\"FiranyCRM.war\".component.\"managed-bean.com.firanycrm.controller.LoginBean\".START",
"jboss.deployment.unit.\"FiranyCRM.war\".deploymentCompleteService",
"jboss.deployment.unit.\"FiranyCRM.war\".jndiDependencyService",
"jboss.naming.context.java.module.FiranyCRM.FiranyCRM.DefaultDataSource",
"jboss.undertow.deployment.default-server.default-host./FiranyCRM",
"jboss.undertow.deployment.default-server.default-host./FiranyCRM.UndertowDeploymentInfoService"
],
"Services that may be the cause:" => [
"jboss.jdbc-driver.mysql",
"jboss.naming.context.java.jdbc.firanyDS"
]
}
}
02:19:34,214 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "firanyDS")
]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"org.wildfly.data-source.firanyDS is missing [jboss.jdbc-driver.mysql]",
"jboss.driver-demander.java:jboss/datasources/firanyDS is missing [jboss.jdbc-driver.mysql]"
]}
02:19:34,216 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "firanyDS")
]) - failure description: {
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"org.wildfly.data-source.firanyDS is missing [jboss.jdbc- driver.mysql]",
"jboss.driver-demander.java:jboss/datasources/firanyDS is missing [jboss.jdbc-driver.mysql]",
"org.wildfly.data-source.firanyDS is missing [jboss.jdbc- driver.mysql]"
],
"WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {
"Services that were unable to start:" => [
"jboss.data-source.reference-factory.firanyDS",
"jboss.naming.context.java.jboss.datasources.firanyDS"
],
"Services that may be the cause:" => [
"jboss.jdbc-driver.mysql",
"jboss.naming.context.java.jdbc.firanyDS"
]
}
}
standalone.xml:
<subsystem xmlns="urn:jboss:domain:datasources:4.0">
<datasources>
<datasource jndi-name="java:jboss/datasources/firanyDS" pool-name="firanyDS">
<connection-url>jdbc:mysql://127.0.0.1:3307/firanycrm</connection-url>
<driver>mysql</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>20</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>root</user-name>
<password>root</password>
</security>
</datasource>
<drivers>
<driver name="mysql" module="org.mysql">
<xa-datasource-class>com.mysql.jdbc.Driver</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
module.xml (in modules folder, modules/org/mysql) :
<module xmlns="urn:jboss:module:1.0" name="org.mysql.driver">
<resources>
<resource-root path="mysql-connector-java-5.1.37.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="firanyDS" transaction-type="RESOURCE_LOCAL">
<jta-data-source>java:/jdbc/firanyDS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect" />
</properties>
</persistence-unit>
</persistence>
In which place I made a mistake?
You have at least two problems:
In the standalone.xml, under the datasources subsystem, you set the driver module to "org.mysql" but the module name in the module.xml is "org.mysql.driver".
The jta-data-source element in persistence.xml should be the jndi name of your datasource: java:jboss/datasources/firanyDS. Besides, since you are using JTA, the transaction-type must be "JTA".
<persistence ...>
<persistence-unit name="firanyDS" transaction-type="JTA">
<jta-data-source>java:/jdbc/firanyDS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect" />
</properties>
</persistence-unit>
</persistence>
I'm trying to configure a data source in Wildfly 8.1 with MySQL. I'm on a local environment on windows and I keep getting errors when I start the server. The datasource is registered, but fails when i test it.
I have the mysql connector jar file in C:\wildfly\modules\system\layers\base\com\mysql\main
standalone.xml
<subsystem xmlns="urn:jboss:domain:datasources:2.0">
<datasources>
<datasource jndi-name="java:jboss/datasources/MySQLDS" pool-name="MySQLDS" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql://localhost:3306/bookdb</connection-url>
<driver>mysql</driver>
<security>
<user-name>root</user-name>
<password>*******</password>
</security>
<timeout>
<idle-timeout-minutes>0</idle-timeout-minutes>
<query-timeout>600</query-timeout>
</timeout>
</datasource>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
<driver name="mysql" module="com.mysql">
<driver-class>com.mysql.jdbc.Driver</driver-class>
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
module.xml C:\wildfly\modules\system\layers\base\com\mysql\main
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-5.1.38-bin.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
<module name="javax.servlet.api" optional="true"/>
</dependencies>
</module>
00:46:17,927 ERROR [org.jboss.as.controller.management-operation](ServerService Thread Pool -- 27) JBAS014613: Operation ("add") failed - address: ([("subsystem" => "datasources"), ("jdbc-driver" => "mysql") ]) - failure description: "JBAS010441: Failed to load module for driver [com.mysql]"
00:46:17,912 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) JBAS010417: Started Driver service with driver-name = h2
00:46:18,171 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) JBAS017525: Started server default-server.
00:46:18,165 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 47) JBAS017527: Creating file handler for path C:\wildfly/welcome-content
00:46:18,498 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017531: Host default-host starting
00:46:18,558 INFO [org.jboss.remoting] (MSC service thread 1-6) JBoss Remoting version 4.0.3.Final
00:46:18,694 INFO org.jboss.as.server.deployment.scanner] (MSC service thread 1-3) JBAS015012: Started FileSystemDeploymentService for directory C:\wildfly\standalone\deployments
00:46:18,701 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017519: Undertow HTTP listener default listening on /127.0.0.1:8080
00:46:18,863 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
00:46:19,112 INFO [org.jboss.ws.common.management] (MSC service thread 1-7) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.2.4.Final
00:46:19,122 ERROR [org.jboss.as.controller.management-operation (Controller Boot Thread) JBAS014613: Operation ("add") failed - address: ([("subsystem" => "datasources"), ("data-source" => "MySQLDS") ]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.data-source.java:jboss/datasources/MySQLDS is missing [jboss.jdbc-driver.mysql]","jboss.driver-demander.java:jboss/datasources/MySQLDS is missing [jboss.jdbc-driver.mysql]" ]}
00:46:19,155 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("add") failed - address: ([("subsystem" => "datasources"),("data-source" => "MySQLDS") ]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.data-source.java:jboss/datasources/MySQLDS is missing [jboss.jdbc-driver.mysql]","jboss.driver-demander.java:jboss/datasources/MySQLDS is missing [jboss.jdbc-driver.mysql]"],"JBAS014879: One or more services were unable to start due to one or more indirect dependencies not being available." => {"Services that were unable to start:" => ["jboss.data-source.reference-factory.MySQLDS", "jboss.naming.context.java.jboss.datasources.MySQLDS"], "Services that may be the cause:" => ["jboss.jdbc-driver.mysql"] } }
00:46:19,254 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report JBAS014775: New missing/unsatisfied dependencies: service jboss.jdbc-driver.mysql (missing) dependents: [service jboss.driver-demander.java:jboss/datasources/MySQLDS, service jboss.data-source.java:jboss/datasources/MySQLDS]
00:46:19,616 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
00:46:19,628 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
00:46:19,643 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: WildFly 8.1.0.Final "Kenny" started (with errors) in 4876ms - Started 185 of 238 services (4 services failed or missing dependencies, 81 services are lazy, passive or on-demand)
00:51:40,780 ERROR [org.jboss.as.controller.management-operation](management-handler-thread - 4) JBAS014613: Operation ("add") failed - address: ([ ("subsystem" => "datasources"), ("jdbc-driver" => "mysql-5-driver") ]) - failure description: "JBAS010441: Failed to load module for driver [mysql]"
00:51:47,961 ERROR [org.jboss.as.controller.management-operation](management-handler-thread - 6) JBAS014613: Operation ("add") failed - address: ([("subsystem" => "datasources"), ("jdbc-driver" => "mysql-5-driver") ]) - failure description: "JBAS010441: Failed to load module for driver [mysql]"
00:53:21,929 ERROR [org.jboss.as.controller.management-operation](management-handler-thread - 8) JBAS014613: Operation ("add") failed - address: ([("subsystem" => "datasources"), ("jdbc-driver" => "mysql-5-driver") ]) - failure description: "JBAS010441: Failed to load module for driver [com.mysql]"
01:01:49,324 ERROR [org.jboss.as.controller.management-operation](XNIO-1 task-7) JBAS014613: Operation ("test-connection-in-pool") failed - address: ([("subsystem" => "datasources"), ("data-source" => "MySQLDS") ]) - failure description: "JBAS010440: failed to invoke operation: JBAS010442: failed to match pool. Check JndiName: java:jboss/datasources/MySQLDS"
Thanks!
Uploading the MySQL connector .jar file via the browser console as a deployment fixed the issue.
My data source is working in WildFly 10x, so I don't know if there was an issue with version 8.1.
Here's a decent video on 3 ways to add a data source to Wildfly: https://www.youtube.com/watch?v=xSHXMcRsF0A
I am getting this exception while trying to start my app on the WildFly 9.0.1 Final release. My WAR file consists only of an application that builds on Spring Framework. My server log file is below.
12:53:57,109 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service
jboss.module.service."deployment.SpringExample.war".main:org.jboss.msc.service.StartException in service
jboss.module.service."deployment.SpringExample.war".main: WFLYSRV0179:
Failed to load module: deployment.SpringExample.war:main at
org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91) at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) at
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) at
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at
java.lang.Thread.run(Unknown Source) Caused by:
org.jboss.modules.ModuleNotFoundException: com.mysql:main at
org.jboss.modules.Module.addPaths(Module.java:1042) at
org.jboss.modules.Module.link(Module.java:1398) at
org.jboss.modules.Module.relinkIfNecessary(Module.java:1426) at
org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:238) at
org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadServic
e.java:68) ... 5 more 12:53:57,115 ERROR
[org.jboss.as.controller.management-operation] (DeploymentScanner-threads
- 2) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment"
=> "SpringExample.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.module.service.\"deployment.SpringExample.war\".main" => "org.jboss.msc.service.StartException in service
jboss.module.service.\"deployment.SpringExample.war\".main: WFLYSRV0179:
Failed to load module: deployment.SpringExample.war:main Caused by: org.jboss.modules.ModuleNotFoundException: com.mysql:main"}} 12:53:57,199
INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) WFLYSRV0010: Deployed "SpringExample.war" (runtime-name : "SpringExample.war") 12:53:57,200 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) WFLYCTL0183: Service status report
WFLYCTL0185: Newly corrected services: service jboss.module.service."deployment.SpringExample.war".main (new available) WFLYCTL0186: Services which failed to start: service
jboss.module.service."deployment.SpringExample.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.SpringExample.war".main: WFLYSRV0179:
Failed to load module: deployment.SpringExample.war:main 12:54:57,515 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0028: Stopped deployment SpringExample.war (runtime-name: SpringExample.war) in 51ms 12:54:57,516 INFO
[org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0027: Starting deployment of "SpringExample.war" (runtime-name: "SpringExample.war") 12:54:58,966 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service
jboss.module.service."deployment.SpringExample.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.SpringExample.war".main: WFLYSRV0179: Failed to load module: deployment.SpringExample.war:main at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91) at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.jboss.modules.ModuleNotFoundException: com.mysql:main at org.jboss.modules.Module.addPaths(Module.java:1042) at org.jboss.modules.Module.link(Module.java:1398) at org.jboss.modules.Module.relinkIfNecessary(Module.java:1426) at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:238) at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:68) ... 5 more 12:54:58,969 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) WFLYCTL0013: Operation ("full-replace-deployment") failed - address: ([]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.module.service.\"deployment.SpringExample.war\".main" => "org.jboss.msc.service.StartException in service jboss.module.service.\"deployment.SpringExample.war\".main: WFLYSRV0179: Failed to load module: deployment.SpringExample.war:main Caused by: org.jboss.modules.ModuleNotFoundException: com.mysql:main"}} 12:54:59,002
INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0016: Replaced deployment "SpringExample.war" with deployment "SpringExample.war" 12:54:59,002 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 1) WFLYCTL0183: Service status report WFLYCTL0184: New missing/unsatisfied dependencies: service
jboss.module.service."deployment.SpringExample.war".main (unavailable) dependents: [service jboss.deployment.unit."SpringExample.war".FIRST_MODULE_USE] WFLYCTL0186: Services which failed to start: service
jboss.module.service."deployment.SpringExample.war".main service
jboss.module.service."deployment.SpringExample.war".main: org.jboss.msc.service.StartException in service
jboss.module.service."deployment.SpringExample.war".main: WFLYSRV0179: Failed to load module: deployment.SpringExample.war:main
Firstly, you have to look module concept of WildFly on documentation. Moreover, defining mySQL module link could be helpful.
So I have followed this tutorial: https://zorq.net/b/2011/07/12/adding-a-mysql-datasource-to-jboss-as-7/
I have done everything as described in the tutorial; yet I keep getting this error on start up:
14:42:19,442 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "ExpensesDataSourcePool")
]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => [
"jboss.data-source.java:/ExpensesDataSource is missing [jboss.jdbc-driver.mysql]",
"jboss.driver-demander.java:/ExpensesDataSource is missing [jboss.jdbc-driver.mysql]"
]}
14:42:19,450 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "ExpensesDataSourcePool")
]) - failure description: {
"JBAS014771: Services with missing/unavailable dependencies" => [
"jboss.data-source.java:/ExpensesDataSource is missing [jboss.jdbc-driver.mysql]",
"jboss.driver-demander.java:/ExpensesDataSource is missing [jboss.jdbc-driver.mysql]"
],
"JBAS014879: One or more services were unable to start due to one or more indirect dependencies not being available." => {
"Services that were unable to start:" => [
"jboss.data-source.reference-factory.ExpensesDataSourcePool",
"jboss.naming.context.java.ExpensesDataSource"
],
"Services that may be the cause:" => ["jboss.jdbc-driver.mysql"]
}
}
14:42:19,489 INFO [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "mysql-connector-java-5.1.34.jar" (runtime-name : "mysql-connector-java-5.1.34.jar")
14:42:19,491 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014775: New missing/unsatisfied dependencies:
service jboss.jdbc-driver.mysql (missing) dependents: [service jboss.data-source.java:/ExpensesDataSource, service jboss.driver-demander.java:/ExpensesDataSource]
This is the structure of my modules dir in the Jboss folder: modules/com/mysql/main with two files module.xml and mysql-connector-java-5.1.34.jar
This is my module.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-5.1.34.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
</dependencies>
</module>
I have also added the mysql jar in standalone/deployments
This is the configuration of my datasource and driver in my standalone.xml under standalone/configuration
<datasource jndi-name="java:/ExpensesDataSource" pool-name="ExpensesDataSourcePool" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql://localhost:3306/expenses</connection-url>
<driver>mysql</driver>
<security>
<user-name>root</user-name>
<password>root</password>
</security>
</datasource>
<driver name="mysql" module="com.mysql"/>
I found my error, I had to put my module.xml and jar under system modules instead of creating a new com folder