-
1. Re: JBoss a dead-end
jflinchbaugh Dec 31, 2003 10:39 AM (in response to sudsy)"jflinchbaugh" wrote:
"jflinchbaugh" wrote:
are you trying to specify an arbitrary context path different from your war name? like deploy app.war with a "/myapp/" context path?
or are you trying to deploy an app as the root (/) of the server?
i think the root app should go in ROOT.war, but i think i've seen this not work for my jboss/tomcat install.
if you want to specify a context-path, i don't think the standard provides a way in the war itself, but you should be able to specify a context per each web app in an ear file. you may just need to package your war within an ear, and specify it in your application.xml. -
2. Re: JBoss a dead-end
sudsy Dec 31, 2003 11:15 AM (in response to sudsy)"sudsy" wrote:
"sudsy" wrote:
"jflinchbaugh" wrote:
if you want to specify a context-path, i don't think the standard provides a way in the war itself, but you should be able to specify a context per each web app in an ear file. you may just need to package your war within an ear, and specify it in your application.xml.
Allow me to be more specific. Suppose I have a web application which permits uploads of images which are then "massaged" by a JSP and then inserted into the application directory structure. The standard mechanism is to use ServletContext.getRealPath() to perform the mapping. The problem with JBoss is that what I call the application root (the location within the filesystem) changes every time the server is restarted or the application is redeployed.
My "working directory" (for the purposes of getRealPath()) might be:
$JBOSS_HOME/server/default/tmp/deploy/tmp39271MyApp.ear-contents/MyApp.war
This entire directory structure is destroyed when the server is shutdown. IOW, there is no persistence. Every other servlet container or J2EE server has provided the capability to specify the root of an application in the filesystem such that I don't lose data when the application is stopped and restarted.
THIS is the restriction to which I refer. I know all about context paths and have no problems there. My production server is Apache/Tomcat and I can specify the docBase and appBase of my Host/Context pairs. I can do the same in IBM WebSphere and BEA WebLogic using the console webapps. So my question is why does JBoss have this glaring omission? -
3. Re: JBoss a dead-end
alanmoor Dec 31, 2003 2:11 PM (in response to sudsy)"alanmoor" wrote:
"alanmoor" wrote:
The way I got around this was to expand my war file in the deploy directory. Hot deployment is neat and cool and everything, but outside a development environment, has little real use. Besides, if I want to redeploy my app, I have found all I need to do is replace the components I need, then touch the WEB-INF/web.xml.
If you expand myapp.war into {jbosshome}/server/default/deploy/myapp.war directory, then getRealPath("/docs") will yield {jbosshome}\server\default\deploy\myapp.war\docs.
Another issue that drove us to this was some poorly written 3rd party code that actually requires OS file names for locations of configuration files. Stupid but true. -
4. Re: JBoss a dead-end
sudsy Dec 31, 2003 9:13 PM (in response to sudsy)"sudsy" wrote:
"sudsy" wrote:
Interesting work-around, but does it work with ears? And, more importantly, will a symbolic link into the deployment structure be both recognized and maintained?
Just so you know, I've already formulated a number of ways around the problem but I hate to code solutions to problems which only exist in a single abberant platform.
I know how to make it work with "vanilla" Tomcat so why is the version bundled with JBoss artificially crippled?
Doesn't it bug you that you have to work around these silly limitations? It would certainly preclude the product from serious consideration in any number of "real world" scenarios IMHO. -
5. Re: JBoss a dead-end
vertigo Jan 6, 2004 6:08 PM (in response to sudsy)"vertigo" wrote:
"vertigo" wrote:
Working with the expanded "folder.ear" (and with expanded "folder.war"'s within) works ok. But I totally disagree with you on your approach to the "upload" problem.
You see, you application folders should not be treated as a repository of any sort. An applications server like WebSphere or WebLogic might expand a deployed EAR into the folders you are using, but there is no contract saying that these folders should remain intact on a server restart or on a redeployment. That is plain bad design on ANY application server. In a clustered environment, for example, any upload to the application "real" diretory would be useless. If file uploads are needed, try using a network storage (like a configurable path **OUTSIDE** the application known to all servers on the cluster). Any other approach, in fact, is a silly design on a serious production environment (no offense). -
6. Re: JBoss a dead-end
erik777 Jan 30, 2004 7:50 PM (in response to sudsy)I whole heartedly agree. You shouldn't even, IMHO, put these folders inside the JBoss installation at all, let alone inside the deploy or application folders.
Even in websphere, we used folders entirely outside the application for any incoming or outgoing data files, whether imports, logs, generated reports, or anything else. Then use a properties file to configure their location, and an application properties class for loading configuration properties. -
7. Re: JBoss a dead-end
captrespect Feb 25, 2004 9:48 AM (in response to sudsy)I have the same problem as this guy. I have an app that lets the users upload pics and they will be used in the application.
I have the upload directory outside joss like /usr/pictures
Uploading to this directory is no problem, but how do I serve from this directory through simple web links? I would like to just say something like:<img href = "/userpics/image1.jpg"/>
So how do I map /usr/pictures to /userpics in a way that they can be served by the same webapp?
Thanks,
Jon -
8. Re: JBoss a dead-end
captrespect Feb 26, 2004 9:21 AM (in response to sudsy)I figured out the answer to my problem and posted the answer here:
http://jboss.org/index.html?module=bb&op=viewtopic&p=3823101#3823101[/url] -
9. Re: JBoss a dead-end
rbottoms Mar 19, 2004 1:07 PM (in response to sudsy)You've answered a question I've had for years about static content. Not so useless a rant after all. Maybe this section should be renamed just Rants.