Maven 部署战争时的模糊解决例外
我在部署到WildFly 8.2.1时遇到了一个奇怪的错误,这与Resteasy和maven设置有关。我花了无数个小时在谷歌上搜索,结果一无所获。Maven 部署战争时的模糊解决例外,maven,jakarta-ee,jax-rs,resteasy,Maven,Jakarta Ee,Jax Rs,Resteasy,我在部署到WildFly 8.2.1时遇到了一个奇怪的错误,这与Resteasy和maven设置有关。我花了无数个小时在谷歌上搜索,结果一无所获。 -无法实例化MessageBodyReader -模糊解析异常:WELD-001318:无法解析 项目组织: -root -project --project-ear --project-main --project-rest --project-jms 根pom.xml <project xmlns="http://maven.ap
-无法实例化MessageBodyReader
-模糊解析异常:WELD-001318:无法解析 项目组织:
-root
-project
--project-ear
--project-main
--project-rest
--project-jms
根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>si.fri.liis.jmsprojekt</groupId>
<artifactId>root</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.wildfly.bom</groupId>
<artifactId>jboss-javaee-7.0-with-all</artifactId>
<version>8.2.1.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-ejb-client-bom</artifactId>
<version>8.2.0.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>3.0.10.Final</version>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.10</version>
<configuration>
<version>7</version>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<generateApplicationXml>true</generateApplicationXml>
<fileNameMapping>no-version</fileNameMapping>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.5</version>
<configuration>
<ejbVersion>3.2</ejbVersion>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
<generateClient>true</generateClient>
<clientIncludes>
<clientInclude>si/fri/liis/jmsprojekt/**/*SbRemote.class</clientInclude>
<clientInclude>si/fri/liis/jmsprojekt/**/*SbLocal.class</clientInclude>
<clientInclude>si/fri/liis/jmsprojekt/**/*Data.class</clientInclude>
<clientInclude>si/fri/liis/jmsprojekt/**/*Exception.class</clientInclude>
</clientIncludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<warName>jmsprojekt</warName>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.6</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
<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>
<parent>
<groupId>si.fri.liis.jmsprojekt</groupId>
<artifactId>root</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../root/pom.xml</relativePath>
</parent>
<artifactId>jmsprojekt</artifactId>
<packaging>pom</packaging>
<modules>
<module>jmsprojekt-ear</module>
<module>jmsprojekt-main</module>
<module>jmsprojekt-jms</module>
<module>jmsprojekt-rest</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>si.fri.liis.jmsprojekt</groupId>
<artifactId>jmsprojekt-main</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>ejb</type>
</dependency>
<dependency>
<groupId>si.fri.liis.jmsprojekt</groupId>
<artifactId>jmsprojekt-main</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>ejb-client</type>
</dependency>
<dependency>
<groupId>si.fri.liis.jmsprojekt</groupId>
<artifactId>jmsprojekt-jms</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>ejb</type>
</dependency>
<dependency>
<groupId>si.fri.liis.jmsprojekt</groupId>
<artifactId>jmsprojekt-rest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>war</type>
</dependency>
</dependencies>
</dependencyManagement>
</project>
<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>
<parent>
<groupId>si.fri.liis.jmsprojekt</groupId>
<artifactId>jmsprojekt</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>jmsprojekt-rest</artifactId>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
</dependency>
<dependency>
<groupId>si.fri.liis.jmsprojekt</groupId>
<artifactId>jmsprojekt-main</artifactId>
<type>ejb</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
4.0.0
si.fri.liis.jmsprojekt
从您的链接日志中,看起来您包含了两次resteasy
,它可能来自您的“rest pom.xml”。它看起来像是对resteasy
的依赖,可能默认为compile
scope。与对javaee
的依赖性相同。这两者都应在范围内提供
原因:org.jboss.weld.exceptions.AmbiguousResolutionException:weld-001318:无法解决以下两者之间的不明确依赖关系:
-带有限定符[@Any@Default]的托管Bean[class org.jboss.resteasy.plugins.providers.jaxb.JAXBXmlSeeAlsoProvider],
-带有限定符[@Any@Default]的托管Bean[class org.jboss.resteasy.plugins.providers.jaxb.JAXBXmlSeeAlsoProvider]
从您的链接日志来看,您似乎包含了两次resteasy
,它可能来自您的“restpom.xml”。它看起来像是对resteasy
的依赖,可能默认为compile
scope。与对javaee
的依赖性相同。这两者都应在范围内提供
原因:org.jboss.weld.exceptions.AmbiguousResolutionException:weld-001318:无法解决以下两者之间的不明确依赖关系:
-带有限定符[@Any@Default]的托管Bean[class org.jboss.resteasy.plugins.providers.jaxb.JAXBXmlSeeAlsoProvider],
-带有限定符[@Any@Default]的托管Bean[class org.jboss.resteasy.plugins.providers.jaxb.JAXBXmlSeeAlsoProvider]
我想可能就是这样。我在所有项目上设置了提供的范围,现在似乎可以工作了。我会等一天接受答案,以防万一,我不相信马文我想你可以相信maven。我个人更喜欢格拉德尔。记住(或确定)您的容器提供了什么是很重要的,因为这样的问题可能会出现。WildFly试图从其隐式模块中找出应用程序需要什么。这可能会提供一些见解。我想可能就是这样。我在所有项目上设置了提供的范围,现在似乎可以工作了。我会等一天接受答案,以防万一,我不相信马文我想你可以相信maven。我个人更喜欢格拉德尔。记住(或确定)您的容器提供了什么是很重要的,因为这样的问题可能会出现。WildFly试图从其隐式模块中找出应用程序需要什么。这可能会提供一些见解。
<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>
<parent>
<groupId>si.fri.liis.jmsprojekt</groupId>
<artifactId>jmsprojekt</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>jmsprojekt-rest</artifactId>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
</dependency>
<dependency>
<groupId>si.fri.liis.jmsprojekt</groupId>
<artifactId>jmsprojekt-main</artifactId>
<type>ejb</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>