Jboss: postgres connection via standalone/configuration.xml - jboss

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.

Related

Connecting Keycloak with 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

Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener?

I have created module for spring jars and put my all jars in it.
but I am getting : Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
if I add all spring jars in /WEB-INF/lib then everything is working fine. my module.xml :
<module xmlns="urn:jboss:module:1.3" name="org.springframework.spring">
<resources>
<resource-root path="spring-aop-3.0.3.RELEASE.jar"/>
<resource-root path="org.springframework.expression-3.0.3.RELEASE.jar"/>
<resource-root path="org.springframework.instrument-3.0.3.release.jar"/>
<resource-root path="org.springframework.web.servlet-3.0.3.RELEASE.jar"/>
<resource-root path="spring-asm-3.0.3.RELEASE.jar"/>
<resource-root path="spring-aspects-3.0.3.RELEASE.jar"/>
<resource-root path="spring-beans-3.0.3.RELEASE.jar"/>
<resource-root path="spring-context-3.0.3.RELEASE.jar"/>
<resource-root path="spring-context-support-3.0.3.RELEASE.jar"/>
<resource-root path="spring-core-3.0.3.RELEASE.jar"/>
<resource-root path="spring-jdbc-3.0.3.RELEASE.jar"/>
<resource-root path="spring-tx-3.0.3.RELEASE.jar"/>
<resource-root path="spring-web-3.0.3.RELEASE.jar"/>
<resource-root path="spring-webmvc-3.0.3.RELEASE.jar"/>
<resource-root path="spring-webmvc-portlet-3.0.3.RELEASE.jar"/>
<resource-root path="spring-jms-3.0.3.RELEASE.jar"/>
<resource-root path="spring-oxm-3.0.3.RELEASE.jar"/>
<resource-root path="spring-orm-3.0.3.RELEASE.jar"/>
</resources>
<dependencies>
<module name="org.apache.commons.logging"/>
<module name="javax.api" export="true"/>
<module name="org.jboss.vfs"/>
</dependencies>
</module>
Stacktrace:
20:30:55,656 INFO [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 60) AMQ221007: Server is now live
20:30:55,656 INFO [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 60) AMQ221001: Apache ActiveMQ Artemis Message Broker version 1.1.0.SP16-redhat-1 [nodeID=f4c08abc-c9d7-11e7-bff9-9555d5330950]
20:30:55,679 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."CAWMobileAPI.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."CAWMobileAPI.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "CAWMobileAPI.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
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(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener from [Module "deployment.CAWMobileAPI.war:main" from Service Module Loader]
at org.jboss.as.jaxrs.deployment.JaxrsComponentDeployer.deploy(JaxrsComponentDeployer.java:89)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
... 5 more
Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener from [Module "deployment.CAWMobileAPI.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
at org.jboss.as.jaxrs.deployment.JaxrsComponentDeployer.deploy(JaxrsComponentDeployer.java:87)
... 6 more
20:30:55,717 INFO [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 60) AMQ221003: trying to deploy queue jms.queue.queue/emailQueue
20:30:55,845 INFO [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 69) AMQ221003: trying to deploy queue jms.queue.queue/orderTransitQueue
20:30:55,855 INFO [org.jboss.as.connector.deployment] (MSC service thread 1-4) WFLYJCA0007: Registered connection factory java:/JmsXA
20:30:55,882 INFO [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 68) AMQ221003: trying to deploy queue jms.queue.DLQ
20:30:55,941 INFO [org.wildfly.extension.messaging-activemq] (ServerService Thread Pool -- 67) WFLYMSGAMQ0002: Bound messaging object to jndi name java:jboss/exported/jms/RemoteConnectionFactory
20:30:56,000 INFO [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 70) AMQ221003: trying to deploy queue jms.queue.queue/pendingOrderQueue
20:30:56,001 INFO [org.apache.activemq.artemis.ra] (MSC service thread 1-4) Resource adaptor started
20:30:56,001 INFO [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 64) AMQ221003: trying to deploy queue jms.queue.queue/orderQueue
20:30:56,002 INFO [org.jboss.as.connector.services.resourceadapters.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-4) IJ020002: Deployed: file://RaActivatoractivemq-ra
20:30:56,015 INFO [org.jboss.as.connector.deployment] (MSC service thread 1-4) WFLYJCA0002: Bound JCA ConnectionFactory [java:/JmsXA]
20:30:56,016 INFO [org.wildfly.extension.messaging-activemq] (MSC service thread 1-4) WFLYMSGAMQ0002: Bound messaging object to jndi name java:jboss/DefaultJMSConnectionFactory
20:30:56,017 INFO [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 66) AMQ221003: trying to deploy queue jms.queue.queue/faxQueue
20:30:56,018 INFO [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 62) AMQ221003: trying to deploy queue jms.queue.queue/customerForgetPwdQueue
20:30:56,023 INFO [org.wildfly.extension.messaging-activemq] (ServerService Thread Pool -- 63) WFLYMSGAMQ0002: Bound messaging object to jndi name java:/ConnectionFactory
20:30:56,024 INFO [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 65) AMQ221003: trying to deploy queue jms.queue.ExpiryQueue
20:30:56,257 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 61) WFLYUT0021: Registered web context: /blazeds
20:30:56,263 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "CAWMobileAPI.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"CAWMobileAPI.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"CAWMobileAPI.war\".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"CAWMobileAPI.war\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener from [Module \"deployment.CAWMobileAPI.war:main\" from Service Module Loader]
Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener from [Module \"deployment.CAWMobileAPI.war:main\" from Service Module Loader]"}}
20:30:56,330 INFO [org.jboss.as.server] (ServerService Thread Pool -- 36) WFLYSRV0010: Deployed "CAWMobileAPI.war" (runtime-name : "CAWMobileAPI.war")
20:30:56,330 INFO [org.jboss.as.server] (ServerService Thread Pool -- 36) WFLYSRV0010: Deployed "blazeds.war" (runtime-name : "blazeds.war")
20:30:56,378 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186: Services which failed to start: service jboss.deployment.unit."CAWMobileAPI.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."CAWMobileAPI.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "CAWMobileAPI.war"
20:30:56,542 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
20:30:56,543 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
20:30:56,543 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: JBoss EAP 7.0.0.GA (WildFly Core 2.1.2.Final-redhat-1) started (with errors) in 9682ms - Started 395 of 687 services (1 services failed or missing dependencies, 409 services are lazy, passive or on-demand)
20:30:56,626 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0028: Stopped deployment CAWMobileAPI.war (runtime-name: CAWMobileAPI.war) in 47ms
20:30:56,702 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0009: Undeployed "CAWMobileAPI.war" (runtime-name: "CAWMobileAPI.war")
20:30:56,704 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 1) WFLYCTL0183: Service status report
WFLYCTL0186: Services which failed to start: service jboss.deployment.unit."CAWMobileAPI.war".POST_MODULE
20:31:01,560 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found CAWMobileAPI.war in deployment directory. To trigger deployment create a file called CAWMobileAPI.war.dodeploy
Thanks in advance
Make sure there is no duplicate jar file with a different version inside the war file. Expand the war file and see.

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.

Unknown error thrown from JBOSS 7.1.1 version while deploying war file to it

Cannot get how this error come out. No reason no brain sence from te
17:52:58,395 INFO [org.jboss.modules] JBoss Modules version 1.1.1.GA
17:52:58,604 INFO [org.jboss.msc] JBoss MSC version 1.0.2.GA
17:52:58,665 INFO [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final
"Brontes" starting 17:52:59,554 INFO [org.xnio] XNIO Version 3.0.3.GA
17:52:59,554 INFO [org.jboss.as.server] JBAS015888: Creating http
management service using socket-binding (management-http) 17:52:59,563
INFO [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
17:52:59,570 INFO [org.jboss.remoting] JBoss Remoting version
3.2.3.GA 17:52:59,590 INFO [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers 17:52:59,593 INFO
[org.jboss.as.configadmin] (ServerService Thread Pool -- 26)
JBAS016200: Activating ConfigAdmin Subsystem 17:52:59,617 INFO
[org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800:
Activating Naming Subsystem 17:52:59,624 INFO [org.jboss.as.osgi]
(ServerService Thread Pool -- 39) JBAS011940: Activating OSGi
Subsystem 17:52:59,633 INFO [org.jboss.as.clustering.infinispan]
(ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan
subsystem. 17:52:59,655 INFO [org.jboss.as.security] (ServerService
Thread Pool -- 44) JBAS013101: Activating Security Subsystem
17:52:59,667 INFO [org.jboss.as.security] (MSC service thread 1-6)
JBAS013100: Current PicketBox version=4.0.7.Final 17:52:59,719 INFO
[org.jboss.as.naming] (MSC service thread 1-5) JBAS011802: Starting
Naming Service 17:52:59,722 INFO [org.jboss.as.mail.extension] (MSC
service thread 1-5) JBAS015400: Bound mail session
[java:jboss/mail/Default] 17:52:59,725 INFO
[org.jboss.as.webservices] (ServerService Thread Pool -- 48)
JBAS015537: Activating WebServices Extension 17:52:59,782 INFO
[org.jboss.as.connector] (MSC service thread 1-8) JBAS010408: Starting
JCA Subsystem (JBoss IronJacamar 1.0.9.Final) 17:52:59,812 INFO
[org.jboss.as.connector.subsystems.datasources] (ServerService Thread
Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class
org.h2.Driver (version 1.3) 17:52:59,861 INFO
[org.jboss.as.connector.subsystems.datasources] (ServerService Thread
Pool -- 27) JBAS010404: Deploying non-JDBC-compliant driver class
com.mysql.jdbc.Driver (version 5.1) 17:52:59,927 INFO
[org.jboss.ws.common.management.AbstractServerConfig] (MSC service
thread 1-5) JBoss Web Services - Stack CXF Server 4.0.2.GA
17:53:00,363 INFO [org.jboss.as.server.deployment.scanner] (MSC
service thread 1-3) JBAS015012: Started FileSystemDeploymentService
for directory D:\jboss-as-7.1.1.Final\standalone\deployments
17:53:00,363 INFO [org.jboss.as.server.deployment.scanner] (MSC
service thread 1-5) JBAS015012: Started FileSystemDeploymentService
for directory
D:\workspace\eclipse.metadata.plugins\org.jboss.ide.eclipse.as.core\JBoss_7.1_Runtime_Server1402151223281\deploy
17:53:00,393 INFO [org.jboss.as.remoting] (MSC service thread 1-8)
JBAS017100: Listening on localhost/ 127.0.0 .1:4447 17:53:00,393 INFO
[org.jboss.as.remoting] (MSC service thread 1-1) JBAS017100: Listening
on / 127 .0. 0.1:10101 17:53:00,413 INFO
[org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-5)
Starting Coyote HTTP/1.1 on http-loca lhost-127. 0.0.1-7070
17:53:00,525 INFO [org.jboss.as.connector.subsystems.datasources]
(MSC service thread 1-4) JBAS010400: Bound data source [java:/MySqlDS]
17:53:00,525 INFO [org.jboss.as.connector.subsystems.datasources]
(MSC service thread 1-1) JBAS010400: Bound data source
[java:jboss/datasources/ExampleDS] 17:53:00,554 INFO [org.jboss.as]
(Controller Boot Thread) JBAS015951: Admin console listening on http:
// 127 .0.0.1: 10102 17:53:00,554 INFO [org.jboss.as] (Controller
Boot Thread) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in
2443ms - Started 139 of 215 services (74 services are passive or
on-demand) 17:53:15,376 INFO [org.jboss.as.server.deployment.scanner]
(DeploymentScanner-threads - 1) JBAS015003: Found HelloRest.war in
deployment directory. To trigger deployment create a file called
HelloRest.war.dodeploy 17:53:15,412 INFO
[org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876:
Starting deployment of "HelloRest.war" 17:53:16,843 INFO
[org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016002:
Processing weld deployment HelloRest.war 17:53:16,853 ERROR
[org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed
to start service jboss.deployment.unit."HelloRest.war".POST_MODULE:
org.jboss.msc.service.StartException in service
jboss.deployment.unit."HelloRest.war".POST_MODULE: Failed to process
phase POST_MODULE of deployment "HelloRest.war" at
org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119)
[jboss-as-server-7.1.1.Final.jar:7.1.1.Final] at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA] at
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
[jboss-msc-1.0.2.GA.jar:1.0.2.GA] at
java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[rt.jar:1.7.0_51] at
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[rt.jar:1.7.0_51] at java.lang.Thread.run(Unknown Source)
[rt.jar:1.7.0_51] Caused by:
java.lang.StringIndexOutOfBoundsException: String index out of range:
0 at java.lang.String.charAt(Unknown Source) [rt.jar:1.7.0_51] at
org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:460)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at
org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at
org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
at
org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.checkDeclaredApplicationClassAsServlet(JaxrsScanningProcessor.java:288)
at
org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.scanWebDeployment(JaxrsScanningProcessor.java:155)
at
org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.deploy(JaxrsScanningProcessor.java:104)
at
org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113)
[jboss-as-server-7.1.1.Final.jar:7.1.1.Final] ... 5 more
17:53:16,868 INFO [org.jboss.as.server] (DeploymentScanner-threads -
2) JBAS015870: Deploy of deployment "HelloRest.war" was rolled back
with failure message {"JBAS014671: Failed services" =>
{"jboss.deployment.unit.\"HelloRest.war\".POST_MODULE" =>
"org.jboss.msc.service.StartException in service
jboss.deployment.unit.\"HelloRest.war\".POST_MODULE: Failed to process
phase POST_MODULE of deployment \"HelloRest.war\""}} 17:53:16,870 INFO
[org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774:
Service status report JBAS014777: Services which failed to start:
service jboss.deployment.unit."HelloRest.war".POST_MODULE:
org.jboss.msc.service.StartException in service
jboss.deployment.unit."HelloRest.war".POST_MODULE: Failed to process
phase POST_MODULE of deployment "HelloRest.war"
17:53:16,879 ERROR [org.jboss.as.server.deployment.scanner]
(DeploymentScanner-threads - 1) {"JBAS014653: Composite operation
failed and was rolled back. Steps that failed:" => {"Operation step-2"
=> {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"HelloRest.war\".POST_MODULE" =>
"org.jboss.msc.service.StartException in service
jboss.deployment.unit.\"HelloRest.war\".POST_MODULE: Failed to process
phase POST_MODULE of deployment \"HelloRest.war\""}}}} 17:53:16,914
INFO [org.jboss.as.server.deployment] (MSC service thread 1-7)
JBAS015877: Stopped deployment HelloRest.war in 40ms
PERSON JAVA CLASS:
package rest.hello;
public class Person implements Speakable {
#Override
public String getName() {
return "My Name";
}
}
SPEACKABLE Interface:
package rest.hello;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
#Path("/person")
#Produces(MediaType.TEXT_PLAIN)
#Consumes(MediaType.TEXT_PLAIN)
public interface Speakable {
#GET
#Path("/name")
public String getName();
}
POM File
<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.jboss.tools</groupId>
<artifactId>hellorest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>hellorest</name>
<description>hellorest</description>
<build>
<resources>
<resource>
<directory>${basedir}/src/main/java</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<warSourceDirectory>${basedir}/WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>maven-central</id>
<url>http://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>maven2-repository.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
<repository>
<id>java.net2</id>
<name>Java.net</name>
<url>https://oss.sonatype.org/content/repositories/java.net2</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>ejb3-persistence</artifactId>
<version>1.0.1.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.3.1.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.6.ga</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>2.2.1.GA</version>
</dependency>
</dependencies>
In your eclipse, click on the project > properties > project facets
uncheck the jax-rs option and try again

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