Hotswap with weblogic and eclipse

1,092 views
Skip to first unread message

Adithya Narayan

unread,
Apr 8, 2016, 6:04:02 AM4/8/16
to HotswapAgent
Hi,

We are using Weblogic/JBoss server for deploying our EARs. We are using eclipse for development. Looking at the quick start guide it seems that the application needs to be started from an IDE. Currently, we can't launch the application from eclipse since, it's a huge application. Is there a way to specify the hotswapagent to look for modified files from a location as we do in JRebel ? There is a properties file but i don't know if that can act as the rebel.xml file for looking up the modified classes. We were specifying the rebel.xml files inside all the jars of the EAR. 

Glad if anyone can guide us through the setup.

Thanks and Regards,
Adithya Narayan 

vladimir dvorak

unread,
Apr 10, 2016, 2:39:16 AM4/10/16
to HotswapAgent
It is not necessary to start the app from IDE. You can use extraClasspath parameter in hotswap-agent.properties to set desired path. You can put this file into your project or define path in start command via -DpropertiesFilePath=... Even you can use hotswap without any IDE support with autoHotswap=true. Look at http://hotswapagent.org/quick-start/configuration

Adithya Narayan

unread,
Apr 13, 2016, 4:08:06 AM4/13/16
to HotswapAgent
Thanks Vladimir. We are facing an issue on weblogic server with DCEVM. Whenever i am changing the code and compiling the class file in IDE and my server debugger is on, i think while reloading something is going wrong and my server is crashing with the following message:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000007d46180, pid=25304, tid=24784
#
# JRE version: Java(TM) SE Runtime Environment (7.0_67-b01) (build 1.7.0_67-b01)
# Java VM: Dynamic Code Evolution 64-Bit Server VM (24.71-b01-dcevmlight-2 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# V  [jvm.dll+0x176180]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Oracle\MIDDLE~2\user_projects\domains\GasOps\hs_err_pid25304.log
#
# If you would like to submit a bug report, please visit:
#

I am not launching the server via IDE. Secondly, on jetty server where i am running spring, it seems to do hotswap correctly but i get the following message on console as follows:

HOTSWAP AGENT: 13:27:6.354 ERROR (org.hotswap.agent.plugin.spring.signature.ClassfileSignatureComparer) - Error reading siganture
org.hotswap.agent.javassist.NotFoundException: com.sungard.energy.aligne.aligneweb.scheduling.LoadsDVO
        at org.hotswap.agent.javassist.ClassPool.get(ClassPool.java:445)
        at org.hotswap.agent.javassist.bytecode.Descriptor.toCtClass(Descriptor.java:577)
        at org.hotswap.agent.javassist.bytecode.Descriptor.getParameterTypes(Descriptor.java:430)
        at org.hotswap.agent.javassist.CtBehavior.getParameterTypes(CtBehavior.java:286)
        at org.hotswap.agent.plugin.spring.signature.CtClassSignature.getMethodString(CtClassSignature.java:35)
        at org.hotswap.agent.plugin.spring.signature.CtClassSignature.get(CtClassSignature.java:65)
        at org.hotswap.agent.plugin.spring.signature.ClassfileSignatureComparer.isPoolClassDifferent(ClassfileSignatureComparer.java:24)
        at org.hotswap.agent.plugin.spring.SpringChangesAnalyzer.classChangeNeedsReload(SpringChangesAnalyzer.java:43)
        at org.hotswap.agent.plugin.spring.SpringChangesAnalyzer.isReloadNeeded(SpringChangesAnalyzer.java:36)
        at org.hotswap.agent.plugin.spring.SpringPlugin$1.transform(SpringPlugin.java:80)
        at org.hotswap.agent.util.HotswapTransformer.transform(HotswapTransformer.java:129)
        at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
        at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)

Is there a way to know more information or get around these problems ? 

Thanks !

Adithya Narayan

unread,
Apr 21, 2016, 11:20:00 AM4/21/16
to HotswapAgent
Looks like it was a problem with Weblogic server. Some error related to permissions !

It is working on JBoss. I had few questions on it though. I don't think i understand what the HotSwapAgent documentation says on the following :

# Watch for changed class files on watchResources path and reload class definition in the running application.
#
# Usually you will launch debugging session from your IDE and use standard hotswap feature.
# This property is useful if you do not want to use debugging session for some reason or
# if you want to enable hotswap at runtime environment.
#
# Internally this uses java Instrumentation API to reload class bytecode. If you need to use JPDA API instead,
# specify autoHotswap.port with JPDA port.
autoHotswap=false

# Create Java Platform Debugger Architecture (JPDA) connection on autoHotswap.port, watch for changed class files
# and do the hotswap (reload) in background.
#
# You need to specify JPDA port at startup
# 
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000
# autoHotswap.port=8000

I am currently having autoHotswap=true and i have specified a port for debugger (8003).

Now, i am having two JDWP debugger ports 9996 and 8003 and i am debugging on 9996. Whenever i debug and make changes in a method, Eclipse tells me that some code changes couldn't be hot swapped and gives me 3 options 'Continue', 'Disconnect' and 'Cancel' (not sure on the 3rd one). I disconnect and i reconnect. Most of the times what i have observed is the code changes aren't reflected / hot swapped. Sometimes when it works i have to do the operation twice to ensure the changes are hot swapped.

Am i doing something wrong ? Can you please help me to correct the configuration if it's wrong ?
Reply all
Reply to author
Forward
0 new messages