Jersey + Spring deployment failure on Glassfish : CDI issue -
i'm tryng setup glassfish + spring configuration. please find below relevant part of pom :
<dependencymanagement> <dependencies> <dependency> <groupid>org.glassfish.jersey</groupid> <artifactid>jersey-bom</artifactid> <version>${jersey.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencymanagement> <dependencies> <dependency> <groupid>org.glassfish.jersey.containers</groupid> <artifactid>jersey-container-servlet</artifactid> <scope>provided</scope> </dependency> <dependency> <groupid>javax.servlet</groupid> <artifactid>javax.servlet-api</artifactid> <version>${servlet.version}</version> <scope>provided</scope> </dependency> <dependency> <groupid>org.glassfish.jersey.ext</groupid> <artifactid>jersey-spring3</artifactid> <!--<scope>provided</scope>--> </dependency> <dependency> <groupid>org.eclipse.birt.runtime</groupid> <artifactid>org.eclipse.birt.runtime</artifactid> <version>4.2.0</version> </dependency> <dependency> <groupid>org.glassfish.jersey.containers</groupid> <artifactid>jersey-container-grizzly2-http</artifactid> <version>${jersey.version}</version> <scope>provided</scope> </dependency> <dependency> <groupid>junit</groupid> <artifactid>junit</artifactid> <version>4.9</version> <scope>test</scope> </dependency> <dependency> <groupid>org.easytesting</groupid> <artifactid>fest-assert-core</artifactid> <version>2.0m10</version> <scope>test</scope> </dependency> <dependency> <groupid>org.postgresql</groupid> <artifactid>postgresql</artifactid> <version>9.3-1100-jdbc41</version> <scope>test</scope> </dependency>
i have issue following dependency :
<dependency> <groupid>org.glassfish.jersey.ext</groupid> <artifactid>jersey-spring3</artifactid> <!--<scope>provided</scope>--> </dependency>
when specify dependency provided, deployment ok.. spring context isn't initialized. if comment provided
element, deployment ok , application running fine, deplyment fail , following weld-001408 exception :
[2014-12-16t10:21:07.618+0100] [glassfish 4.0] [severe] [ncls-core-00026] [javax.enterprise.system.core] [tid: _threadid=34 _threadname=admin-listener(3)] [timemillis: 1418721667618] [levelvalue: 1000] [[ exception during lifecycle processing org.glassfish.deployment.common.deploymentexception: cdi deployment failure:weld-001408 unsatisfied dependencies type [iterableprovider<defaulttopicdistributionerrorservice>] qualifiers [@default] @ injection point [[backedannotatedfield] @inject private org.glassfish.hk2.internal.defaulttopicdistributionservice.errorhandlers] @ org.glassfish.weld.welddeployer.event(welddeployer.java:225) @ org.glassfish.kernel.event.eventsimpl.send(eventsimpl.java:131) caused by: org.jboss.weld.exceptions.deploymentexception: weld-001408 unsatisfied dependencies type [iterableprovider<defaulttopicdistributionerrorservice>] qualifiers [@default] @ injection point [[backedannotatedfield] @inject private org.glassfish.hk2.internal.defaulttopicdistributionservice.errorhandlers] @ org.jboss.weld.bootstrap.validator.validateinjectionpointfordeploymentproblems(validator.java:403) @ org.jboss.weld.bootstrap.validator.validateinjectionpoint(validator.java:325) @ org.jboss.weld.bootstrap.validator.validategeneralbean(validator.java:177) @ org.jboss.weld.bootstrap.validator.validateribean(validator.java:208) @ org.jboss.weld.bootstrap.validator.validatebean(validator.java:519) @ org.jboss.weld.bootstrap.validator.validatebeans(validator.java:505) @ org.jboss.weld.bootstrap.validator.validatedeployment(validator.java:480) @ org.jboss.weld.bootstrap.weldbootstrap.validatebeans(weldbootstrap.java:536) @ org.glassfish.weld.welddeployer.event(welddeployer.java:216) ... 36 more ]]
i've seen many issues regarding this, still don't right way go... want rest api built jersey, benefits of spring cdi (ideally no xml spring config).
what should modify in pom make work ?
thank you.
you're victim of issue: https://issues.jboss.org/browse/cdi-377
i'm guessing since didn't provide version of glassfish using. issue has been fixed in cdi 1.2 included in glassfish 4.1. best solution update version.
if can't or don't want update can use workaround: http://weld.cdi-spec.org/documentation/#4
Comments
Post a Comment