DeploymentException: CDI deployment failure:WELD-001408 Unsatisfied dependencies for type … の件.

スポンサーリンク

NetBeans IDE 7.3.1 で Maven の Web Application を作成し,サーバを GlassFish 4.0 にしてみます.

まずは素の状態で Run Project を実行し,GlassFish が起動することを確認します.

その後,Dependency に GeoIP2 を追加してみます.

<dependency>
  <groupId>com.maxmind.geoip2</groupId>
  <artifactId>geoip2</artifactId>
  <version>0.4.0</version>
</dependency>

追加後,Run Project を実行すると下記のようなエラーとなりました.

プロジェクトのログ

GlassFish Server 4.0, deploy, null, false
The module has not been deployed.
See the server log for details.
	at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:210)
	at org.netbeans.modules.maven.j2ee.ExecutionChecker.performDeploy(ExecutionChecker.java:184)
	at org.netbeans.modules.maven.j2ee.ExecutionChecker.executionResult(ExecutionChecker.java:135)
	at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:235)
	at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)

GlassFish Server 4.0 のログ

SEVERE:   Exception during lifecycle processing
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)
	at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:328)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:493)
...
Caused by: org.jboss.weld.exceptions.DeploymentException: 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.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:403)
	at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:325)
...
SEVERE:   Exception while loading the app
SEVERE:   Undeployment failed for context /hello
SEVERE:   Exception while loading the app : 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>)]
org.jboss.weld.exceptions.DeploymentException: 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.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)
...

例えば,下記のように dependency に対して exclusion を追記してみます.

<dependency>
  <groupId>com.maxmind.geoip2</groupId>
  <artifactId>geoip2</artifactId>
  <version>0.4.0</version>
  <exclusions>
    <exclusion>
      <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
      </exclusion>
  </exclusions>
</dependency>

プロジェクトを右クリックして Clean した後に再度 Run Project を行い,エラー無く GlassFish が起動することを確認します.

参考

Solving org.glassfish.deployment.common.DeploymentException: CDI deployment failure – Cassandra Datastax Java Driver, Maven, Glassfish 4
http://stackoverflow.com/questions/17770201/solving-org-glassfish-deployment-common-deploymentexception-cdi-deployment-fail