• 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

Manually adding java class files to a WAR file

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been doing core java for awhile. I'm kind of new to web environment...

To be more specific new to generating WAR files.

My development environment is Windows, Eclipse and Tomcat.
Target environment is Unix and WebLogic.

I've updated and successfully tested 3 java classes and 1 JSP in an existing web application. Now I'm ready to build the war file and deploy it on the test environment on Unix.

The [grumpy] systems administrator instructed me to build the WAR file as follows (he is unaware if a Build.XML file exists):
1. In Windows, use the 7zip application to "browse/explore" into the [existing] WAR file
2. Drag and drop the updated class files and jsp file from Tomcat into the WAR file

The WAR file deployed on Weblogic, and the web app did came up, but the [JSP] page that I updated is not rendering. The sys admin is blaming my code, but I don't think that is the problem.

My question is: Is this a valid way update a WAR file?

Thanks, I just need validation. If this is a valid way to update a WAR file then I'll continue down this path.


 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's a valid mechanism only if you don't screw it up by placing the files in the wrong location. I would use a slight modification to this process: rename the xxx.war file to xxx.zip, unzip it into en empty directory, copy the files to the correct directories, and then zip it back up (making sure that you don't accidentally make xxx the base directory!), and rename the xxx.zip file to xxx.war. I have done this often with JAR files when I want to change a single class.

Warning: if you do this, make sure you use standard zip compression, Java cannot handle some of the compression mechanisms provided by 7Zip (avoid any mechanism that claims to provide better compression).

Of course, using a standard build script to rebuild from source is always the preferred method.
 
Lawrence Gatson
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for the response; I'll continue down this path with your suggestions...I agree, I wish I could get my hands on the build script. -llg
 
I suggest huckleberry pie. But the only thing on the gluten free menu is this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic