NoClassDefFound issue on startup

478 views
Skip to first unread message

entrin...@gmail.com

unread,
Mar 6, 2014, 11:13:23 AM3/6/14
to hotswa...@googlegroups.com
Hello,

I'm attempting to setup the HotswapAgent for a GWT application I'm developing.  I followed the quick start instructions here (minus the hotswap-agent.properties file step):


Attached is the output I get when starting up my application.

I'm sure there's some setting I'm missing, but I'm not sure where to look.

Any help would be appreciated!

Thanks,
Holly
startup screenshot.JPG

Jiri Bubnik

unread,
Mar 7, 2014, 2:48:20 AM3/7/14
to hotswa...@googlegroups.com
The startup looks Ok (but the exception). 

Can you please add hotswap-agent.properties onto your classpath (e.g. into src/main/resources) with:
LOGGER=trace
and send the log file?

I have never tried Hotswap agent with GWT, I suspect this is because some classloading magic in WebAppContextWithReload. If you can create a fork of https://github.com/HotswapProjects/HotswapAgent and add a module with GWT simple application, i will look into it and maybe someone may even create a plugin for GWT with it.

Jiri

entrin...@gmail.com

unread,
Mar 11, 2014, 10:26:50 AM3/11/14
to hotswa...@googlegroups.com
I've attached the resulting log file to this reply.
HotswapAgent-trace-log.txt

Jiří Bubník

unread,
Mar 15, 2014, 2:47:22 PM3/15/14
to entrin...@gmail.com, hotswa...@googlegroups.com

Hi,

 

the root error is the ClassNotFoundException: org.hotswap.agent.PluginManager  using a URLClassLoader. PluginManager class is part of the HotswapAgent.jar and as such should be part of the “root” classloader and visible to all classes. Clearly this is not the case in your application. The reason could be because of some magic in GWT development mode or  maybe because of additional -javaagent:C:\Users\holly.000\.IntelliJIdea13\system\groovyHotSwap\gragent.jar.

 

Unfortunately, I am not able to tell more from the log only. If you can create an example project, I could debug it and find the problem. Or if you can find the reason why jetty classloader does not load classes from javaagent (some description of GWT dev mode classloading mechanism), I can look into it.

 

You can also try to disable jetty plugin in hotswap-agent.properties. But I am afraid, there will be similar problem for other plugins as well.

 

Jiri

Jiri Bubnik

unread,
Mar 16, 2014, 4:21:37 AM3/16/14
to hotswa...@googlegroups.com
I have created new repo https://github.com/HotswapProjects/HotswapAgentExamples, Please provide an applicaition showing the problem and I will prepare bugfix.

entrin...@gmail.com

unread,
Mar 18, 2014, 10:20:33 AM3/18/14
to hotswa...@googlegroups.com
I was able to get this working on my setup with your suggestions.  I directly added the HotswapAgent.jar as a dependency and also disabled the Jetty, Hibernate, and Spring plugins.  This allowed my system to startup and a hotswap that failed previously now works without issue.  I'll have a few of the other developers I work with try the same setup and see if they're successful as well.

uli....@googlemail.com

unread,
Apr 9, 2014, 5:13:40 AM4/9/14
to hotswa...@googlegroups.com
Hello, I have the same problem. But I run a web application on a WebSphere Liberty Profile application server. Is this possible at all? By the way, the same exception is thrown when I use spring-loaded.

uli....@googlemail.com

unread,
Apr 9, 2014, 9:45:14 AM4/9/14
to hotswa...@googlegroups.com
I disabled some plugins (Jetty,Hibernate,Spring,ZK,Tomcat,Logback,Jsf,Seam) and added HotswapAgent.jar. The exception changed to
javax.servlet.ServletException: javax.portlet.PortletException: java.lang.NoClassDefFoundError: Could not initialize class org.apache.jasper.el.ELResolverImpl
I don't know what caused the change, as I played around a lot (e.g. changed dependecies). Interestingly the exception is only thrown, if there are template variables in my JSP-view:

<c:out value="${test}" />
=> exception

<c:out value="'test'" />
=> no exception

You explained some problems with class loading issues here, https://github.com/HotswapProjects/HotswapAgent/tree/master/HotswapAgent, but I must admit that I don't understand much. It sounds to me, as you suggested not to add "HotswapAgent.jar" to the war-package, which is the contrary to what entrin...@gmail.com did for his solution.

uli....@googlemail.com

unread,
Apr 9, 2014, 10:46:42 AM4/9/14
to hotswa...@googlegroups.com
I think this log-message is interesting:

HOTSWAP AGENT: 16:41:23.357 TRACE (org.hotswap.agent.util.HotswapTransformer) - Transform on class 'org/apache/jasper/el/ELResolverImpl' @org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@37030e[com.ibm.ws.org.apache.jasper.el.2.2:1.0.1(id=91)] redefiningClass 'null'.

By the way, is the similary named plugin "ElResolverPlugin" just a coincidence?

I would really appreciate your help :)
Reply all
Reply to author
Forward
0 new messages