Static module : org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies

Posted on

Hello all,

I'm working with JBoss-EAP-6.3 and I've got a problem with a static module creation.

A project deployed in the JBOSS has a library (config-util.jar) in its lib folder.

|_ my-ejb.jar
|_ / lib
|_ config-util.jar

The config-util.jar library uses the @Produces CDI annotation in a class :

public class ConfigMger {

    private ConfigReg configRegistry;

    public Properties get(InjectionPoint ip) {
        Config config = ip.getAnnotated().getAnnotation(Config.class);
        return configRegistry.get(config.value());

This class is injected in the ejb module my-ejb.jar and both of jars have the META-INF/beans.xml file.
Everything works fine but we would like to use this library for another projects.
That's why it should be great to transform the library into JBoss static module.

I created the mdule with all dependencies, however when I try to start JBOSS with the new module I always have this error message :

org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Properties] with qualifiers [@Default] at injection poin
t [[field] @Config @Inject private com.proxy.ProxyFactory.config]

This is the config-util.jar module.xml file :
<module xmlns="urn:jboss:module:1.1" name="com.config.config-util" slot="1.0.0">
<resource-root path="config-util-1.0.0.jar" />
<module name="javax.api" export="true" />
<module name="javax.enterprise.api" export="true" />
<module name="org.jboss.weld.spi" export="true" />
<module name="org.apache.log4j" export="false" />

This is a part of the jboss-deployment-structure.xml file contained into my-ear.ear :
<module name="com.config.config-util" export="true" slot="1.0.0" />

I assume there is a problem with the WELD analysis of the static module but I don't know what I have to do...
Anybody can help me?

Thanks in advance.