views:

41

answers:

1

Please pardon me if this question is silly. Suppose I develop a j2ee web application using srping framework and a MS SQL Server database, using a Webspphere application server. I later create a war file for this application. Can I deploy this war file on a tomcat server without any change in code? Or my question is can this be hosted by web hosting which provides only Tomcat servers? If yes, is there any change in code required? If it cannot be deployed, can you please suggest me what to do, because I havent developed any application on a tomcat server. All the applications that I have developed have been on Websphere App Server using RAD.

+1  A: 

In principle, yes WAR files should be portable across JEE servers. In practice I would not expect many portability problems, but it very much depends upon the details of your application and whether you've stuck very closely to JEE standards. Also, just deploying your app into a different environment (your dev machine versus a hosting environment) might hit snags, not so much a WAS v Tomcat as this environment v that environment.

Possible issues, descending order of likelyhood:

1). Are you targetting the same versions of the standards.

2). Did you use any WebSphere specific extensions beyond the JEE specs. Most vendors have some extra goodies, did you use any.

3). You've hard-coded some resource (file, directory, printer, database) that is accessed differently on your target platform.

4). Did you hit a spec ambiguity? Is there some corner case where WAS behaviour differes from Tomcat behaviour.

5). You depend upon something that WAS or your platform does really quickly and your taget platform doesn't.

My general rule for portability: always test early across your range of intended deployment platforms. There's nearly always some gotcha. If you find out early you can fix with little pain.

djna