JBoss java.io.IOException during deployment - jboss

I am building a JBoss Application Server module, on JBossAS 7.1.1. While trying to modify the classpath in the manifest file, I ran into this error:
12:30:53,097 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "MyDeployableProject.war"
12:30:53,141 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."MyDeployableProject.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."MyDeployableProject.war".STRUCTURE: Failed to process phase STRUCTURE of deployment "MyDeployableProject.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$Worker.runTask(ThreadPoolExecutor.java:886) [classes.jar:1.6.0_31]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_31]
at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_31]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to get manifest for deployment "/opt/server/bin/jboss-as-7.1.1.Final/standalone/deployments/MyDeployableProject.war"
at org.jboss.as.server.deployment.module.ManifestAttachmentProcessor.deploy(ManifestAttachmentProcessor.java:73) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
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
Caused by: java.io.IOException: invalid header field
at java.util.jar.Attributes.read(Attributes.java:393) [classes.jar:1.6.0_31]
at java.util.jar.Manifest.read(Manifest.java:182) [classes.jar:1.6.0_31]
at java.util.jar.Manifest.<init>(Manifest.java:52) [classes.jar:1.6.0_31]
at org.jboss.vfs.VFSUtils.readManifest(VFSUtils.java:216)
at org.jboss.vfs.VFSUtils.getManifest(VFSUtils.java:199)
at org.jboss.as.server.deployment.module.ManifestAttachmentProcessor.deploy(ManifestAttachmentProcessor.java:69) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 6 more

It turns out, a slight bug in MANIFEST.MF was causing this issue. The file was:
Manifest-Version: 1.0
Class-Path:
Turns out, the bug was due to there being no space after Class-Path:. This (only a space different) is what works:
Manifest-Version: 1.0
Class-Path:
Hopefully this will stop others from wondering.

Also, you could have something as:
Manifest-Version: 1.0
Dependencies: org.slf4j,org.apache.commons.logging
**,org.joda.time**
Built-By: Pablo
Build-Jdk: 1.6.0_30
Created-By: Apache Maven
Archiver-Version: Plexus Archiver
instead of
Manifest-Version: 1.0
Dependencies: org.slf4j,org.apache.commons.logging,org.joda.time
Built-By: Pablo
Build-Jdk: 1.6.0_30
Created-By: Apache Maven
Archiver-Version: Plexus Archiver
In this case, review pom.xml
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<archive>
<manifestEntries>
<!-- IMPORTANT: All dependencies in te same line --> <Dependencies>org.slf4j,org.apache.commons.logging,org.joda.time</Dependencies>
</manifestEntries>
</archive>
</configuration>
</plugin>

Related

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.

How can I use Apache CXF 2.6.7 as dependency of my war project and not CXF that is installed in the modules of JBoss 7.1?

I am upgrading to JBoss 7.1 and unfortunately I can not deploy my application.
I want to use Apache CXF 2.6.7 that is dependency of our war project and not CXF that is installed in the modules of JBoss 7.1.
Unfortunately, the deployment of WAR is failing with the following warning and exception:
10:39:39,511 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015876: Starting deployment of "example.war"
10:39:49,021 WARN [org.jboss.as.server.deployment] (MSC service thread 1-16) Class Path entry jaxb-api.jar in "/example.war/WEB-INF/lib/jaxb-impl-2.2.5.jar" does not point to a valid jar for a Class-Path reference.
10:39:49,024 WARN [org.jboss.as.server.deployment] (MSC service thread 1-16) Class Path entry activation.jar in "/example.war/WEB-INF/lib/jaxb-impl-2.2.5.jar" does not point to a valid jar for a Class-Path reference.
10:39:49,025 WARN [org.jboss.as.server.deployment] (MSC service thread 1-16) Class Path entry jsr173_1.0_api.jar in "/example.war/WEB-INF/lib/jaxb-impl-2.2.5.jar" does not point to a valid jar for a Class-Path reference.
10:39:49,027 WARN [org.jboss.as.server.deployment] (MSC service thread 1-16) Class Path entry jaxb1-impl.jar in "/example.war/WEB-INF/lib/jaxb-impl-2.2.5.jar" does not point to a valid jar for a Class-Path reference.
10:39:49,029 WARN [org.jboss.as.server.deployment] (MSC service thread 1-16) Class Path entry jaxb-api.jar in "/example.war/WEB-INF/lib/jaxb-xjc-2.2.5.jar" does not point to a valid jar for a Class-Path reference.
10:39:49,031 WARN [org.jboss.as.server.deployment] (MSC service thread 1-16) Class Path entry jaxb-impl.jar in "/example.war/WEB-INF/lib/jaxb-xjc-2.2.5.jar" does not point to a valid jar for a Class-Path reference.
10:39:49,033 WARN [org.jboss.as.server.deployment] (MSC service thread 1-16) Class Path entry jsr173_1.0_api.jar in "/example.war/WEB-INF/lib/jaxb-xjc-2.2.5.jar" does not point to a valid jar for a Class-Path reference.
10:39:49,035 WARN [org.jboss.as.server.deployment] (MSC service thread 1-16) Class Path entry activation.jar in "/example.war/WEB-INF/lib/jaxb-xjc-2.2.5.jar" does not point to a valid jar for a Class-Path reference.
10:39:49,038 WARN [org.jboss.as.server.deployment] (MSC service thread 1-16) Class Path entry activation.jar in "/example.war/WEB-INF/lib/mail-1.4.jar" does not point to a valid jar for a Class-Path reference.
10:39:49,041 WARN [org.jboss.as.server.deployment] (MSC service thread 1-16) Class Path entry xml-apis.jar in "/example.war/WEB-INF/lib/serializer-2.7.1.jar" does not point to a valid jar for a Class-Path reference.
10:39:49,047 WARN [org.jboss.as.server.deployment] (MSC service thread 1-16) Class Path entry xercesImpl.jar in "/example.war/WEB-INF/lib/xalan-2.7.0.jar" does not point to a valid jar for a Class-Path reference.
10:39:49,049 WARN [org.jboss.as.server.deployment] (MSC service thread 1-16) Class Path entry xml-apis.jar in "/example.war/WEB-INF/lib/xalan-2.7.0.jar" does not point to a valid jar for a Class-Path reference.
10:39:49,050 WARN [org.jboss.as.server.deployment] (MSC service thread 1-16) Class Path entry serializer.jar in "/example.war/WEB-INF/lib/xalan-2.7.0.jar" does not point to a valid jar for a Class-Path reference.
10:39:49,127 WARN [org.jboss.as.server.deployment] (MSC service thread 1-10) JBAS015893: Encountered invalid class name 'org.springframework.context.ApplicationContext,org.springframework.beans.BeansException' for service type 'org.apache.cxf.bus.factory'
10:39:49,805 WARN [org.jboss.as.ee] (MSC service thread 1-4) JBAS011006: Not installing optional component org.apache.cxf.transport.http.Servlet3ContinuationProvider$Servlet3Continuation due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.apache.cxf.transport.http.Servlet3ContinuationProvider$Servlet3Continuation
at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606)
at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [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$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_33]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_33]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_33]
10:39:49,826 WARN [org.jboss.as.ee] (MSC service thread 1-4) JBAS011006: Not installing optional component org.eclipse.jetty.continuation.Servlet3Continuation$1 due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.eclipse.jetty.continuation.Servlet3Continuation$1
at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606)
at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [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$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_33]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_33]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_33]
10:39:49,854 WARN [org.jboss.as.ee] (MSC service thread 1-4) JBAS011006: Not installing optional component org.eclipse.jetty.continuation.Servlet3Continuation$2 due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.eclipse.jetty.continuation.Servlet3Continuation$2
at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:606)
at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:81)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [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$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_33]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_33]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_33]
My jboss-deployment-structure.xml is the following:
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.jboss.as.jmx"/>
</dependencies>
<exclusions>
<module name="javaee.api" />
<module name="org.hibernate"/>
<module name="javax.xml.bind.api"/>
<module name="org.apache.cxf"/>
<module name="org.jboss.ws.api"/>
<module name="jorg.jboss.ws.spi"/>
<module name="com.sun.xml.bind"/>
<module name="org.apache.xalan"/>
<module name="javax.mail.api"/>
</exclusions>
</deployment>
</jboss-deployment-structure>
How can I solve warnings and errors and to deploy my application?
You should exclude webservices subsystem from being activated for your deployment
add this into META-INF/jboss-deployment-structure.xml
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<!-- exclude-subsystem prevents a subsystems deployment unit processors running on a deployment -->
<!-- which gives basically the same effect as removing the subsystem, but it only affects single deployment -->
<exclude-subsystems>
<subsystem name="webservices" />
</exclude-subsystems>
<deployment>
</jboss-deployment-structure>
or you can go to standalone.xml and remove subsystem there.
To do so, you need to remove
<subsystem xmlns="urn:jboss:domain:webservices:1.x">
...
...
<subsystem>
part of configuration, extension part of on top can stay it wont hurt either way.
or you can connect to server with CLI and run
/subsystem=webservices:remove()
In any case I would recommend to read bit about classloading in AS7 https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7
Just a note, exclude-subsystems functionality and deployment-strucure:1.2 was added in 7.1.2 and as such will not work on on 7.1.1.
I can able to deploy Ear/War with CXF-2.7.14 with Spring 3.1.2 on Jboss-7.1.1.Final. The changes I did listed beow:
The following libraries are added
CXF-2.7.14.jar, wss4j-1.6.17.jar, neethi-3.0.3.jar,
geronimo-ws-metadata_2.0_spec-1.1.1.jar,
ord.apache.servicemix.bundles.saaj-impl-1.3.18_1.jar, wsdl4j-1.6.3.jar,
woodstox-core-asl-4.4.1.jar, xmlsec-1.5.7.jar
In jboss-deployment-structure.xml file add as shown below :
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="com.sun.xml.messaging.saaj" export="true" />
</dependencies>
<exclusions>
<module name="org.apache.log4j"/>
<module name="org.slf4j" />
<module name="org.apache.commons.logging"/>
<module name="org.log4j"/>
<module name="org.jboss.logging"/>
</exclusions>
</deployment>
<sub-deployment name="project.webapp.war">
<exclusions>
<module name="org.apache.log4j"/>
<module name="org.slf4j" />
<module name="org.apache.commons.logging"/>
<module name="org.log4j"/>
<module name="org.jboss.logging"/>
</exclusions>
</sub-deployment>
</jboss-deployment-structure>
I can able to deploy with no issues. Hope it helps others.

Anyone know how to customize the servlet port for an embedded JBoss container using Maven Cargo?

I"m using Maven 3.0.3 with the Cargo 1.3.3 plugin. I'm trying to configure an embedded JBoss 7.1 container. I would like to customize the port on which JBoss listens for requests, normally 8080. However, I can't seem to customize it, using the "cargo.servlet.port" property in the configuration section. Below is my configuration
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.3.3</version>
<configuration>
<home>${project.build.directory}/jboss-${jboss.version}/container</home>
<properties>
<cargo.logging>high</cargo.logging>
<cargo.servlet.port>${jboss.servlet.port}</cargo.servlet.port>
</properties>
<container>
<containerId>jboss${jboss.major}x</containerId>
<zipUrlInstaller>
<url>http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.zip</url>
<downloadDir>${project.basedir}/downloads</downloadDir>
<extractDir>${project.build.directory}/extracts</extractDir>
</zipUrlInstaller>
<output>${project.build.directory}/jboss${jboss.major}x.log</output>
<log>${project.build.directory}/cargo.log</log>
</container>
<deployables>
<deployable>
<location>target/${project.artifactId}.${project.packaging}</location>
<pingURL>http://localhost:${jboss.servlet.port}/${project.artifactId}</pingURL>
<pingTimeout>60000</pingTimeout>
<properties>
<context>${project.artifactId}</context>
</properties>
</deployable>
</deployables>
</configuration>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
<goal>deploy</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
Here is the bind exception I get in the application server log (I already have a JBoss instance running on port 8080).
16:45:41,913 INFO [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-10) JBoss Web Services - Stack CXF Server 4.0.2.GA
16:45:42,010 ERROR [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-3) Error initializing endpoint: java.net.BindException: Address already in use /0.0.0.0:8080
at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:983) [jbossweb-7.0.13.Final.jar:]
at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:190) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.connector.Connector.init(Connector.java:983) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:267) [jboss-as-web-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$Worker.runTask(ThreadPoolExecutor.java:895) [classes.jar:1.6.0_41]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [classes.jar:1.6.0_41]
at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_41]
16:45:42,025 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.web.connector.http: org.jboss.msc.service.StartException in service jboss.web.connector.http: JBAS018007: Error starting web connector
at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:271)
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$Worker.runTask(ThreadPoolExecutor.java:895) [classes.jar:1.6.0_41]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [classes.jar:1.6.0_41]
at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_41]
Caused by: LifecycleException: Protocol handler initialization failed: java.net.BindException: Address already in use /0.0.0.0:8080
at org.apache.catalina.connector.Connector.init(Connector.java:985)
at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:267)
... 5 more
The reason I like the Cargo plugin is it allows me to use my own JBoss standalone.xml configuration, but am open to alternatives to Cargo, provided I can customize my config. Thanks for any guidance, - Dave
You seemingly just have a small bug in your configuration. The properties are part of the Cargo configuration, which is a child/property of the plugin configuration, so in fact, you have to put a configuration tag inside a configuration tag. Here's mine (partly):
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.3.3</version>
<configuration>
<container>
<!-- Add your container here, we use a custom one -->
</container>
<configuration>
<properties>
<cargo.servlet.port>5556</cargo.servlet.port>
<!-- other properties -->
</properties>
<configfiles combine.children="append">
<!-- here we add our configuration files -->
<configfile>
<!-- Expect configfiles to be filtered and gathered in
target/jboss71x (in the respective subdirectories) -->
<file>${project.build.directory}/cargo/jboss71x</file>
</configfile>
</configfiles>
</configuration>
</configuration>
</plugin>

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

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

deploy jboss sar at jboss as 7 error

Hello i try to deploy jboss sar file on jboss as. My problem is he can recognize end jboss-sar.
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.0.2.Final</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
With this deploy plugin i get this error
[INFO] Could not execute goal deploy on dts.jboss-sar. Reason: D:\Workspace Liferay\DTS_TRUNK\code\dts\dts-sar\target\dts.jboss-sar (The system cannot find the file specified)
And Question is how can i tell him to looking dts.sar not dts.jboss-sar couse this file dts.sar is there but he ca't see it.
Okey i found somewhere solution and change plugin on
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.0.2.Final</version>
<configuration>
<filename>dts.sar</filename>
<artifactTypeMappings>
<artifactTypeMapping type="jboss-sar" mapping="sar"/>
</artifactTypeMappings>
</configuration>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
Now it's look like it was working but have other issue :
16:50:14,298 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC00001: Failed to start service jboss.deployment.unit."dts.sar".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."dts.sar".PARSE: Failed to process phase PARSE of deployment "dts.sar"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_15]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_15]
at java.lang.Thread.run(Thread.java:619) [:1.6.0_15]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to parse service xml ["/D:/liferay-portal-6.1.0-ce-ga1/jboss-7.0.2/bin/content/dts.sar/META-INF/jboss-service.xml"]
at org.jboss.as.service.ServiceDeploymentParsingProcessor.deploy(ServiceDeploymentParsingProcessor.java:94)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
... 5 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[2,1]
Message: Unexpected element 'server'
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:98) [staxmapper-1.0.0.Final.jar:1.0.0.Final]
at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:59) [staxmapper-1.0.0.Final.jar:1.0.0.Final]
at org.jboss.as.service.ServiceDeploymentParsingProcessor.deploy(ServiceDeploymentParsingProcessor.java:87)
... 6 more
16:50:14,301 INFO [org.jboss.as.server.controller] (pool-1-thread-3) Deployment of "dts.sar" was rolled back with failure message {"Failed services" => {"jboss.deployment.unit.\"dts.sar\".PARSE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"dts.sar\".PARSE: Failed to process phase PARSE of deployment \"dts.sar\""}}
16:50:14,304 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) Stopped deployment dts.sar in 3ms
I have similar issue when i try to deploy other war file and i don't know what to do.
it was easy just remove Mbean from jboss-service.xml