简体   繁体   English

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

[英]CDI deployment failure:com/sun/enterprise/InjectionException

I've been trying to solve the Problem here: Previous Deployment error and I have reduced the application code to a minimum. 我一直在尝试解决以下问题: 以前的部署错误,并且我已将应用程序代码减少到最少。 I still have problem deploying the application to GlassFish 4. 我仍然无法将应用程序部署到GlassFish 4。

Here the Server Log: 这是服务器日志:

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)

I have also pushed the application code to GutHub: testfish1 code 我也将应用程序代码推送到了GutHub: testfish1代码

The Application consist of: 该应用程序包括:

  1. Template.xhtml 的template.xhtml
  2. Index.xhtml 的index.xhtml
  3. Movietest.java (Entity) Movietest.java(实体)
  4. AbstractFacade.Java AbstractFacade.Java
  5. MovieFacadeREST.Java MovieFacadeREST.Java

Pls. PLS。 let me know if you wand the code posted here 让我知道你是否在这里张贴代码

Thanks for any help 谢谢你的帮助

The problem is that you are providing (means it is packaged in your WAR file) a javaee-api version which is different to the one included in Glassfish 4. You are using a beta version, you shouldn't do that anyway. 问题是您正在提供(它包装在WAR文件中)一个javaee-api版本,该版本与Glassfish 4中包含的版本不同。您使用的是beta版本,无论如何都不应该这样做。

Change your pom.xml to the final version like this: 将您的pom.xml更改为最终版本,如下所示:

    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-api</artifactId>
        <version>7.0</version>
        <type>jar</type>
    </dependency>

Because it is included in Glassfish 4, you can even set the scope to provided . 因为它包含在Glassfish 4中,所以您甚至可以将作用域设置为provided
In addition to that you are including the package javax.inject , which is not needed in the packaged web application. 除此之外,您还包括软件包javax.inject ,在打包的Web应用程序中不需要。 You can set it's scope to provided too. 您也可以将其范围providedprovided

You have two dependencies that are not listed as provided. 您有两个未按提供内容列出的依赖项。 One is javaee-api, and the other is javax.inject. 一个是javaee-api,另一个是javax.inject。 Here's a gist with an updated pom.xml for you: https://gist.github.com/johnament/11327517 这是为您提供更新的pom.xml的要点: https : //gist.github.com/johnament/11327517

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 GlassFish 4.0 CDI部署失败+ Apache Spark - GlassFish 4.0 CDI deployment failure + Apache Spark CDI部署失败:WELD-001414 Bean名称不明确 - CDI deployment failure:WELD-001414 Bean name is ambiguous Java EE,Maven项目 - Glassfish4中的CDI部署失败 - Java EE, Maven project - CDI deployment failure in Glassfish4 添加依赖项时:CDI部署失败,类型Set的不满意依赖项 <Service> 与限定词@Default - When adding dependency: CDI deployment failure, Unsatisfied dependencies for type Set<Service> with qualifiers @Default com.sun.tools.javac.code.Symbol $ ClassSymbol.isSubClass上的Javac故障 - Javac failure at com.sun.tools.javac.code.Symbol$ClassSymbol.isSubClass maven 构建失败 package com.sun.tools.classfile 不存在 - maven build failure package com.sun.tools.classfile does not exist 企业Java Bean部署 - Enterprise Java Beans Deployment Tomcat部署失败 - Tomcat deployment failure Maven测试部署失败 - maven test deployment failure java.lang.ClassNotFoundException: com.sun.jersey.server.impl.container.servlet.Include from [Module \"deployment.myproject_dev.war\" from Service Modu - java.lang.ClassNotFoundException: com.sun.jersey.server.impl.container.servlet.Include from [Module \"deployment.myproject_dev.war\" from Service Modu
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM