我想部署一个生成JSON的jersey restful webservice。但我得到以下错误
14:08:26,743错误[org.jboss.MSC.service.fail](MSC服务线程1-9)MSC00001:无法启动服务jboss.deployment.unit.“rssample.war”.POST_MODULE:org.jboss.MSC.service.startService jboss.deployment.unit.“rssample.war”.POST_MODULE:org.jboss.as.server.deployment.deployment.deployment.deployment.deployment.deployment.start(ed:org.jboss.as.server.deployment.DeploymentUnitProcessingException:JBAS011232:只允许一个JAX-RS应用程序类。org.glassfish.jersey.server.resourceconfig org.glassfish.jersey.server.resourceconfig$wrappingresourceconfig org.jboss.as.jaxrs.deployment.jaxrsscanningprocessor.scan(jaxrsscanningprocessor.java:209)org.jboss.as.jaxrs.deployment.jaxrsscanningprocessor.deploy(jaxrsscanningprocessor.deploy(jaxrsscanningprocessor.105)
web.xml
<?xml version="1.0" encoding="UTF-8"?> <!-- This web.xml file is not required when using Servlet 3.0 container,
see implementation details >http://jersey.java.net/nonav/documentation/latest/jax-rs.html --> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >xsi:schemaLocation="http://java.sun.com/xml/ns/javaee >http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <servlet>
<servlet-name>Jersey Web Application</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet->class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>com.ph.restful.sample.RSSample</param-value>
</init-param>
<load-on-startup>1</load-on-startup> </servlet> <servlet-mapping>
<servlet-name>Jersey Web Application</servlet-name>
<url-pattern>/webapi/*</url-pattern> </servlet-mapping> </web-app>
<modelVersion>4.0.0</modelVersion>
<groupId>com.ph.restful.sample</groupId>
<artifactId>RSSample</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>RSSample</name>
<build>
<finalName>RSSample</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<inherited>true</inherited>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<version>${jersey.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<!-- use the following artifactId if you don't need servlet 2.x compatibility -->
<!-- artifactId>jersey-container-servlet</artifactId -->
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-moxy</artifactId>
</dependency>
</dependencies>
<properties>
<jersey.version>2.22.2</jersey.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
@GET
@Path("/get")
@Produces("application/json")
public Product getIt() {
Product prod = new Product();
prod.setName("PS4");
prod.setId("123");
prod.setDescription("console game");
return prod;
}
private String name;
private String id;
private String description;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
jboss-deployment-structure.x
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<exclude-subsystems>
<subsystem name="jaxrs" />
</exclude-subsystems>
<exclusions>
<module name="javax.ws.rs.api" />
</exclusions>
<deployment>
</jboss-deployment-structure>
Here the problem is with multiple rest service implementations i.e., one is jboss rest implementation and another one is jersey.So here in this case , you may have to exclude the jaxrs of jboss by creating jboss-deployment-structure.xml file and excluding that.
Example of jboss-deployment-structure.xml
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
<dependencies>
<module name="org.jboss.as.jpa"/>
<module name="org.hibernate"/>
</dependencies>
<exclude-subsystems>
<subsystem name="jaxrs" />
</exclude-subsystems>
<exclusions>
<!-- <module name="org.jboss.as.jsf"/> -->
<module name="org.jboss.as.jaxrs"/>
<module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider"/>
<module name="com.fasterxml.jackson.core.jackson-annotations"/>
<module name="com.fasterxml.jackson.core.jackson-databind"/>
<module name="com.fasterxml.jackson.core.jackson-core"/>
</exclusions>
</deployment>
</jboss-deployment-structure>
我想部署一个生成JSON的jersey restful Web服务。。但是我得到了以下错误 14:08:26743错误[org.jboss.msc.service.fail](msc服务线程1-9)MSC00001:无法启动服务jboss.deployment.unit.“RSSample.war”。POST_模块:org.jboss.msc.service.StartException in s
启动jboss服务器时,出现错误,无法启动服务jboss.deployment.unit.“jbpm console.war”。但是当我使用start.demo运行jbpm6演示时,它工作得很好。
我用父pom项目和少数模块开发Java EE应用程序。我有2个EJB模块,1个web(war)模块和1个EAR模块。当我尝试将ear模块部署到Wildfy 21.0.0时,服务器给出错误:错误[org.jboss.MSC.service.fail](MSC服务线程1-5)MSC000001:未能启动服务jboss.module.service.“deployment.leqadoviprojekt
我在启动jboss服务器时遇到以下错误。只是我安装了JBPM6.1.0,试图启动服务器和部署也失败了。 请建议... 2014-09-16 12:16:54,008错误[org.jboss.as.controller.management-Operation](部署扫描器-线程-2)JBAS014613:操作(“完全-替换-部署”)失败-地址:([])-失败描述:{“JBAS014771:Serv
问题内容: 码头工人给我一个困难时期。我按照以下说明进行操作,以便在运行由strato.de托管的Ubuntu 14.04的虚拟服务器上安装docker。 执行此行直接将我带入此错误消息: 安装完成后,我安装了上述两个软件包。现在我的问题是我无法让docker运行。 结果是: 结果是 和 结果是 有人对缺少哪些依赖项有任何线索吗?还有什么可能出问题了?码头工人是否提供任何日志? 我正在来回寻找解决
当收到来自服务器的数据报文时,显示错误日志: