Running Java application inside JBoss
brolly May 28, 2004 1:30 PMHi.
I currently deploy J2EE applications using ORION as my application Server. I've been trying to test JBoss to see how it compares to ORION to future developments. I've successfully configured JBoss to use most of what I need in my current applications (EJB,Web Services,JMS,etc).
Still there is one thing I couldn't manage to do so far. In some cases I need to run some applications inside my Application server, mainly it will be a thread that will be monitoring either some database data, files or listening on a port for some input from other system.
In Orion it was easy to do it. It would just be a matter of defining that in META-INF/Application.xml file of my EAR file and then simply setting auto-start in one of the orion configuration files.
Application.xml example
...
Monitor-Client.jar
...
In JBoss when I do this I will get an error during startup:
18:21:50,515 ERROR [MainDeployer] could not create deployment: file:/F:/JBoss/server/default/tmp/deploy/tmp23188eurApp2.ear-contents/Monitor-client.jar
org.jboss.deployment.DeploymentException: Network is unreachable: connect; - nested throwable: (java.net.SocketException: Network is unreachable: connect) at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:316) at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:247)
at org.jboss.deployment.ClientDeployer.create(ClientDeployer.java:93)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:778)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
How can I make this application to run inside JBoss. I've seen that I can run services inside JBoss using MBeans. Should this be the way?
I don't think that would be a good solution in this case since that would require addicional and specific coding into my application and I intend to be able to run it inside any J2EE app server and also be able to run it standalone if someday I intend to.
Could anyone please help me out?
Thanx