我一直在努力解决这里的问题:以前的部署错误,我已经将应用程序代码减少到最低限度。我在将应用程序部署到GlassFish 4时仍然有问题。
这里的服务器日志:
INFO: WELD-000119 Not generating any bean definitions from com.sun.faces.vendor.Tomcat6InjectionProvider because of underlying class loading error: Type org.apache.AnnotationProcessor not found. If this is unexpected, enable DEBUG logging to see the full error.
INFO: WELD-000119 Not generating any bean definitions from com.sun.faces.vendor.Jetty6InjectionProvider because of underlying class loading error: Type Lorg.mortbay.jetty.plus.annotation.InjectionCollection; not found. If this is unexpected, enable DEBUG logging to see the full error.
INFO: WELD-000119 Not generating any bean definitions from com.sun.faces.vendor.GlassFishInjectionProvider because of underlying class loading error: Type com.sun.enterprise.InjectionException not found. If this is unexpected, enable DEBUG logging to see the full error.
WARNING: WELD-001519 An InjectionTarget implementation is created for an abstract class com.sun.faces.taglib.jsf_core.MaxMinValidatorTag. It will not be possible to produce instances of this type!
WARNING: WELD-001529 An InjectionTarget implementation is created for a class javax.faces.webapp.UIComponentTag$UIComponentTagAdapter which does not have any appropriate constructor.
WARNING: WELD-001519 An InjectionTarget implementation is created for an abstract class javax.faces.webapp.UIComponentBodyTag. It will not be possible to produce instances of this type!
WARNING: WELD-001519 An InjectionTarget implementation is created for an abstract class javax.faces.webapp.ConverterELTag. It will not be possible to produce instances of this type!
WARNING: WELD-001519 An InjectionTarget implementation is created for an abstract class javax.faces.webapp.UIComponentELTag. It will not be possible to produce instances of this type!
WARNING: WELD-001519 An InjectionTarget implementation is created for an abstract class javax.faces.webapp.UIComponentClassicTagBase. It will not be possible to produce instances of this type!
WARNING: WELD-001519 An InjectionTarget implementation is created for an abstract class javax.faces.webapp.UIComponentTag. It will not be possible to produce instances of this type!
WARNING: WELD-001519 An InjectionTarget implementation is created for an abstract class javax.faces.webapp.UIComponentTagBase. It will not be possible to produce instances of this type!
WARNING: WELD-001519 An InjectionTarget implementation is created for an abstract class javax.faces.webapp.ValidatorELTag. It will not be possible to produce instances of this type!
SEVERE: Exception during lifecycle processing
org.glassfish.deployment.common.DeploymentException: CDI deployment failure:com/sun/enterprise/InjectionException
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:225)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:328)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:493)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
我还将应用程序代码推送到了GutHub:testfish1代码
应用程序包括:
- 模板.xhtml
- 索引.xhtml
- Movietest.java(实体)
- AbstractFacade.Java
- 电影FacadeRESTJava
请。如果你把贴在这里的代码用扫描一下,请告诉我
感谢您的帮助
您有两个依赖项,但未按提供列出。一个是javaee-api,另一个是java.injecthttps://gist.github.com/johnament/11327517
问题是您提供的是(意味着它被打包在WAR文件中)javaee-api
版本,它与Glassfish 4中包含的版本不同。您使用的是测试版,无论如何都不应该这样做。
将您的pom.xml
更改为最终版本,如下所示:
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<type>jar</type>
</dependency>
因为它包含在Glassfish 4中,所以您甚至可以将作用域设置为provided
除此之外,您还包括打包的web应用程序中不需要的程序包javax.inject
。您也可以将其范围设置为provided
。