1 Reply Latest reply on Sep 13, 2013 7:52 PM by klind

    Weld 7.2.0 - Null

    klind Newbie

      Hi, I have an application that worked fine on 7.1.1-Final. I now upgraded to 7.2.0

       

      I have a ear file that has several apps... including 2 web apps.

      Both apps are webservice apps.

       

      I inject a interface from one of the web apps in the other... and that worked in 7.1.1-final.

       

      Here is one of the webservice implementations from webservice.war

      @WebService(serviceName = JSIProfitWebService.WS_NAME)
      public class JSIProfitWebServiceImpl implements JSIProfitWebService {
      ...
      }
      
      
      

       

       

      And here I try i inject the JSIProfitWebService in the ppmock.war

      @WebService
      public class PrintProviderMockSoap extends HttpServlet implements ProfitWebService {
        @Inject
        private static JSIProfitWebService jsiProfitWebService;
      
      
        @Inject
      
      

       

      When Jboss starts up this is in the log.. and no errors

      14:39:44,953 INFO  [org.jboss.weld.deployer] (MSC service thread 1-7) JBAS016002: Processing weld deployment jsi-3.33.0-SNAPSHOT.ear

      14:39:45,037 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016002: Processing weld deployment ppmock.war

      14:39:45,038 INFO  [org.jboss.weld.deployer] (MSC service thread 1-11) JBAS016002: Processing weld deployment jsi-dashboard.war

      14:39:45,038 INFO  [org.jboss.weld.deployer] (MSC service thread 1-7) JBAS016002: Processing weld deployment webservice.war

      14:39:45,037 INFO  [org.jboss.weld.deployer] (MSC service thread 1-16) JBAS016002: Processing weld deployment health.war

      14:39:45,052 INFO  [org.jboss.weld.deployer] (MSC service thread 1-15) JBAS016002: Processing weld deployment websocket.war

       

      I have the beans.xml file in the deployments.

      But the

           private static JSIProfitWebService jsiProfitWebService

      is null

      Other injections through the app seems to work.

       

      To see if the WELD is actually picking up the JSIProfitWebService I copied the class JSIProfitWebServiceImpl and named the new class JSIProfitWebServiceImpl2...

      And as expected I see ...

       

      14:54:04,051 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-11) MSC00001: Failed to start service jboss.deployment.subunit."jsi-3.33.0-SNAPSHOT.ear"."ppmock.war".component."com.farheap.jsi.p

      pmock.PrintProviderMockSoap".WeldInstantiator: org.jboss.msc.service.StartException in service jboss.deployment.subunit."jsi-3.33.0-SNAPSHOT.ear"."ppmock.war".component."com.farheap.jsi.ppmock.PrintPr

      oviderMockSoap".WeldInstantiator: Failed to start service

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

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_13]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_13]

              at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_13]

      Caused by: org.jboss.weld.exceptions.AmbiguousResolutionException: WELD-001318 Cannot resolve an ambiguous dependency between [Managed Bean [class com.farheap.jsi.ws.JSIProfitWebServiceImpl2] with qua

      lifiers [@Any @Default], Managed Bean [class com.farheap.jsi.ws.JSIProfitWebServiceImpl] with qualifiers [@Any @Default]]

              at org.jboss.weld.manager.BeanManagerImpl.resolve(BeanManagerImpl.java:1036)

              at org.jboss.as.weld.injection.WeldEEInjection.createWeldEEInjection(WeldEEInjection.java:159)

              at org.jboss.as.weld.injection.WeldManagedReferenceFactory.start(WeldManagedReferenceFactory.java:154)

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

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

              ... 3 more

        • 1. Re: Weld 7.2.0 - Null
          klind Newbie

          For now I solved the problem by creating a SessionBean in the PrintProviderMockSoap, and inject the JSIProfitWebService in that SessionBean.

           

          The injection of a SessionBean in the PrintProviderMockSoap did not work either.

          1 of 1 people found this helpful