I have an EAR project I'm deploying to Jboss EAP 6.1. The product of my maven build looks like this:
myapp-ear
├── myapp-ejb.jar
├── myapp-web.war
├── lib
│ ├── activation.jar
│ ├── activiti-bpmn-converter.jar
│ ├── activiti-bpmn-model.jar
.....
│ ├── xml-apis.jar
│ └── xmlbeans.jar
└── META-INF
├── application.xml
├── hotswap-agent.properties
├── myapp-ds.xml
├── jboss-deployment-structure.xml
└── MANIFEST.MF
Here's what I get in the jboss log when when I deploy my app:
21:34:55,570 INFO [stdout] (MSC service thread 1-5) HOTSWAP AGENT: 21:34:55.569 INFO (org.hotswap.agent.config.PluginRegistry) - Plugin 'org.hotswap.agent.plugin.jbossmodules.JBossModulesPlugin' initialized in ClassLoader 'ModuleClassLoader for Module "deployment.myapp-ds.xml:main" from Service Module Loader'.
21:35:04,357 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015876: Starting deployment of "null" (runtime-name: "myapp-web.war")
21:35:04,357 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015876: Starting deployment of "null" (runtime-name: "myapp-ejb.jar")
21:35:04,781 INFO [org.jboss.as.jpa] (MSC service thread 1-3) JBAS011401: Read persistence.xml for myproject
21:35:05,306 INFO [stdout] (MSC service thread 1-7) HOTSWAP AGENT: 21:35:05.306 INFO (org.hotswap.agent.config.PluginRegistry) - Plugin 'org.hotswap.agent.plugin.jbossmodules.JBossModulesPlugin' initialized in ClassLoader 'ModuleClassLoader for Module "deployment.myapp-ear.ear:main" from Service Module Loader'.
and
21:35:05,488 INFO [stdout] (MSC service thread 1-6) HOTSWAP AGENT: 21:35:05.487 INFO (org.hotswap.agent.config.PluginRegistry) - Plugin 'org.hotswap.agent.plugin.hotswapper.HotswapperPlugin' initialized in ClassLoader 'ModuleClassLoader for Module "deployment.myapp-ear.ear.myapp-web.war:main" from Service Module Loader'.
21:35:05,520 INFO [stdout] (MSC service thread 1-4) HOTSWAP AGENT: 21:35:05.517 INFO (org.hotswap.agent.config.PluginRegistry) - Plugin 'org.hotswap.agent.plugin.jbossmodules.JBossModulesPlugin' initialized in ClassLoader 'ModuleClassLoader for Module "deployment.myapp-ear.ear.myapp-ejb.jar:main" from Service Module Loader'.
The problem is that when I deploy my ear into jboss it takes about 10 times it's normal time and when I try to access the application from a browser it throws a "PermGen space: java.lang.OutOfMemoryError: PermGen space". I tired increasing my PermGen memory to 700MB but no luck. So I suspected that hotswap-agent is watching all the classes in my EAR including the ones in the lib directory which's causing it to consume too much memory.
The next place I looked into is disabling hotswap by default, by placing autoHotswap=false in hotswap-agent.properties. I tried placing this file in the EAR as shown above and the EJB and WAR classpaths but it didn't make any difference. I also tried, to no avail, adding to the JVM_OPTS like so:
-javaagent:/workspace/tools/hotswap-agent-1.0.jar=disablePlugin=Deltaspike,disablePlugin=JavaBeans,autoHotswap=false"
So my question is, how does one control the hotswap-agent in my environment? Also is there a way to only watch classes in a specified package, say "com.foobar"? Finally, what's the right way to configure hotswap-agent for an ear deployment on jboss.