PDA

View Full Version : Installing webapps (WAR files)



poklee
05-27-2003, 12:47 PM
Is there anyway with InstallShield to automatically deploy a WAR file on a web server such as Tomcat? I don't want to just dump the WAR file into a folder and have the users install the app manually.

brianl
05-27-2003, 04:43 PM
You can use the Bean Extra bean "XML File Update In Archive" to modify the manifest and any other App server XML configuration files in the .war file after it is installed. Basically, you install it in a Files bean, then modify it using XML File Update in Archive.

brianl
05-27-2003, 04:54 PM
I should mention that you can get "XML File Update In Archive" from the Bean Extra (http://www.installshield.com/downloads/beans.asp?prod=mpf) page.

poklee
05-28-2003, 09:02 AM
Thank you for your responce. The web.xml file is inside the .war file itself. I tried the bean and it doesn't seem to be able to access the xml file. Any suggestions?

brianl
05-28-2003, 09:42 AM
Hi,

It turns out that we have a bad link to that bean-- it links to XMLFileUpdate.zip rather than XMLFileUpdateInArchive.zip, which is what you need.

You can get XMLFileUpdateInArchive.zip from:
http://www.installshield.com/downloads/mpf/javabeans/XMLFileUpdateInArchive.zip

Extract this zip file to your 'classes' directory, then register 'com.installshield.extras.product.XMLFileUpdateInArchive'. After you add this product bean to your project, you configure the path to your WAR file in the Archive property, and the relative path to "web.xml" in the XML File property. You will need to create some XSL that does the modifications that you need. If you need to obtain runtime values to put in the XSL, you can embed "$P" and "$W" expressions.

Sorry for the confusion.

Ken Alverson
05-30-2003, 09:00 AM
Originally posted by brianl
Hi,

It turns out that we have a bad link to that bean-- it links to XMLFileUpdate.zip rather than XMLFileUpdateInArchive.zip, which is what you need.

You can get XMLFileUpdateInArchive.zip from:
http://www.installshield.com/downloads/mpf/javabeans/XMLFileUpdateInArchive.zip

Extract this zip file to your 'classes' directory, then register 'com.installshield.extras.product.XMLFileUpdateInArchive'. After you add this product bean to your project, you configure the path to your WAR file in the Archive property, and the relative path to "web.xml" in the XML File property. You will need to create some XSL that does the modifications that you need. If you need to obtain runtime values to put in the XSL, you can embed "$P" and "$W" expressions.

Sorry for the confusion.

This looks like something I have a need to have done. i.e. - I need to change the "THE_PORT" text string in conf\server.xml to a user defined value. However, the userinput wizard bean is in the multi-suite project and the XML wizard update bean only appears in the product tree. I would need to figure out how to pass the multi-suite userinput string values into the product being installed. This would be easier if you could provide a wizard bean equivalent that works on an already expanded archive.

brianl
05-30-2003, 02:01 PM
Ken,

You can use values from a user input panel in a multi-installer suite by referencing $W in a subproduct's XML File Update in Archive product bean. This will work as long as you link to the user input panel in the sub-product's wizard tree through a Wizard Bean Reference, a Multi-Wizard Bean Reference, or a Suite Wizard Bean Reference. The User Input Panel must also be in the same subproduct as the subproduct that contains the XML File Update in Archive bean.

You can modify an XML external to an archive using the XML File Update bean (not to be confused with XML File Update In Archive) that was mentioned earlier. This can be downloaded from the Bean Extras page. All the links now work correctly.

ke0nha
06-12-2003, 03:24 PM
Originally posted by brianl
Hi,

It turns out that we have a bad link to that bean-- it links to XMLFileUpdate.zip rather than XMLFileUpdateInArchive.zip, which is what you need.

You can get XMLFileUpdateInArchive.zip from:
http://www.installshield.com/downloads/mpf/javabeans/XMLFileUpdateInArchive.zip

Extract this zip file to your 'classes' directory, then register 'com.installshield.extras.product.XMLFileUpdateInArchive'. After you add this product bean to your project, you configure the path to your WAR file in the Archive property, and the relative path to "web.xml" in the XML File property. You will need to create some XSL that does the modifications that you need. If you need to obtain runtime values to put in the XSL, you can embed "$P" and "$W" expressions.

Sorry for the confusion.

Hi,
I am very new with xsl file. is there any xsl template file that I can use? for example, I would like to change the install location in the web.xml file after install is done. How can I create an xsl file to do that?
web.xml entry
<location>/usr/local/myapp</location>
thanks

ke0nha
06-12-2003, 04:41 PM
Hi Brian,
I followed your instruction above of how to modify web.xml using XMLUpdateFileInArchive class. I inserted XMLUpdateFileInArchive product bean into my project and got "java.lang.NoSuchMethodError" when I tried to build my project. Do you have any idea ? anyway, I am using ISMP 4.53 version.
thanks.

brianl
06-16-2003, 11:13 AM
Hi,

XMLFileUpdateInArchive is actually designed for ISMP 5.x. The MethodNotFound exception is occuring because that bean has a call to FileService.isAbsolute(), which is an API that was added in 5.0. If you want to use that bean with 4.5x, you will need to remove the code
// make sure the xml file is a relative path
if (fs.isAbsolute(resolveString(getXMLFile()))){
support.logEvent(this, Log.ERROR, "XML File property must be a relative path within the archive"); and just always make sure that you specify a relative path to the XML file inside your WAR.

mplanchart
03-16-2006, 01:53 PM
Hi,

Can you please guide me to a sample project that precisely does this.

I appreciate the help,

Thanks,

Michael