War deployment question.......help!

Hi,

Not sure if this is the most appropriate forum to post in but I'll give it a go.......... Please feel free to move this post if you know of a better place.

I have a problem that I do not know the answer to. I am developing a WebApp at the moment and this is being built as a WAR file. I am implementing a piece of software within this WAR that deals with writing files to the filesystem (within the webapp). The files will be located using a look-up table within a database table I have.

Now my problem is as follows:

I use a shared webserver at a hosting provider. When I develop this webapp further and come to deploy the new version by uploading the new war will it autodeploy replacing the old webapp, thus losing any files from the filesystem that were created via the web interface that are not in the new war file? How can I get around this without having to upload each file individually?

Any help would be greatly appreciated!

Thanks,

Andrew

[1004 byte] By [ebay_garindana] at [2007-10-2 23:35:06]
# 1
the is the problem when you have shared enviroment..you must try to change the path of the files that is written through your app.. it maybe out side your app.. it is better to do that on war deployment
jgalacambraa at 2007-7-14 16:17:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Hi, thanks for the response. Would you recon the following would work?

1) Deploy the webapp at http://www.xyz.com/mywebapp/

2) Create a directory for the files at: http://www.xyz.com/files/

3) Write all files attached to the web forms to the directory in 2, and freely redeploy the war file into the directory at 1.

Any ideas?

Thanks,

Andrew

ebay_garindana at 2007-7-14 16:17:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
yes it would work.. i have tried it.. but the problem on the files that will be writenn is the url must be absolute like what you've done in number two
jgalacambraa at 2007-7-14 16:17:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Thanks for the reply. Is there another more elegant way of doing this perhaps? It seems a bit restrictive otherwise.Best wishes,Andrew
ebay_garindana at 2007-7-14 16:17:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
ithink it will be best for your enviroment so you have no control no full control on the server
jgalacambraa at 2007-7-14 16:17:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
Ok thanks for that. I am considering moving to another host that gives me control of my JVM. Is there a better model for this host I should follow?Thanks for all your help,Andrew
ebay_garindana at 2007-7-14 16:17:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7

you want to find another host? why not try to setup your own server and register the domain that you want.. in this case you have full control of the server.. whenever the server crashes its up to you if you will are backing up your files.. some of the hosting solutions don't provide back ups for their client, so whenever their server crashes, the clients are affected.

jgalacambraa at 2007-7-14 16:17:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8

You can develop further on this by having an user interface which will copy the existing files to a temporary location and then redeploy the new war. The new war file could have another user interface which can read back the data.

Another option would be to have an admin user interface that can download the documents (as a zipped file) and would allow you to upload it back once you have redeployed the new war. This may be slightly more work.

ram.

Madathil_Prasada at 2007-7-14 16:17:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 9
Thanks for that suggestion. That certainly is an interesting one. I really appreciate your answers. I'll go away and mull them over now.Thanks once again, Andrew
ebay_garindana at 2007-7-14 16:17:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 10

I suppose the other option in to pop all the files into the database. This would eradicate the problem but would you guys recommend this? 99% of the files will be images, ranging in size from about 50kb to 200kb. I might have about 10,000 over the longer term.

Any pointers greatly received.

Best wishes,

Andrew

ebay_garindana at 2007-7-14 16:17:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 11
the question is, Does your hosting solution provide database for you? if it does will it support large storage like the one that you need? How will you make a back up for the files?
jgalacambraa at 2007-7-14 16:17:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...