-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Glassfish support #39
Comments
@edudant does it work for you after setting the org.osgi.framework.bootdelegation property? I'm still getting
|
@edudant, I've got the same problem. Setting org.osgi.framework.bootdelegation property didn't help. Also adding JVM option -Dorg.glassfish.additionalOSGiBundlesToStart didn't work. |
You must place hotswap-agent.jar into domains/domain1/lib/ext folder. After that problem with ClassNoFoundExeception and ClassDefFoundError have been solved, but than have been occur another problem. When I change code and swap it than throw exception and changes not apply:
|
Thanks for contributing the config. That saved me a lot of time. For me it is now functional with the latest GIT version of hotswap-agent and DCEVM-light-8u66 with JDK 8u66. I used the same osgi config.inside my domain.xml and placed the jar inside ext folder.I did not tested all, but I could at least update a Managed Bean. |
Payara 4.1.1163 start with the following logs: HOTSWAP AGENT: 21:53:35.341 INFO (org.hotswap.agent.HotswapAgent) - Loading Hotswap agent {0.4.0-SNAPSHOT} - unlimited runtime class redefinition. What's wrong? |
It looks it couldn't happened... |
But I get this exception again and again. And reloading didn't work. May be need some additional information? I can fix this exception very simply - use concurrent set. And in my fork I do this. But why this happen? |
I didn't see it at first glance, but there is a new command scheduled in command execution somewhere in HA. There should be ConcurrentHashMap as you suggested or copy of or original. Thank you for report ! |
Thanks for related works. I build latest version of hotswap and could do simple reloading of simple class. Hotswap couldn't reload fields inject into EJB, but method reloading is works. All is good on small project. But I deploy massive production web project with many dependencies and get dead lock. jstack log in attached file. |
locking on classloader fails, related issue #39
I've commented out the problematic classloader lock. It should be more stable now. But the risk of dedlock is not removed and still persists. As a last option you can increase timeout at this line , but this is hack. We must find out better solution for the new (delayed) release. |
Thanks for fix deadlock. I continue research and adapt functionality of reloading and get a some problem with project structure. I have main single war archive with many dependency. Application logic which I want reload placed in such dependencies. I try change class of some dependencies and nothing happens. I suppose that "extraClasspath" property is need for my purpose. But how I must used it? I try simply set path to .class file for dependent project ({absolute_path}/target/classes/) but this wasn't help. Or for such purpose need special plugin? |
Honestly I didn't test the extraClasspath on Payara yet. You can pass global params directly in command line
if you set params into application classes folder then theses params will be applied (and will be visible) locally in the application classloader. But the most important is the fact that the application classloader must be patched by hotswapagent to support the extraClasspath extension. Until now we have patches for Tomcat, Jetty and Wildfy not for Payara/Glassfish - may be there is the problem. |
Generally - URLClassloader is supported, however application server usually use custom classloader, which needs to be patched.
extraClasspath should point to directory (semantics similar to https://docs.oracle.com/javase/8/docs/technotes/tools/windows/classpath.html ).
Jiri
|
1.1.0-SNAPSHOT release includes improved support for glassfish. It is no more necessary to define bootdelegation to hotswap's agent classes. Hotswap-agent.jar in domain/lib/ext is still needed. |
Glassfish is based on OSGI.
Currently it does not start at all - error
java.lang.NoClassDefFoundError: org/hotswap/agent/PluginManager
. This is because of OSGI bundle mechanism, where parent classloader delegation does not work. Look at /~https://github.com/HotswapProjects/HotswapAgent/blob/master/hotswap-agent-core/src/main/java/org/hotswap/agent/HotswapAgent.java fixJboss7Modules(), this is similar fix for JBoss. On Glassfish, you need to set "org.osgi.framework.bootdelegation" property (see https://blogs.oracle.com/swchan/entry/profiling_glassfish_3_with_jprofiler), but I was unable to do it from HotswapAgent.Support for hotswap-agent.properties needs to be developed (similar to JettyPlugin, TomcatPlugin).
Test with /~https://github.com/HotswapProjects/HotswapAgentExamples/blob/master/plain-servlet/run-tests.sh , uncomment Glassfish section.
The text was updated successfully, but these errors were encountered: