In having 1 JVM per application, you actually make worse use of resources. Since an application is supported by the J2EE infrastructure (JMS, JNDI, JBoss microkernel, etc) running two separate JVMs require the replication of these J2EE sub-systems in memory and in execution. Your J2EE environment is akin to an OS for your J2EE components. Your JVM encapsulates the J2EE environment, which is in turn encapsulated by your platform OS. You can and should run multiple J2EE applications (or components, depending on how distributed your application is) in the same JBoss instance on the one machine.
For the same reason you don't run two operating systems simultaneously on the same machine, you normally wouldn't run two separate J2EE environments on the same system.
Hope that explanation was not too confusing.
Not too confusing at all. Thanks for the explaination.
How do you protect against apps that are resource hogs or problematic applications that require JBoss server restarts? Does the JMX microkernel protect you against this because you have atomic control of the container?
No it doesn't. And AFAICR running with a VM security manager with more restrictions isn't fully tested either.
So if you suspect you may have to host suspicious applications (that attempt DoS via infinite thread creation for example), then you should host one application per VM process.
In that case, can you send to me a working sample-bindings.xml file? The one included in the distro has not worked for me.
Currently, I'm running JRun 4.0 and host 8-10 apps, each under their own server/JVM. The reason is I don't want suspicious apps crashing into non-suspicious apps and having to restart all apps when problems occur. I know this requires service duplication, more memory, etc., but memory is cheap these days. Granted, JRun is different than JBoss but things have worked well under these conditions. So, that's where I'm coming from when asking for multiple instances.
I am using JBoss for development purposes because it seems to integerate better with other tools that I'm using such as Maven, XDoclet, Hibernate, etc.
The one included in the distro has not worked for me.
What is not working?
What I've done is this:
- fresh install (unzip) of jboss-3.2.2.zip
- uncomment ServiceBindingManager section in jboss-service.xml file for default server.
- configure ServiceBindingManager section to use the 'ports-default' configuration (I moved and renamed the sample-bindings.xml file to /jboss-3.2.2/server/port-bindings.xml).
- start jboss via /jboss-3.2.2/bin/run.sh
- java -version output:
java version "1.4.2_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_01-b06)
Java HotSpot(TM) Client VM (build 1.4.2_01-b06, mixed mode)
- running jboss within cygwin.
exceptions are thrown in server.log file, starting with UIL problems.
Out-of-the-box, JBoss starts fine within cygwin without any exceptions.
Post the exceptions and configuration changes you've made.