从 jboss 迁移到 wildfly

Migrating from jboss as to wildfly

我正在从 JBoss AS 7 迁移到 Wildfly 9.0.2。

我更改了 standalone.xml 以添加我们的数据源、电子邮件配置和安全性 (JAAS)。其余配置是分发默认值。

我更改了我的应用程序以使用 JAAS 的新命名(没有 java:jaas/)。

但是,当我部署我的应用程序时,出现以下错误:

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)

我不明白为什么会发生这个错误,我也不知道如何找出它发生的原因。

关于如何调试此类问题的任何提示(例如,它试图将哪个 class 对象传递到哪里)? 或者,也许有人以前遇到过这个问题并提供了一些解决方法的建议?

我通过修补焊接发现了错误以记录错误:https://github.com/weld/core/pull/1359

日志显示问题出在限定词中。

所以我 grep.ear 里面为那个限定符,它在多个地方:

  • /库
  • /context1.war
  • /context3.war

所以,我基本上将它从 context1context2 war 文件中删除,一切都按预期工作。