I did a change in the deployment scanner of my Jboss 6.4 with the idea to change the path :
standalone.xml
<subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">
<deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000"/>
<deployment-scanner name="MYWAR" path="usr\MYWAR\deployments" relative-to="jboss.server.base.dir" scan-enabled="true" scan-interval="5000" auto-deploy-zipped="false" auto-deploy-exploded="false" deployment-timeout="60"/>
</subsystem>
I can deploy without problems and it works, but the problem appears when I try to execute my rest services: I got a error 404. I cannot find any indication as to the source of the problem in the server log.
The same war in another jboss 6.4 with the default deployment path works perfectly.
Log:
13:42:41,228 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) JBAS015003: mywar.war in Deployment-Verzeichnis gefunden. Um Deployment zustarten, erstellen Sie eine Datei namens mywar.war.dodeploy
13:42:44,721 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starte Deployment von "DocumenzCarlos" (runtime-name: "mywar")
13:42:44,783 INFO [org.jboss.as.server] (HttpManagementService-threads - 18) JBAS015859: "mywar" deployed (runtime-name: "mywar")
standalone.xml
<deployments>
<deployment name="mywar" runtime-name="mywar.war">
<fs-archive path="usr\mywar\deployments" relative-to="jboss.server.base.dir"/>
</deployment>
</deployments>
Any Idea where is the conflict?
Related
I'm new in the company and they were helping me while I setup the enviroment, I got this error when I started WildFly server (they gave me their wildfly 18):
`
09:47:20,106 INFO [org.jboss.as.ejb3] (MSC service thread 1-4) WFLYEJB0493: EJB subsystem suspension complete
09:47:20,124 INFO [org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer] (MSC service thread 1-5) IJ020018: Enabling <validate-on-match> for java:/goljagen
09:47:20,124 INFO [org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer] (MSC service thread 1-8) IJ020018: Enabling <validate-on-match> for java:/goljagra
09:47:20,129 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-7) WFLYJCA0001: Bound data source [java:/agepos]
09:47:20,129 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) WFLYJCA0001: Bound data source [java:/goljagen]
09:47:20,130 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-8) WFLYJCA0001: Bound data source [java:/goljagra]
09:47:22,425 INFO [org.jboss.as.patching] (MSC service thread 1-1) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none
09:47:22,439 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-1) WFLYDS0013: Started FileSystemDeploymentService for directory C:\Program Files\wildfly-18.0.0.Final\standalone\deployments
09:47:22,458 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0027: Starting deployment of "archiconEar.ear" (runtime-name: "archiconEar.ear")
09:47:22,760 INFO [org.wildfly.extension.undertow] (MSC service thread 1-2) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
09:47:23,436 INFO [org.jboss.ws.common.management] (MSC service thread 1-6) JBWS022052: Starting JBossWS 5.3.0.Final (Apache CXF 3.3.3)
09:47:25,221 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."archiconEar.ear".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."archiconEar.ear".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "archiconEar.ear"
at org.jboss.as.server#10.0.0.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:183)
at org.jboss.msc#1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at org.jboss.msc#1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
at org.jboss.msc#1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads#2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0166: Sub deployment archiconWeb.war in jboss-deployment-structure.xml was not found. Available sub deployments: archiconWeb
at org.jboss.as.server#10.0.0.Final//org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.subDeploymentNotFound(DeploymentStructureDescriptorParser.java:327)
at org.jboss.as.server#10.0.0.Final//org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.deploy(DeploymentStructureDescriptorParser.java:221)
at org.jboss.as.server#10.0.0.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:176)
... 8 more
09:47:25,728 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "archiconEar.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"archiconEar.ear\".STRUCTURE" => "WFLYSRV0153: Failed to process phase STRUCTURE of deployment \"archiconEar.ear\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0166: Sub deployment archiconWeb.war in jboss-deployment-structure.xml was not found. Available sub deployments: archiconWeb"}}
09:47:25,747 INFO [org.jboss.as.server] (ServerService Thread Pool -- 44) WFLYSRV0010: Deployed "archiconEar.ear" (runtime-name : "archiconEar.ear")
09:47:25,748 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186: Services which failed to start: service jboss.deployment.unit."archiconEar.ear".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "archiconEar.ear"
09:47:25,820 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
09:47:25,823 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
09:47:25,824 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
09:47:25,824 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 18.0.0.Final (WildFly Core 10.0.0.Final) started (with errors) in 18868ms - Started 597 of 859 services (1 services failed or missing dependencies, 408 services are lazy, passive or on-demand)
`
We whatched in the jboss-deployment-structur and we have this:
`
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
<sub-deployment name="archiconWeb.war">
<dependencies>
<!-- <module name="org.apache.poi" /> -->
<module name="org.apache.commons.codec" />
</dependencies>
</sub-deployment>
</jboss-deployment-structure>
`
this is the pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>it.sisal</groupId>
<artifactId>archicon</artifactId>
<version>0.0.39-SNAPSHOT</version>
</parent>
<artifactId>archiconEar</artifactId>
<packaging>ear</packaging>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>${version.ear.plugin}</version>
<configuration>
<wtpContextName>archicon</wtpContextName>
<!-- Tell Maven we are using Java EE 7 -->
<version>7</version>
<!-- Use Java EE ear libraries as needed. Java EE ear libraries
are in easy way to package any libraries needed in the ear, and automatically
have any modules (EJB-JARs and WARs) use them -->
<defaultLibBundleDir>lib</defaultLibBundleDir>
<outputFileNameMapping>#{artifactId}#</outputFileNameMapping>
<contextRoot>/archicon</contextRoot>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>it.sisal</groupId>
<artifactId>archiconWeb</artifactId>
<version>0.0.39-SNAPSHOT</version>
<type>war</type>
</dependency>
</dependencies>
</project>
Everyone else got the same file, Do you have any Idea which file should I check and how I can solve this problem.
Thanks to all!!!!
They told me to do:
mvn build, on eclipse do:
mvn update;
Project -> clean;
Project -> build All;
On the right click on the server I selected: clean than Publish.
When i using wildfly maven plugin for deploy my java ee application to my wildfly 8.1.0 standalone web application server with this POM configuration:
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>1.0.2.Final</version>
<configuration>
<hostname>127.0.0.1</hostname>
<port>9991</port>
<username>root</username>
<password>manager</password>
</configuration>
</plugin>
If i run mvn wildfly:deploy the application is deployed and i've this message from server log console:
....
21:45:42,100 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "MyApp-0.0.1.war" (runtime-name: "MyApp-0.0.1.war")
21:45:42,819 INFO [org.wildfly.extension.undertow] (MSC service thread 1-7) JBAS017534: Registered web context: /MyApp-0.0.1
21:45:44,319 INFO [org.jboss.as.server] (management-handler-thread - 1) JBAS018562: Redeployed "MyApp-0.0.1.war"
....
If i specify the name parameter in configuration section of plugin into POM like this:
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>1.0.2.Final</version>
<configuration>
<hostname>127.0.0.1</hostname>
<port>9991</port>
<username>root</username>
<password>manager</password>
<name>WebApp</name>
</configuration>
</plugin>
the application is deployed but Web Context is not specified and if i go to: http://127.0.0.1:8080/WebApp the server show error page 404! When application is deployed with this parameter the server console log show only this message:
....
21:44:28,299 INFO [org.jboss.as.repository] (management-handler-thread - 1) JBAS014900: Content added at location D:\Wildfly\standalone\data\content\c0\e78f2599016bf33187b1049001b210040b829a\content
21:44:28,299 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "WebApp" (runtime-name: "WebApp")
21:44:28,705 INFO [org.jboss.as.server] (management-handler-thread - 1) JBAS018559: Redeployed "WebApp" (runtime-name : "WebApp")
....
Why, only with name specification, the web context is not registerd? Can i specify the web context in configurations parameters like the application name? Someone can help me please?
I've tried this out and it turned out that you will have to set to WebApp.war to get it working.
I would personally prefer setting the name directly in the section using the tag since this is more common and there you can omit the file extension.
this is the first time I am trying to setup datasource in my Wildfly server. I tried to follow some tutorials which I found on Google but it still doesn't work.
I am working on a web service but I keep getting some errors when I deploy my .war file.
Here is the latest log when app is deployed:
22:16:33,049 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment IslamicPostsWS.war (runtime-name: IslamicPostsWS.war) in 7ms
22:16:33,184 INFO [org.jboss.as.server] (XNIO-1 task-2) JBAS018558: Undeployed "IslamicPostsWS.war" (runtime-name: "IslamicPostsWS.war")
22:16:33,186 INFO [org.jboss.as.controller] (XNIO-1 task-2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.unit."IslamicPostsWS.war".POST_MODULE
22:16:35,518 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015877: Stopped deployment IslamicPostsWS (runtime-name: IslamicPostsWS) in 7ms
22:16:35,660 INFO [org.jboss.as.server] (XNIO-1 task-6) JBAS018558: Undeployed "IslamicPostsWS" (runtime-name: "IslamicPostsWS")
22:16:38,358 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) JBAS015018: Deployment IslamicPostsWS was previously deployed by this scanner but has been removed from the server deployment list by another management tool. Marker file C:\Users\Ilhami\workspace-services\.metadata\.plugins\org.jboss.ide.eclipse.as.core\WildFly_8.0_Runtime_Server1396040937545\deploy\IslamicPostsWS.undeployed is being added to record this fact.
22:17:00,406 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015876: Starting deployment of "IslamicPostsWS.war" (runtime-name: "IslamicPostsWS.war")
22:17:00,540 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 2) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "IslamicPostsWS.war")]) - failure description: {
"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.IslamicPostsWS.IslamicPostsWS.DefaultDataSource is missing [jboss.naming.context.java.jboss.datasources.ExampleDS]"],
"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.deployment.unit.\"IslamicPostsWS.war\".component.\"com.sun.faces.config.ConfigureListener\".START",
"jboss.deployment.unit.\"IslamicPostsWS.war\".component.\"javax.faces.webapp.FacetTag\".START",
"jboss.deployment.unit.\"IslamicPostsWS.war\".component.\"javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV\".START",
"jboss.deployment.unit.\"IslamicPostsWS.war\".component.\"javax.servlet.jsp.jstl.tlv.ScriptFreeTLV\".START",
"jboss.deployment.unit.\"IslamicPostsWS.war\".component.\"org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher\".START",
"jboss.deployment.unit.\"IslamicPostsWS.war\".component.\"org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap\".START",
"jboss.deployment.unit.\"IslamicPostsWS.war\".deploymentCompleteService",
"jboss.deployment.unit.\"IslamicPostsWS.war\".jndiDependencyService",
"jboss.naming.context.java.module.IslamicPostsWS.IslamicPostsWS.env.jdbc.TestDB",
"jboss.undertow.deployment.default-server.default-host./IslamicPostsWS",
"jboss.undertow.deployment.default-server.default-host./IslamicPostsWS.UndertowDeploymentInfoService"
],
"Services that may be the cause:" => [
"jboss.jdbc-driver.com_mysql_jdbc_Driver",
"jboss.naming.context.java.jboss.datasources.ExampleDS"
]
}
}
22:17:00,683 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "IslamicPostsWS.war" (runtime-name : "IslamicPostsWS.war")
22:17:00,683 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014775: New missing/unsatisfied dependencies:
service jboss.naming.context.java.jboss.datasources.ExampleDS (missing) dependents: [service jboss.naming.context.java.module.IslamicPostsWS.IslamicPostsWS.DefaultDataSource]
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" 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">
<persistence-unit name="JPADB">
<jta-data-source>java:jboss/datasources/DBTest</jta-data-source>
<properties>
<property name="showSql" value="true"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
</properties>
</persistence-unit>
</persistence>
Just tell me if you need more files.
Go into your wildfly console (something like localhost:9990) and edit the Configuration->Container->EE->Default Bindings section. Set the default datasource to the JNDI name of some valid datasource.
I removed the default one that was there and just pointed it to my main datasource since the server exists to run one app only.
You probably have the ds declaration "java:jboss/datasources/ExampleDS" missing in your standalone.xml xmlns "urn:jboss:domain:datasources:2.0" section, just and it will work (here's the example from the default configuration):
<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>
</drivers>
Or you can also add through the UI as mentioned by other response.
can you post your datasource definition?
I think it would be the best to test the datasource deployment 'standalone'. I mean separated from an actual application deployment, just to test whether your datasource works or not.
You can test this f.i. using the web console (localhost:9990/console).
It also looks like there are problems with the pre-configured example DS of wildfly. Did you remove this DS? In standalone.xml there is also a reference on ExampleDS which might be broken.
Assuming you are using a MySQL DB, you can create a DS in the following way:
(1) Download the mysql driver from here:
http://dev.mysql.com/downloads/connector/j/
(2) Copy the mysql driver to:
WILDFLY_HOME/modules/system/layers/base/com/mysql/main
(3) From the JBoss (or Wildfly) console, run the command:
/subsystem=datasources/jdbc-driver=mysql:add(driver-name=mysql, driver-module-name=com.mysql, driver-class-name=com.mysql.jdbc.Driver)
(4) Then, again from the JBoss (or Wildfly) console, run command:
/subsystem=datasources/data-source=YourDS:add(driver-name=mysql, user-name=USERNAME, password=PASSWORD, connection-url=jdbc:mysql://localhost:3306/YOURDATABASE, min-pool-size=5, max-pool-size=15, jndi-name=java:jboss/datasources/YourDS, enabled=true, validate-on-match=true, valid-connection-checker-class-name=org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker, exception-sorter-class-name=org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter)
Voila. Now you have a Datasource with a JNDI path of:
java:jboss/datasources/YourDS
Check if default-bindings configuration references to correct datasource: https://docs.jboss.org/author/display/WFLY8/Default+EE+Bindings+Configuration
I had
service jboss.naming.context.java.jboss.datasourservice jboss.naming.context.java.jboss.datasources.ExampleDS (missing) dependents:...
on wildfly-8.1.0.Final.
IMHO
in standalone/configuration/standalone-full.xml it had
<default-bindings ... datasource="java:jboss/datasources/ExampleDS" ...
and
<datasource jndi-name="java:/datasources/ExampleDS"...
jndi-name mismatch!
I created ExampleDS2 with jndi-name="java:jboss/datasources/ExampleDS". This solved my problem.
From this post start from Jboss AS7 the jdbc driver is able to deploy as regular application. However a question is, how other application is able to refer to this jdbc jar?
here is what I tried but it doesn't work
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
......
<deployment>
<dependencies>
<module name="ojdbc6.jar" />
</dependencies>
</deployment>
.....
</jboss-deployment-structure>
UPDATE
When I deploy ojdbc.jar there is a section of log from console:
10:56:20,416 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "ojdbc6.jar"
10:56:21,487 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 11.2)
10:56:21,489 INFO [org.jboss.as.osgi] (MSC service thread 1-7) JBAS011907: Register module: Module "deployment.ojdbc6.jar:main" from Service Module Loader
10:56:21,499 INFO [org.jboss.as.server] (HttpManagementService-threads - 6) JBAS018559: Deployed "ojdbc6.jar"
Per the log jdbc module is with name deployment.ojdbc6.jar:main, but after I update jboss-deployment-structure.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
......
<deployment>
<dependencies>
<module name="deployment.ojdbc6.jar:main" />
</dependencies>
</deployment>
.....
</jboss-deployment-structure>
it still does not work. with following message:
10:59:34,448 INFO [org.jboss.as.server] (HttpManagementService-threads - 7) JBAS015870: Deploy of deployment "MyApp.war" was rolled back with failure message {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"MyApp.war.war\".POST_MODULE Missing[JBAS014861: <one or more transitive dependencies>]","jboss.module.service.\"deployment.MyApp.war.war\".main Missing[jboss.module.spec.service.\"deployment.ojdbc6.jar:main\".main]"]}
10:59:35,198 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015877: Stopped deployment MyApp.war.war in 749ms
You can reference the jars from other deployments in this way:
<module name="deployment.YourEarOrWar.YourJar.jar" />
Where deployment is the general prefix for a reference to your deployed apps.
However, for a lib like a jdbc-driver I recommend to put it in the module-folder of the JBoss
<module xmlns="urn:jboss:module:1.1" name="driver.ojdbc">
<resources>
<resource-root path="ojdbc6.jar"/>
</resources>
</module>
and reference it then
<module name="driver.ojdbc"/>
See also
https://community.jboss.org/thread/169894
and
http://www.mastertheboss.com/jboss-as-7/how-to-install-a-module-on-jboss-as-7
I am running JBoss as standalone version. I would like to connect to my local mysql database
I copied the mysql connector in modules folder
me#air~/Downloads/jboss/standalone/configuration - 10:56:18 $ ls ../../modules/org/mysql/main/
mysql-connector-java-5.1.22-bin.jar
Next I changed the standalone.xml in jboss/standalone/configuration as
<drivers>
<driver name="com.mysql" module="org.mysql" />
<driver name="h2" module="com.h2database.h2"> <!-- default provided-->
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
Then I added the datasource as
<datasource jndi-name="java:/bb" pool-name="bb-pool" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:mysql://127.0.0.1:3306/mydb</connection-url>
<driver>mysql</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>100</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>bb</user-name>
<password>bb</password>
</security>
<statement>
<prepared-statement-cache-size>100</prepared-statement-cache-size>
<share-prepared-statements>true</share-prepared-statements>
</statement>
</datasource>
I am using JBoss AS 7.1.
When I start the server on console, I see errors
10:54:47,458 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
10:54:47,671 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:/bb]
10:54:47,676 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
10:54:47,676 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss AS 7.1.1.Final "Brontes" started (with errors) in 2000ms - Started 134 of 212 services (2 services failed or missing dependencies, 74 services are passive or on-demand)
and when I hit Ctrl+C, I see
^C10:54:54,998 INFO [org.jboss.as.osgi] (MSC service thread 1-8) JBAS011942: Stopping OSGi Framework
10:54:55,004 INFO [org.jboss.as.logging] JBAS011503: Restored bootstrap log handlers
10:54:55,007 INFO [com.arjuna.ats.jbossatx] ARJUNA032018: Destroying TransactionManagerService
10:54:55,008 INFO [com.arjuna.ats.jbossatx] ARJUNA032014: Stopping transaction recovery manager
10:54:55,010 INFO [org.apache.catalina.core.StandardContext] Container org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/] has not been started
10:54:55,039 INFO [org.apache.coyote.http11.Http11Protocol] Pausing Coyote HTTP/1.1 on http--127.0.0.1-8080
10:54:55,039 INFO [org.apache.coyote.http11.Http11Protocol] Stopping Coyote HTTP/1.1 on http--127.0.0.1-8080
10:54:55,043 INFO [org.jboss.as.controller] JBAS014774: Service status report
JBAS014776: Newly corrected services:
service jboss.jdbc-driver.mysql (new available)
10:54:55,044 INFO [org.jboss.as] JBAS015950: JBoss AS 7.1.1.Final "Brontes" stopped in 47ms
I am new to JBoss and don't know how to fix this issue or to understand what is that I am doing wrong here
I think in your datasource you are referencing the driver mysql, but you named the driver com.mysql.
Try changing one the driver name to mysql.
Just a note: it is best to use the CLI to install the drivers and use the CLI or Web Console to build your datasources. The intention with AS7 is that these tools are used for all of your config and there are very few reasons why you should touch the XML yourself.
I had exactly the same mistake. Took me hours to find out how dumb it was.
In my case I was running jboss as a service under the jboss-as user, nice and easy. Except that when I created the mysql/main directory, along with the files within, I was under another user. No permissions there for jboss-as guy.
A simple chown on modules/ directory did the job.
First of all, your driver definition name doesn't match the driver name under the <datasource> definition. Replace <driver name="com.mysql" ... with <driver name="mysql" ... for it to work.
Second, have you added the module.xml file? It's not enough to copy the MySQL connector jar in the ./modules/com/mysql/main folder, you also have to add the module.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-5.1.26-bin.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
Also, I had a strage similar problem when using the MySQL connector version 5.0.8, where the driver was not found / recognized. It disappeared when I switched to the newer 5.1.26 version.
Make sure you are using latest version of mysql jdbc connector , i solve same issue of mine with replacing latest mysql connetor