disabling weld plugin

525 views
Skip to first unread message

Jim V

unread,
Feb 8, 2016, 3:55:38 PM2/8/16
to HotswapAgent
I'm using wildfly 8.2 with CDI and EJB.  I'm having errors using the HotswapAgent.  if I make a change in one of my @Stateless beans, I get:
15:45:14,951 INFO  [stdout] (Thread-341) java.lang.reflect.InvocationTargetException
15:45:14,951 INFO  [stdout] (Thread-341) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
15:45:14,951 INFO  [stdout] (Thread-341) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
15:45:14,951 INFO  [stdout] (Thread-341) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
15:45:14,951 INFO  [stdout] (Thread-341) at java.lang.reflect.Method.invoke(Method.java:497)
15:45:14,951 INFO  [stdout] (Thread-341) at org.hotswap.agent.plugin.weld.command.BeanClassRefreshCommand.executeCommand(BeanClassRefreshCommand.java:73)
15:45:14,951 INFO  [stdout] (Thread-341) at org.hotswap.agent.command.impl.CommandExecutor.run(CommandExecutor.java:25)
15:45:14,951 INFO  [stdout] (Thread-341) Caused by: java.lang.IllegalStateException: JBAS016071: Singleton not set for ModuleClassLoader for Module "deployment.mytest.war:main" from Service Module Loader. This means that you are trying to access a weld deployment with a Thread Context ClassLoader that is not associated with the deployment.
15:45:14,951 INFO  [stdout] (Thread-341) at org.jboss.as.weld.services.ModuleGroupSingletonProvider$TCCLSingleton.get(ModuleGroupSingletonProvider.java:77)
15:45:14,951 INFO  [stdout] (Thread-341) at org.jboss.as.weld.services.ModuleGroupSingletonProvider$TCCLSingleton.get(ModuleGroupSingletonProvider.java:134)
15:45:14,951 INFO  [stdout] (Thread-341) at org.jboss.weld.Container.instance(Container.java:55)
15:45:14,951 INFO  [stdout] (Thread-341) at org.jboss.as.weld.WeldProvider.getCDI(WeldProvider.java:61)
15:45:14,951 INFO  [stdout] (Thread-341) at javax.enterprise.inject.spi.CDI.current(CDI.java:60)
15:45:14,951 INFO  [stdout] (Thread-341) at org.hotswap.agent.plugin.weld.command.BeanDeploymentArchiveAgent.reloadBean(BeanDeploymentArchiveAgent.java:179)
15:45:14,951 INFO  [stdout] (Thread-341) at org.hotswap.agent.plugin.weld.command.BeanDeploymentArchiveAgent.refreshBeanClass(BeanDeploymentArchiveAgent.java:157)
15:45:14,951 INFO  [stdout] (Thread-341) ... 6 more

I read that the weld plugin doesn't support EJB that well yet, and I should just disable it.  I did so by creating a hotswap-agent.properties file in src/main/resources, with the line:
disabledPlugins=Weld

I then try to restart wildfly, but it gives an error because the Weld plugin is disabled:
15:50:26,184 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016002: Processing weld deployment mytest.war
15:50:26,186 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."mytest.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."mytest.war".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment "mytest.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_51]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_51]
Caused by: java.lang.Error: java.lang.IllegalArgumentException: Plugin class org.hotswap.agent.plugin.weld.WeldPlugin is not initialized in classloader ModuleClassLoader for Module "deployment.mytest.war:main" from Service Module Loader.
at org.jboss.as.weld.deployment.BeanDeploymentArchiveImpl.<init>(BeanDeploymentArchiveImpl.java:95)
at org.jboss.as.weld.deployment.processors.BeanArchiveProcessor$ResourceRootHandler.createExplicitBeanDeploymentArchive(BeanArchiveProcessor.java:328)
at org.jboss.as.weld.deployment.processors.BeanArchiveProcessor$ResourceRootHandler.processResourceRoot(BeanArchiveProcessor.java:287)
at org.jboss.as.weld.deployment.processors.BeanArchiveProcessor$ResourceRootHandler.handleResourceRoot(BeanArchiveProcessor.java:221)
at org.jboss.as.weld.deployment.processors.BeanArchiveProcessor$ResourceRootHandler.access$100(BeanArchiveProcessor.java:193)
at org.jboss.as.weld.deployment.processors.BeanArchiveProcessor.deploy(BeanArchiveProcessor.java:116)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]
... 5 more
Caused by: java.lang.IllegalArgumentException: Plugin class org.hotswap.agent.plugin.weld.WeldPlugin is not initialized in classloader ModuleClassLoader for Module "deployment.mytest.war:main" from Service Module Loader.
at org.hotswap.agent.config.PluginRegistry.getPlugin(PluginRegistry.java:196) [hotswap-agent.jar:0.3.1-SNAPSHOT]
at org.hotswap.agent.config.PluginManager.getPlugin(PluginManager.java:75) [hotswap-agent.jar:0.3.1-SNAPSHOT]
at org.hotswap.agent.config.PluginManager.getPlugin(PluginManager.java:60) [hotswap-agent.jar:0.3.1-SNAPSHOT]

How can I either fix the weld plugin, or disable it (so I can at least use some of the HotswapAgent features)?  

Jim V

unread,
Feb 8, 2016, 5:09:19 PM2/8/16
to HotswapAgent
Fixed it by running with -javaagent:/path/to/hotswap-agent.jar=disablePlugin=Weld 

Not sure why I need this in addition to the properties file, but it gets rid of the error.

vladimir dvorak

unread,
Feb 10, 2016, 2:31:25 AM2/10/16
to HotswapAgent
Did you try the last version (cloned) from repository?

Jim V

unread,
Feb 10, 2016, 11:59:51 AM2/10/16
to HotswapAgent
Yes, the above was tried out with the latest version that was checked in last Friday (77eac12ee2bc51e70ba0236547758ab70f9f70f2)...

It's not working out for me, unfortunately.  If I don't disable Weld, I get the above error.  If I do disable Weld, any change I make to a method (in an EJB) isn't updated until I recompile.  No errors in the log, but my IDE (Netbeans) gives a message:
"The debugger does not support Hot fix action, details: schema change not implemented". 

I haven't had much time to debug yet though.  I'll give it another go on the weekend.

vladimir dvorak

unread,
Feb 11, 2016, 4:28:24 AM2/11/16
to HotswapAgent
I'll check if there is problem with EJBs. I've tested it with non EJBs proxied classes. Could you check if class after update  is deployed to the container in your case please? May be you have problem with hotswap configuration...
Reply all
Reply to author
Forward
0 new messages