Search This Blog

Friday, February 3, 2017

hotswap jdk 8 with eclipse

Patch the jdk which is being used by your eclipse and your app server.

lets say jdk8

run the jar to patch the jvm

https://github.com/dcevm/dcevm/releases/download/light-jdk8u66%2B5/DCEVM-light-8u66-installer.jar


java -jar abovejar

use the altjvm option , it will create another folder in the jdk8 with name dcem



step2

download the hotswap agent which will go as a parameter in the app server start script. .e.g weblogic.


https://github.com/HotswapProjects/HotswapAgent/releases/download/RELEASE-0.3/HotswapAgent-0.3.zip



add this to java options of the start server

-XXaltjvm=dcevm -javaagent:/usr/local/hotswapagent/hotswap-agent.jar=autoHotswap=true


now restart the app server and develop your java project in eclipse using the same jdk.


Now click on run -- debug configuration and attach to the process of app server, you need to run the app server in debug mode with proper arguments in setDomain script for weblogic.




Thats it , change code compile in eclipse and its auto reflected in the target app server..

If you are working on an EAR deploy it normally from the console and check the location of exploded ear in the _WL_user folder inside tmp and locate your WARS and JARS over there.

Now change the JAR or WAR from archive to the folder keeping the name same.
Use the direct path of this folder in the build path of the eclipse project (Target folder for class files)

So if deployer has exploded your demo.ear in /domain/servers/tmp/_wluser/sdfd/demo.jar 


give this path in the output folder section on the java buld path of the project.




Friday, December 23, 2016

JBOSS wont start on jdk8

There is a known bug with JBOSS , it won’t start on JDK 8 and will be stuck on boot itself.”Brontes”…

Change standalone.bat to point to jdk 7 or apply the patch from github and build yourself.

Else use wildfly 8.



Tuesday, December 20, 2016

Find loaded class in JVM via the class loader

If you are not sure what all classes are loaded in currently running jvm.
Nice trick to find out what all classes are loaded in the JVM.

Try running this.

java -verbose:class CPTest |findstr URL

It will grep your class and will tell if that is loaded or not.



Wednesday, December 14, 2016

jmx via mission controller

To enable jmx to be used with java mission control.

append the following to the java process, while starting the process.


-Dcom.sun.management.jmxremote=true
-Dcom.sun.management.jmxremote.port=3614
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false