[jboss-jira] [JBoss JIRA] (WFLY-9488) WeldDeployment initialisation error causes session fail-over to fail.

Emond Papegaaij (JIRA) issues at jboss.org
Wed Nov 8 03:39:00 EST 2017


    [ https://issues.jboss.org/browse/WFLY-9488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13487304#comment-13487304 ] 

Emond Papegaaij commented on WFLY-9488:
---------------------------------------

[~mkouba] Wicket-CDI injects all classes managed by Wicket. These are Wicket components, not CDI beans. You can find the code that performs the injection here: https://github.com/apache/wicket/blob/master/wicket-cdi-1.1/src/main/java/org/apache/wicket/cdi/NonContextual.java . We've reproduced this issue with Wicket classes deployed in a war inside an ear. The faulty ResourceLoader tries to lookup the class in the classloader of the ear, where it should have been searching inside the war.

With regard to this report, it seems clear that the code in {{org.jboss.as/weld.deployment.WeldDeployment}} is wrong. The constructor of {{BeanDeploymentArchiveImpl}} explicitly registers a {{ResourceLoader}} at [line 81|https://github.com/weld/as7-weld-subsystem/blob/master/subsystem/src/main/java/org/jboss/as/weld/deployment/BeanDeploymentArchiveImpl.java#L81] which is overridden directly thereafter by WeldDeployment at [line 183|https://github.com/weld/as7-weld-subsystem/blob/master/subsystem/src/main/java/org/jboss/as/weld/deployment/WeldDeployment.java#L183] by the {{ResourceLoader}} setup at [line 103|https://github.com/weld/as7-weld-subsystem/blob/master/subsystem/src/main/java/org/jboss/as/weld/deployment/WeldDeployment.java#L103].

> WeldDeployment initialisation error causes session fail-over to fail.
> ---------------------------------------------------------------------
>
>                 Key: WFLY-9488
>                 URL: https://issues.jboss.org/browse/WFLY-9488
>             Project: WildFly
>          Issue Type: Bug
>          Components: CDI / Weld
>    Affects Versions: 11.0.0.Final
>         Environment: Testen on OS X Sierra with Oracle JDK 1.8.0_152
>            Reporter: Klaasjan Brand
>            Assignee: Martin Kouba
>         Attachments: serviceregistry.patch
>
>
> At Topicus we've tested one of our Java EE applications to check compatibility with Wildfly session replication. This resulted in deserialization errors when performing a failover test.
> (WELD-001122: Failed to deserialize annotated type identified with AnnotatedTypeIdentifier)
> The application is deployed as an EAR archive containing several modules, one of them a WAR which hosts the main web frontend.
> Point of interest is our application uses Wicket (with Wicket-CDI) to inject CDI resources in Wicket pages.
> After a debugging session we concluded the "tryToLoadUnknownBackedAnnotatedType" method in the Weld class "SlimAnnotatedType" uses the wrong ResourceLoader when trying to load the class containing an injected object.
> Further debugging proved the initialisation in the WeldDeployment method "createAndRegisterAdditionalBeanDeploymentArchive" copies all of the ServiceRegistry entries of the parent BeanDeployment to the child, overwriting the already set ResourceLoader.
> I've attached a patch which prevents the overwriting of the deployment's already set entries. This fixed the replication problems with our application.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list