-
1. Re: Where to deploy files for users to download
peterj Jan 18, 2010 1:15 PM (in response to notify)There are several possibilites.
a) You could place the downloadable file in the ROOT.war directory (if you told me which version of JBoss AS I could give you the exact location, but a find within the service configuration directory should locate it)
b) You could deploly your EAR, and it's embedded WAR, as exploded directories. Then you could place the file in your WAR directory.
http://community.jboss.org/wiki/ExplodedDeployment
c) You can setup up an external directory
-
2. Re: Where to deploy files for users to download
notify Jan 18, 2010 1:31 PM (in response to peterj)jboss-4.2.3.GA
Thanks.
-
3. Re: Where to deploy files for users to download
peterj Jan 18, 2010 1:33 PM (in response to notify)server/xxx/deploy/jboss-web.deployer/ROOT.war -
4. Re: Where to deploy files for users to download
notify Jan 18, 2010 3:27 PM (in response to peterj)If I deploy the file there I still get;
The requested resource (/MyFile.xxx) is not available.
-
5. Re: Where to deploy files for users to download
peterj Jan 18, 2010 4:16 PM (in response to notify)What URL are you using?
If you placed a file named downloadthis.pdf into the ROOT.war directory, then from a browser you would be able to access it using the URL you gave in your original post.
-
6. Re: Where to deploy files for users to download
notify Jan 18, 2010 6:00 PM (in response to peterj)I've put a PDF in the ROOT.war directory on my server.
and try and access it by;
I get;
The requested resource (/Test.pdf) is not available.
-
7. Re: Where to deploy files for users to download
peterj Jan 18, 2010 6:22 PM (in response to notify)Looks like a letter casing mismatch (test.pdf vs Test.pdf). What is the real name of the file (test.pdf or Test.pdf), and what is the actual URL you used? And are you running on Linux - if you are then casing matters.
Also, just to double-check, your host's name is "www.mydomain.com" and you configured JBoss AS to listen to port 80. right?
Or are you running Apache HTTP at port 80 and having it filter and forward the requests?
Here is the full path of my PDF file: /opt/jbia/jboss-4.2.3.GA/server/admin/deploy/jboss-web.deployer/ROOT.war/test.pdf
I can access it just fine using: http://localhost:8080/test.pdf
On Linux, using http://localhost:8080/Test.pdf yields a "resourse not available" error.
-
8. Re: Where to deploy files for users to download
notify Jan 19, 2010 6:06 AM (in response to peterj)www.mydomain.com has the beta version of my website and is in use on port 80. I have also put the PDF file on the localhost
The PDF file is lowercase test.pdf. I am using the correct URL for both tests;
www.mydomain.com/test.pdf & http://localhost:8080/test.pdf
And in both cases I get;
The requested resource (/test.pdf) is not available.
I didn't mention that my web app is deployed under JBoss Seam;
jboss-seam-2.2.0.GA
Also tried;
Serving Static External Files in recent 4.x versions of jboss
This works for Jboss 4.2.x and probably other versions as well.
Step 1 (optional): Copy a default web.xml from <JBOSS_HOME>/server/<config-name>/deploy/http-invoker.sar/invoker.war/WEB-INF and place it in your external directory, for example: /home/pgib/images/WEB-INF
Step 2: Edit <JBOSS_HOME>/server/<config-name>/deploy/jboss-web.deployer/server.xml and add a Context element under Host.(Step similar to standalone TC)
<Host name="localhost" ...> <!-- ADD static images DIRECTORY --> <Context path="/images" docBase="/home/pgib/images" reloadable="true"> </Context> <!-- The rest of your Host entity --> </Host>
This didn't work either!
Is Seam the cause?
Thanks for all you help.
-
9. Re: Where to deploy files for users to download
peterj Jan 19, 2010 11:16 AM (in response to notify)Seam is not the fault because Seam is not used by the ROOT app.
How are you starting the app server? Are you using the -b option and is so what value are you specifying? See if this helps:
-
10. Re: Where to deploy files for users to download
notify Jan 19, 2010 11:32 AM (in response to peterj)On the server the only way I could get the the application to run when the URL www.mydomain.com was entered was by starting JBoss with the command;
run.bat -b 0.0.0.0
On development machine (localhost) I start JBoss with the standard;
run.bat
(NO -b parameters)
As it doesn't work with either I not sure what to do!
-
11. Re: Where to deploy files for users to download
peterj Jan 19, 2010 11:56 AM (in response to notify)Well, there is something about your environment or configuration that is causing this, but at this point I have run out of ideas of what it could be. I have asked every question I can think of.
You say you cannot even access the file on your local development machine. I gave you the full path for my PDF file, and also the URL I used to successfully access it. Could you supply the same information for your development machine?
-
12. Re: Where to deploy files for users to download
notify Jan 19, 2010 12:09 PM (in response to peterj)The test.pdf is located in;
C:\jboss-4.2.3.GA\server\default\deploy\jboss-web.deployer\ROOT.war\test.pdf
Thanks for all your help.
I need this facilty for users to download a BlackBerry application from the website. It's a bit of a show stopper.
-
13. Re: Where to deploy files for users to download
peterj Jan 19, 2010 12:25 PM (in response to notify)Based on the PDF file's location, and the way you start the app server, entering http://localhost:8080/test.pdf into the browser's address bar and hitting enter should cause the PDF to be downloaded (or opened, depending on the browser you are using and the browser's configuration). Heck, I even just now checked with Explorer and Chrome, my earlier attempt was with Firefox. All three worked.
For now, let's try to get this working on just your development machine; once that is working we will go back to www.mydomain.com.
Have you made any changes to any of the files that came with 4.2.3?
Could you try using a clean installation of 4.2.3 in another location (say at c:\temp\jboss-4.2.3.GA)? Deploy only the test.pdf file - do not deploy your app.
Also, what happens when you enter just http://localhost:8080?
-
14. Re: Where to deploy files for users to download
notify Jan 19, 2010 12:49 PM (in response to peterj)The home (seam) page of my app loads and displays. Maybe this is the cause?
A number of changes to deploy my EJBs, SEAM configuration ejb-jar.xml, jboss.xml, web.xml.
***** UPDATE *****
Deployed the PDF to a clean installation of JBoss 5.1 and I can open the PDF with;
http://localhost:8080/test.pdf
I now suspect it is the configuration to open the home page when I type http://localhost:8080