tags:

views:

19

answers:

1

Hello

I have built a web app using Tomcat 6 as a container. I was using a couple of Jars of Tomcat's and referring to them from my ant build in Eclipse.

I've written another ant build to deploy my app into a .war and then together with an application.xml deployment descriptor into an .ear for deploying to WAS 7. In order to support this, I've pulled the jars into my war so I know they'll be available to the app which worked through Tomcat.

I know that I need to put something into the application.xml file to cause the class loader to use the jars I've pulled in and not WAS's but for the life of me I can't even find a decent resource to read up on what full range of options exist in an application.xml file let alone exactly what I need to type to put this (PARENT_LAST?) text in.

1) Can anyone point me to a full online document listing all the things that I can put into my application.xml to control my .ear

2) Can anyone post a listing which modifies the below xml such that when the xml file is included in a .ear it can deploy to WAS such that the WAS container uses the jars in the enclosed war rather than the ones in the WAS setup.

I will be eternally grateful.

<?xml version="1.0" encoding="UTF-8"?>
<application id="Client">
   <display-name>Client</display-name>
   <description>Web application supporting the configuration and management of server components</description>
   <module id="Client">
      <web>
         <web-uri>Client.war</web-uri>
         <context-root>client</context-root>
      </web>
   </module> 
</application>
A: 

PARENT_LAST is not likely to help you, not to mention that I wouldn't touch that option with a 10-foot pole as I always considered it a hack.

The behavior you're looking for is provided by default - that's actually the "correct" way of working according to the J2EE spec. Can you provide us with the exact composition of your EAR file, your WAR file, and the MANIFEST.MF file of both?

[Edited to add the following]

The comment below is correct as well (thanks) - if you included JAR files from Tomcat inside your Web application, then you're already doing something very wrong and most likely unportable.

  • JAR files pertaining to the J2EE specification (such as JAR files containing the J2EE API) are provided by application server vendors; you should exclude them from your deployable module (EAR, WAR).
  • JAR files pertaining to specific Tomcat functionality... Well, those wouldn't function outside of Tomcat so the entire subject of WebSphere migration is moot.
Isaac
Under the circumstances, the answer is correct. Don't do it. I've learned the hard way to never pull jars from one app server for use in another.
Mark Lewis