Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JBoss/WildFly and the fly likes Deploy two identical ears on JBoss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Deploy two identical ears on JBoss" Watch "Deploy two identical ears on JBoss" New topic
Author

Deploy two identical ears on JBoss

Michael Couck
Ranch Hand

Joined: Nov 15, 2003
Posts: 46
Hi,

I would like to deploy two identical applicaitons on one instance of JBoss. One for development connected to it's own datasource, and one for production connected to the production datasource. The trouble is of course is that the session beans all get the same JNDI string.

I've looked at two instances of JBoss on the same machine, looks messy, other than the cloned ip for the machine. Also looked at swapping the datasource on the fly, but that means development and production can't run at the same time, which is not an option. And of course two virtual operating systems on the same machine, not the VMWare type but the partition type, which also seems messy.

I suppose that two ears seems to be the best option. Trouble is that how will the client connect either to application one or application two bean if they are both called ApplicationBean? This seems like a conundrum.

Has anyone done this? Please share your wisdom great sage.

Mike
graham king
Ranch Hand

Joined: Dec 30, 2004
Posts: 133
Originally posted by Michael Couck:

This seems like a conundrum.


Nice, I think it is.

We have two JBoss instances running in production which are not on the same machine.

One machine is my beast and the other is another developer's. I use his to test new features which I point the DAO's to a staging environment. This way I don't interfere with what is currently running in production. I don't think you could get away with it without many aches and pains. Mainly because of the classloading mechanism JBoss uses. Basically it shares all the classes within each deployment. Which would mean in your case it's gonna get confused by the two deployments on the single instance.

Check my next post. It sorta deals with the problem.


write, revise, re-write, revise, again...<br />write, revise, re-write, revise, again...
Michael Couck
Ranch Hand

Joined: Nov 15, 2003
Posts: 46
Yep, read your jar loading problem which is related, Graham.

No solution there, JBoss finds two objects with the sme name in two different but identical applications and doesn't like that at all.

The light at the end of tunnel has been turned off. I will gracefully bow out of this line of thinking, and follow the less travelled road. Specifically I will reconfigure the core, which means decoupling the relationships between the Pojos and the tables and of course each other.

I owe, I owe, it's off to work I go.

Mike
graham king
Ranch Hand

Joined: Dec 30, 2004
Posts: 133
Mike,

I'm not sure if this will fix your problem, but, I was able to achieve ear isolation by adding the following to my ear deployment:

myapp.ear/META-INF/jboss-app.xml


Note: the myapp and I believe the myapp.ear should be unique names.

Here's what I gather. The ear is not fully isolated, meaning, it can still use other classes that have been deployed elsewhere or that exist on the server. However, JBoss will first look for the classes within the ear and if found use them. Which creates the ability to deploy application specific modules.

HTH,

Graham
[ October 04, 2006: Message edited by: graham king ]
Michael Couck
Ranch Hand

Joined: Nov 15, 2003
Posts: 46
Hi Graham,

Thanks for that, I think I am going to give it a twirl in fact!

See ya

Michael
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Deploy two identical ears on JBoss