• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How War file generated

 
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How war file knows , where and which class files to pick up and generate war file.
I mean how war file knows to pick corresponding files.
 
Sheriff
Posts: 67748
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A war file doesn't know anything. You pick which files go into a war file when you create it.
 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rajendra,

Yes, war file does not know anything, It takes related information from the command you have provided during war file creation...

e.g. consider there is an application with name myApp available in 'C:\' then the command to create the war file is something like this:

C:\myApp> jar -cvf myApp.war *.class

Here is the answer to your question where and which class files to pick up and generate war file:

1. Where : From the command line path 'C:\myApp', it will find the files to pick.
2. Which : the '*.class' part in command which indicates that pick up class files which is available in C:\myApp directory.

Please let us this is what you want to know.

Thanks

Rahul


 
Rajendra Prakash
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi raghul , how the same war file generation in console .(you explained in command prompt)
 
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rahul wrote:
C:\myApp> jar -cvf myApp.war *.class



Though this will generate a .war file it is not as per the directory structure required for a WAR file as per specification. The class files will be present in the root of the war which are supposed to be present in WEB-INF/classes


Rajendra wrote
hi raghul , how the same war file generation in console .(you explained in command prompt)



Which console?
 
Rajendra Prakash
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
weblogic Administration console
 
Amol Nayak
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not too sure of weblogic console but i havent come across any such utility in the other application server's console, i doubt if you will find one. Logically a console is used to deploy an application and not generate one to be deployed.
However if you find this Command prompt approach to be tedious you can use ant to build your app.

If you still want one simpler approach specific to your test projects, why not have a bat file prepared to build the war file.
 
Rahul Nair
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

@Amol: This is a just an example for explanation purpose, for the asked question. In case you want to retains the whole directory structure then you may use '*.*' instead of *.class file pattern.

@Rajendra: I have mentioned word command prompt (cmd) on windows XP. if you have any difficulty for generating war file using the command then you may use an eclipse or any other IDE for the same.

Thanks,

Rahul
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you say "the console" most people will assume that you mean the shell or command line interface to the operating system.
If you're looking for help that is specific to WebLogic, your best bet would be to post your question in our BEA Weblogic forum. If you aren't going to do that and post instead to a more generic forum like "Servlets" it would be a good idea to mention that you are looking for a Weblogic specific solution in your first post.

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rajendra Prakash wrote:weblogic Administration console



Is there any specific reason you want to create war file using weblogic console?

if you have option to go with other idea's .

Check out war ANT task or equivalent in Maven etc.

Weblogic console can identify a war file(arhived/exploded) after you created it. But I think it cannot help you creating war file since it cannot know what files should be included in your specific application.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic