Connecting Keycloak with Postgresql - postgresql

I am trying to just simply connect my keycloak with postgresql. Keycloak and postgres are running on the same machine. Here are the sections from my standalone.xml file:
DataSources
<datasources>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
<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>
<datasource jndi-name="java:jboss/datasources/KeycloakDS" pool-name="KeycloakDS" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
<connection-url>jdbc:postgresql://10.76.106.4:5432/keycloakSQL</connection-url>
<driver>postgresql</driver>
<pool>
<max-pool-size>20</max-pool-size>
</pool>
<security>
<user-name>KeycloakAdmin</user-name>
<password>password</password>
</security>
</datasource>
<drivers>
​<driver name="postgresql" module="org.postgresql">
​<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
​</driver>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
Module.xml
<?xml version="1.0" ?>
<module xmlns="urn:jboss:module:1.3" name="org.postgresql">
<resources>
<resource-root path="postgresql-42.2.23.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
Here is the error that I am getting when attempting to run the standalone.bat:
Error
E:\keycloak\bin>standalone.bat
Calling "E:\keycloak\bin\standalone.conf.bat"
Setting JAVA property to "C:\Program Files\Java\jre1.8.0_301\bin\java"
===============================================================================
JBoss Bootstrap Environment
JBOSS_HOME: "E:\keycloak"
JAVA: "C:\Program Files\Java\jre1.8.0_301\bin\java"
JAVA_OPTS: "-Dprogram.name=standalone.bat -Xms64M -Xmx512M -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true "
===============================================================================
15:02:41,211 INFO [org.jboss.modules] (main) JBoss Modules version 1.11.0.Final
15:02:43,937 INFO [org.jboss.msc] (main) JBoss MSC version 1.4.12.Final
15:02:43,953 INFO [org.jboss.threads] (main) JBoss Threads version 2.4.0.Final
15:02:44,081 INFO [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: Keycloak 15.0.2 (WildFly Core 15.0.1.Final) starting
15:02:45,483 INFO [org.wildfly.security] (ServerService Thread Pool -- 20) ELY00001: WildFly Elytron version 1.15.3.Final
15:02:50,702 INFO [org.jboss.as.controller] (Controller Boot Thread) OPVDX002: Failed to pretty print validation error: null
15:02:50,706 ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:143)
at org.jboss.as.server.ServerService.boot(ServerService.java:403)
at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:416)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.xml.stream.XMLStreamException: com.ctc.wstx.exc.WstxParsingException: Received non-all-whitespace CHARACTERS or CDATA event in nextTag().
at [row,col {unknown-source}]: [152,14]
at org.jboss.as.connector.subsystems.datasources.DataSourcesExtension$DataSourceSubsystemParser.readElement(DataSourcesExtension.java:651)
at org.jboss.as.connector.subsystems.datasources.DataSourcesExtension$DataSourceSubsystemParser.readElement(DataSourcesExtension.java:205)
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:122)
at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69)
at org.jboss.as.server.parsing.StandaloneXml_16.parseServerProfile(StandaloneXml_16.java:673)
at org.jboss.as.server.parsing.StandaloneXml_16.readServerElement(StandaloneXml_16.java:243)
at org.jboss.as.server.parsing.StandaloneXml_16.readElement(StandaloneXml_16.java:140)
at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:144)
at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:52)
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:122)
at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:76)
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:126)
... 3 more
Caused by: com.ctc.wstx.exc.WstxParsingException: Received non-all-whitespace CHARACTERS or CDATA event in nextTag().
at [row,col {unknown-source}]: [152,14]
at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:634)
at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:504)
at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:488)
at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1223)
at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.nextTag(XMLExtendedStreamReaderImpl.java:152)
at org.jboss.as.connector.subsystems.datasources.DsParser.parseDataSources(DsParser.java:208)
at org.jboss.as.connector.subsystems.datasources.DsParser.parse(DsParser.java:189)
at org.jboss.as.connector.subsystems.datasources.DataSourcesExtension$DataSourceSubsystemParser.readElement(DataSourcesExtension.java:644)
... 14 more
15:02:50,712 FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
15:02:50,725 INFO [org.jboss.as] (MSC service thread 1-1) WFLYSRV0050: Keycloak 15.0.2 (WildFly Core 15.0.1.Final) stopped in 7ms
Press any key to continue . . .
I am also attaching a screenshot of my postgresql instance, in the case it maybe help.
postgres screenshot

Related

Jboss: postgres connection via standalone/configuration.xml

I tried several tutorials about how to add DB connection(mainly this one) to jboss and seems a got lost.
Please correct my steps if I miss did something:
I added following description to standalone/configuration.xml:
<datasources>
<datasource module="org.postgresql" jndi-name="java:jboss/datasources/Postgres" pool-name="Postgres" enabled="true" use-java-context="true">
<connection-url>jdbc:postgresql://localhost:5432/postgres;DB_CLOSE_DELAY=-1</connection-url>
<driver>postgresDriver</driver>
<security>
<user-name>postgres</user-name>
<password>postgres</password>
</security>
</datasource>
<drivers>
<driver name="postgresDriver" module="org.postgresql">
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
I created org/postgres/main/ directory in ...modules/system/layers/base/org/ directory
I moved there postgres-9.4.1208.jre6.jar file.
I created in this location org/postgres/main/ following module.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="org.postgresql">
<resources>
<resource-root path="postgresql-9.4-1208.jre6.jar" />
</resources>
<dependencies>
<module name="javax.api" />
<module name="javax.transaction.api" />
</dependencies>
</module>
And my persistence.xml looks like:
<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="movie-unit">
<jta-data-source>java:jboss/datasources/Postgres</jta-data-source>
</persistence-unit>
</persistence>
Then I start server with deployed *.war:
/usr/local/share/jboss/bin/standalone.sh
15:36:14,370 INFO [org.jboss.modules] (main) JBoss Modules version 1.2.2.Final-redhat-1
15:36:14,502 INFO [org.jboss.msc] (main) JBoss MSC version 1.0.4.GA-redhat-1
15:36:14,556 INFO [org.jboss.as] (MSC service thread 1-7) JBAS015899: JBoss EAP 6.1.1.GA (AS 7.2.1.Final-redhat-10) starting
15:36:15,188 INFO [org.xnio] (MSC service thread 1-5) XNIO Version 3.0.7.GA-redhat-1
15:36:15,190 INFO [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)
15:36:15,192 INFO [org.xnio.nio] (MSC service thread 1-5) XNIO NIO Implementation Version 3.0.7.GA-redhat-1
15:36:15,198 INFO [org.jboss.remoting] (MSC service thread 1-5) JBoss Remoting version 3.2.16.GA-redhat-1
15:36:15,243 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 29) JBAS010280: Activating Infinispan subsystem.
15:36:15,267 INFO [org.jboss.as.connector.logging] (MSC service thread 1-2) JBAS010408: Starting JCA Subsystem (IronJacamar 1.0.19.Final-redhat-2)
15:36:15,327 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 37) JBAS011800: Activating Naming Subsystem
15:36:15,328 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 25) JBAS014613: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("jdbc-driver" => "postgresDriver")
]) - failure description: "JBAS010441: Failed to load module for driver [org.postgresql]"
Please, verify my steps and help me figure out where is my mistake.

ClassNotFoundException at deployment

I have an external dependency (ejb-client) installed in local maven repo. Eclipse and manual maven builds see it just fine and compile successfully. It is also listed correctly under Maven dependencies.
When I deploy to WildFly 8.1, the runtime does not recognise the classes and throws exceptions. I never had problems with dependencies like this before. The only difference with this project is that it's a SwitchYard 2.0 project (WildFly 8.1 overlay). I suspect that either WildFly configuration is wrong due to overlay or I am missing some maven build plugins.
I finally solved it using maven shade plugin which compiles the dependency inside but:
1. I never needed it before so I don't like the solution
2. It is not run automatically when deploying from eclipse so I have to do a manual maven build and manual deploy. How do I tell maven to run the shade plugin when deploying? I tried to change phase from package to deploy to no avail.
The external dependency causing trouble is jmsprojekt-main.
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>si.fri.liis.jmsprojektsy</groupId>
<artifactId>vloga-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>si.fri.liis.jmsprojektsy:vloga-service</name>
<properties>
<switchyard.version>2.0.0.Final</switchyard.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.switchyard</groupId>
<artifactId>switchyard-bom</artifactId>
<version>${switchyard.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.switchyard.components</groupId>
<artifactId>switchyard-component-bean</artifactId>
</dependency>
<dependency>
<groupId>org.switchyard.components</groupId>
<artifactId>switchyard-component-soap</artifactId>
</dependency>
<dependency>
<groupId>org.switchyard</groupId>
<artifactId>switchyard-api</artifactId>
</dependency>
<dependency>
<groupId>org.switchyard</groupId>
<artifactId>switchyard-transform</artifactId>
</dependency>
<dependency>
<groupId>org.switchyard</groupId>
<artifactId>switchyard-validate</artifactId>
</dependency>
<dependency>
<groupId>org.switchyard</groupId>
<artifactId>switchyard-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.switchyard.components</groupId>
<artifactId>switchyard-component-test-mixin-cdi</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>si.fri.liis.jmsprojekt</groupId>
<artifactId>jmsprojekt-main</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>ejb-client</type>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.switchyard</groupId>
<artifactId>switchyard-plugin</artifactId>
<version>${switchyard.version}</version>
<executions>
<execution>
<goals>
<goal>configure</goal>
</goals>
</execution>
</executions>
<configuration>
<scannerClassNames>
<param>org.switchyard.transform.config.model.TransformSwitchYardScanner</param>
</scannerClassNames>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>si.fri.liis.jmsprojekt:jmsprojekt-main</include>
</includes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
WildFly startup log showing classes from the dependency not being found:
20:06:26,777 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."vloga-service.jar".SwitchYardService: org.jboss.msc.service.StartException in service jboss.deployment.unit."vloga-service.jar".SwitchYardService: 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(Unknown Source) [rt.jar:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.8.0_51]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.8.0_51]
Caused by: java.lang.NoClassDefFoundError: si/fri/liis/jmsprojekt/data/VlogaData
at java.lang.Class.getDeclaredMethods0(Native Method) [rt.jar:1.8.0_51]
at java.lang.Class.privateGetDeclaredMethods(Unknown Source) [rt.jar:1.8.0_51]
at java.lang.Class.privateGetPublicMethods(Unknown Source) [rt.jar:1.8.0_51]
at java.lang.Class.getMethods(Unknown Source) [rt.jar:1.8.0_51]
at org.switchyard.transform.internal.TransformerUtil.isTransformer(TransformerUtil.java:223)
at org.switchyard.transform.internal.TransformerUtil.newTransformers(TransformerUtil.java:71)
at org.switchyard.transform.internal.TransformerRegistryLoader.newTransformers(TransformerRegistryLoader.java:231)
at org.switchyard.transform.internal.TransformerRegistryLoader.registerTransformers(TransformerRegistryLoader.java:117)
at org.switchyard.transform.internal.TransformerRegistryLoader.registerTransformers(TransformerRegistryLoader.java:101)
at org.switchyard.deploy.internal.Deployment.registerTransformers(Deployment.java:271)
at org.switchyard.deploy.internal.Deployment.doInit(Deployment.java:117)
at org.switchyard.deploy.internal.AbstractDeployment.init(AbstractDeployment.java:139)
at org.switchyard.as7.extension.deployment.SwitchYardDeployment.start(SwitchYardDeployment.java:155)
at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:77)
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
Caused by: java.lang.ClassNotFoundException: si.fri.liis.jmsprojekt.data.VlogaData from [Module "deployment.vloga-service.jar:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final]
... 19 more
20:06:26,817 ERROR [stderr] (MSC service thread 1-9) Warning: org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
20:06:26,899 ERROR [stderr] (MSC service thread 1-9) Compiler warnings:
20:06:26,900 ERROR [stderr] (MSC service thread 1-9) WARNING: 'org.apache.xerces.jaxp.SAXParserImpl: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.'
20:06:27,265 INFO [org.switchyard.common.camel.SwitchYardCamelContextImpl] (MSC service thread 1-9) Route: direct:{urn:si.fri.liis.jmsprojektsy:vloga-service:1.0}VlogaServicePortType started and consuming from: Endpoint[direct://%7Burn:si.fri.liis.jmsprojektsy:vloga-service:1.0%7DVlogaServicePortType]
20:06:27,361 INFO [org.switchyard] (MSC service thread 1-9) Addressing [enabled = false, required = false]
20:06:27,361 INFO [org.switchyard] (MSC service thread 1-9) MTOM [enabled = false, threshold = 0]
20:06:27,443 INFO [org.jboss.ws.cxf.metadata] (MSC service thread 1-9) JBWS024061: Adding service endpoint metadata: id=VlogaService
address=http://localhost:8080/vloga-service/VlogaService
implementor=org.switchyard.component.soap.endpoint.BaseWebService
serviceName={urn:si.fri.liis.jmsprojektsy:vloga-service:1.0}VlogaService
portName={urn:si.fri.liis.jmsprojektsy:vloga-service:1.0}VlogaServicePort
annotationWsdlLocation=null
wsdlLocationOverride=vfs:/C:/Users/cen/Desktop/wildfly-8.1.0.Final-sy/bin/content/vloga-service-0.0.1-SNAPSHOT.jar/VlogaService.wsdl
mtomEnabled=false
20:06:27,982 INFO [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-9) Creating Service {urn:si.fri.liis.jmsprojektsy:vloga-service:1.0}VlogaService from WSDL: vfs:/C:/Users/cen/Desktop/wildfly-8.1.0.Final-sy/bin/content/vloga-service-0.0.1-SNAPSHOT.jar/VlogaService.wsdl
20:06:28,172 INFO [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-9) Setting the server's publish address to be http://localhost:8080/vloga-service/VlogaService
20:06:28,261 INFO [org.jboss.ws.cxf.deployment] (MSC service thread 1-9) JBWS024074: WSDL published to: file:/C:/Users/cen/Desktop/wildfly-8.1.0.Final-sy/standalone/data/wsdl/vloga-service.deployment/VlogaService.wsdl
20:06:28,266 INFO [org.jboss.as.webservices] (MSC service thread 1-5) JBAS015539: Starting service jboss.ws.endpoint."vloga-service.deployment".VlogaService
20:06:28,331 INFO [org.wildfly.extension.undertow] (MSC service thread 1-9) JBAS017534: Registered web context: /vloga-service
20:06:28,411 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "vloga-service.jar")]) - failure description: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"vloga-service.jar\".SwitchYardService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"vloga-service.jar\".SwitchYardService: Failed to start service
Caused by: java.lang.NoClassDefFoundError: si/fri/liis/jmsprojekt/data/VlogaData
Caused by: java.lang.ClassNotFoundException: si.fri.liis.jmsprojekt.data.VlogaData from [Module \"deployment.vloga-service.jar:main\" from Service Module Loader]"}}
20:06:28,496 INFO [org.jboss.as.server] (ServerService Thread Pool -- 33) JBAS018559: Deployed "vloga-service.jar" (runtime-name : "vloga-service.jar")
20:06:28,497 INFO [org.jboss.as.server] (ServerService Thread Pool -- 33) JBAS018559: Deployed "vloga-service-0.0.1-SNAPSHOT.jar" (runtime-name : "vloga-service-0.0.1-SNAPSHOT.jar")
20:06:28,499 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.unit."vloga-service.jar".SwitchYardService: org.jboss.msc.service.StartException in service jboss.deployment.unit."vloga-service.jar".SwitchYardService: Failed to start service
20:06:28,751 INFO [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016009: Stopping weld service for deployment vloga-service.jar
20:06:28,803 INFO [org.jboss.as.server.deployment] (MSC service thread 1-11) JBAS015877: Stopped deployment vloga-service.jar (runtime-name: vloga-service.jar) in 67ms
20:06:28,805 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:9990/management
20:06:28,805 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
20:06:28,806 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.1.0.Final "Kenny" started in 17000ms - Started 287 of 340 services (98 services are lazy, passive or on-demand)
20:06:29,053 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018558: Undeployed "vloga-service.jar" (runtime-name: "vloga-service.jar")
20:06:29,054 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.unit."vloga-service.jar".SwitchYardService
The solution is to wrap the SwitchYard project into an EAR. Dependencies are resolved correctly then.

Skinny wars with multiple spring boot wars into an ear package and deploy to jboss 7.3 (jboss-eap-6.2)

I'm trying to deploy an ear package into a jboss 7.3 (jboss-eap-6.2) with skinnywars, with no luck so far. The ear conatins multiple spring-boot wars and jars.
For the sake of clarity, i've created one simple ear project with 2 little spring-boot wars and I obtained the same results, skinnywars to false and then it works....
The process:
I've made a fresh installation of jboss-eap-6.2 (which will be running in standalone mode)
I've created a parent pom.xml for the main project with the spring-boot-starter-parent and the dependenciesManagements for the modules (
I've created two simple web1.war and a web2.war spring boot projects with nothing else than an index thymeleaf page on each one of them. (each war deployed to the server runs perfectly fine)
I've created an ear pom.xml with the common dependencies (for the skinny part) and the maven-ear-plugin configuration for skinnywars.
Packaging and installing works ok (the ear project weights about 12Mb,
Copied the .ear file to standalone/deployments and the server doesn't start neither of the spring boot applications...
What am I missing??
The parent pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework</groupId>
<artifactId>skinny</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.1.9.RELEASE</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>1.1.9.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
<version>1.1.9.RELEASE</version>
</dependency>
</dependencies>
</dependencyManagement>
<modules>
<module>web1</module>
<module>web2</module>
<module>ear</module>
</modules>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
<version>2.3.2</version>
</plugin>
</plugins>
</build>
</project>
The web1.war project pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>web1</artifactId>
<version>0.1.0</version>
<packaging>war</packaging>
<parent>
<groupId>org.springframework</groupId>
<artifactId>skinny</artifactId>
<version>1.0</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
</dependencies>
<properties>
<start-class>hello.Application</start-class>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<finalName>web1</finalName>
</build>
</project>
The web2.war project (the same of web1):
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>web2</artifactId>
<version>0.1.0</version>
<packaging>war</packaging>
<parent>
<groupId>org.springframework</groupId>
<artifactId>skinny</artifactId>
<version>1.0</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
</dependencies>
<properties>
<start-class>hello.Application</start-class>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<finalName>web2</finalName>
</build>
</project>
Finally the ear pom with skinnywars configuration of maven-ear-plugin:
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>skinny</artifactId>
<groupId>org.springframework</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<name>ear</name>
<artifactId>ear</artifactId>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>web1</artifactId>
<version>0.1.0</version>
<type>war</type>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>web2</artifactId>
<version>0.1.0</version>
<type>war</type>
</dependency>
<!-- to get skinnywars the ear project has the common dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<skinnyWars>true</skinnyWars>
<defaultJavaBundleDir>lib</defaultJavaBundleDir>
<modules>
<webModule>
<groupId>org.springframework</groupId>
<artifactId>web1</artifactId>
<contextRoot>/web1</contextRoot>
</webModule>
<webModule>
<groupId>org.springframework</groupId>
<artifactId>web2</artifactId>
<contextRoot>/web2</contextRoot>
</webModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
</project>
As I mentioned before, if I change true to false the ear package runs fine in the application server...
I've tried so many diferent configurations of maven-war-plugin and maven-ear-plugin with no sucess...
Updated: This is the output of the jboss log, it seems that is going to load the context of web1 and web2 but neither of the two spring-boot applications start....
07:59:28,780 INFO [org.jboss.modules] (main) JBoss Modules version 1.3.0.Final-redhat-2
07:59:29,054 INFO [org.jboss.msc] (main) JBoss MSC version 1.0.4.GA-redhat-1
07:59:29,158 INFO [org.jboss.as] (MSC service thread 1-6) JBAS015899: JBoss EAP 6.2.0.GA (AS 7.3.0.Final-redhat-14) iniciando
07:59:30,233 INFO [org.xnio] (MSC service thread 1-2) XNIO Version 3.0.7.GA-redhat-1
07:59:30,236 INFO [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creando el servicio de administración http utilizando el enlace de socket (management-http)
07:59:30,241 INFO [org.xnio.nio] (MSC service thread 1-2) XNIO NIO Implementation Version 3.0.7.GA-redhat-1
07:59:30,249 INFO [org.jboss.remoting] (MSC service thread 1-2) JBoss Remoting version 3.2.18.GA-redhat-1
07:59:30,363 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 29) JBAS010280: Activando el sub-sistema Infinispan.
07:59:30,369 INFO [org.jboss.as.security] (ServerService Thread Pool -- 42) JBAS013171: Activando el sub-sistema de seguridad
07:59:30,374 INFO [org.jboss.as.jsf] (ServerService Thread Pool -- 35) JBAS012605: Se activaron las siguientes implementaciones JSF: [main, 1.2]
07:59:30,387 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 37) JBAS011800: Activando el sub-sistema de nombrado
07:59:30,389 INFO [org.jboss.as.security] (MSC service thread 1-6) JBAS013170: Versión PicketBox actual=4.0.19.SP2-redhat-1
07:59:30,460 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 46) JBAS015537: Activando WebServices Extension
07:59:30,472 INFO [org.jboss.as.connector.logging] (MSC service thread 1-3) JBAS010408: Iniciando JCA sub-sistema (IronJacamar 1.0.23.Final-redhat-1)
07:59:30,502 INFO [org.jboss.as.naming] (MSC service thread 1-7) JBAS011802: Iniciando el servicio de nombrado
07:59:30,508 INFO [org.jboss.as.mail.extension] (MSC service thread 1-7) JBAS015400: Sesión de correo enlazada [java:jboss/mail/Default]
07:59:30,672 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 25) JBAS010403: Implementación del controlador que cumple con los requerimientos de JDBC class oracle.jdbc.OracleDriver (versión 12.1)
07:59:30,694 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 25) JBAS010403: Implementación del controlador que cumple con los requerimientos de JDBC class org.h2.Driver (versión 1.3)
07:59:31,085 INFO [org.apache.coyote.http11] (MSC service thread 1-4) JBWEB003001: Coyote HTTP/1.1 initializing on : http-/127.0.0.1:8080
07:59:31,100 INFO [org.apache.coyote.http11] (MSC service thread 1-4) JBWEB003000: Coyote HTTP/1.1 starting on: http-/127.0.0.1:8080
07:59:31,332 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010400: Fuente de datos enlazados [java:jboss/datasources/ExampleDS]
07:59:31,333 INFO [org.jboss.ws.common.management] (MSC service thread 1-8) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.2.3.Final-redhat-1
07:59:31,359 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) JBAS015012: Inició FileSystemDeploymentService para el directorio /usr/local/Cellar/jboss/6.2.0/standalone/deployments
07:59:31,371 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015876: Iniciando la implementación de ear-1.0.ear" (runtime-name: "ear-1.0.ear")
07:59:31,371 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Iniciando la implementación de bm-ds.xml" (runtime-name: "bm-ds.xml")
07:59:31,371 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015876: Iniciando la implementación de bddbm-ds.xml" (runtime-name: "bddbm-ds.xml")
07:59:31,371 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015876: Iniciando la implementación de bddjira4-ds.xml" (runtime-name: "bddjira4-ds.xml")
07:59:31,372 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Iniciando la implementación de jira-ds.xml" (runtime-name: "jira-ds.xml")
07:59:31,379 INFO [org.jboss.as.remoting] (MSC service thread 1-4) JBAS017100: Escuchando en 127.0.0.1:9999
07:59:31,379 INFO [org.jboss.as.remoting] (MSC service thread 1-1) JBAS017100: Escuchando en 127.0.0.1:4447
07:59:31,567 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Fuente de datos enlazados [java:jboss/datasource/bddjiraDS]
07:59:31,567 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-7) JBAS010400: Fuente de datos enlazados [java:jboss/datasource/bddbmDS]
07:59:31,568 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Fuente de datos enlazados [java:jboss/datasource/jiraDS]
07:59:31,568 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Fuente de datos enlazados [java:jboss/datasource/ubmDS]
07:59:33,118 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015876: Iniciando la implementación de null" (runtime-name: "web1-0.1.0.war")
07:59:33,118 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Iniciando la implementación de null" (runtime-name: "web2-0.1.0.war")
07:59:33,414 INFO [org.jboss.web] (ServerService Thread Pool -- 51) JBAS018210: Registrar el contexto web: /web2
07:59:33,414 INFO [org.jboss.web] (ServerService Thread Pool -- 48) JBAS018210: Registrar el contexto web: /web1
07:59:33,595 INFO [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Implementado "jira-ds.xml" (runtime-name : "jira-ds.xml")
07:59:33,595 INFO [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Implementado "ear-1.0.ear" (runtime-name : "ear-1.0.ear")
07:59:33,596 INFO [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Implementado "bm-ds.xml" (runtime-name : "bm-ds.xml")
07:59:33,596 INFO [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Implementado "bddjira4-ds.xml" (runtime-name : "bddjira4-ds.xml")
07:59:33,596 INFO [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Implementado "bddbm-ds.xml" (runtime-name : "bddbm-ds.xml")
07:59:33,605 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Interfaz de administración http escuchando en http://127.0.0.1:9990/management
07:59:33,606 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Consola de administración escuchando en http://127.0.0.1:9990
07:59:33,606 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss EAP 6.2.0.GA (AS 7.3.0.Final-redhat-14) inició en 5229ms - Inició 352 de 425 servicios (72 servicios son pasivos o por demanda)
Updated: I pushed the sample code to github -> guilu/spring-boot-ear-skinny-war in order to see if someone gets the project deployed and running in an standalone jboss-eap-6.2 server.

How to deploy cxf web service on jboss eap 6.1

Hey guys I am trying to deploy my cxf web service on jboss-eap-6.1 but its not getting done.. I am providing the stack trace below:
16:37:30,821 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.unit."GenericEnterpriseApplicationSkeleton.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."GenericEnterpriseApplicationSkeleton.war".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment "GenericEnterpriseApplicationSkeleton.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_40]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_40]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_40]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011030: Could not configure component org.apache.cxf.wsn.client.Publisher
at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:91)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
... 5 more
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.apache.cxf.wsn.client.Publisher
at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:607)
at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:80)
... 6 more
16:37:30,854 INFO [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "GenericEnterpriseApplicationSkeleton.war" (runtime-name : "GenericEnterpriseApplicationSkeleton.war")
16:37:30,854 INFO [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "EAApplication.ear" (runtime-name : "EAApplication.ear")
16:37:30,855 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.unit."GenericEnterpriseApplicationSkeleton.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."GenericEnterpriseApplicationSkeleton.war".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment "GenericEnterpriseApplicationSkeleton.war"
16:37:31,036 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http:// 127.0.0.1:9990/management
16:37:31,037 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http:// 127.0.0.1:9990
16:37:31,037 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss EAP 6.1.0.GA (AS 7.2.0.Final-redhat-8) started (with errors) in 5102ms - Started 198 of 260 services (1 services failed or missing dependencies, 60 services are passive or on-demand)
Please do have a look.
I got similar but not the exact error as mentioned by you. I solved it by bypassing the default Jboss Webservices implementation.
I commented out the following lines in the standalone.xml
<extension module="org.jboss.as.webservices"/>
and the subsystem
<subsystem xmlns="urn:jboss:domain:webservices:1.2">
<modify-wsdl-address>true</modify-wsdl-address>
<wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
<endpoint-config name="Standard-Endpoint-Config"/>
<endpoint-config name="Recording-Endpoint-Config">
<pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
<handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
</pre-handler-chain>
</endpoint-config>
<client-config name="Standard-Client-Config"/>
</subsystem>
Please see the link on how I got the idea - https://developer.jboss.org/thread/221654. Hope this helps.

JBOSS doesn't find datasource

I'm developing a webapp with EJB3, Hibernate, JSF and JBOSS, but I'm not able to start JBOSS, as it keeps on throwing this error:
16:03:55,888 INFO [org.jboss.modules] JBoss Modules version 1.1.1.GA
16:03:56,130 INFO [org.jboss.msc] JBoss MSC version 1.0.2.GA
16:03:56,187 INFO [org.jboss.as] JBAS015899: JBoss AS 7.1.0.Final "Thunder" starting
16:03:57,085 INFO [org.xnio] XNIO Version 3.0.3.GA
16:03:57,086 INFO [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
16:03:57,097 INFO [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
16:03:57,105 INFO [org.jboss.remoting] JBoss Remoting version 3.2.2.GA
16:03:57,131 INFO [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
16:03:57,135 INFO [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
16:03:57,136 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
16:03:57,148 INFO [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
16:03:57,160 INFO [org.jboss.as.security] (MSC service thread 1-3) JBAS013100: Current PicketBox version=4.0.6.final
16:03:57,165 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
16:03:57,168 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
16:03:57,172 INFO [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
16:03:57,220 INFO [org.jboss.as.connector] (MSC service thread 1-10) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.7.Final)
16:03:57,261 INFO [org.jboss.as.naming] (MSC service thread 1-12) JBAS011802: Starting Naming Service
16:03:57,273 INFO [org.jboss.as.mail.extension] (MSC service thread 1-10) JBAS015400: Bound mail session [java:jboss/mail/Default]
16:03:57,286 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
16:03:57,419 INFO [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-3) JBoss Web Services - Stack CXF Server 4.0.1.GA
16:03:57,680 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) JBAS015012: Started FileSystemDeploymentService for directory C:\desarrollo\jboss-as-7.1.0.Final\standalone\deployments
16:03:57,682 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found AllYouCanVisit.ear in deployment directory. To trigger deployment create a file called AllYouCanVisit.ear.dodeploy
16:03:57,684 INFO [org.jboss.as.remoting] (MSC service thread 1-7) JBAS017100: Listening on localhost/127.0.0.1:4447
16:03:57,685 INFO [org.jboss.as.remoting] (MSC service thread 1-6) JBAS017100: Listening on /127.0.0.1:9999
16:03:57,700 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-11) Starting Coyote HTTP/1.1 on http-localhost-127.0.0.1-8080
16:03:57,836 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-9) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
16:03:58,086 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:jboss/datasources/mysql_ds]
16:03:58,113 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss AS 7.1.0.Final "Thunder" started (with errors) in 2515ms - Started 135 of 209 services (2 services failed or missing dependencies, 70 services are passive or on-demand)
My persistence.xml file:
<?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="primary">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:jboss/datasources/mysql_ds</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<!-- Properties for Hibernate -->
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.use_sql_comments" value="true" />
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
</properties>
</persistence-unit>
</persistence>
And the datasources from the standalone.xml file in JBOSS:
<datasource jndi-name="java:jboss/datasources/mysql_ds" pool-name="mysql_ds" enabled="true" use-java-context="true" jta="true">
<connection-url>jdbc:mysql://localhost:3306/mydatabase</connection-url>
<driver>mysql</driver>
<security>
<user-name>user</user-name>
<password>password</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">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
What am I missing?
Reinstalling the server and configuring the driver and datasources again made it work.
Hope this can help anyone.
It is work for me.
https://www.youtube.com/watch?v=G-oj9XagiPo