Eclipse and JBoss AS 5.1 with minimal configuration
As I explained yesterday I managed to improve startup times of my JBoss AS 5.1 server dramatically by fiddling a little with the web profile provided by Red Hat. It did however give me some problems when I wanted to start/stop/deploy my web project from Eclipse since this all of a sudden did not work anymore. I decided to fix this and this is what I did.
Use the JRMP invoker proxy
Either copy the jmx-invoker-service.xml
from the default profile into your deploy
directory of your profile or apply these changes to your jmx-invoker-service.xml
file.
Change
<mbean code="org.jboss.invocation.jrmp.server.JRMPProxyFactory" name="jboss.jmx:type=adaptor,name=Invoker,protocol=http, service=proxyFactory">
<!-- Use the HTTP Invoker from conf/jboss-service.xml -->
<depends optional-attribute-name="InvokerName">
jboss:service=invoker,type=http
</depends>
...
</mbean>
to
<mbean code="org.jboss.invocation.jrmp.server.JRMPProxyFactory" name="jboss.jmx:type=adaptor,name=Invoker,protocol=jrmp, service=proxyFactory">
<!-- Use the standard JRMPInvoker from conf/jboss-service.xml -->
<depends optional-attribute-name="InvokerName">
jboss:service=invoker,type=jrmp
</depends>
...
</mbean>
and
<mbean code="org.jboss.jmx.connector.invoker.MBeanProxyRemote" name="jboss.jmx:type=adaptor,name=MBeanProxyRemote,protocol=jrmp">
<depends optional-attribute-name="MBeanServerConnection">
jboss.jmx:type=adaptor,name=Invoker,protocol=http,service=proxyFactory
</depends>
</mbean>
to
<mbean code="org.jboss.jmx.connector.invoker.MBeanProxyRemote" name="jboss.jmx:type=adaptor,name=MBeanProxyRemote,protocol=jrmp">
<depends optional-attribute-name="MBeanServerConnection">
jboss.jmx:type=adaptor,name=Invoker,protocol=jrmp,service=proxyFactory
</depends>
</mbean>
Enable the listening port for the JNP service
Edit the MBean NamingService in the jboss-service.xml
file found in the conf
directory.
Change
<attribute name="Port">-1</attribute>
to
<attribute name="Port">
<value-factory bean="ServiceBindingManager" method="getIntBinding">
<parameter>jboss:service=Naming</parameter>
<parameter>Port</parameter>
</value-factory>
</attribute>
Voila! You should now be able to start, stop and deploy your web apps in Eclipse.