GlassFish 4 Web应用程序部署 [英] GlassFish 4 web application deployement

查看:120
本文介绍了GlassFish 4 Web应用程序部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在研究一个spring web应用程序(使用spring安全和spring数据jpa)

我最近得到这个错误,而且我没有任何想法如何解决它:
当我尝试部署WAr,我得到这个:

  org.glassfish .deployment.common.DeploymentException:CDI部署失败:WELD-001408带有限定符的[Set< Service>]类型的不满意依赖关系[注释点[@Default]] [[BackedAnnotatedParameter] [BackedAnnotatedConstructor]的参数1 @Inject com.google.common .util.concurrent.ServiceManager(Set< Service>)] 
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:225)
at org.glassfish.kernel.event.EventsImpl.send (EventsImpl.java:131)

任何想法在这里有什么问题?



编辑:



这里是我的pom.xml:

 <! -  Spring依赖关系 - > 
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-webmvc< / artifactId>
< version> $ {spring.version}< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-core< / artifactId>
< version> $ {spring.version}< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-web< / artifactId>
< version> $ {spring.version}< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-context< / artifactId>
< version> $ {spring.version}< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-aop< / artifactId>
< version> $ {spring.version}< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-expression< / artifactId>
< version> $ {spring.version}< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-orm< / artifactId>
< version> $ {spring.version}< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-jdbc< / artifactId>
< version> $ {spring.version}< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-dao< / artifactId>
< version> 2.0.8< / version>
< /依赖关系>


<! - spring security - >
< dependency>
< groupId> org.springframework.security< / groupId>
< artifactId> spring-security-web< / artifactId>
< version> $ {spring-security.version}< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework.security< / groupId>
< artifactId> spring-security-core< / artifactId>
< version> $ {spring-security.version}< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework.security< / groupId>
< artifactId> spring-security-config< / artifactId>
< version> $ {spring-security.version}< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework.security< / groupId>
< artifactId> spring-security-taglibs< / artifactId>
< version> $ {spring-security.version}< / version>
< /依赖关系>

<! - Spring数据JPA依赖关系 - >
< dependency>
< groupId> org.springframework.data< / groupId>
< artifactId> spring-data-jpa< / artifactId>
< version> 1.6.1.RELEASE< / version>
< /依赖关系>
< dependency>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-entitymanager< / artifactId>
< version> $ {hibernate.version}< / version>
< /依赖关系>


<! - - com.mysema.querydsl依赖关系 - >
< dependency>
< groupId> com.mysema.querydsl< / groupId>
< artifactId> querydsl-sql< / artifactId>
< version> $ {com.mysema.querydsl.version}< / version>
< /依赖关系>
< dependency>
< groupId> com.mysema.querydsl< / groupId>
< artifactId> querydsl-jpa< / artifactId>
< version> $ {com.mysema.querydsl.version}< / version>
< /依赖关系>
< dependency>
< groupId> com.mysema.querydsl< / groupId>
< artifactId> querydsl-core< / artifactId>
< version> $ {com.mysema.querydsl.version}< / version>
< /依赖关系>

<! - Hibernate依赖关系 - >
< dependency>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-core< / artifactId>
< version> $ {hibernate.version}< / version>
< /依赖关系>

<! - db - >
< dependency>
< groupId> mysql< / groupId>
< artifactId> mysql-connector-java< / artifactId>
< version> 5.1.23< / version>
< /依赖关系>

<! - 连接池 - >
< dependency>
< groupId> org.apache.tomcat< / groupId>
< artifactId> tomcat-dbcp< / artifactId>
< version> 8.0.9< / version>
< /依赖关系>

<! - thymeleaf和servlet api - >
< dependency>
< groupId> org.thymeleaf< / groupId>
< artifactId> thymeleaf-spring4< / artifactId>
< version> 2.1.2.RELEASE< / version>
< /依赖关系>
< dependency>
< groupId> javax.servlet< / groupId>
< artifactId> servlet-api< / artifactId>
< version> 2.5< / version>
< scope>提供< / scope>
< /依赖关系>

< /依赖关系>


解决方案

这个错误通常来自 Google Guava 14 .x 包装在一个Web应用程序中。



您应该知道哪个依赖项对此负责,并从该依赖项中排除Google Guava。此外,您必须添加一个新的Guava作为依赖项,例如:

 <依赖项> 
< artifactId>番石榴< / artifactId>
< groupId> com.google.guava< / groupId>
< version> 16.0< / version>
< /依赖关系>

更新:

一个快速测试表明, querydsl-core 是具有Guava依赖性的lib。排除它像这样:

 <依赖关系> 
< groupId> com.mysema.querydsl< / groupId>
< artifactId> querydsl-core< / artifactId>
< version> $ {com.mysema.querydsl.version}< / version>
<排除项>
<排除>
< artifactId>番石榴< / artifactId>
< groupId> com.google.guava< / groupId>
< /排除>
< /排除>
< /依赖关系>

(并且不要忘记对Guava 16的新依赖)

另请参阅: $ b


i'm working on a spring web application lately (with spring security and spring data jpa)

I'm getting this error lately and i don't have any idea how to solve it : when i try to deploy the WAr , i get this :

org.glassfish.deployment.common.DeploymentException: CDI deployment failure:WELD-001408 Unsatisfied dependencies for type [Set<Service>] with qualifiers [@Default] at injection point [[BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject com.google.common.util.concurrent.ServiceManager(Set<Service>)]
    at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:225)
    at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)

any idea what's the problem here ?

EDIT:

here's my pom.xml:

 <!--Spring dependencies-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-expression</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-dao</artifactId>
            <version>2.0.8</version>
        </dependency>


        <!-- spring security-->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>${spring-security.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>${spring-security.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>${spring-security.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-taglibs</artifactId>
            <version>${spring-security.version}</version>
        </dependency>

        <!-- Spring Data JPA dependencies -->
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-jpa</artifactId>
            <version>1.6.1.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>${hibernate.version}</version>
        </dependency>


        <!--com.mysema.querydsl dependencies-->
        <dependency>
            <groupId>com.mysema.querydsl</groupId>
            <artifactId>querydsl-sql</artifactId>
            <version>${com.mysema.querydsl.version}</version>
        </dependency>
        <dependency>
            <groupId>com.mysema.querydsl</groupId>
            <artifactId>querydsl-jpa</artifactId>
            <version>${com.mysema.querydsl.version}</version>
        </dependency>
        <dependency>
            <groupId>com.mysema.querydsl</groupId>
            <artifactId>querydsl-core</artifactId>
            <version>${com.mysema.querydsl.version}</version>
        </dependency>

        <!--Hibernate dependencies-->
         <dependency>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-core</artifactId>
          <version>${hibernate.version}</version>
        </dependency>

        <!--db-->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.23</version>
        </dependency>

        <!--connection pool-->
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-dbcp</artifactId>
            <version>8.0.9</version>
        </dependency>

        <!--thymeleaf and servlet api-->
        <dependency>
            <groupId>org.thymeleaf</groupId>
            <artifactId>thymeleaf-spring4</artifactId>
            <version>2.1.2.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>

    </dependencies>

解决方案

This error often comes from Google Guava 14.x being packaged in a web application.

You should find out which dependency is responsible for that, and exclude Google Guava from that dependency. Additionally you have to add a newer Guava as dependency, for example:

    <dependency>
        <artifactId>guava</artifactId>
        <groupId>com.google.guava</groupId>
        <version>16.0</version>
    </dependency>

Update:

A quick test showed that querydsl-core is the the lib which has Guava as dependency. Exclude it like this:

    <dependency>
        <groupId>com.mysema.querydsl</groupId>
        <artifactId>querydsl-core</artifactId>
        <version>${com.mysema.querydsl.version}</version>
        <exclusions>
            <exclusion>
                <artifactId>guava</artifactId>
                <groupId>com.google.guava</groupId>
            </exclusion>
        </exclusions>
    </dependency>

(And don't forget the new dependency on Guava 16)

See also:

这篇关于GlassFish 4 Web应用程序部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆