CDI部署失败:com / sun / enterprise / InjectionException

时间:2014-04-26 13:26:46

标签: maven jsf java-ee cdi glassfish-4

我一直在尝试解决问题:Previous Deployment error并且我已将应用程序代码减少到最少。 我仍然无法将应用程序部署到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 code

申请表包括:

  1. 的template.xhtml
  2. 的index.xhtml
  3. Movietest.java(实体)
  4. AbstractFacade.Java
  5. MovieFacadeREST.Java
  6. PLS。如果你想知道这里发布的代码,请告诉我

    感谢您的帮助

2 个答案:

答案 0 :(得分:1)

问题是你提供的(意味着它包装在你的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
除此之外,您还要包含程序包javax.inject,这在打包的Web应用程序中是不需要的。您也可以将其范围设置为provided

答案 1 :(得分:1)

您有两个未按提供列出的依赖项。一个是javaee-api,另一个是javax.inject。以下是为您提供更新的pom.xml的要点:https://gist.github.com/johnament/11327517