3 Replies Latest reply: Feb 9, 2012 3:07 PM by Paul Robinson RSS

How to inject a class that is inside of one jboss's module?

Romulo Lana Newbie

I'm having a problem to use Inject with a classe that is inside of a module.

 

I have an application WAR that injects a class (this class is inside of: jboss-7.0.2.Final\modules\mp\ejb). The module's name is mp.ejb.

 

In the WAR application, I put the MANIFEST.MF file inside the META-INF directory (mp.ejb export). The  RemoteFactory class is inside of the module mp.ejb, but the exception happens even so.

 

Does anyone have a hint to help me?

 

The exception:

 

15:54:22,496 ERROR [org.jboss.weld.Bootstrap] (MSC service thread 1-1) Exception(s) thrown during observer of BeforeShutdown

15:54:22,496 ERROR [org.jboss.weld.Bootstrap] (MSC service thread 1-1) : java.lang.IllegalStateException: Singleton not set for ModuleClassLoader for Module "deployment.gescom-vaadin-0.0.1-SNAPSHOT.war:main" from Service Module Loader

  at org.jboss.as.weld.services.ModuleGroupSingletonProvider$TCCLSingleton.get(ModuleGroupSingletonProvider.java:73) [jboss-as-weld-7.0.2.Final.jar:7.0.2.Final]

  at org.jboss.weld.context.AbstractSharedContext.getBeanStore(AbstractSharedContext.java:54) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

  at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:94) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

  at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:693) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

  at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:264) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

...

15:54:22,500 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."gescom-vaadin-0.0.1-SNAPSHOT.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."gescom-vaadin-0.0.1-SNAPSHOT.war".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [RemoteFactory] with qualifiers [@Default] at injection point [[field] @Inject private br.gov.mg.mp.gescom.ui.presenter.unidade.UnidadeOrigemFormPresenter.remoteFactory]

  at org.jboss.as.weld.services.WeldService.start(WeldService.java:96)

  at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

  at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

...

Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [RemoteFactory] with qualifiers [@Default] at injection point [[field] @Inject privatebr.gov.mg.mp.gescom.ui.presenter.unidade.UnidadeOrigemFormPresenter.remoteFactory]

  at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:270)

      ... 5 more

 

 

 

Thanks in advance.