jersey
  1. jersey
  2. JERSEY-1941

Adding jersey-mvc to my pom.xml causes weld to fail on GF 4 deploy

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Invalid
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: extensions
    • Labels:
      None

      Description

      My project: http://walczak.it/files/PcRepairLocations3.zip

      Execption on deploy:

      SEVERE: Exception while loading the app : CDI deployment failure:WELD-001408 Unsatisfied dependencies for type [Ref<ContainerRequest>] with qualifiers [@Default] at injection point [[BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject org.glassfish.jersey.server.internal.routing.UriRoutingContext(Ref<ContainerRequest>, ProcessingProviders)]
      org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Ref<ContainerRequest>] with qualifiers [@Default] at injection point [[BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedConstructor] @Inject org.glassfish.jersey.server.internal.routing.UriRoutingContext(Ref<ContainerRequest>, ProcessingProviders)]
      at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:403)
      at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:325)
      at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:177)
      at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:208)
      at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:519)
      at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:505)
      at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:480)
      at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:536)
      at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:216)
      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)
      at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.Subject.doAs(Subject.java:356)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
      at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
      at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
      at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
      at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
      at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
      at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
      at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
      at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
      at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
      at java.lang.Thread.run(Thread.java:722)

        Activity

        Hide
        walec51 added a comment -

        The pom.xml dependencies and their scopes done by the documentation:

        <?xml version="1.0" encoding="UTF-8"?>
        <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
            <modelVersion>4.0.0</modelVersion>
        
            <groupId>pcrl</groupId>
            <artifactId>PcRepairLocations</artifactId>
            <version>1.0-SNAPSHOT</version>
            <packaging>war</packaging>
        
            <name>PcRepairLocations</name>
        
            <properties>
                <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
                <deltaspike.version>0.4</deltaspike.version>
                <netbeans.hint.deploy.server>gfv3ee6</netbeans.hint.deploy.server>
            </properties>
            
            <dependencies>
                <dependency>
                    <groupId>org.eclipse.persistence</groupId>
                    <artifactId>eclipselink</artifactId>
                    <version>2.5.0-SNAPSHOT</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.eclipse.persistence</groupId>
                    <artifactId>javax.persistence</artifactId>
                    <version>2.1.0-SNAPSHOT</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.eclipse.persistence</groupId>
                    <artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>
                    <version>2.5.0-SNAPSHOT</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>javax</groupId>
                    <artifactId>javaee-web-api</artifactId>
                    <version>7.0</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.glassfish.jersey.containers</groupId>
                    <artifactId>jersey-container-servlet</artifactId>
                    <version>2.0</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.glassfish.jersey.ext</groupId>
                    <artifactId>jersey-mvc</artifactId>
                    <version>2.0</version>
                </dependency>
                <dependency>
                    <groupId>org.glassfish.jersey.ext</groupId>
                    <artifactId>jersey-mvc-jsp</artifactId>
                    <version>2.0</version>
                </dependency>
                <dependency>
                    <groupId>org.beanio</groupId>
                    <artifactId>beanio</artifactId>
                    <version>2.1.0.M1</version>
                </dependency>
            </dependencies>
        
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>3.1</version>
                        <configuration>
                            <source>1.7</source>
                            <target>1.7</target>
                            <compilerArguments>
                                <endorseddirs>${endorsed.dir}</endorseddirs>
                            </compilerArguments>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-war-plugin</artifactId>
                        <version>2.3</version>
                        <configuration>
                            <failOnMissingWebXml>false</failOnMissingWebXml>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>2.6</version>
                        <executions>
                            <execution>
                                <phase>validate</phase>
                                <goals>
                                    <goal>copy</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${endorsed.dir}</outputDirectory>
                                    <silent>true</silent>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>javax</groupId>
                                            <artifactId>javaee-endorsed-api</artifactId>
                                            <version>7.0</version>
                                            <type>jar</type>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <repositories>
                <repository>
                    <url>http://download.eclipse.org/rt/eclipselink/maven.repo/</url>
                    <id>eclipselink</id>
                    <layout>default</layout>
                    <name>Repository for library EclipseLink (JPA 2.1)</name>
                </repository>
            </repositories>
        </project>
        
        Show
        walec51 added a comment - The pom.xml dependencies and their scopes done by the documentation: <?xml version= "1.0" encoding= "UTF-8" ?> <project xmlns= "http: //maven.apache.org/POM/4.0.0" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" > <modelVersion>4.0.0</modelVersion> <groupId>pcrl</groupId> <artifactId>PcRepairLocations</artifactId> <version>1.0-SNAPSHOT</version> <packaging>war</packaging> <name>PcRepairLocations</name> <properties> <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <deltaspike.version>0.4</deltaspike.version> <netbeans.hint.deploy.server>gfv3ee6</netbeans.hint.deploy.server> </properties> <dependencies> <dependency> <groupId>org.eclipse.persistence</groupId> <artifactId>eclipselink</artifactId> <version>2.5.0-SNAPSHOT</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.eclipse.persistence</groupId> <artifactId>javax.persistence</artifactId> <version>2.1.0-SNAPSHOT</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.eclipse.persistence</groupId> <artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId> <version>2.5.0-SNAPSHOT</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax</groupId> <artifactId>javaee-web-api</artifactId> <version>7.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.glassfish.jersey.containers</groupId> <artifactId>jersey-container-servlet</artifactId> <version>2.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.glassfish.jersey.ext</groupId> <artifactId>jersey-mvc</artifactId> <version>2.0</version> </dependency> <dependency> <groupId>org.glassfish.jersey.ext</groupId> <artifactId>jersey-mvc-jsp</artifactId> <version>2.0</version> </dependency> <dependency> <groupId>org.beanio</groupId> <artifactId>beanio</artifactId> <version>2.1.0.M1</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.7</source> <target>1.7</target> <compilerArguments> <endorseddirs>${endorsed.dir}</endorseddirs> </compilerArguments> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.3</version> <configuration> <failOnMissingWebXml> false </failOnMissingWebXml> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.6</version> <executions> <execution> <phase>validate</phase> <goals> <goal>copy</goal> </goals> <configuration> <outputDirectory>${endorsed.dir}</outputDirectory> <silent> true </silent> <artifactItems> <artifactItem> <groupId>javax</groupId> <artifactId>javaee-endorsed-api</artifactId> <version>7.0</version> <type>jar</type> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> </plugins> </build> <repositories> <repository> <url>http: //download.eclipse.org/rt/eclipselink/maven.repo/</url> <id>eclipselink</id> <layout> default </layout> <name>Repository for library EclipseLink (JPA 2.1)</name> </repository> </repositories> </project>
        Hide
        walec51 added a comment -

        Besides the bookstore-webapp example in jerseys repo (tag 2.0) fails with the same error...

        Show
        walec51 added a comment - Besides the bookstore-webapp example in jerseys repo (tag 2.0) fails with the same error...
        Hide
        walec51 added a comment -

        PS. I use Glassfish 4.0_b89

        Show
        walec51 added a comment - PS. I use Glassfish 4.0_b89
        Hide
        majulvez added a comment -

        Same with glassfish 4.0 final

        Show
        majulvez added a comment - Same with glassfish 4.0 final
        Hide
        Jakub Podlesak added a comment -

        GF v4 already contains Jersey MVC module, no need to bundle it with your application again.
        It is possible that this is just a bundling issue (see JERSEY-1949).

        Please try to change the scope to provided for all jersey dependencies you pull in:

                <dependency>
                    <groupId>org.glassfish.jersey.ext</groupId>
                    <artifactId>jersey-mvc-jsp</artifactId>
                    <version>2.0</version>
                    <scope>provided</scope>
                </dependency>
        

        You also do not need to explicitly define jersey-mvc dependency, as that one
        would be transitively imported via jersey-mvc-jsp.

        Does it work now?

        Also please do not forget to upgrade Jersey as described in
        http://marek.potociar.net/2013/06/13/jax-rs-2-0-and-jersey-2-0-released/

        Show
        Jakub Podlesak added a comment - GF v4 already contains Jersey MVC module, no need to bundle it with your application again. It is possible that this is just a bundling issue (see JERSEY-1949 ). Please try to change the scope to provided for all jersey dependencies you pull in: <dependency> <groupId>org.glassfish.jersey.ext</groupId> <artifactId>jersey-mvc-jsp</artifactId> <version>2.0</version> <scope>provided</scope> </dependency> You also do not need to explicitly define jersey-mvc dependency, as that one would be transitively imported via jersey-mvc-jsp. Does it work now? Also please do not forget to upgrade Jersey as described in http://marek.potociar.net/2013/06/13/jax-rs-2-0-and-jersey-2-0-released/
        Hide
        majulvez added a comment -

        Thanks

        Show
        majulvez added a comment - Thanks
        Hide
        Jakub Podlesak added a comment -

        Closing as invalid, as my understanding is this was indeed a packaging issue.
        Please feel free to re-open if you think otherwise.

        Show
        Jakub Podlesak added a comment - Closing as invalid, as my understanding is this was indeed a packaging issue. Please feel free to re-open if you think otherwise.

          People

          • Assignee:
            Unassigned
            Reporter:
            walec51
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: