ClassNotFoundException on com.sun.jersey.spi.container.servlet.ServletContainer - jboss

I am migrating project from jBoss-eap-5.1 to jboss-eap-6.0. I have defined jersey jars in the modules directory of jboss as follows:
com
|_jersey
|_jersey-core
|_jersey-client
|_jersey-server
|_jersey-servlet
In my project .pom file i defined the jars as follows:
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-servlet</artifactId>
<version>1.10</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
<version>${jersey-version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>${jersey-version}</version>
<scope>test</scope>
</dependency>
However, when I try to deploy, I get the following error on ServletContainer class:
13:03:29,908 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.subunit."ApiEar-2.0.0-SNAPSHOT.ear"."ApiService-2.
0.0-SNAPSHOT.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."ApiEar-2.0.0-SNAPSHOT.ear"."ApiService-2.0.0-SNAPSHOT.war".POST_MODULE
: JBAS018733: Failed to process phase POST_MODULE of subdeployment "ApiService-2.0.0-SNAPSHOT.war" of deployment "ApiEar-2.0.0-SNAPSHOT.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:123) [jboss-as-server-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA-redhat-1.jar:1.0.2.GA-redhat-1]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_32-ea]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_32-ea]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_32-ea]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.ClassNotFoundException: com.sun.jersey.spi.container.servlet.ServletContainer from [Modu
le "deployment.ApiEar-2.0.0-SNAPSHOT.ear.ApiService-2.0.0-SNAPSHOT.war:main" from Service Module Loader]
at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.checkDeclaredApplicationClassAsServlet(JaxrsScanningProcessor.java:295)
at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.scanWebDeployment(JaxrsScanningProcessor.java:160)
at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.deploy(JaxrsScanningProcessor.java:109)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) [jboss-as-server-7.1.2.Final-redhat-1.jar:7.1.2.Final-redhat-1]
... 5 more
Initially, I was getting this error when I did not define jersey-servlet, but I did some searching, and presumably, jersey-servlet.jar is the one that contains that class. However, that did solve the error.

I have solved the issue by adding this dependencies into my manifest.mf file. In my .pom file I added the build plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Dependencies>com.jersey.jersey-server,com.jersey.jersey-client,com.jersey.jersey-json</Dependencies>
</manifestEntries>
</archive>
</configuration>
</plugin>
that added references to the needed .jar files in my manifest file

Not an answer, but I believe this was implemented in jersey in version 10. That is when big overhaul of library happened

Related

Caused by: org.jboss.modules.ModuleNotFoundException: org.quartz

I am adding quartz-2.2.1 scheduler to my application and on deploying it on WildFly 12 the below error is thrown.
Caused by: org.jboss.modules.ModuleNotFoundException: org.quartz
at org.jboss.modules.Module.addPaths(Module.java:1221)
at org.jboss.modules.Module.link(Module.java:1577)
at org.jboss.modules.Module.relinkIfNecessary(Module.java:1605)
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:296)
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:280)
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:68)
... 8 more
This is for WildFly 12 application server. Earlier my application was on Jboss6 with quartz-1.8.3 and it's working fine. Now I am trying to upgrade the application server.
Below are the pom.xml dependency code and jboss-deployment-structure.xml under WEB-INF.
pom.xml
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz-jobs</artifactId>
<version>2.2.1</version>
</dependency>
jboss-deployment-structure.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
<deployment>
<dependencies>
<module name="org.quartz" />
</dependencies>
</deployment>
</jboss-deployment-structure>
I want to know if I am missing something so that I am getting this error.

WildFly GWT Error message tomcat container

after deploying my application over WildFly I see the following messages:
2017-02-15 10:06:51,440 ERROR [org.jboss.msc.service.fail]
(ServerService Thread Pool -- 178) MSC000001: Failed to start service
jboss.undertow.deployment.default-server.default-host./cati:
org.jboss.msc.service.StartException in service
jboss.undertow.deployment.default-server.default-host./cati:
java.lang.NoSuchMethodError:
org.apache.tomcat.util.descriptor.DigesterFactory.newDigester(ZZLorg/apache/tomcat/util/digester/RuleSet;Z)Lorg/apache/tomcat/util/digester/Digester;
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320) Caused by: java.lang.NoSuchMethodError:
org.apache.tomcat.util.descriptor.DigesterFactory.newDigester(ZZLorg/apache/tomcat/util/digester/RuleSet;Z)Lorg/apache/tomcat/util/digester/Digester;
at org.apache.tomcat.util.descriptor.tld.TldParser.(TldParser.java:49)
at org.apache.tomcat.util.descriptor.tld.TldParser.(TldParser.java:44)
at org.apache.jasper.servlet.TldScanner.(TldScanner.java:79)
at org.apache.jasper.servlet.JasperInitializer.newTldScanner(JasperInitializer.java:120)
at org.eclipse.jetty.apache.jsp.JettyJasperInitializer.newTldScanner(JettyJasperInitializer.java:115)
at org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:101)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:184)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
... 6 more
in my maven project I also import the following depdencies
<!-- GWT -->
<!-- https://mvnrepository.com/artifact/com.google.gwt/gwt-user -->
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.8.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.gwt/gwt-servlet -->
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>2.8.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.gwt/gwt-dev -->
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-util-scan</artifactId>
<version>8.5.2</version>
</dependency>
As I read over the WildFly project the Tomcat container was removed that why I added the following dependecies :
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-util-scan</artifactId>
<version>8.5.2</version>
</dependency>
any ideea how to bypass this error message ?
Of course is not working , as you can see if you add for testing the following depedency (gwt-dev):
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>2.8.0</version>
</dependency>
is including the jetty server and this is one of the movtiv for receving the message from my first question.
Be sure to not clutter the server side with compile time dependencies.
gwt-servlet is needed only for runtime, gwt-dev and gwt-user should be set to provided - which results in having them available for compiling to JavaScript, but leaving them out in the final WAR file on the application server.
<!-- GWT -->
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<scope>provided</scope>
</dependency>
But after all it looks to me like you should not try to put any Tomcat libraries in the WildFly server as it already contains everything to run the server part of your application.
Therefore just stick to the plain servlet API like so:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
It is provided again, as WildFly has it built-in.
Can you try to exclude the Tomcat dependencies and see if it works for you?

Maven: java.lang.ClassNotFoundException on Jboss

Firstable sorry for my English, I have a Maven Project which is a Web Service (packaged into a war file)
I use this pom:
<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>ec.gob.turismo</groupId>
<artifactId>mintur-bpm</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>mintur-bpm</name>
<description>Servicio Web que interactúa con los procesos del negocio</description>
<properties>
<jbpm.version>6.0.1.Final</jbpm.version>
</properties>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.5.Final</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>ec.gob.turismo.siete.establecimientos</groupId>
<artifactId>establecimientos-dto</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-core</artifactId>
<version>2.7.11</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>2.7.11</version>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-api</artifactId>
<version>${jbpm.version}</version>
</dependency>
<dependency>
<groupId>org.kie.remote</groupId>
<artifactId>kie-services-client</artifactId>
<version>${jbpm.version}</version>
</dependency>
</dependencies>
</project>
I use JbossEAP 6.3, when I type mvn clean install, maven generates the war file and copy inside the standalone directory. Next when I see my console in my eclipse I see this error:
[DEBUG] Executing deployment
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.643s
[INFO] Finished at: Thu Oct 02 16:49:19 COT 2014
[INFO] Final Memory: 29M/358M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.5.Final:deploy (default) on project mintur-bpm: Deployment failed and was rolled back. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.5.Final:deploy (default) on project mintur-bpm: Deployment failed and was rolled back.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.jboss.as.plugin.common.DeploymentExecutionException: Deployment failed and was rolled back.
at org.jboss.as.plugin.deployment.standalone.StandaloneDeployment.execute(StandaloneDeployment.java:180)
at org.jboss.as.plugin.deployment.AbstractDeployment.executeDeployment(AbstractDeployment.java:121)
at org.jboss.as.plugin.deployment.AbstractDeployment.doExecute(AbstractDeployment.java:146)
at org.jboss.as.plugin.deployment.AbstractAppDeployment.doExecute(AbstractAppDeployment.java:70)
at org.jboss.as.plugin.deployment.AbstractDeployment.execute(AbstractDeployment.java:111)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Finally in Jboss log (server.log), I see this stack trace:
16:49:17,770 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."mintur-bpm-0.0.1-SNAPSHOT.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."mintur-bpm-0.0.1-SNAPSHOT.war".INSTALL: JBAS018733: Error al procesar la fase INSTALL de deployment "mintur-bpm-0.0.1-SNAPSHOT.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: ec.gob.turismo.siete.serviciosweb.bmp.BusinessProcessManagement from [Module "deployment.mintur-bpm-0.0.1-SNAPSHOT.war:main" from Service Module Loader]
at org.jboss.wsf.stack.cxf.metadata.MetadataBuilder.createDDEndpoint(MetadataBuilder.java:241)
at org.jboss.wsf.stack.cxf.metadata.MetadataBuilder.build(MetadataBuilder.java:82)
at org.jboss.wsf.stack.cxf.deployment.aspect.DescriptorDeploymentAspect.generateMetadataFromDeployment(DescriptorDeploymentAspect.java:135)
at org.jboss.wsf.stack.cxf.deployment.aspect.DescriptorDeploymentAspect.start(DescriptorDeploymentAspect.java:68)
at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:74)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
... 5 more
Caused by: java.lang.ClassNotFoundException: ec.gob.turismo.siete.serviciosweb.bmp.BusinessProcessManagement from [Module "deployment.mintur-bpm-0.0.1-SNAPSHOT.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:443) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:431) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:373) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:118) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.wsf.stack.cxf.metadata.MetadataBuilder.createDDEndpoint(MetadataBuilder.java:237)
... 10 more
16:49:17,781 ERROR [org.jboss.as.server] (management-handler-thread - 29) JBAS015870: La implementaci▒n de "mintur-bpm-0.0.1-SNAPSHOT.war" se deshizo con el siguiente mensaje de fallo:
{"JBAS014671: Servicios fallidos" => {"jboss.deployment.unit.\"mintur-bpm-0.0.1-SNAPSHOT.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"mintur-bpm-0.0.1-SNAPSHOT.war\".INSTALL: JBAS018733: Error al procesar la fase INSTALL de deployment \"mintur-bpm-0.0.1-SNAPSHOT.war\"
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: ec.gob.turismo.siete.serviciosweb.bmp.BusinessProcessManagement from [Module \"deployment.mintur-bpm-0.0.1-SNAPSHOT.war:main\" from Service Module Loader]
Caused by: java.lang.ClassNotFoundException: ec.gob.turismo.siete.serviciosweb.bmp.BusinessProcessManagement from [Module \"deployment.mintur-bpm-0.0.1-SNAPSHOT.war:main\" from Service Module Loader]"}}
16:49:19,100 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015877: Se detuvo la implementaci▒nmintur-bpm-0.0.1-SNAPSHOT.war (runtime-name: mintur-bpm-0.0.1-SNAPSHOT.war) en 1317ms
The error above says that a Class is not found in my war file, which is incorrect because I have opened many times the war file and there are all the classes inside.
Could you help me please, because I can't find a solution?
Thanks.
PD: If you need more information, please let me know.
It was my fault, this package does not exist in my war file, that's why the error:
ec.gob.turismo.siete.serviciosweb.bmp.BusinessProcessManagement
The correct package is:
ec.gob.turismo.serviciosweb.bmp.BusinessProcessManagement
Aditional I have placed a web.xml file that makes references to the class that implements the BusinessProcessManagement interface.
Thanks.

Deploy web applications to JBoss from Eclipse, with dependencies

I have a project developed under Eclipse with JBoss tools installed. When I deploy the application to the Jboss server, some helper jar files which are made available to the project through Maven are not copied inside the WEB-INF/lib folder. Hence, I get a ClassNotFound exception at runtime.
Is there any approach to convince Eclipse (or Maven) to copy the jars into the lib folder at deployment?
EDIT: the pom.xml looks like:
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.whatever.simulators</groupId>
<artifactId>eebuildingsim</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>eebuildingsim Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<!-- begin JBoss -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>2.3.2.FINAL</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>jaxrs-api</artifactId>
<version>2.3.0.GA</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.1.2</version>
<scope>provided</scope>
</dependency>
<!-- end JBoss -->
<dependency>
<groupId>ro.mysite</groupId>
<artifactId>petrinetexec</artifactId>
<version>0.1.3.81</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.whatever.myAuxiliaryStuff</groupId>
<artifactId>myAuxiliaryStuff </artifactId>
<version>0.1.0.1305</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.2.0-m09</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.2.0-m09</version>
</dependency>
</dependencies>
<build>
<finalName>eebuildingsim</finalName>
</build>
The artifact myAuxiliaryStuff should be deployed under WEB-INF/lib, under the jboss deployment server.
Using:
Eclipse: Juno Service Release 1
Jboss: 7.1.1. final
m2e 1.3.1.20130219-1424
eclipse web tools platform 3.4.2.v2013
Later edit: the error reported in jboss' log file looks like:
12:31:38,507 INFO [org.jboss.weld.deployer] (MSC service thread 1-5)
JBAS016002: Processing weld deployment mywar.war 12:31:38,522 ERROR
[org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed
to start service jboss.deployment.unit."mywar.war".POST_MODULE:
org.jboss.msc.service.StartException in service
jboss.deployment.unit."mywar.war".POST_MODULE: Failed to process phase
POST_MODULE of deployment "mywar.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(ThreadPoolExecutor.java:1110)
[rt.jar:1.7.0_05] at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
[rt.jar:1.7.0_05] at java.lang.Thread.run(Thread.java:722)
[rt.jar:1.7.0_05] Caused by: java.lang.NoSuchFieldError: FLOW at
com.sun.faces.flow.FlowDiscoveryCDIExtension.<clinit>(FlowDiscoveryCDIExtension.java:90)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method) [rt.jar:1.7.0_05] at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
[rt.jar:1.7.0_05] at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[rt.jar:1.7.0_05] at
java.lang.reflect.Constructor.newInstance(Constructor.java:525)
[rt.jar:1.7.0_05] at
org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.loadExtension(WeldPortableExtensionProcessor.java:117)
at
org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.loadAttachments(WeldPortableExtensionProcessor.java:100)
at
org.jboss.as.weld.deployment.processors.WeldPortableExtensionProcessor.deploy(WeldPortableExtensionProcessor.java:86)
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
12:31:38,522 INFO [org.jboss.as.server] (DeploymentScanner-threads -
2) JBAS015870: Deploy of deployment "mywar.war" was rolled back with
failure message {"JBAS014671: Failed services" =>
{"jboss.deployment.unit.\"mywar.war\".POST_MODULE" =>
"org.jboss.msc.service.StartException in service
jboss.deployment.unit.\"mywar.war\".POST_MODULE: Failed to process
phase POST_MODULE of deployment \"mywar.war\""}} 12:31:38,647 INFO
[org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877:
Stopped deployment mywar.war in 115ms 12:31:38,647 INFO
[org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774:
Service status report JBAS014775: New missing/unsatisfied
dependencies:
service jboss.naming.context.java.module.mywar.mywar (missing) dependents: [service
jboss.naming.context.java.module.mywar.mywar.ValidatorFactory, service
jboss.naming.context.java.module.mywar.mywar.Validator] JBAS014777:
Services which failed to start: service
jboss.deployment.unit."mywar.war".POST_MODULE:
org.jboss.msc.service.StartException in service
jboss.deployment.unit."mywar.war".POST_MODULE: Failed to process phase
POST_MODULE of deployment "mywar.war"
12:31:38,647 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.\"mywar.war\".POST_MODULE" =>
"org.jboss.msc.service.StartException in service
jboss.deployment.unit.\"mywar.war\".POST_MODULE: Failed to process
phase POST_MODULE of deployment \"mywar.war\""}}}}
Eclipse and the plugins are a bit finicky. This is what I've done to get it to work.
Project -> Properties -> Deployment Assembly
Add...
Java Build Path Entries (Next >)
Maven Dependencies (Finish)
The Deploy Properties panel should now include an entry for Source: Maven Dependecies -> Deploy Path: WEB_INF/lib
This is suspicious:
java.lang.NoSuchFieldError: FLOW
Which is related to JSF, if I'm not mistaken. I've got a few suggestions but I'm not an expert in any aspect.
First try to add provided dependency scope for jsf-api and jsf-impl like this (since the JBoss has them):
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.2.0-m09</version>
<scope>provided</scope> // <----- do it for both
</dependency>
AFAIK, JBoss 7.1.1 already has the JSF 2.1.7. So, if you really need the JSF 2.2 you should update the JSF module in JBoss. Here is how to Migration to JSF 2.2.
Another option is to bundle the JSF in to your WAR and inform JBoss to exclude the container version (the one that is shipped with JBoss) of it:
in web.xml add:
<context-param>
<param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
<param-value>true</param-value>
</context-param>
and in jboss-deployment-structure.xml exclude the JBoss's implementation:
<jboss-deployment-structure>
<deployment>
<exclusions>
<module name="javax.faces.api" />
</exclusions>
.
.
.
Based on your description, you only have Eclipse and JBoss Tools in use and dependencies stored in Maven pom files. For Eclipse to become aware of those dependencies, you need to have eclipse-maven integration. M2e is the common choice for it.
So you would need these installed:
m2e
m2e-wtp
Go to the directory where your pom.xml resides and execute following command.
mvn package
This command should create a war file for you to deploy to your application server. This file is a zip file, look to its contents and see if your myAuxiliaryStuff.jar is in web-inf/lib. If it is, your problem lies with eclipse integration with maven.
You seem to have everything installed.
I had this problem too.
Just needed to right click on the project and choose.
"Mark as Deployable"

jboss as 7 + jersey - ClassNotFound com.sun.jersey.server.impl.container.servlet.Include

I migrating project on jboss as 7 from jersey version 1.9 to 1.17 and I get the following exception:
12:05:48,573 WARN [org.jboss.as.ee] (MSC service thread 1-10) JBAS011006: Not installing optional component com.sun.jersey.server.impl.container.servlet.Include due to except
ion: java.lang.ClassNotFoundException: com.sun.jersey.server.impl.container.servlet.Include from [Module "deployment.ApiEar-2.0.0-SNAPSHOT.ear.ApiService-2.0.0-SNAPSHOT.war:ma
in" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
at java.lang.Class.forName0(Native Method) [rt.jar:1.6.0_32-ea]
at java.lang.Class.forName(Class.java:247) [rt.jar:1.6.0_32-ea]
at org.jboss.as.server.deployment.reflect.DeploymentClassIndex.classIndex(DeploymentClassIndex.java:54)
at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81) [jboss-as-ee-7.1.2.Final-redhat-1.jar:7.1.2.Final-
redhat-1]
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_32-ea]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_32-ea]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_32-ea]
code runs fine under 1.9. Here are my dependencies:
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
<version>1.9.1</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.9.1</version>
</dependency>
what could cause such an exception?
I think your problem is related to the fact that Jersey was changed quite a bit from version 1.9 to 1.10; namely there was a big change to Servlet functionality. You can read more here: Jersey 1.10 released
As far as your problem goes, I think you simply missing some dependencies. I know I had to add the following to my .pom file:
<!-- Jersey 1.17 dependencies -->
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-servlet</artifactId>
<version>${jersey-version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0.2</version>
<scope>compile</scope>
</dependency>
<!-- end Jersey 1.17 dependencies -->