我正在尝试将一个Web应用程序(.war)部署到glassfish v4。相同的应用程序适用于jetty(通过maven-jetty-plugin)。
该应用程序使用jersey 2.7,eclipselink 2.5.0和servlet 3.0规范。
当我尝试从管理控制台进行部署时,我在错误日志中得到以下内容(摘录,原始邮件超过300行,http://pastebin.com/UTNt5EHM完整版)
2014-05-21T17:43:55.650+0200] [glassfish 4.0] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=34 _ThreadName=admin-listener(3)] [timeMillis: 1400687035650] [levelValue: 1000] [[
Exception while loading the app : CDI deployment failure:Exception List with 4 exceptions:
Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Configuration] with qualifiers [@Default] at injection point [[BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject public org.glassfish.jersey.message.filtering.SecurityServerScopeProvider(Configuration, ServiceLocator)]
at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:403)
[...]
Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Configuration] with qualifiers [@Default] at injection point [[BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject public org.glassfish.jersey.message.filtering.CommonScopeProvider(Configuration, ServiceLocator)]
at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:403)
[...]
Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [EntityGraphProvider] with qualifiers [@Default] at injection point [[BackedAnnotatedField] @Inject private org.glassfish.jersey.message.filtering.EntityInspectorImpl.graphProvider]
at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:403)
[...]
Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Configuration] with qualifiers [@Default] at injection point [[BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject public org.glassfish.jersey.message.filtering.ServerScopeProvider(Configuration, ServiceLocator)]
at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:403)
[...]
war文件包含以下内容:
Length Date Time Name
--------- ---------- ----- ----
0 2014-05-21 17:49 META-INF/
131 2014-05-21 17:49 META-INF/MANIFEST.MF
0 2014-05-20 21:26 WEB-INF/
0 2014-05-20 21:26 WEB-INF/lib/
0 2014-05-20 21:26 WEB-INF/classes/
0 2014-05-20 21:26 WEB-INF/classes/de/
0 2014-05-20 21:26 WEB-INF/classes/de/sitl/
0 2014-05-20 21:26 WEB-INF/classes/de/sitl/dev/
0 2014-05-20 21:26 WEB-INF/classes/de/sitl/dev/games/
0 2014-05-20 21:26 WEB-INF/classes/de/sitl/dev/games/game00/
0 2014-05-20 21:26 WEB-INF/classes/META-INF/
780 2014-05-20 18:25 WEB-INF/web.xml
962808 2014-05-15 19:01 WEB-INF/lib/jersey-guava-2.7.jar
15988 2014-05-19 14:53 WEB-INF/lib/jetty-continuation-9.1.1.v20140108.jar
111466 2014-05-19 20:35 WEB-INF/lib/jetty-webapp-9.1.1.v20140108.jar
67151 2014-05-15 19:01 WEB-INF/lib/hk2-utils-2.2.0.jar
333974 2014-05-19 14:53 WEB-INF/lib/jetty-util-9.1.1.v20140108.jar
26366 2014-05-15 19:01 WEB-INF/lib/javax.annotation-api-1.2.jar
68682 2014-05-16 17:59 WEB-INF/lib/jersey-entity-filtering-2.7.jar
15714 2014-05-15 19:01 WEB-INF/lib/jersey-container-servlet-2.7.jar
103252 2014-05-19 14:53 WEB-INF/lib/jetty-http-9.1.1.v20140108.jar
100227 2014-05-19 14:53 WEB-INF/lib/jetty-io-9.1.1.v20140108.jar
399677 2014-05-19 14:53 WEB-INF/lib/jetty-server-9.1.1.v20140108.jar
25110 2014-05-19 17:46 WEB-INF/lib/jersey-container-jetty-http-2.7.jar
112758 2014-05-15 19:01 WEB-INF/lib/javax.ws.rs-api-2.0.jar
5596 2014-05-21 17:34 WEB-INF/lib/game00-service-core-rest-0.0.1-SNAPSHOT.jar
714195 2014-05-15 19:01 WEB-INF/lib/javassist-3.18.1-GA.jar
7724 2014-05-21 17:34 WEB-INF/lib/game00-model-core-api-0.0.1-SNAPSHOT.jar
95887 2014-05-19 20:35 WEB-INF/lib/jetty-security-9.1.1.v20140108.jar
110637 2014-05-19 20:35 WEB-INF/lib/jetty-servlet-9.1.1.v20140108.jar
708636 2014-05-15 19:01 WEB-INF/lib/jersey-common-2.7.jar
2838580 2014-05-15 18:58 WEB-INF/lib/derby-10.10.2.0.jar
142439 2014-05-15 19:01 WEB-INF/lib/hk2-api-2.2.0.jar
5968 2014-05-15 19:01 WEB-INF/lib/javax.inject-2.2.0.jar
95806 2014-05-19 22:31 WEB-INF/lib/javax.servlet-api-3.1.0.jar
171588 2014-05-15 19:01 WEB-INF/lib/hk2-locator-2.2.0.jar
53866 2014-05-15 19:01 WEB-INF/lib/jersey-container-servlet-core-2.7.jar
63777 2014-05-15 19:01 WEB-INF/lib/validation-api-1.1.0.Final.jar
7897 2014-05-21 17:34 WEB-INF/lib/game00-model-core-jpa-0.0.1-SNAPSHOT.jar
4977121 2014-05-16 17:59 WEB-INF/lib/org.eclipse.persistence.core-2.5.0.jar
488045 2014-05-16 17:59 WEB-INF/lib/org.eclipse.persistence.moxy-2.5.0.jar
24874 2014-05-16 17:59 WEB-INF/lib/jersey-media-moxy-2.7.jar
923051 2014-05-15 19:01 WEB-INF/lib/jersey-server-2.7.jar
271208 2014-05-16 17:59 WEB-INF/lib/org.eclipse.persistence.asm-2.5.0.jar
8842 2014-05-21 17:34 WEB-INF/lib/game00-model-core-jaxb-0.0.1-SNAPSHOT.jar
41763 2014-05-19 20:35 WEB-INF/lib/jetty-xml-9.1.1.v20140108.jar
162126 2014-05-15 18:58 WEB-INF/lib/javax.persistence-2.1.0.jar
20235 2014-05-15 19:01 WEB-INF/lib/osgi-resource-locator-1.0.1.jar
6926 2014-05-19 20:35 WEB-INF/lib/jersey-container-jetty-servlet-2.7.jar
21007 2014-05-15 18:58 WEB-INF/lib/commonj.sdo-2.1.1.jar
7322 2014-05-21 17:34 WEB-INF/lib/game00-build-tools-0.0.1-SNAPSHOT.jar
8318722 2014-05-20 19:47 WEB-INF/lib/eclipselink-2.5.0.jar
14867 2014-05-15 19:01 WEB-INF/lib/aopalliance-repackaged-2.2.0.jar
151688 2014-05-15 19:01 WEB-INF/lib/jersey-client-2.7.jar
189645 2014-05-16 17:59 WEB-INF/lib/org.eclipse.persistence.antlr-2.5.0.jar
1005 2014-05-21 17:49 WEB-INF/classes/de/sitl/dev/games/game00/RestApplication$1.class
925 2014-05-21 17:49 WEB-INF/classes/de/sitl/dev/games/game00/RestApplication.class
1458 2014-05-20 21:26 WEB-INF/classes/META-INF/persistence.xml
60 2014-05-20 21:26 WEB-INF/classes/META-INF/load.sql
194 2014-05-18 17:50 test.xhtml
7266 2014-05-21 17:37 META-INF/maven/de.sitl.dev.games.game00/game00-webapp/pom.xml
132 2014-05-21 17:49 META-INF/maven/de.sitl.dev.games.game00/game00-webapp/pom.properties
--------- -------
23005162 62 files
web.xml文件包含:
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<servlet>
<servlet-name>de.sitl.dev.games.game00.RestApplication</servlet-name>
</servlet>
<servlet-mapping>
<servlet-name>de.sitl.dev.games.game00.RestApplication</servlet-name>
<url-pattern>/webapp/*</url-pattern>
</servlet-mapping>
</web-app>
persistence.xml包含:
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
version="2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="WebappPersistenceUnit"
transaction-type="RESOURCE_LOCAL">
<class>de.sitl.dev.games.game00.model.core.jpa.ConcreteUnitData</class>
<class>de.sitl.dev.games.game00.model.core.jpa.SkillData</class>
<properties>
<!-- JDBC settings -->
<property name="javax.persistence.jdbc.driver"
value="org.apache.derby.jdbc.EmbeddedDriver" />
<property name="javax.persistence.jdbc.url"
value="jdbc:derby:memory:CoreDB;create=true" />
<property name="javax.persistence.jdbc.user" value="" />
<property name="javax.persistence.jdbc.password"
value="" />
<!-- Schema settings -->
<property
name="javax.persistence.schema-generation.database.action"
value="create" />
<property
name="javax.persistence.schema-generation.create-source"
value="metadata" />
<property
name="javax.persistence.sql-load-script-source"
value="META-INF/load.sql" />
</properties>
</persistence-unit>
</persistence>
我目前不知道这意味着什么,所提及的类都不是我的代码的一部分。感觉就像在路径上缺少了一些东西,但是我认为(从泽西手册中)球衣被包含在glassfish v4中是一种假设。
答案 0 :(得分:0)
看起来Jersey已经由容器提供,因此无需将其与您的应用程序捆绑在一起。可能这是你问题的原因。您可能希望更仔细地阅读glassfish文档。
以下是您遇到同样错误的人的错误链接。它最终因用户错误/打包问题而被关闭,但评论可能会对您有所帮助。