Hotswap Agent / Wildfly / Weld: Exception when reloading: BeanManagerImpl.contexts not accessible

626 views Asked by At

I'm using WildFly, and have properly configured Hotswap Agent 1.0 as far as I can see. It's starting up nicely with the message:

HOTSWAP AGENT: 20:01:19.893 INFO (org.hotswap.agent.HotswapAgent) - Loading Hotswap agent {1.0} - unlimited runtime class redefinition.
HOTSWAP AGENT: 20:01:21.096 INFO (org.hotswap.agent.config.PluginRegistry) - Discovered plugins: [Hotswapper, WatchResources, AnonymousClassPatch, ClassInitPlugin, Hibernate, Hibernate3JPA, Hibernate3, Spring, Jersey1, Jersey2, Jetty, Tomcat, ZK, Logback, Log4j2, MyFaces, Mojarra, Seam, ELResolver, WildFlyELResolver, OsgiEquinox, Proxy, WebObjects, Weld, JBossModules, ResteasyRegistry, Deltaspike, JavaBeans]
20:01:22,363 INFO  [org.jboss.modules] (main) JBoss Modules version 1.5.1.Final

However every time I modify a class, I get the following WARNING in the console log. Modified classes are not properly reloaded.

19:56:07,946 INFO  [stdout] (Thread-281) HOTSWAP AGENT: 19:56:07.946 WARNING (org.hotswap.agent.plugin.weld.command.BeanDeploymentArchiveAgent) - BeanManagerImpl.contexts not accessible
19:56:07,947 INFO  [stdout] (Thread-281) java.lang.NoSuchFieldException: contexts
19:56:07,948 INFO  [stdout] (Thread-281)    at java.lang.Class.getField(Class.java:1703)
19:56:07,948 INFO  [stdout] (Thread-281)    at org.hotswap.agent.plugin.weld.command.BeanDeploymentArchiveAgent.getContexts(BeanDeploymentArchiveAgent.java:269)
19:56:07,948 INFO  [stdout] (Thread-281)    at org.hotswap.agent.plugin.weld.command.BeanDeploymentArchiveAgent.reloadManagedBeanInContexts(BeanDeploymentArchiveAgent.java:318)
19:56:07,948 INFO  [stdout] (Thread-281)    at org.hotswap.agent.plugin.weld.command.BeanDeploymentArchiveAgent.reloadManagedBean(BeanDeploymentArchiveAgent.java:297)
19:56:07,948 INFO  [stdout] (Thread-281)    at org.hotswap.agent.plugin.weld.command.BeanDeploymentArchiveAgent.reloadBean(BeanDeploymentArchiveAgent.java:231)
19:56:07,948 INFO  [stdout] (Thread-281)    at org.hotswap.agent.plugin.weld.command.BeanDeploymentArchiveAgent.refreshBeanClass(BeanDeploymentArchiveAgent.java:192)
19:56:07,948 INFO  [stdout] (Thread-281)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
19:56:07,949 INFO  [stdout] (Thread-281)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
19:56:07,949 INFO  [stdout] (Thread-281)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
19:56:07,949 INFO  [stdout] (Thread-281)    at java.lang.reflect.Method.invoke(Method.java:497)
19:56:07,949 INFO  [stdout] (Thread-281)    at org.hotswap.agent.plugin.weld.command.BeanClassRefreshCommand.executeCommand(BeanClassRefreshCommand.java:93)
19:56:07,949 INFO  [stdout] (Thread-281)    at org.hotswap.agent.command.impl.CommandExecutor.run(CommandExecutor.java:25)
19:56:07,950 INFO  [stdout] (Thread-281) 
19:56:08,030 INFO  [stdout] (Thread-282) HOTSWAP AGENT: 19:56:08.030 INFO (org.hotswap.agent.plugin.wildfly.el.PurgeWildFlyBeanELResolverCacheCommand) - Cleaning  BeanPropertiesCache lgc.mysynap.ui.components.SourcePopup ModuleClassLoader for Module "deployment.mysynap-0.1.war:main" from Service Module Loader.

Any idea what could be the cause?

1

There are 1 answers

0
Mehrnoosh On

I had the same problem, after disabling all breakpoint in the running time, it will work. then you need to activate breakpoints again.