Hotswap Agent with embedded Jetty, Spring, Hibernate

1,034 views
Skip to first unread message

Duy Tùng Trần

unread,
Oct 15, 2014, 5:56:51 AM10/15/14
to hotswa...@googlegroups.com
Hi, I encountered a problem when ran a embedded Jetty server with a web app based on Spring, Hibernate
This is the log:
Caused by: org.hotswap.agent.javassist.NotFoundException: buildSessionFactory(..) is not found in org.hibernate.cfg.Configuration

I just follow the installation guide in here http://tirthalpatel.blogspot.com/2014/06/steps-to-setup-hotswap-agent-in-eclipse.html

Any idea?
Thanks,

Jiří Bubník

unread,
Oct 15, 2014, 7:18:15 AM10/15/14
to Duy Tùng Trần, hotswa...@googlegroups.com

Hi,

 

Which Hibernate version do you use? Hibernate 3x is not fully supported yet.

 

See https://github.com/HotswapProjects/HotswapAgent/blob/master/plugin/hotswap-agent-hibernate-plugin/run-tests.sh for tested versions.

 

You can disable the plugin by specifying command line option:

-javaagent:c:\java\hotswap-agent.jar=disablePlugin=hibernate

 

Jiri

--
You received this message because you are subscribed to the Google Groups "HotswapAgent" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hotswapagent...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Duy Tùng Trần

unread,
Oct 16, 2014, 11:23:57 PM10/16/14
to hotswa...@googlegroups.com, duyt...@gmail.com
Thank Jiri,
I did disable Hibernate by properties file. But I found that the Hotswap Agent setup doesn't work with even a simple main method. This is my setup:
https://groups.google.com/forum/#!msg/hotswapagent/5tCnkRayv8g/0dC__VVpPEgJ

Jiří Bubník

unread,
Oct 17, 2014, 3:00:42 AM10/17/14
to Duy Tùng Trần, hotswa...@googlegroups.com

If you try

java -version

do you see DCEVM info?

 

When you start your application, do you see output like:

HOTSWAP AGENT: 9:49:29.548 INFO (org.hotswap.agent.HotswapAgent) - Loading Hotswap agent - unlimited runtime class redefinition.

HOTSWAP AGENT: 9:49:29.725 INFO (org.hotswap.agent.config.PluginRegistry) - Discovered plugins: [org.hotswap.agent.plugin.hotswapper.HotswapperPlugin, org.hotswap.agent.plugin.jvm.AnonymousClassPatchPlugin, org.hotswap.agent.plugin.hibernate.HibernatePlugin, org.hotswap.agent.plugin.spring.SpringPlugin, org.hotswap.agent.plugin.jetty.JettyPlugin, org.hotswap.agent.plugin.tomcat.TomcatPlugin, org.hotswap.agent.plugin.zk.ZkPlugin, org.hotswap.agent.plugin.logback.LogbackPlugin]

 

What does it mean, that it “does not work”. There are two ways how to apply code changes:

·        Use Eclipse debug mode and apply changes manually

·        Or use -javaagent:c:\java\hotswap-agent.jar=autoHotswap=true to apply changes automatically

which one do you use and what is the result?

 

Jiri

 

Duy Tùng Trần

unread,
Oct 17, 2014, 8:14:36 AM10/17/14
to hotswa...@googlegroups.com, duyt...@gmail.com
Hi Jiri,
I used Eclipse. "Doesn't work" means when I change java file and save, nothing happens. But I did see the log you mentioned:


HOTSWAP AGENT: 9:49:29.548 INFO (org.hotswap.agent.HotswapAgent) - Loading Hotswap agent - unlimited runtime class redefinition.

HOTSWAP AGENT: 9:49:29.725 INFO (org.hotswap.agent.config.PluginRegistry) - Discovered plugins: [org.hotswap.agent.plugin.hotswapper.HotswapperPlugin, org.hotswap.agent.plugin.jvm.AnonymousClassPatchPlugin, org.hotswap.agent.plugin.hibernate.HibernatePlugin, org.hotswap.agent.plugin.spring.SpringPlugin, org.hotswap.agent.plugin.jetty.JettyPlugin, org.hotswap.agent.plugin.tomcat.TomcatPlugin, org.hotswap.agent.plugin.zk.ZkPlugin, org.hotswap.agent.plugin.logback.LogbackPlugin]



Reply all
Reply to author
Forward
0 new messages