cargo+JBOSS7.1+virtual hosting

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

cargo+JBOSS7.1+virtual hosting

sebDK
This post was updated on .
Hi there,

First I would like to tell you I really appreciate your work.
I have a problem to deploy a war file (for example mytest.war)with a jboss-web.xml.
Herer is the content of my jboss-web.xml in order to set a virtual host on JBoss.
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 4.2//EN" "jboss-web_4_0.dtd">
<jboss-web>
	<context-root>/</context-root>
	<virtual-host>calcreport-test</virtual-host>
</jboss-web>

Problem is that on Jboss I get
<deployment name="rootContext.war" runtime-name="rootContext.war">
instead of
<deployment name="mytest.war" runtime-name="mytest.war">
.

If there is no jboss-web.xml in my war file, I can deploy without any problem. I get
<deployment name="mytest.war" runtime-name="mytest.war">
 as expected.

I am using a ant script to run cargo (cargo-core-uberjar-1.4.12.jar, cargo-core-container-jboss-1.4.12.jar)

After several investigations, I think the problem is coming from org.codehaus.cargo.module.webapp.jboss.JBossWAR.java:

private String parseJbossWebXml()
    {
        String context = null;

        if (this.warArchive.getJBossWebXml() != null)
        {
        	//If there is a virtual-host in jboss-web.xml the context-root name is not used. WAR file name will be used instead.
        	if(!this.warArchive.getJBossWebXml().isVirtualHost()) context = this.warArchive.getJBossWebXml().getContextRoot();
        }

        return context;
    }

Should we note add a case where there is a virtual host set?

Thanks for your help.

S.
Reply | Threaded
Open this post in threaded view
|

Re: cargo+JBOSS7.1+virtual hosting

sebDK
Hi Ali,

Can you tell me if virtual-host in
jboss-web.xml
 will be supported in the next Cargo version?

Best regards,

Sébastien
Reply | Threaded
Open this post in threaded view
|

Re: cargo+JBOSS7.1+virtual hosting

sebDK
This post was updated on .
In reply to this post by sebDK
Hi there,

First I would like to tell you I really appreciate your work.
I have a problem to deploy a war file (for example mytest.war)with a jboss-web.xml.
Herer is the content of my jboss-web.xml in order to set a virtual host on JBoss.
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 4.2//EN" "jboss-web_4_0.dtd">
<jboss-web>
        <context-root>/</context-root>
        <virtual-host>calcreport-test</virtual-host>
</jboss-web>

Problem is that on Jboss I get
<deployment name="rootContext.war" runtime-name="rootContext.war">
instead of
<deployment name="mytest.war" runtime-name="mytest.war">
.

If there is no jboss-web.xml in my war file, I can deploy without any problem. I get
<deployment name="mytest.war" runtime-name="mytest.war">
 as expected.

I am using a ant script to run cargo (cargo-core-uberjar-1.4.12.jar, cargo-core-container-jboss-1.4.12.jar)

After several investigations, I think the problem is coming from org.codehaus.cargo.module.webapp.jboss.JBossWAR.java:

private String parseJbossWebXml()
    {
        String context = null;

        if (this.warArchive.getJBossWebXml() != null)
        {
        //If there is a virtual-host in jboss-web.xml the context-root name is not used. WAR file name will be used instead.
        if(!this.warArchive.getJBossWebXml().isVirtualHost()) context = this.warArchive.getJBossWebXml().getContextRoot();
        }

        return context;
    }

Should we note add a case where there is a virtual host set?

Thanks for your help.

S.
Reply | Threaded
Open this post in threaded view
|

Re: cargo+JBOSS7.1+virtual hosting

S. Ali Tokmen
Hi Seb

FYI, none of your messages on Nabble arrived to the mailing list. I'd suggest you actually register as explained in http://cargo.codehaus.org/Mailing+Lists

Now, here come the other point: we do not understand what you're trying to achieve and what doesn't work. Can you please detail a bit?

Also, it seems your jboss-web.xml is pretty old, perhaps a refresh based on https://developer.jboss.org/docs/DOC-17264 would be good.

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/03/15 15:26, sebDK wrote:
Hi there,


First I would like to tell you I really appreciate your work.

I have a problem to deploy a war file (for example mytest.war)with a jboss-web.xml.

Herer is the content of my jboss-web.xml in order to set a virtual host on JBoss.

<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 4.2//EN" "jboss-web_4_0.dtd">
<jboss-web>
	<context-root>/</context-root>
	<virtual-host>calcreport-test</virtual-host>
</jboss-web>
Problem is that on Jboss I get <deployment name="rootContext.war" runtime-name="rootContext.war">instead of <deployment name="mytest.war" runtime-name="mytest.war">.


If there is no jboss-web.xml in my war file, I can deploy without any problem. I get <deployment name="mytest.war" runtime-name="mytest.war"> as expected.


I am using a ant script to run cargo (cargo-core-uberjar-1.4.12.jar, cargo-core-container-jboss-1.4.12.jar)


After several investigations, I think the problem is coming from org.codehaus.cargo.module.webapp.jboss.JBossWAR.java:


private String parseJbossWebXml()
    {
        String context = null;

        if (this.warArchive.getJBossWebXml() != null)
        {
        	//If there is a virtual-host in jboss-web.xml the context-root name is not used. WAR file name will be used instead.
        	if(!this.warArchive.getJBossWebXml().isVirtualHost()) context = this.warArchive.getJBossWebXml().getContextRoot();
        }

        return context;
    }
Should we note add a case where there is a virtual host set?


Thanks for your help.


S.



--
View this message in context: http://cargo.996258.n3.nabble.com/cargo-JBOSS7-1-virtual-hosting-tp19968p20079.html
Sent from the User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: cargo+JBOSS7.1+virtual hosting

sebDK
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: cargo+JBOSS7.1+virtual hosting

sebDK
Sorry few typos in my previous email, I post it again:

Hi Ali,

I think the mailing issue is now fixed.
First thanks for your help.

Regarding the following documentation,
jboss-web.xml
 should look like:
<jboss-web>
	<context-root>/</context-root>
	<virtual-host>test</virtual-host>
</jboss-web>
if I want to get the following virtual host working http://test.mydomain.com:8080

Now if I deploy my archive test.war to JBoss AS 7.1.1 througth the web console management, I get in
standalone.xml
 the new line:
<deployment name="test.war" runtime-name="test.war">
            <content sha1="452e4ba137a15a0c2662ed354e61b4e92c0075d1"/>
</deployment>
. It is fine.

If I use cargo to deploy test.war, I get the following line in standalone.xml
<deployment name="rootContext.war" runtime-name="rootContext.war">
            <content sha1="34d54ba137a15a0c2662ed354e61b4e92c004576"/>
</deployment>

In a short summary, if I use cargo to deploy a war file that has a virtual host set in
jboss-web.xml
 the deployment name is set to rootContext.war all the time. This is a problem if I deploy a couple of war files with virtual host settings because the deployment names have to be different.

Is it giving any sense to you now?
Can you make the problem again in your environment?
If yes - I wrote a patch to fix the issue.

Cheers,

Sébastien

Reply | Threaded
Open this post in threaded view
|

Re: cargo+JBOSS7.1+virtual hosting

S. Ali Tokmen
Hi Seb

OK, now I understand the problem. So the proper solution would be that
when a virtual host is present the deployed file name should be the
virtual host + the context.

What do you think?

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/

On 31/03/15 08:26, sebDK wrote:

> Sorry few typos in my previous email, I post it again:
>
> Hi Ali,
>
> I think the mailing issue is now fixed.
> First thanks for your help.
>
> Regarding the following  documentation
> <https://docs.jboss.org/jbossas/guides/webguide/r2/en/html/ch07.html>  ,
> should look like:
>
> if I want to get the following virtual host working
> http://test.mydomain.com:8080
>
> Now if I deploy my archive test.war to JBoss AS 7.1.1 througth the web
> console management, I get in  the new line:
> . It is fine.
>
> If I use cargo to deploy test.war, I get the following line in
> standalone.xml
>
>
> In a short summary, if I use cargo to deploy a war file that has a virtual
> host set in  the deployment name is set to *rootContext.war* all the time.
> This is a problem if I deploy a couple of war files with virtual host
> settings because the deployment names have to be different.
>
> Is it giving any sense to you now?
> Can you make the problem again in your environment?
> If yes - I wrote a patch to fix the issue.
>
> Cheers,
>
> Sébastien
>
>
>
>
>
> --
> View this message in context: http://cargo.996258.n3.nabble.com/cargo-JBOSS7-1-virtual-hosting-tp19968p20091.html
> Sent from the User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: cargo+JBOSS7.1+virtual hosting

sebDK
Hi Ali,

Well, I basically wrote a patch to handle this problem.
Here is the key point of my workaround:

private String parseJbossWebXml()
    {
        String context = null;

        if (this.warArchive.getJBossWebXml() != null)
        {
        	//If there is a virtual-host in jboss-web.xml the context-root name is not used. WAR file name will be used instead.
        	if(!this.warArchive.getJBossWebXml().isVirtualHost()) context = this.warArchive.getJBossWebXml().getContextRoot();
        }

        return context;
    }

If your are intereseted, here is the patch I´ve done: jbossvirtualhost.patch

But, Ali, your solution is also fine.

Thanks for your help.

S.
Reply | Threaded
Open this post in threaded view
|

Re: cargo+JBOSS7.1+virtual hosting

sebDK
Hi Ali,

You do not think that the best deploy name should be the war file name ?

S.
Reply | Threaded
Open this post in threaded view
|

Re: cargo+JBOSS7.1+virtual hosting

S. Ali Tokmen
Hi Seb

I think not - Imagine a deployment where you are deploying webapp a
which has a WAR called "root" and webapp b another WAR called "root" as
well; but both under different Maven project ids (which is possible)...
Wouldn't work.

So, we need to add the virtual host there as well.

Cheers

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/

On 02/04/15 10:18, sebDK wrote:

> Hi Ali,
>
> You do not think that the best deploy name should be the war file name ?
>
> S.
>
>
>
>
> --
> View this message in context: http://cargo.996258.n3.nabble.com/cargo-JBOSS7-1-virtual-hosting-tp19968p20105.html
> Sent from the User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: cargo+JBOSS7.1+virtual hosting

sebDK
Hi Ali,

It looks fine. Looking forward getting the new cargo version.

S.
Reply | Threaded
Open this post in threaded view
|

Re: cargo+JBOSS7.1+virtual hosting

S. Ali Tokmen
Hi Seb

All good - Fix commited and documented in
https://jira.codehaus.org/browse/CARGO-1313

Check out
http://cargo.codehaus.org/Maven2+Plugin+Installation#Maven2PluginInstallation-snapshots
to understand how to start using it before we go with the new version.

Happy Easter!

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/

On 03/04/15 09:10, sebDK wrote:

> Hi Ali,
>
> It looks fine. Looking forward getting the new cargo version.
>
> S.
>
>
>
> --
> View this message in context: http://cargo.996258.n3.nabble.com/cargo-JBOSS7-1-virtual-hosting-tp19968p20115.html
> Sent from the User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email