Springboot Wildfly 10.0 War file deployment ---> Failed to instantiate WebApplicationInitializer class - scala

I created spring boot with scala Rest api and it is working with tomcat (default server) with the jar file. Now I want to deploy into Jboss/Wildfly 10.0 and created the war file. During the deployment I am getting the below issue. can some one help on this issue.
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>com.aexp.prospect</groupId>
<artifactId>atules</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<!--packaging>jar</packaging -->
<name>atules</name>
<url>http://maven.apache.org</url>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.2.RELEASE</version>
<relativePath />
<!-- lookup parent from repository -->
</parent>
<!-- properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties -->
<properties>
<start-class>com.aexp.prospect.atules.AtulApplication</start-class>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<!-- dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId>
<version>3.8.1</version> <scope>test</scope> </dependency> </dependencies -->
<dependencies>
<!-- Additional for war files -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<!-- dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId>
</dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId>
</dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId>
</dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId>
</dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope> </dependency> <dependency> <groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId> <version>2.4.0</version> </dependency>
<dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId>
<version>2.4.0</version> </dependency -->
<!-- dependency> <groupId>org.scala-lang</groupId> <artifactId>scala-library</artifactId>
<version>2.11.8</version> </dependency -->
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.5</version><!--$NO-MVN-MAN-VER$ -->
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.liftweb/lift-json -->
<dependency>
<groupId>net.liftweb</groupId>
<artifactId>lift-json_2.11</artifactId>
<version>2.6.3</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<!-- Additional for war files -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
</dependencies>
<build>
<finalName>SpringBootES</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<!-- build> <plugins> <plugin> <groupId>net.alchim31.maven</groupId> <artifactId>scala-maven-plugin</artifactId>
<version>3.1.3</version> <executions> <execution> <goals> <goal>compile</goal>
<goal>testCompile</goal> </goals> </execution> </executions> </plugin> <plugin>
<groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugins> </build -->
</project>
Error Message while deploying:
13:56:38,104 INFO [org.jboss.as.repository] (DeploymentScanner-threads - 2) WFLYDR0001: Content added at location C:\Risk_Mgt\Downloads\wildfly-10.0.0.Final\standalone\data\content\76\46dbc0aa1700b71ef90ada1bc3c326e8d02776\content
13:56:38,109 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0019: Stopped Driver service with driver-name = SpringBootES.war_org.h2.Driver_1_4
13:56:38,119 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 249) WFLYUT0022: Unregistered web context: /SpringBootES
13:56:38,126 INFO [io.undertow.servlet] (ServerService Thread Pool -- 249) Closing Spring root WebApplicationContext
13:56:38,127 INFO [org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext] (ServerService Thread Pool -- 249) Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#42447031: startup date [Wed Mar 21 13:30:53 EDT 2018]; root of context hierarchy
13:56:38,129 INFO [org.springframework.jmx.export.annotation.AnnotationMBeanExporter] (ServerService Thread Pool -- 249) Unregistering JMX-exposed beans on shutdown
13:56:40,019 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0028: Stopped deployment SpringBootES.war (runtime-name: SpringBootES.war) in 1913ms
13:56:40,023 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0027: Starting deployment of "SpringBootES.war" (runtime-name: "SpringBootES.war")
13:56:51,926 WARN [org.jboss.as.ee] (MSC service thread 1-2) WFLYEE0007: Not installing optional component org.springframework.http.server.ServletServerHttpAsyncRequestControl due to an exception (enable DEBUG log level to see the cause)
13:56:51,928 WARN [org.jboss.as.ee] (MSC service thread 1-2) WFLYEE0007: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to an exception (enable DEBUG log level to see the cause)
13:56:52,006 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.4)
13:56:52,012 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0018: Started Driver service with driver-name = SpringBootES.war_org.h2.Driver_1_4
13:56:52,093 INFO [io.undertow.servlet] (ServerService Thread Pool -- 260) 2 Spring WebApplicationInitializers detected on classpath
13:56:53,033 INFO [stdout] (ServerService Thread Pool -- 260)
13:56:53,033 INFO [stdout] (ServerService Thread Pool -- 260) . ____ _ __ _ _
13:56:53,034 INFO [stdout] (ServerService Thread Pool -- 260) /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
13:56:53,034 INFO [stdout] (ServerService Thread Pool -- 260) ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
13:56:53,034 INFO [stdout] (ServerService Thread Pool -- 260) \\/ ___)| |_)| | | | | || (_| | ) ) ) )
13:56:53,034 INFO [stdout] (ServerService Thread Pool -- 260) ' |____| .__|_| |_|_| |_\__, | / / / /
13:56:53,035 INFO [stdout] (ServerService Thread Pool -- 260) =========|_|==============|___/=/_/_/_/
13:56:53,055 INFO [stdout] (ServerService Thread Pool -- 260) :: Spring Boot :: (v1.5.2.RELEASE)
13:56:53,056 INFO [stdout] (ServerService Thread Pool -- 260)
13:56:53,241 INFO [com.aexp.prospect.atules.AtulApplication] (ServerService Thread Pool -- 260) Starting AtulApplication on NYKPC06712N with PID 16880 (started by pveerana in C:\Risk_Mgt\Downloads\wildfly-10.0.0.Final\bin)
13:56:53,241 INFO [com.aexp.prospect.atules.AtulApplication] (ServerService Thread Pool -- 260) No active profile set, falling back to default profiles: default
13:56:53,304 INFO [org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext] (ServerService Thread Pool -- 260) Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#61eb59d6: startup date [Wed Mar 21 13:56:53 EDT 2018]; root of context hierarchy
13:56:55,604 INFO [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor] (ServerService Thread Pool -- 260) JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
13:56:55,877 INFO [io.undertow.servlet] (ServerService Thread Pool -- 260) Initializing Spring embedded WebApplicationContext
13:56:55,878 INFO [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 260) Root WebApplicationContext: initialization completed in 2573 ms
13:56:57,166 INFO [org.springframework.boot.web.servlet.ServletRegistrationBean] (ServerService Thread Pool -- 260) Mapping servlet: 'dispatcherServlet' to [/]
13:56:57,168 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean] (ServerService Thread Pool -- 260) Mapping filter: 'errorPageFilter' to: [/*]
13:56:57,168 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean] (ServerService Thread Pool -- 260) Mapping filter: 'characterEncodingFilter' to: [/*]
13:56:57,168 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean] (ServerService Thread Pool -- 260) Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
13:56:57,168 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean] (ServerService Thread Pool -- 260) Mapping filter: 'httpPutFormContentFilter' to: [/*]
13:56:57,168 INFO [org.springframework.boot.web.servlet.FilterRegistrationBean] (ServerService Thread Pool -- 260) Mapping filter: 'requestContextFilter' to: [/*]
13:56:58,042 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter] (ServerService Thread Pool -- 260) Looking for #ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext#61eb59d6: startup date [Wed Mar 21 13:56:53 EDT 2018]; root of context hierarchy
13:56:58,226 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 260) Mapped "{[/api/eshost/{eshost}/indexName/{indexName}/_basicSearch],methods=[GET]}" onto public java.lang.String com.aexp.prospect.atules.controllers.AtulSearchController.basicSearch(java.lang.String,java.lang.String,java.lang.String,java.lang.String)
13:56:58,235 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 260) Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
13:56:58,235 INFO [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (ServerService Thread Pool -- 260) Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
13:56:58,306 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] (ServerService Thread Pool -- 260) Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
13:56:58,306 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] (ServerService Thread Pool -- 260) Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
13:56:58,503 INFO [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] (ServerService Thread Pool -- 260) Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
13:56:58,924 INFO [org.springframework.jmx.export.annotation.AnnotationMBeanExporter] (ServerService Thread Pool -- 260) Registering beans for JMX exposure on startup
13:56:58,988 INFO [com.aexp.prospect.atules.AtulApplication] (ServerService Thread Pool -- 260) Started AtulApplication in 6.67 seconds (JVM running for 50698.335)
13:56:58,994 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 260) Initializing Mojarra 2.2.12-jbossorg-2 20150729-1131 for context '/SpringBootES'
13:57:03,889 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 260) WFLYUT0021: Registered web context: /SpringBootES
13:57:03,975 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) WFLYSRV0016: Replaced deployment "SpringBootES.war" with deployment "SpringBootES.war"
13:57:03,976 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) WFLYCTL0183: Service status report
WFLYCTL0186: Services which failed to start: service jboss.undertow.deployment.default-server.default-host."/atules-0.0.1-SNAPSHOT": org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host."/atules-0.0.1-SNAPSHOT": java.lang.RuntimeException: javax.servlet.ServletException: Failed to instantiate WebApplicationInitializer class
13:57:03,986 INFO [org.jboss.as.repository] (DeploymentScanner-threads - 2) WFLYDR0002: Content removed from location C:\Risk_Mgt\Downloads\wildfly-10.0.0.Final\standalone\data\content\e4\796fce1370fb5d7b11d99012c33f8a30730b2a\content

The issue is with the POM file and I fixed it. Below is the POM file which I used. Especially start-class, spring-boot-maven-plugin and servlet (Initially I developed Application and it should be converted into servlet). These were not there in my initial POM file. Also should exclude the tomcat as this deployment in Jboss/Wildfly 10.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
<groupId>com.aexp.xxx</groupId>
<artifactId>xxxes</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>xxxes</name>
<url>http://maven.apache.org</url>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.2.RELEASE</version>
<relativePath />
<!-- lookup parent from repository -->
</parent>
<properties>
<start-class>com.aexp.xxx.xxxes.<Application Class Name></start-class>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>SpringBootES</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

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.

Rest EJB Project not deploying on Wildfly 8.0

I am creating Project Using Rest EJB. When I try to deploy on Jboss throws following error
am using jboss standalone for database configuration
12:14:06,358 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 70) JBAS011410: Stopping Persistence Unit (phase 2 of 2) Service 'webservice.war#webUnit'
12:14:06,359 INFO [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016009: Stopping weld service for deployment webservice.war
12:14:06,370 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 70) JBAS011410: Stopping Persistence Unit (phase 1 of 2) Service 'webservice.war#webUnit'
12:14:06,383 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877: Stopped deployment webservice.war (runtime-name: webservice.war) in 30ms
12:14:06,383 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015876: Starting deployment of "webservice.war" (runtime-name: "webservice.war")
12:14:06,588 INFO [org.jboss.as.jpa] (MSC service thread 1-4) JBAS011401: Read persistence.xml for webUnit
12:14:06,616 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 70) JBAS011409: Starting Persistence Unit (phase 1 of 2) Service 'webservice.war#webUnit'
12:14:06,616 INFO [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 70) HHH000204: Processing PersistenceUnitInfo [
name: webUnit
...]
12:14:06,627 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016002: Processing weld deployment webservice.war
12:14:06,630 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-1) JNDI bindings for session bean named EmployeeEJBImpl in deployment unit deployment "webservice.war" are as follows:
java:global/webservice/EmployeeEJBImpl!com.webservice.service.EmployeeEJBIf
java:app/webservice/EmployeeEJBImpl!com.webservice.service.EmployeeEJBIf
java:module/EmployeeEJBImpl!com.webservice.service.EmployeeEJBIf
java:global/webservice/EmployeeEJBImpl
java:app/webservice/EmployeeEJBImpl
java:module/EmployeeEJBImpl
12:14:06,650 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016005: Starting Services for CDI deployment: webservice.war
12:14:06,653 INFO [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016008: Starting weld service for deployment webservice.war
12:14:06,657 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 70) JBAS011409: Starting Persistence Unit (phase 2 of 2) Service 'webservice.war#webUnit'
12:14:06,659 INFO [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 70) HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
12:14:06,660 INFO [org.hibernate.engine.jdbc.internal.LobCreatorBuilder] (ServerService Thread Pool -- 70) HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
12:14:06,663 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (ServerService Thread Pool -- 70) HHH000397: Using ASTQueryTranslatorFactory
12:14:06,663 WARN [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 70) Unrecognized value for "hibernate.hbm2ddl.auto": none
12:14:06,798 WARN [org.jboss.as.weld] (MSC service thread 1-3) JBAS016018: Using deployment classloader to load proxy classes for module org.jboss.resteasy.resteasy-jaxrs:main. Package-private access will not work. To fix this the module should declare dependencies on [org.jboss.weld.core, org.jboss.weld.spi]
12:14:06,843 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./webservice: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./webservice: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_40]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_40]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_40]
Caused by: com.google.common.util.concurrent.ExecutionError: java.lang.ExceptionInInitializerError
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2199)
at com.google.common.cache.LocalCache.get(LocalCache.java:3934)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821)
at org.jboss.weld.util.cache.LoadingCacheUtils.getCacheValue(LoadingCacheUtils.java:49)
at org.jboss.weld.util.cache.LoadingCacheUtils.getCastCacheValue(LoadingCacheUtils.java:74)
at org.jboss.weld.bean.proxy.ClientProxyProvider.getClientProxy(ClientProxyProvider.java:204)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:736)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:762)
at org.jboss.weld.util.ForwardingBeanManager.getReference(ForwardingBeanManager.java:61)
at org.jboss.weld.bean.builtin.BeanManagerProxy.getReference(BeanManagerProxy.java:89)
at org.jboss.resteasy.cdi.CdiConstructorInjector.construct(CdiConstructorInjector.java:64)
at org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2211)
at org.jboss.resteasy.spi.ResteasyProviderFactory.addClientExceptionMapper(ResteasyProviderFactory.java:1048)
at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1438)
at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1346)
at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1268)
at org.jboss.resteasy.spi.ResteasyDeployment.registerProvider(ResteasyDeployment.java:531)
at org.jboss.resteasy.spi.ResteasyDeployment.registration(ResteasyDeployment.java:338)
at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:241)
at org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap.contextInitialized(ResteasyBootstrap.java:28)
at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:193)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:87)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:72)
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.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.8.0_40]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [rt.jar:1.8.0_40]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.8.0_40]
at java.lang.reflect.Constructor.newInstance(Constructor.java:422) [rt.jar:1.8.0_40]
at java.lang.Class.newInstance(Class.java:442) [rt.jar:1.8.0_40]
at org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:33)
at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.8.0_40]
at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:303)
at org.jboss.weld.bean.proxy.ClientProxyFactory.create(ClientProxyFactory.java:111)
at org.jboss.weld.bean.proxy.ClientProxyProvider.createClientProxy(ClientProxyProvider.java:180)
at org.jboss.weld.bean.proxy.ClientProxyProvider.createClientProxy(ClientProxyProvider.java:170)
at org.jboss.weld.bean.proxy.ClientProxyProvider.access$100(ClientProxyProvider.java:45)
at org.jboss.weld.bean.proxy.ClientProxyProvider$CreateClientProxy.load(ClientProxyProvider.java:56)
at org.jboss.weld.bean.proxy.ClientProxyProvider$CreateClientProxy.load(ClientProxyProvider.java:52)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195)
... 29 more
Caused by: java.security.PrivilegedActionException: java.lang.NoSuchMethodException: org.jboss.resteasy.client.exception.mapper.ApacheHttpClient4ExceptionMapper.mapHttpException(org.apache.http.HttpException)
at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.8.0_40]
at org.jboss.resteasy.client.exception.mapper.ApacheHttpClient4ExceptionMapper$Proxy$_$$_WeldClientProxy.<clinit>(Unknown Source)
... 47 more
Caused by: java.lang.NoSuchMethodException: org.jboss.resteasy.client.exception.mapper.ApacheHttpClient4ExceptionMapper.mapHttpException(org.apache.http.HttpException)
at java.lang.Class.getDeclaredMethod(Class.java:2130) [rt.jar:1.8.0_40]
at org.jboss.weld.security.GetDeclaredMethodAction.run(GetDeclaredMethodAction.java:39)
at org.jboss.weld.security.GetDeclaredMethodAction.run(GetDeclaredMethodAction.java:22)
... 49 more
12:14:06,850 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) JBAS014613: Operation ("full-replace-deployment") failed - address: ([]) - failure description: {"JBAS014671: Failed services" => {"jboss.undertow.deployment.default-server.default-host./webservice" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./webservice: Failed to start service
Caused by: com.google.common.util.concurrent.ExecutionError: java.lang.ExceptionInInitializerError
Caused by: java.lang.ExceptionInInitializerError
Caused by: java.security.PrivilegedActionException: java.lang.NoSuchMethodException: org.jboss.resteasy.client.exception.mapper.ApacheHttpClient4ExceptionMapper.mapHttpException(org.apache.http.HttpException)
Caused by: java.lang.NoSuchMethodException: org.jboss.resteasy.client.exception.mapper.ApacheHttpClient4ExceptionMapper.mapHttpException(org.apache.http.HttpException)"}}
12:14:06,875 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS018565: Replaced deployment "webservice.war" with deployment "webservice.war"
12:14:06,875 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 1) JBAS014774: Service status report
JBAS014775: New missing/unsatisfied dependencies:
service jboss.deployment.unit."webservice.war".component.EmployeeEJBImpl.START (unavailable) dependents: [service jboss.deployment.unit."webservice.war".deploymentCompleteService]
service jboss.deployment.unit."webservice.war".component."org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap".START (unavailable) dependents: [service jboss.deployment.unit."webservice.war".deploymentCompleteService]
service jboss.deployment.unit."webservice.war".component."org.jboss.weld.servlet.WeldTerminalListener".START (unavailable) dependents: [service jboss.deployment.unit."webservice.war".deploymentCompleteService]
service jboss.persistenceunit."webservice.war#webUnit" (unavailable) dependents: [service jboss.deployment.unit."webservice.war".deploymentCompleteService]
JBAS014777: Services which failed to start: service jboss.undertow.deployment.default-server.default-host./webservice: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./webservice: Failed to start service
service jboss.undertow.deployment.default-server.default-host./webservice
but if I remove following lines from web.xml it gets deployed
<listener>
<listener-class>
org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
</listener-class>
</listener>
but on access of my url(http://localhost:8080/webservice/) throws this error
12:22:05,207 WARN [org.jboss.as.weld] (default task-3) JBAS016018: Using deployment classloader to load proxy classes for module org.jboss.resteasy.resteasy-jaxrs:main. Package-private access will not work. To fix this the module should declare dependencies on [org.jboss.weld.core, org.jboss.weld.spi]
12:22:05,247 ERROR [io.undertow.request] (default task-3) UT005023: Exception handling request to /webservice/: com.google.common.util.concurrent.ExecutionError: java.lang.ExceptionInInitializerError
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2199)
at com.google.common.cache.LocalCache.get(LocalCache.java:3934)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821)
at org.jboss.weld.util.cache.LoadingCacheUtils.getCacheValue(LoadingCacheUtils.java:49) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
at org.jboss.weld.util.cache.LoadingCacheUtils.getCastCacheValue(LoadingCacheUtils.java:74) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
at org.jboss.weld.bean.proxy.ClientProxyProvider.getClientProxy(ClientProxyProvider.java:204) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:736) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:762) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
at org.jboss.weld.util.ForwardingBeanManager.getReference(ForwardingBeanManager.java:61) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
at org.jboss.weld.bean.builtin.BeanManagerProxy.getReference(BeanManagerProxy.java:89) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
at org.jboss.resteasy.cdi.CdiConstructorInjector.construct(CdiConstructorInjector.java:64) [resteasy-cdi-3.0.10.Final.jar:]
at org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2211) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.spi.ResteasyProviderFactory.addClientExceptionMapper(ResteasyProviderFactory.java:1048) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1438) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1346) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:1268) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.spi.ResteasyDeployment.registerProvider(ResteasyDeployment.java:531) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.spi.ResteasyDeployment.registration(ResteasyDeployment.java:338) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:241) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:112) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36) [resteasy-jaxrs-3.0.10.Final.jar:]
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:79)
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:220) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.core.ManagedServlet.getServlet(ManagedServlet.java:163) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:84) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:63) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:247) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:76) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:166) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:197) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:759) [undertow-core-1.1.0.Final.jar:1.1.0.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_40]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_40]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_40]
Caused by: java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.8.0_40]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [rt.jar:1.8.0_40]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.8.0_40]
at java.lang.reflect.Constructor.newInstance(Constructor.java:422) [rt.jar:1.8.0_40]
at java.lang.Class.newInstance(Class.java:442) [rt.jar:1.8.0_40]
at org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:33) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.8.0_40]
at org.jboss.weld.bean.proxy.ProxyFactory.create(ProxyFactory.java:303) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
at org.jboss.weld.bean.proxy.ClientProxyFactory.create(ClientProxyFactory.java:111) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
at org.jboss.weld.bean.proxy.ClientProxyProvider.createClientProxy(ClientProxyProvider.java:180) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
at org.jboss.weld.bean.proxy.ClientProxyProvider.createClientProxy(ClientProxyProvider.java:170) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
at org.jboss.weld.bean.proxy.ClientProxyProvider.access$100(ClientProxyProvider.java:45) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
at org.jboss.weld.bean.proxy.ClientProxyProvider$CreateClientProxy.load(ClientProxyProvider.java:56) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
at org.jboss.weld.bean.proxy.ClientProxyProvider$CreateClientProxy.load(ClientProxyProvider.java:52) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195)
... 52 more
Caused by: java.security.PrivilegedActionException: java.lang.NoSuchMethodException: org.jboss.resteasy.client.exception.mapper.ApacheHttpClient4ExceptionMapper.mapHttpException(org.apache.http.HttpException)
at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.8.0_40]
at org.jboss.resteasy.client.exception.mapper.ApacheHttpClient4ExceptionMapper$Proxy$_$$_WeldClientProxy.<clinit>(Unknown Source) [resteasy-jaxrs-3.0.10.Final.jar:]
... 70 more
Caused by: java.lang.NoSuchMethodException: org.jboss.resteasy.client.exception.mapper.ApacheHttpClient4ExceptionMapper.mapHttpException(org.apache.http.HttpException)
at java.lang.Class.getDeclaredMethod(Class.java:2130) [rt.jar:1.8.0_40]
at org.jboss.weld.security.GetDeclaredMethodAction.run(GetDeclaredMethodAction.java:39) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
at org.jboss.weld.security.GetDeclaredMethodAction.run(GetDeclaredMethodAction.java:22) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]
... 72 more
This is my pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.webservice</groupId>
<artifactId>webservice</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>3.0.13.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_1.1_spec</artifactId>
<version>1.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.ejb</groupId>
<artifactId>jboss-ejb-api_3.1_spec</artifactId>
<version>1.0.2.Final</version>
</dependency>
<!-- Validationg Form -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
<!-- logger -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
<scope>provided</scope>
</dependency>
<!-- Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
</dependencies>
<!-- imp this will force deployed file name to be artifacid else in url
we need to provide complete file name including 0.0.1-SNAPSHOT -->
<build>
<finalName>${project.artifactId}</finalName>
</build>
</project>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>webservice</display-name>
<context-param>
<param-name>resteasy.scan</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>resteasy.servlet.mapping.prefix</param-name>
<param-value>/</param-value>
</context-param>
<listener>
<listener-class>
org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
</listener-class>
</listener>
<servlet>
<servlet-name>resteasy-servlet</servlet-name>
<servlet-class>
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>resteasy-servlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>html/welcome.html</welcome-file>
</welcome-file-list>
</web-app>
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="webUnit">
<jta-data-source>java:jboss/datasources/webDS</jta-data-source>
<class>com.webservice.model.Employee</class>
<properties>
<property name="hibernate.hbm2ddl.auto" value="none" />
<property name="hibernate.archive.autodetection" value="class,hbm" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
</properties>
</persistence-unit>
</persistence>
Problem resolved by changing scope as provided for dependency
<scope>provided</scope>
compile
This is the default scope, used if none is specified. Compile dependencies are available in all classpaths of a project. Furthermore, those dependencies are propagated to dependent projects.
provided
This is much like compile, but indicates you expect the JDK or a container to provide the dependency at runtime. For example, when building a web application for the Java Enterprise Edition, you would set the dependency on the Servlet API and related Java EE APIs to scope provided because the web container provides those classes. This scope is only available on the compilation and test classpath, and is not transitive.
As explained in
Difference between maven scope compile and provided for JAR packaging

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.

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