• 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

jboss-web.xml not being read by JBoss Server

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using JBoss 4.2.3 GA

In my server.xml ( located @ jboss-web.deployer ) I added a Context element to my Host so that I can serve files from an external directory structure. It looks like this

<Host name="localhost" etc etc>
<Context docBase="C:\myfolder\stuff" path="\warehouse" />
</Host>


Inside of C:\myfolder\stuff I added a WEB-INF directory, since JBoss now reconizes this as a web deployment of sorts. In WEB-INF I added a web.xml which defines security constraints and roles. I then added a jboss-web.xml inside of WEB-INF, and in this file I define the security-domain.

When I start the server and navigate to this resource, my secuirty policy ( as defined in login-config ) does not execuite. It turns out that JBoss is not reading in my jboss-web.xml file , it only reads the web.xml file.



Now, as an experiment I took the conents of C:\myfolder\stuff and turned it into a WAR. Then I deployed this WAR file into ${JBOSS_DIR}\default\deploy. Low and behold the jboss-web.xml was read, the security domain applied, and the policy defined in my login-config was used.


How do I get my context/external directory to be treated like something in the deploy dir... so that the jboss-web.xml is read and such??? Are there attributes I have to add? I am stumped.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What you really want to do is have the deployer deploy that directory as if it was an app. First, get rid of the server.xml changes, that is not what you want. Second, rename the stuff folder to stuff.war (so that the deployer will recognize that it is a WAR). Then in server/xxx/conf/jboss-service.xml, look all the way at the end of the file for the URLDeploymentScanner and the "URLs" attribute. Add your external directory to there like this:



I hope that "file://c:..." is correct, it might be "file:///c:...", URLs using Windows drive letters are sometimes screwy.
 
Kenny Johnson
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply Peter, but I don't think that will help me 100%. I cannot WAR the contents of the external dir ( it is several GB worth of files which customers download depending on choices and the context of their request. ). My main enterprise app ( deployed as an EAR in server/default/deploy ) contains the web front end and backend logic - the external directory contains all of the stuff customers will want to download ( think of it as a warehouse ).

I kept these separate since I am constantly adding new files or deleting files from the "warehouse" and do not want to redeploy my EAR every time ( would be several times a week if the warehouse was part of the EAR ).

I merely did the experiment where I took /stuff and placed it in a WAR to see if JBOSS would recognize it, and to pinpoint my problem. Is there a way to have JBOSS treat my external directory as a WAR ( like an exploded WAR )? Let me know if you need any more detailed info.
 
Peter Johnson
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

Is there a way to have JBOSS treat my external directory as a WAR ( like an exploded WAR )?


Yes, that is why I gave you the instructions I did. I never said to package the 'stuff' directory as a WAR, I said to rename the 'stuff' directory to 'stuff.war'. Then when the deployer scans the c:/myfolder directory it will see the stuff.war directory and treat it as an exploded WAR. (You already have the WEB-INF/web.xml, which is the only other thing required.)
 
Kenny Johnson
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!! This seems to be working so far. I was stumped for the longest time.

NOTE: I had to use the format of file:///

<attribute name="URLs">
deploy/, file:///C:/myfolder/thing.war
</attribute>
reply
    Bookmark Topic Watch Topic
  • New Topic