JBoss deployment question

I am used to working with Tomcat and exploded directories. This allows
me to access my webapp via http://localhost/.

My co-worker was telling me that I have to use a war for the JBoss.
When I deploy, I have to access my application via
http://localhost/war_name. Is there a way to access it via
http://localhost/ ?

--
Norris Shelton
Sun Certified Java Programmer

8 comments

1.) If you want to deploy from exploded directory instead of a war file
then you have name your exploded directory .war (e.g. exploded.war). (This is due to the fact that JBoss picks the internal deployer mbean based on the file extension.) 2.) If you deploy a standalone web module then you have to set the context path in the jboss-web.xml file. (If you are using the JBoss plugin then there's a setting for that in the web module editor.) 3.) You may specify /]]> in the jboss-web.xml
file. Then you can access your app via http://localhost/.


Norris Shelton wrote:

I am used to working with Tomcat and exploded directories. This allows
me to access my webapp via http://localhost/.

My co-worker was telling me that I have to use a war for the JBoss.
When I deploy, I have to access my application via
http://localhost/war_name. Is there a way to access it via
http://localhost/ ?

0

2) Do you mean this screen? I see that jboss-web.xml is specified as a
DD, but I see no way to set anything related to it's content. Do I have
to do this manually?

Norris Shelton
Sun Certified Java Programmer




Martin Fuhrer wrote:

1.) If you want to deploy from exploded directory instead of a war
file then you have name your exploded directory <something>.war (e.g.
exploded.war). (This is due to the fact that JBoss picks the internal
deployer mbean based on the file extension.)

>

2.) If you deploy a standalone web module then you have to set the
context path in the jboss-web.xml file. (If you are using the JBoss
plugin then there's a setting for that in the web module editor.)

>

3.) You may specify <context-root>/</context-root> in the
jboss-web.xml file. Then you can access your app via http://localhost/.

>
>

Norris Shelton wrote:

>
>> I am used to working with Tomcat and exploded directories. This
>> allows me to access my webapp via http://localhost/.
>>
>> My co-worker was telling me that I have to use a war for the JBoss.
>> When I deploy, I have to access my application via
>> http://localhost/war_name. Is there a way to access it via
>> http://localhost/ ?
>>



Attachment(s):
moz-screenshot-8.jpg
0

Norris, didn¹t you mean you want to deploy your app to the / context? I
don¹t know of a way to do that in Jboss, never looked incredibly hard for
it, in Tomcat it works because Tomcat has a ROOT directory (all upper) which
corresponds to /. Not sure jboss has the same.

R


On 12/8/04 6:19 AM, in article 41B6E35D.9060508@yahoo.com, "Norris Shelton"
<i.hate.spam@yahoo.com> wrote:

2) Do you mean this screen? I see that jboss-web.xml is specified as a DD,
but I see no way to set anything related to it's content. Do I have to do
this manually?

Norris Shelton
Sun Certified Java Programmer



Martin Fuhrer wrote:

>> 1.) If you want to deploy from exploded directory instead of a war file then
>> you have name your exploded directory .war (e.g. exploded.war). >> (This is due to the fact that JBoss picks the internal deployer mbean based >> on the file extension.) >> >> 2.) If you deploy a standalone web module then you have to set the context >> path in the jboss-web.xml file. (If you are using the JBoss plugin then >> there's a setting for that in the web module editor.) >> >> 3.) You may specify / in the jboss-web.xml file. >> Then you can access your app via http://localhost/. >> >> >> Norris Shelton wrote: >> >>> I am used to working with Tomcat and exploded directories. This allows me >>> to access my webapp via http://localhost/. >>> >>> My co-worker was telling me that I have to use a war for the JBoss. When I >>> deploy, I have to access my application via http://localhost/war_name. Is >>> there a way to access it via http://localhost/ ? >>> >>>]]>





Attachment(s):
image.jpg
0

No, I mean this screen (you get at it by choosing 'Edit...' in the
context menu of the web module, then selecting the 'JBoss Server' tab).

There you can enter '/' in the 'Context Root' field.


Norris Shelton wrote:

2) Do you mean this screen? I see that jboss-web.xml is specified as a
DD, but I see no way to set anything related to it's content. Do I have
to do this manually?

Norris Shelton
Sun Certified Java Programmer




Martin Fuhrer wrote:

>> 1.) If you want to deploy from exploded directory instead of a war
>> file then you have name your exploded directory .war (e.g. >> exploded.war). (This is due to the fact that JBoss picks the internal >> deployer mbean based on the file extension.) >> >> 2.) If you deploy a standalone web module then you have to set the >> context path in the jboss-web.xml file. (If you are using the JBoss >> plugin then there's a setting for that in the web module editor.) >> >> 3.) You may specify / in the >> jboss-web.xml file. Then you can access your app via http://localhost/. >> >> >> Norris Shelton wrote: >> >>> I am used to working with Tomcat and exploded directories. This >>> allows me to access my webapp via http://localhost/. >>> >>> My co-worker was telling me that I have to use a war for the JBoss. >>> When I deploy, I have to access my application via >>> http://localhost/war_name. Is there a way to access it via >>> http://localhost/ ? >>>]]>



Attachment(s):
img10.png
0

Oh HAHA, I forgot about this screen, but does this work in Jboss? It seems
odd that it would because if you deploy your app as foo.war and set the
context to /, and you use other apps which also use / as a context, then
you're going to surely have 2 problems:
1- there will be context collision
2- Jboss will deploy your app under context /foo because of the war name...

Or am I mistaken?

R


On 12/8/04 7:52 AM, in article cp6tds$vcq$1@is.intellij.net, "Martin Fuhrer"
<mf@fuhrer.com> wrote:

No, I mean this screen (you get at it by choosing 'Edit...' in the
context menu of the web module, then selecting the 'JBoss Server' tab).

There you can enter '/' in the 'Context Root' field.


Norris Shelton wrote:

>> 2) Do you mean this screen? I see that jboss-web.xml is specified as a
>> DD, but I see no way to set anything related to it's content. Do I have
>> to do this manually?
>>
>> Norris Shelton
>> Sun Certified Java Programmer
>>
>>
>>
>>
>> Martin Fuhrer wrote:
>>
>>> 1.) If you want to deploy from exploded directory instead of a war
>>> file then you have name your exploded directory .war (e.g. >>> exploded.war). (This is due to the fact that JBoss picks the internal >>> deployer mbean based on the file extension.) >>> >>> 2.) If you deploy a standalone web module then you have to set the >>> context path in the jboss-web.xml file. (If you are using the JBoss >>> plugin then there's a setting for that in the web module editor.) >>> >>> 3.) You may specify / in the >>> jboss-web.xml file. Then you can access your app via http://localhost/. >>> >>> >>> Norris Shelton wrote: >>> >>>> I am used to working with Tomcat and exploded directories. This >>>> allows me to access my webapp via http://localhost/. >>>> >>>> My co-worker was telling me that I have to use a war for the JBoss. >>>> When I deploy, I have to access my application via >>>> http://localhost/war_name. Is there a way to access it via >>>> http://localhost/ ? >>>>]]>

0

You're absolutely right for point 1. If you deploy to context / then you
replace any other app using also / as a context (e.g. the standard JBoss
admin app). Therefore I wouldn't recommend such a setting in a
productive environment, unless you're really sure what you're doing.

But you're only partly right for point 2. The name of the war file (or
the exploded directory) is used as context name only if you don't
specify a context root in jboss-web.xml. So deploying a foo.war
containing <context-root>/</context-root> in jboss-web.xml will make the
app available under context / (and context /foo won't be available).

Robert S. Sfeir wrote:

Oh HAHA, I forgot about this screen, but does this work in Jboss? It seems
odd that it would because if you deploy your app as foo.war and set the
context to /, and you use other apps which also use / as a context, then
you're going to surely have 2 problems:
1- there will be context collision
2- Jboss will deploy your app under context /foo because of the war name...

Or am I mistaken?

R


On 12/8/04 7:52 AM, in article cp6tds$vcq$1@is.intellij.net, "Martin Fuhrer"
<mf@fuhrer.com> wrote:

>>No, I mean this screen (you get at it by choosing 'Edit...' in the
>>context menu of the web module, then selecting the 'JBoss Server' tab).
>>
>>There you can enter '/' in the 'Context Root' field.
>>
>>
>>Norris Shelton wrote:
>>
>>>2) Do you mean this screen? I see that jboss-web.xml is specified as a
>>>DD, but I see no way to set anything related to it's content. Do I have
>>>to do this manually?
>>>
>>>Norris Shelton
>>>Sun Certified Java Programmer
>>>
>>>
>>>
>>>
>>>Martin Fuhrer wrote:
>>>
>>>
>>>>1.) If you want to deploy from exploded directory instead of a war
>>>>file then you have name your exploded directory .war (e.g. >>>>exploded.war). (This is due to the fact that JBoss picks the internal >>>>deployer mbean based on the file extension.) >>>> >>>>2.) If you deploy a standalone web module then you have to set the >>>>context path in the jboss-web.xml file. (If you are using the JBoss >>>>plugin then there's a setting for that in the web module editor.) >>>> >>>>3.) You may specify / in the >>>>jboss-web.xml file. Then you can access your app via http://localhost/. >>>> >>>> >>>>Norris Shelton wrote: >>>> >>>> >>>>>I am used to working with Tomcat and exploded directories. This >>>>>allows me to access my webapp via http://localhost/. >>>>> >>>>>My co-worker was telling me that I have to use a war for the JBoss. >>>>>When I deploy, I have to access my application via >>>>>http://localhost/war_name. Is there a way to access it via >>>>>http://localhost/ ? >>>>>]]>


0

ROOT.war works if you are using the version of JBoss that uses Tomcat as it's web container.

I forgot how to do it if you are using Jetty.

0

I think you right. Now I just need a way to prevent the base JBoss
webapp from being deployed. This works automatically with the Tomcat
integration.

Norris Shelton
Sun Certified Java Programmer




Patrick Burleson wrote:

>ROOT.war works if you are using the version of JBoss that uses Tomcat as it's web container.
>
>I forgot how to do it if you are using Jetty.

>

0

Please sign in to leave a comment.