File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes Problem in deploying multiple EARs in same JBOSS having same application and EJBs in all the EARs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Problem in deploying multiple EARs in same JBOSS having same application and EJBs in all the EARs" Watch "Problem in deploying multiple EARs in same JBOSS having same application and EJBs in all the EARs" New topic
Author

Problem in deploying multiple EARs in same JBOSS having same application and EJBs in all the EARs

Shreyasi Gupta
Greenhorn

Joined: Apr 24, 2010
Posts: 2
Can anyone help me out as i have given a work to deploy two or multiple EARS in same JBOSS ,i.e. inside Default folder of JBOSS but having same application in all the EAR'S .For e.g i am currntly trying to deploy two EARS having same application and ejb's.,nd 1 application got delpoyed,the names of application are BancMateBOB.ear and BancMatePNB.ear ,both are having same war,same jar,and BancMateBOB.ear got deployed first successfully without any error,but after deploying BancMateBOB.ear ,BancMatePNB.ear could not be deployed,the error was like:



I am using JBOSS 4.0.2 CR2 and made changes in application.xml of both in METAIINF ,i have changed conteXt root as i have to And tried to make changes in ejb-jar.xml,jboss.xml and jbosscmp-jdbc,xml for BancMatePNB.ear but error came as i am showing...........please provide me the solution for the same .
Thanking you.waiting for the answer
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2516
    
  10

Welcome to JavaRanch, Shreyasi.

I have updated your post to change the "all uppercase" title to mixed case.


OCUP UML fundamental and ITIL foundation
youtube channel
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5845
    
    7

You cannot do what you are trying to do. The easiest thing to do is run multiple instances of JBoss AS and deploy only one EAR to each instance.

A harder solution is to change the JNDI names of all EJBs, and of course modify the code in each app to use the updated names.


JBoss In Action
Shreyasi Gupta
Greenhorn

Joined: Apr 24, 2010
Posts: 2
Thanks for the reply,i made chages as per you told to change the jndi names,and i changed all the <ejb-name> and <jndi- name> in ejb-jar.xml and jboss.xml but only for BancMatePNB.Ear.For BancMateBOB.ear,i didnt make any chages as it was alwaz getting deployed.And i also made changes in LookupClient.java file so that it while deploying,when ejb's get looked up,thay must get the required result as changes made in ejb.jar.xml and jboss.xml.Also i didn't have to change all the ejb's name in every code,only made changes in LookUpClient.java and through the use of variable whose value got defined in INI file.till now i have achieved the deployment of both the ears successfully,thanks you for your answers and support .

now my next task is to run each ear with different database,for that i have written two datasource in mssql-ds.xml for each of the two different ear,and again made changes in DabaseClass.java for the connections,but both are getting connected to one database only,is it posiible to make connection for each of them separately........
.
changes made in Databaseclass.java for connection:


value of LOOKUPSTR=PNB in ini file.Also some changes made in ejb-jar.xml for BancMatePNB are as follows:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in deploying multiple EARs in same JBOSS having same application and EJBs in all the EARs