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 EAR File in JBOSS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "EAR File in JBOSS" Watch "EAR File in JBOSS" New topic
Author

EAR File in JBOSS

V Bunny
Greenhorn

Joined: Dec 31, 2007
Posts: 20
I have a ear file for my web application which has a war file. when i deploy my ear file in jboss , the tomcat deployer deploy the war file thrice. i am totally confused with this behaviour. for your information i generated the ear file through an ant script.Please help me
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

Please post the contents of your application.xml file, the contents of your ear file (use "jar -tf your.ear") and the console log output you see when you deploy the ear file (start JBossAS first, once it is started then deploy the EAR, and post the log entries after the "Started in xxx seconds" entry).


JBoss In Action
V Bunny
Greenhorn

Joined: Dec 31, 2007
Posts: 20

[ June 29, 2008: Message edited by: V Bunny ]
V Bunny
Greenhorn

Joined: Dec 31, 2007
Posts: 20
Hi peter,

Immediate help wil be appreciated more



Bunny
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9327
    
110

Originally posted by V Bunny:
Hi peter,

Immediate help wil be appreciated more





Please be patient.


The logs you posted show that there are some errors related to log4j configurations. I did not see any logs which shows that the application is being deployed thrice. I do see that there are (probably your application's) "Thread started" log messages which show up more than once? Is this why, you think the application is being deployed more than once?


[My Blog] [JavaRanch Journal]
V Bunny
Greenhorn

Joined: Dec 31, 2007
Posts: 20
Hi Jaikiran
My war file is deployed thrice i have shown it bold in the log entries.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9327
    
110

Originally posted by V Bunny:

i have shown it bold in the log entries.


I use Firefox and did not notice the bold lines Now that i opened this post in IE, i see those log messages marked in bold.

Your application.xml looks correct. I don't see any obvious reasons why the war should be deployed multiple times. Try getting rid of those log4j errors and see if that fixes the problem. Maybe since the war wasn't deployed in the first attempt, its trying to redeploy it (which by the way, i haven't come across with any of the applications that i use).
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

Have you set up any virtual hosts? According to the code, the deployer will deploy the app once for each host. Unfortunately, the host name never shows up in the log (would be nice if it did), but the host name is used to build the mbean for the app.
V Bunny
Greenhorn

Joined: Dec 31, 2007
Posts: 20
Hi Peter
I dont think any virtual host is there. I deployed s simple ear file it deployed once only .
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

EAR is not the same as WAR, and each type is deployed with its own deployer. The WAR deployer deploys once for each virtual host. Do this. Look in jmx-console for MBeans named jboss.web:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//XXX/pms. The XXX will be the host name. There should be three of them. What are the three host names used?
V Bunny
Greenhorn

Joined: Dec 31, 2007
Posts: 20
Dear Peter,

There are three host available local host,vhost1,vost2

The trace in jmx-console

V Bunny
Greenhorn

Joined: Dec 31, 2007
Posts: 20
DEAR Peter

Thank you very much for your help. I have fixed the problem. There was two virtual host setting .Thank you so much.
V Bunny
Greenhorn

Joined: Dec 31, 2007
Posts: 20
Dear Peter,

What is the use of having jboss-web.xml in the application. Why to set virtual host.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

The virtual host setting enables you to offer web apps on different IP addresses. For example, one app could be accessible from http://www.somehost.com, and the other from http://www.otherhost.org.
V Bunny
Greenhorn

Joined: Dec 31, 2007
Posts: 20
Hi Peter,

So the war file has to be deployed in each server huh? for eg:if i have two virtual host 172.0.0.19 and 172.0.0.20 then i have to deploy the war in both the server then only i can access the application
in both know //172.0.0.19:8080/myapp and //172.0.0.20:8080/myapp
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EAR File in JBOSS
 
Similar Threads
deploying on jboss
Deployment wars inside ear
EAR File in JBOSS
What's the point of an ear file?
Deploying EAR files on JBOSS