Reputation: 20643
I'm migrating from JBoss AS 7 to Wildfly 9.0.2.
I changed the standalone.xml to add our datasources, email configuration and security (JAAS). The rest of the config are the distribution defaults.
I changed my app to use the new naming for JAAS (without java:jaas/
).
But, when I deploy my app, I get the following error:
16:58:57,777 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) WFLYWELD0006: Starting Services for CDI deployment: foo-app.ear
16:58:57,868 INFO [org.jboss.weld.Version] (MSC service thread 1-1) WELD-000900: 2.2.16 (SP1)
16:58:58,012 INFO [org.jboss.weld.deployer] (MSC service thread 1-3) WFLYWELD0009: Starting weld service for deployment foo-app.ear
16:58:58,221 INFO [org.wildfly.extension.undertow] (MSC service thread 1-8) WFLYUT0018: Host default-host starting
16:58:59,737 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 60) WFLYJPA0010: Starting Persistence Unit (phase 2 of 2) Service 'foo-app.ear#Admin'
16:58:59,737 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 59) WFLYJPA0010: Starting Persistence Unit (phase 2 of 2) Service 'foo-app.ear#ReadOnly'
16:58:59,915 INFO [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 59) HCANN000001: Hibernate Commons Annotations {4.0.5.Final}
16:59:01,847 INFO [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 59) HHH000400: Using dialect: com.foo.dialect.CADialect
16:59:01,865 INFO [org.hibernate.engine.jdbc.internal.LobCreatorBuilder] (ServerService Thread Pool -- 59) HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
16:59:01,944 INFO [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 60) HHH000400: Using dialect: com.foo.dialect.CADialect
16:59:01,946 INFO [org.hibernate.engine.jdbc.internal.LobCreatorBuilder] (ServerService Thread Pool -- 60) HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
16:59:03,752 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (ServerService Thread Pool -- 60) HHH000397: Using ASTQueryTranslatorFactory
16:59:03,758 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (ServerService Thread Pool -- 59) HHH000397: Using ASTQueryTranslatorFactory
16:59:03,762 WARN [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 60) Unrecognized value for "hibernate.hbm2ddl.auto": none
16:59:03,763 WARN [org.hibernate.cfg.SettingsFactory] (ServerService Thread Pool -- 59) Unrecognized value for "hibernate.hbm2ddl.auto": none
16:59:09,658 INFO [org.hibernate.tuple.PojoInstantiator] (ServerService Thread Pool -- 59) HHH000182: No default (no-argument) constructor for class: com.foo.entity.MotivoBaixa (class must be instantiated by Interceptor)
16:59:09,659 INFO [org.hibernate.tuple.PojoInstantiator] (ServerService Thread Pool -- 60) HHH000182: No default (no-argument) constructor for class: com.foo.entity.MotivoBaixa (class must be instantiated by Interceptor)
16:59:10,639 INFO [org.hibernate.tuple.PojoInstantiator] (ServerService Thread Pool -- 59) HHH000182: No default (no-argument) constructor for class: com.foo.invoice.ServiceInvoiceMessage (class must be instantiated by Interceptor)
16:59:10,640 INFO [org.hibernate.tuple.PojoInstantiator] (ServerService Thread Pool -- 60) HHH000182: No default (no-argument) constructor for class: com.foo.invoice.ServiceInvoiceMessage (class must be instantiated by Interceptor)
16:59:18,224 WARN [org.jboss.weld.Bootstrap] (weld-worker-1) WELD-001125: Illegal bean type com.foo.service.ListFilter<com.foo.negotiation.entity.Negotiation<?, ?>> ignored on [EnhancedAnnotatedTypeImpl] public class com.foo.negotiation.NegotiationFilter
16:59:18,236 WARN [org.jboss.weld.Bootstrap] (weld-worker-1) WELD-001125: Illegal bean type com.foo.service.ListFilter<com.foo.negotiation.entity.Negotiation<?, ?>> ignored on [EnhancedAnnotatedTypeImpl] public class com.foo.negotiation.statement.NegotiationStatementFilter
16:59:23,125 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."foo-app.ear".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."foo-app.ear".WeldStartService: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904)
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: 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:128)
at org.jboss.weld.resolution.QualifierInstance.of(QualifierInstance.java:95)
at org.jboss.weld.resolution.ResolvableBuilder.addQualifier(ResolvableBuilder.java:147)
at org.jboss.weld.resolution.ResolvableBuilder.addQualifiers(ResolvableBuilder.java:197)
at org.jboss.weld.resolution.ResolvableBuilder.addQualifiers(ResolvableBuilder.java:192)
at org.jboss.weld.manager.BeanManagerImpl.resolveDecorators(BeanManagerImpl.java:904)
at org.jboss.weld.injection.producer.BeanInjectionTarget.initializeAfterBeanDiscovery(BeanInjectionTarget.java:108)
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:431)
at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:83)
at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:93)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
... 3 more
16:59:23,240 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "foo-app.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"foo-app.ear\".WeldStartService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"foo-app.ear\".WeldStartService: Failed to start service
Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class"}}
16:59:23,342 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "foo-app.ear" (runtime-name : "foo-app.ear")
16:59:23,347 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186: Services which failed to start: service jboss.deployment.unit."foo-app.ear".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."foo-app.ear".WeldStartService: Failed to start service
16:59:23,668 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
16:59:23,669 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
16:59:23,669 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 9.0.2.Final (WildFly Core 1.0.2.Final) started (with errors) in 44463ms - Started 18381 of 21165 services (2571 services failed or missing dependencies, 283 services are lazy, passive or on-demand)
I don't understand why this error is happening and I also don't know how to find out why it is happening.
Any tips on how to debug this kind of issue (e.g., which class object it is trying to pass around to where)? Or, maybe, someone that had this problem before with some advice on how to tackle it?
Upvotes: 0
Views: 487
Reputation: 20643
I found the error by patching weld to log the error: https://github.com/weld/core/pull/1359
The logs showed that the problem was in a qualifier.
So I grep
inside the .ear
for that qualifier, and it was in multiple places:
So, I basically remove it from context1
and context2
war files and everything worked as expected.
Upvotes: 0