wood burning stoves 2.0*
The moose likes Servlets and the fly likes how to create .war file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to create .war file" Watch "how to create .war file" New topic
Author

how to create .war file

nishant vaishnaw
Greenhorn

Joined: Feb 27, 2013
Posts: 22
as our old unix server is migration into new unix version and , we need to create the war file in order to get deployed into IBM websphare.
In existing system their is no war file .
please guide the command to generat the war for below file system:
$ cd /apps/ntac/untfrontend5.6.6
$ ls -ltr
total 10
drwxrwxr-x 2 ntac ntac 512 May 25 2007 properties
drwxrwxr-x 7 ntac ntac 512 Jul 10 2007 web
drwxrwxr-x 2 ntac ntac 512 Jul 17 2007 lib
drwxrwxr-x 2 ntac ntac 512 Nov 22 17:40 servlets
drwxrwxr-x 2 ntac ntac 512 Dec 19 19:42 logs


Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41106
    
  45
A war file is a zip file - you can use old zip tool to create it.


Ping & DNS - my free Android networking tools app
nishant vaishnaw
Greenhorn

Joined: Feb 27, 2013
Posts: 22
thanks for replying ,

as the existing files structure in unix dosen't have web.xml and web-inf , so it it mandatory to have web.inf or web.xml in .war file
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41106
    
  45
Yes, you need to create the WEB-INF/web.xml file. Alternatively, learn how to use the Ant build tool (which runs on all common operating systems) - it has facilities to create .war files.
nishant vaishnaw
Greenhorn

Joined: Feb 27, 2013
Posts: 22
Thanks, what are the values i need to put in web.xml.
or directory structure , in other words where i need to copy my application folder in web.inf , can you please guide.
below are my application directory and file :
$ cd /apps/ntac/untfrontend5.6.6
$ ls -ltr
total 10
drwxrwxr-x 2 ntac ntac 512 May 25 2007 properties
drwxrwxr-x 7 ntac ntac 512 Jul 10 2007 web
drwxrwxr-x 2 ntac ntac 512 Jul 17 2007 lib
drwxrwxr-x 2 ntac ntac 512 Nov 22 17:40 servlets
drwxrwxr-x 2 ntac ntac 512 Dec 19 19:42 logs

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41106
    
  45
I don't know what you mean by "application folder". In web.xml you would declare your servlets, filters, mappings, security settings and a bunch of other stuff. If you're unfamilier with that file I advise to look for a tutorial on these things, it's way too much to cover in a forum post.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30116
    
150

What are you running on the old server to serve that content? I ask because it might have an export utility.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
nishant vaishnaw
Greenhorn

Joined: Feb 27, 2013
Posts: 22
Hi ,

in existing setup it is not using .war file only .jar files was deployeed in old version of IBM websphare.
and httpd modules are their where applicaiton path are configure in unix server.

Below is details of httpd.conf file :
<VirtualHost nus405.in.telstra.com.au:8094>
ServerAdmin webmaster@host.some_domain.com
DocumentRoot /apps/ntac/untfrontend/web
ServerName host.some_domain.com
ErrorLog /var/IBMHTTPD/logs/ntac-dev356_error_log
TransferLog /var/IBMHTTPD/logs/ntac-dev356_access_log
</VirtualHost>
Lawrence Xu
Greenhorn

Joined: Feb 11, 2004
Posts: 11
which version is your old websphere version?
I think you may open websphere manage console
nishant vaishnaw
Greenhorn

Joined: Feb 27, 2013
Posts: 22
The old version of websphare is 3.5.6


the new version where we are migration the code is :
•IBM HTTP Server and WAS Network Deployment v 7.0.0.3
•IBM WebSphere MQ v 7.0.0.2)


Ivan Jozsef Balazs
Rancher

Joined: May 22, 2012
Posts: 867
    
    5
What is under the directory "web" ?

If you did not happen to have zip, you can use "jar" (part of the JDK).

nishant vaishnaw
Greenhorn

Joined: Feb 27, 2013
Posts: 22
Under web these are the folder:
$ cd web
$ ls -ltr
total 56
drwxr-xr-x 2 ntac ntac 4096 Apr 21 2006 reports
drwxr-xr-x 7 ntac ntac 4096 Apr 21 2006 global
drwxr-xr-x 4 ntac ntac 4096 Apr 21 2006 help
drwxr-xr-x 3 ntac ntac 4096 Apr 21 2006 manual
-rwxr-xr-x 1 ntac ntac 1926 Apr 21 2006 index.html
drwxr-xr-x 3 ntac ntac 8192 Apr 23 2006 jsp


But no web-inf and no web.xml, please guide
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9937
    
159

It depends on the server and the Java EE version of the application. Latest versions do not mandate a web.xml for a war deployment.

[My Blog] [JavaRanch Journal]
nishant vaishnaw
Greenhorn

Joined: Feb 27, 2013
Posts: 22
thanks for guidance, the IBM Webspahre version is 8 and java 1.6, please guide the steps to place the file and create the .war file to deployee
nishant vaishnaw
Greenhorn

Joined: Feb 27, 2013
Posts: 22
please duige the steps for creatig .war file for the existing structure( without web.inf & web.xml)$ cd /apps/ntac/untfrontend5.6.6
$ ls -ltr
total 10
drwxrwxr-x 2 ntac ntac 512 May 25 2007 properties
drwxrwxr-x 7 ntac ntac 512 Jul 10 2007 web
drwxrwxr-x 2 ntac ntac 512 Jul 17 2007 lib
drwxrwxr-x 2 ntac ntac 512 Nov 22 17:40 servlets
drwxrwxr-x 2 ntac ntac 512 Dec 19 19:42 logs
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to create .war file
 
Similar Threads
Expanded/exploded war permissions
PIA Installation is completed but Files are Missing on PeopleTools 8.49
PIA Installation is completed but Files are Missing on PeopleTools 8.49
tomcat catalina.out does not created
Can't watch video on Safari and Firefox on OS X Tiger...