wood burning stoves 2.0*
The moose likes JBoss/WildFly and the fly likes How to set up 2 web applicaion in an ear file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "How to set up 2 web applicaion in an ear file? " Watch "How to set up 2 web applicaion in an ear file? " New topic
Author

How to set up 2 web applicaion in an ear file?

chaohua wang
Ranch Hand

Joined: Dec 22, 2002
Posts: 62
Hi Folks

I put 2 war files (pds.war and reportwriter.war ) into an ear. The 2 war files have their own jboss-web.xml file, but the content is the same, and under their own WEB-INF folder.

After I started Jboss, I got this error


----------------------------------------------------------

17:49:59,571 INFO [EJBDeployer] Deployed: file:/D:/jboss-4.0.2/server/default/t

mp/deploy/tmp48527pdss.ear-contents/rulesfw-ejb.jar

17:49:59,586 INFO [TomcatDeployer] deploy, ctxPath=/, warUrl=file:/D:/jboss-4.0

.2/server/default/tmp/deploy/tmp48527pdsstudio.ear-contents/pds-exp.war/

17:49:59,696 INFO [STDOUT] Reporting Servlet has been initalized

17:49:59,696 INFO [STDOUT] Using Reporting Pricer Version: 1.93

17:49:59,711 INFO [STDOUT] Using Reporting Point Processor Version: 1.7

17:49:59,711 INFO [STDOUT] Using Reporting Cache Manager Version: 1.0

17:50:00,039 INFO [TomcatDeployer] deploy, ctxPath=/, warUrl=file:/D:/jboss-4.0

.2/server/default/tmp/deploy/tmp48527pds.ear-contents/reportwriter-exp.war

/

17:50:00,242 INFO [EARDeployer] Started J2EE application: file:/D:/jboss-4.0.2/

server/default/deploy/pdsstudio.ear

17:50:00,398 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-808

0

17:50:00,508 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009

17:50:00,508 INFO [JkMain] Jk running ID=0 time=0/31 config=null

17:50:00,508 INFO [Server] JBoss (MX MicroKernel) [4.0.2 (build: CVSTag=JBoss_4

_0_2 date=200505022023)] Started in 24s:24ms
17:50:00,976 INFO [WebappClassLoader] Illegal access: this web application instance has been stopped already. Could not load com.RunFileFilter. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.

-------------------




com.RunFileFilter is a servlet in pds.war.

I can load the servlets in reportwriter.war, but not servlet in pdsstudio.war


Could you tell me what is wrong? Thank you!

Chaohua
shan Iyer
Ranch Hand

Joined: Jul 13, 2005
Posts: 391
Post ur web.xml for both the war files.......and dont forget to paste web.xml under webroot in ur application.

rgrds,
Shankar


Warm Regards, S.Iyer
SCJP1.4, SCWCD1.4
chaohua wang
Ranch Hand

Joined: Dec 22, 2002
Posts: 62
Shankar,

Thank you much for your reply.

I wonder where is webroot directory in Jboss. I put the web.xml under WEB-INF.

Here I pasted 2 web.xml files. please help.

Chaohua
---------------

web.xml for pds
---------------

?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<display-name>PDS Studio Web Module</display-name>
<description>Web module for the PDSWebsite</description>

<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>

<servlet>
<servlet-name>OutputServer</servlet-name>
<servlet-class>com.OutputServer</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>OutputServer</servlet-name>
<url-pattern>/servlet/OutputServer.*</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>pdshelp</servlet-name>
<servlet-class>com.StudioHTMLHelp</servlet-class>
</servlet>
</web-app>

------------------------------
web.xml for reportwriter.war
----------------

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">


<web-app>

<display-name>Eclipse BIRT Report Viewer</display-name>

<servlet-name>ViewerServlet</servlet-name>
<servlet-class>org.eclipse.birt.report.viewer.servlets.ViewerServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>ViewerServlet</servlet-name>
<url-pattern>/frameset</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>ViewerServlet</servlet-name>
<url-pattern>/run</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>ViewerServlet</servlet-name>
<url-pattern>/navigation</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>ViewerServlet</servlet-name>
<url-pattern>/toolbar</url-pattern>
</servlet-mapping>


<session-config>
<session-timeout>30</session-timeout>
</session-config>


</web-app>
shan Iyer
Ranch Hand

Joined: Jul 13, 2005
Posts: 391
Chaohua,

com.RunFileFilter is a servlet in pds.war.


There is no reference to the above servlet in pds.war's web.xml.

Also, what is the need for so many url-patterns for a single servlet in reportwriter.war? Though there is no harm in this, it could make life tough when you need to configure your web.xml as and when you add Servlets and JSPs to your .war files.
Post your status after making a reference to RunFileFilter in your web.xml.

rgrds,
Shankar
chaohua wang
Ranch Hand

Joined: Dec 22, 2002
Posts: 62
Shankar,

thank you! Sorry I forgot to put in in the post.


But I still got the error after I started Jboss
----------------------------------------------------------
17:50:00,976 INFO [WebappClassLoader] Illegal access: this web application instance has been stopped already. Could not load com.runfilter. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.

-------------------

the interesting is after I changed "UseJBossWebLoader" attribuate from false (default) to true in Jboss-service.xml in server\default\deploy\jbossweb-tomcat55.sar\META-INF, then started Jboss again. this error is gone, looks perfect. But still one pds.war is not loaded. What is worng?

<!-- A flag indicating if the JBoss Loader should be used. This loader
uses a unified class loader as the class loader rather than the tomcat specific class loader.The default is false to ensure that wars have isolated class loading for duplicate jars and jsp files. -->
<attribute name="UseJBossWebLoader">true</attribute>

Thank you!
Chaohua
shan Iyer
Ranch Hand

Joined: Jul 13, 2005
Posts: 391
Chaohua,

Its not possible to debug withot looking into the servlets and deployment descriptors. (web.xml, jbossweb.xml).Also , are u modifying ur login-config.xml or ur auth.conf file by any chance??
Why dont u send me ur application at shankarniyer@rediffmail.com

We'll work it out!!!

rgrds,
Shankar
chaohua wang
Ranch Hand

Joined: Dec 22, 2002
Posts: 62
Shankar,

Thank you. they are 2 different web applicaions. jboss-web.xml is like the following. I got 2 warns. And the error is still there.
I think the reason is 2 different applications should be loaded by the different loader. Actually my applications are very simple. I can make any one of them work in Jboss. but not both. The error is still there.

chwang

---
<jboss-web>
<class-loading java2ClassLoadingCompliance='false'>
<loader-repository>
domain.biz:loader=pds.war
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
</class-loading>

<context-root>/</context-root>
<virtual-host>pds</virtual-host>
<virtual-directory virtual-path="/arcimsoutputs" real-path="/O:/" />
<virtual-directory virtual-path="/outputs" real-path="/D:/outputs" />

</jboss-web>


--------------------------------------------------------------
17:08:53,145 WARN [DeploymentInfo] Only the root deployment can set the loader repository, ignoring config=LoaderRepositoryConfig(repositoryName: domain.biz:loader=pds.war, repositoryClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3, configParserClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3ConfigParser, repositoryConfig: java2ParentDelegation=false)
17:08:55,498 WARN [DeploymentInfo] Only the root deployment can set the loader repository, ignoring config=LoaderRepositoryConfig(repositoryName: domain.biz:loader=reportwriter.war, repositoryClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3, configParserClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3ConfigParser, repositoryConfig: java2ParentDelegation=false)
chaohua wang
Ranch Hand

Joined: Dec 22, 2002
Posts: 62
Shankar,

I have figured out.
both applcaion can't have the same <context-root>.

Thank you!

Chaohua
shan Iyer
Ranch Hand

Joined: Jul 13, 2005
Posts: 391
chaohua ,

Thanx for the effort u made!!

This could also help me in future when i try to deploy 2 web apps.

keep in touch!!!

rgrds,
Shankar
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to set up 2 web applicaion in an ear file?
 
Similar Threads
Webservices using hibernate, jboss and eclipse and MySQL
HTTP 404 error using JBoss
Jboss 4.0.2 ActiveBPEL deployment error
getting errors while using JBoss JTA to implement 2 phase commit
jboss farm-service