Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2250

WeldStartService failed to start: object is not an instance of declaring class

    XMLWordPrintable

    Details

      Description

      I get following error:

      12:30:45,473 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."ear-0.0.7-SNAPSHOT.ear".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."ear-0.0.7-SNAPSHOT.ear".WeldStartService: Failed to start service
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1919)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: org.jboss.weld.exceptions.WeldException: WELD-001602: Cannot create qualifier instance model for @org.apache.camel.cdi.ContextName(value=user)
      at org.apache.camel.cdi.ContextName.value(ContextName.java:0)
      StackTrace:
      at org.jboss.weld.resolution.QualifierInstance.createValues(QualifierInstance.java:137)
      at org.jboss.weld.resolution.QualifierInstance.of(QualifierInstance.java:94)
      at org.jboss.weld.resolution.ResolvableBuilder.addQualifier(ResolvableBuilder.java:148)
      at org.jboss.weld.resolution.ResolvableBuilder.addQualifiers(ResolvableBuilder.java:198)
      at org.jboss.weld.resolution.ResolvableBuilder.addQualifiers(ResolvableBuilder.java:193)
      at org.jboss.weld.manager.BeanManagerImpl.resolveDecorators(BeanManagerImpl.java:887)
      at org.jboss.weld.injection.producer.BeanInjectionTarget.initializeAfterBeanDiscovery(BeanInjectionTarget.java:109)
      at org.jboss.weld.injection.producer.InjectionTargetInitializationContext.initialize(InjectionTargetInitializationContext.java:42)
      at org.jboss.weld.injection.producer.InjectionTargetService.initialize(InjectionTargetService.java:63)
      at org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:442)
      at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:83)
      at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:95)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1963)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1896)
      ... 3 more
      Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.jboss.weld.resolution.QualifierInstance.createValues(QualifierInstance.java:135)
      ... 16 more

      widlfly is master @ 58ce7e3c7a340f33ab183084a01c89c75ab42ac2
      weld/core is master @ 18ca45d884404cfad5fcec0c9613bc18c3556525 which is a tag for 2.4.0.Final.

      EAR contains two WARs both using an annotation org.apache.camel.cdi.ContextName coming from

      <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-cdi</artifactId>
      <version>2.17.2</version>
      </dependency>

      My assumption is, that loading of second war fails because reflection call is using a method that was actually retrieved from class loaded from first war.

      The setting:

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
      <ear-subdeployments-isolated>true</ear-subdeployments-isolated>
      </jboss-deployment-structure>

      seams to have no effect, both true and false are not working.

      WORKAROUND: move camel-cdi-2.17.2.jar to EAR's lib directory.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  manovotn Matej Novotny
                  Reporter:
                  radzimir Radoslaw Wisniewski
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: