Unable to deploy to Tomcat

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

Unable to deploy to Tomcat

Martin Wortner
Hello there, 
I'm really fighting with Cargo remote deployment. I want to use Cargo Daemon and I finally suceeded, BUT the problem is now with Tomcat(7x btw.). Cargo daemon just drops the .war file in the webapps, but the autodeploy feature of Tomcat will not replace the unpacked war content(unless the context is deleted or you delete the folder by hand). Note I'm using existing configuration. But I have seen this behavior even for local deployment as it is how tomcat behaves by default.

Is there way to use Cargo Daemon and redeploy properly, I need to mention that the redeployment is fired, but the content is used from the expanded war. Am I doing something wrong???

Please help I'm getting desperate.

M.W
Reply | Threaded
Open this post in threaded view
|

Re: Unable to deploy to Tomcat

S. Ali Tokmen
Hi Martin

Can you please explain a bit more in detail what you are doing (steps,
screenshots, code examples, pom.xml extracts, etc.)?

Thank you

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

On 28/01/15 13:55, Martin Wortner wrote:

> Hello there,
> I'm really fighting with Cargo remote deployment. I want to use Cargo
> Daemon and I finally suceeded, BUT the problem is now with Tomcat(7x
> btw.). Cargo daemon just drops the .war file in the webapps, but the
> autodeploy feature of Tomcat will not replace the unpacked war
> content(unless the context is deleted or you delete the folder by
> hand). Note I'm using existing configuration. But I have seen this
> behavior even for local deployment as it is how tomcat behaves by default.
>
> Is there way to use Cargo Daemon and redeploy properly, I need to
> mention that the redeployment is fired, but the content is used from
> the expanded war. Am I doing something wrong???
>
> Please help I'm getting desperate.
>
> M.W


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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Unable to deploy to Tomcat

Martin Wortner
Hi,
the problem is simple Tomcat will not unpack the .war file that is copied in place by Cargo. This happen when the unpacked folder is already there ie. redeploy. So first time everything is ok and .war file is unpacked, second time the redeploy happens, but seems from the old unpacked folder, thus the old version is then running. 

I'm using existing instalation. I don't know how cargo is suppose to work, but if the folder is there it will not work. Through the manager interface it works, but otherwise. My solution for now is to undeploy using tomcat maven plugin, which will remove the folder and then I'm doing cargo:daemon-start.

Maybe I'm missing something. I don't have the config here, but is just uses existing config, and tomcat7x container will add it after I will arive to work. Anyway thanks for answer.

Regards

M.W

---------- Původní zpráva ----------
Od: S. Ali Tokmen <[hidden email]>
Komu: [hidden email]
Datum: 29. 1. 2015 22:41:23
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

Can you please explain a bit more in detail what you are doing (steps,
screenshots, code examples, pom.xml extracts, etc.)?

Thank you

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

On 28/01/15 13:55, Martin Wortner wrote:

> Hello there,
> I'm really fighting with Cargo remote deployment. I want to use Cargo
> Daemon and I finally suceeded, BUT the problem is now with Tomcat(7x
> btw.). Cargo daemon just drops the .war file in the webapps, but the
> autodeploy feature of Tomcat will not replace the unpacked war
> content(unless the context is deleted or you delete the folder by
> hand). Note I'm using existing configuration. But I have seen this
> behavior even for local deployment as it is how tomcat behaves by default.
>
> Is there way to use Cargo Daemon and redeploy properly, I need to
> mention that the redeployment is fired, but the content is used from
> the expanded war. Am I doing something wrong???
>
> Please help I'm getting desperate.
>
> M.W


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

http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

Re: Unable to deploy to Tomcat

S. Ali Tokmen
Hi Martin

Thanks for these details.

Would you be so kind to go, step by step, on what you do? There are many combinations I can think of, and all that I tried worked so there must be something different between what I try and what you do.

Regards

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 07:39, Martin Wortner wrote:
Hi,
the problem is simple Tomcat will not unpack the .war file that is copied in place by Cargo. This happen when the unpacked folder is already there ie. redeploy. So first time everything is ok and .war file is unpacked, second time the redeploy happens, but seems from the old unpacked folder, thus the old version is then running. 

I'm using existing instalation. I don't know how cargo is suppose to work, but if the folder is there it will not work. Through the manager interface it works, but otherwise. My solution for now is to undeploy using tomcat maven plugin, which will remove the folder and then I'm doing cargo:daemon-start.

Maybe I'm missing something. I don't have the config here, but is just uses existing config, and tomcat7x container will add it after I will arive to work. Anyway thanks for answer.

Regards

M.W

---------- Původní zpráva ----------
Od: S. Ali Tokmen [hidden email]
Komu: [hidden email]
Datum: 29. 1. 2015 22:41:23
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

Can you please explain a bit more in detail what you are doing (steps,
screenshots, code examples, pom.xml extracts, etc.)?

Thank you

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

On 28/01/15 13:55, Martin Wortner wrote:
> Hello there,
> I'm really fighting with Cargo remote deployment. I want to use Cargo
> Daemon and I finally suceeded, BUT the problem is now with Tomcat(7x
> btw.). Cargo daemon just drops the .war file in the webapps, but the
> autodeploy feature of Tomcat will not replace the unpacked war
> content(unless the context is deleted or you delete the folder by
> hand). Note I'm using existing configuration. But I have seen this
> behavior even for local deployment as it is how tomcat behaves by default.
>
> Is there way to use Cargo Daemon and redeploy properly, I need to
> mention that the redeployment is fired, but the content is used from
> the expanded war. Am I doing something wrong???
>
> Please help I'm getting desperate.
>
> M.W


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

http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Unable to deploy to Tomcat

Martin Wortner
So requested details. Just tried that one more not to waste your time.

1. manually overwriting .war file locally without server restart properly worked
2. using cargo:daemon-start failed as the old context even with old probably restored session is used
3. manually overwriting .war file on remote works while server running works


Seems the restart causes Tomcat not to pick up the .war file.
Note I tried already deployOnStartup options, but then it deploys twice and the old version is deployed:-/


So now some config
my maven

   <profile>
            <id>tomcat7daemon</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                        <artifactId>cargo-maven2-plugin</artifactId>
                        <executions>
                            <!--execute after integration test this is to deploy to container not test-->
                            <execution>
                                <id>deploy-after-build</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>daemon-start</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <configuration>
                                <type>existing</type>
                                <home>${remote-tomcat7.home}</home>
                                <properties>
                                    <cargo.servlet.port>${servlet.port}</cargo.servlet.port>
                                </properties>
                            </configuration>
                            <container>
                                <containerId>tomcat7x</containerId>
                                <home>${remote-tomcat7.home}</home>
                                <dependencies>
                                    <dependency>
                                        <groupId>org.hsqldb</groupId>
                                        <artifactId>hsqldb</artifactId>
                                    </dependency>
                                </dependencies>
                            </container>
                            <deployables>
                                <deployable>
                                    <type>war</type>
                                    <pingURL>http://${hostname}:${servlet.port}/${application.name}/home</pingURL>       //not working ignored
                                </deployable>
                            </deployables>
                            <daemon>
                                <properties>
                                    <cargo.daemon.url>http://${hostname}:${daemon.port}/</cargo.daemon.url>
                                    <cargo.daemon.handleid>tomcat7-existing-remote-daemon</cargo.daemon.handleid>
                                </properties>
                            </daemon>
                        </configuration>
                    </plugin>
                </plugins>
                <finalName>${application.name}</finalName>
            </build>

        </profile>
 
in conf/context.xml i have this
<WatchedResource>META-INF/MANIFEST.MF</WatchedResource>
 as the app do not have web.xml I thought is good idea  to watch for some other file

my conf/server.xml
   <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true" undeployOldVersions="true" deployOnStartup="false">

I have wasted so much time on this issue. I was so long waiting for opportunity to introduce cargo to our company, but
now with so much time lost I don't know if I will be able to defend this solution.

One more thing I found out that Tomcat from 7.something do not auto deploy wars placed outside of webapps(aka appbase),
can it be that Tomcat thinks webapps is not his doc base when started from daemon, ie. deamon passes the doc base from config
and thus Tomcat thinks the folder is not appbase?:-/

"The documented and intended behaviour of unpackWARs is that it only applies to WARs in the appBase.  This is true for 5.5.x, 6.0.x and 7.0.x."

I have so many questions and cargo so many options.

Thanks in advance for hints

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen
Komu: [hidden email]
Datum: 30. 1. 2015 7:49:05
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin



Thanks for these details.



Would you be so kind to go, step by step, on what you do? There
are many combinations I can think of, and all that I tried worked
so there must be something different between what I try and what
you do.



Regards



S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 07:39, Martin Wortner wrote:



Hi,
the problem is simple Tomcat will not unpack the .war file
that is copied in place by Cargo. This happen when the unpacked
folder is already there ie. redeploy. So first time everything
is ok and .war file is unpacked, second time the redeploy
happens, but seems from the old unpacked folder, thus the old
version is then running. 





I'm using existing instalation. I don't know how cargo is
suppose to work, but if the folder is there it will not work.
Through the manager interface it works, but otherwise. My
solution for now is to undeploy using tomcat maven plugin, which
will remove the folder and then I'm doing cargo:daemon-start.





Maybe I'm missing something. I don't have the config here,
but is just uses existing config, and tomcat7x container will
add it after I will arive to work. Anyway thanks for answer.





Regards





M.W



---------- Původní zpráva ----------

Od: S. Ali Tokmen

Komu: [hidden email]

Datum: 29. 1. 2015 22:41:23

Předmět: Re: [cargo-user] Unable to deploy to Tomcat



Hi Martin



Can you please explain a bit more in detail what you are doing
(steps,

screenshots, code examples, pom.xml extracts, etc.)?



Thank you



S. Ali Tokmen

http://ali.tokmen.com/

http://contact.ali.tokmen.com/



On 28/01/15 13:55, Martin Wortner wrote:

> Hello there,

> I'm really fighting with Cargo remote deployment. I want
to use Cargo

> Daemon and I finally suceeded, BUT the problem is now
with Tomcat(7x

> btw.). Cargo daemon just drops the .war file in the
webapps, but the

> autodeploy feature of Tomcat will not replace the
unpacked war

> content(unless the context is deleted or you delete the
folder by

> hand). Note I'm using existing configuration. But I have
seen this

> behavior even for local deployment as it is how tomcat
behaves by default.

>

> Is there way to use Cargo Daemon and redeploy properly, I
need to

> mention that the redeployment is fired, but the content
is used from

> the expanded war. Am I doing something wrong???

>

> Please help I'm getting desperate.

>

> M.W





---------------------------------------------------------------------

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: Unable to deploy to Tomcat

S. Ali Tokmen
Hi Martin

OK, I see the problem: the existing local container does a .deploy and not .redeploy; so I believe in Tomcat's case this makes the server miss the new file.

Here's what you could try: in your pom.xml, add a remote deployer and call redeploy right after the daemon-start - this will most likely nail it down.

Let me know if this helps.

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 09:16, Martin Wortner wrote:
So requested details. Just tried that one more not to waste your time.

1. manually overwriting .war file locally without server restart properly worked
2. using cargo:daemon-start failed as the old context even with old probably restored session is used
3. manually overwriting .war file on remote works while server running works


Seems the restart causes Tomcat not to pick up the .war file.
Note I tried already deployOnStartup options, but then it deploys twice and the old version is deployed:-/


So now some config
my maven

   <profile>
            <id>tomcat7daemon</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                        <artifactId>cargo-maven2-plugin</artifactId>
                        <executions>
                            <!--execute after integration test this is to deploy to container not test-->
                            <execution>
                                <id>deploy-after-build</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>daemon-start</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <configuration>
                                <type>existing</type>
                                <home>${remote-tomcat7.home}</home>
                                <properties>
                                    <cargo.servlet.port>${servlet.port}</cargo.servlet.port>
                                </properties>
                            </configuration>
                            <container>
                                <containerId>tomcat7x</containerId>
                                <home>${remote-tomcat7.home}</home>
                                <dependencies>
                                    <dependency>
                                        <groupId>org.hsqldb</groupId>
                                        <artifactId>hsqldb</artifactId>
                                    </dependency>
                                </dependencies>
                            </container>
                            <deployables>
                                <deployable>
                                    <type>war</type>
                                    <pingURL>http://${hostname}:${servlet.port}/${application.name}/home</pingURL>       //not working ignored
                                </deployable>
                            </deployables>
                            <daemon>
                                <properties>
                                    <cargo.daemon.url>http://${hostname}:${daemon.port}/</cargo.daemon.url>
                                    <cargo.daemon.handleid>tomcat7-existing-remote-daemon</cargo.daemon.handleid>
                                </properties>
                            </daemon>
                        </configuration>
                    </plugin>
                </plugins>
                <finalName>${application.name}</finalName>
            </build>

        </profile>
  
in conf/context.xml i have this
<WatchedResource>META-INF/MANIFEST.MF</WatchedResource>
 as the app do not have web.xml I thought is good idea  to watch for some other file

my conf/server.xml
   <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true" undeployOldVersions="true" deployOnStartup="false">

I have wasted so much time on this issue. I was so long waiting for opportunity to introduce cargo to our company, but
now with so much time lost I don't know if I will be able to defend this solution.

One more thing I found out that Tomcat from 7.something do not auto deploy wars placed outside of webapps(aka appbase),
can it be that Tomcat thinks webapps is not his doc base when started from daemon, ie. deamon passes the doc base from config
and thus Tomcat thinks the folder is not appbase?:-/

"The documented and intended behaviour of unpackWARs is that it only applies to WARs in the appBase.  This is true for 5.5.x, 6.0.x and 7.0.x."

I have so many questions and cargo so many options. 

Thanks in advance for hints

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen 
Komu: [hidden email]
Datum: 30. 1. 2015 7:49:05
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin



Thanks for these details.



Would you be so kind to go, step by step, on what you do? There
are many combinations I can think of, and all that I tried worked
so there must be something different between what I try and what
you do.



Regards



S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 07:39, Martin Wortner wrote:



Hi,
the problem is simple Tomcat will not unpack the .war file
that is copied in place by Cargo. This happen when the unpacked
folder is already there ie. redeploy. So first time everything
is ok and .war file is unpacked, second time the redeploy
happens, but seems from the old unpacked folder, thus the old
version is then running. 





I'm using existing instalation. I don't know how cargo is
suppose to work, but if the folder is there it will not work.
Through the manager interface it works, but otherwise. My
solution for now is to undeploy using tomcat maven plugin, which
will remove the folder and then I'm doing cargo:daemon-start.





Maybe I'm missing something. I don't have the config here,
but is just uses existing config, and tomcat7x container will
add it after I will arive to work. Anyway thanks for answer.





Regards





M.W



---------- Původní zpráva ----------

Od: S. Ali Tokmen 

Komu: [hidden email]

Datum: 29. 1. 2015 22:41:23

Předmět: Re: [cargo-user] Unable to deploy to Tomcat



Hi Martin



Can you please explain a bit more in detail what you are doing
(steps,

screenshots, code examples, pom.xml extracts, etc.)?



Thank you



S. Ali Tokmen

http://ali.tokmen.com/

http://contact.ali.tokmen.com/



On 28/01/15 13:55, Martin Wortner wrote:

Hello there, 

      
I'm really fighting with Cargo remote deployment. I want
to use Cargo

Daemon and I finally suceeded, BUT the problem is now
with Tomcat(7x

btw.). Cargo daemon just drops the .war file in the
webapps, but the

autodeploy feature of Tomcat will not replace the
unpacked war

content(unless the context is deleted or you delete the
folder by

hand). Note I'm using existing configuration. But I have
seen this

behavior even for local deployment as it is how tomcat
behaves by default.


      

      
Is there way to use Cargo Daemon and redeploy properly, I
need to

mention that the redeployment is fired, but the content
is used from

the expanded war. Am I doing something wrong???

      

      

      
Please help I'm getting desperate.

      

      

      
M.W




---------------------------------------------------------------------

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: Unable to deploy to Tomcat

Martin Wortner

Hi, thanks for insight. It is close to my solution with maven tomcat plugin. Will try that anyway. I like Cargo and really thanks for suport.

Regards
M.W.

Sent with AquaMail for Android
http://www.aqua-mail.com

On 30 January 2015 19:57:16 "S. Ali Tokmen" <[hidden email]> wrote:

Hi Martin

OK, I see the problem: the existing local container does a .deploy and not .redeploy; so I believe in Tomcat's case this makes the server miss the new file.

Here's what you could try: in your pom.xml, add a remote deployer and call redeploy right after the daemon-start - this will most likely nail it down.

Let me know if this helps.

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 09:16, Martin Wortner wrote:
So requested details. Just tried that one more not to
waste your time.

1. manually overwriting .war file locally without server restart properly
worked
2. using cargo:daemon-start failed as the old context even with old
probably restored session is used
3. manually overwriting .war file on remote works while server running works


Seems the restart causes Tomcat not to pick up the .war file.
Note I tried already deployOnStartup options, but then it deploys twice and
the old version is deployed:-/


So now some config
my maven

   <profile>
            <id>tomcat7daemon</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                       
<artifactId>cargo-maven2-plugin</artifactId>
                        <executions>
                            <!--execute after integration test this is
to deploy to container not test-->
                            <execution>
                                <id>deploy-after-build</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>daemon-start</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <configuration>
                                <type>existing</type>
                                <home>${remote-tomcat7.home}</home>
                                <properties>
                                   
<cargo.servlet.port>${servlet.port}</cargo.servlet.port>
                                </properties>
                            </configuration>
                            <container>
                                <containerId>tomcat7x</containerId>
                                <home>${remote-tomcat7.home}</home>
                                <dependencies>
                                    <dependency>
                                       
<groupId>org.hsqldb</groupId>
                                       
<artifactId>hsqldb</artifactId>
                                    </dependency>
                                </dependencies>
                            </container>
                            <deployables>
                                <deployable>
                                    <type>war</type>
                                    <pingURL>http://${hostname}:${servlet.port}/${application.name}/home</pingURL>
      //not working ignored
                                </deployable>
                            </deployables>
                            <daemon>
                                <properties>
                                    <cargo.daemon.url>http://${hostname}:${daemon.port}/</cargo.daemon.url>
                                   
<cargo.daemon.handleid>tomcat7-existing-remote-daemon</cargo.daemon.handleid>
                                </properties>
                            </daemon>
                        </configuration>
                    </plugin>
                </plugins>
                <finalName>${application.name}</finalName>
            </build>

        </profile>
  
in conf/context.xml i have this
<WatchedResource>META-INF/MANIFEST.MF</WatchedResource>
 as the app do not have web.xml I thought is good idea  to watch for some
other file

my conf/server.xml
   <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true" undeployOldVersions="true"
deployOnStartup="false">

I have wasted so much time on this issue. I was so long waiting for
opportunity to introduce cargo to our company, but
now with so much time lost I don't know if I will be able to defend this
solution.

One more thing I found out that Tomcat from 7.something do not auto deploy
wars placed outside of webapps(aka appbase),
can it be that Tomcat thinks webapps is not his doc base when started from
daemon, ie. deamon passes the doc base from config
and thus Tomcat thinks the folder is not appbase?:-/

"The documented and intended behaviour of unpackWARs is that it only applies to WARs in the appBase.  This is true for 5.5.x, 6.0.x and 7.0.x."

I have so many questions and cargo so many options. 

Thanks in advance for hints

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen 
Komu: [hidden email]
Datum: 30. 1. 2015 7:49:05
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin



Thanks for these details.



Would you be so kind to go, step by step, on what you do? There
are many combinations I can think of, and all that I tried worked
so there must be something different between what I try and what
you do.



Regards



S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 07:39, Martin Wortner wrote:



Hi,
the problem is simple Tomcat will not unpack the .war file
that is copied in place by Cargo. This happen when the unpacked
folder is already there ie. redeploy. So first time everything
is ok and .war file is unpacked, second time the redeploy
happens, but seems from the old unpacked folder, thus the old
version is then running. 





I'm using existing instalation. I don't know how cargo is
suppose to work, but if the folder is there it will not work.
Through the manager interface it works, but otherwise. My
solution for now is to undeploy using tomcat maven plugin, which
will remove the folder and then I'm doing cargo:daemon-start.





Maybe I'm missing something. I don't have the config here,
but is just uses existing config, and tomcat7x container will
add it after I will arive to work. Anyway thanks for answer.





Regards





M.W



---------- Původní zpráva ----------

Od: S. Ali Tokmen 

Komu: [hidden email]

Datum: 29. 1. 2015 22:41:23

Předmět: Re: [cargo-user] Unable to deploy to Tomcat



Hi Martin



Can you please explain a bit more in detail what you are doing
(steps,

screenshots, code examples, pom.xml extracts, etc.)?



Thank you



S. Ali Tokmen

http://ali.tokmen.com/

http://contact.ali.tokmen.com/



On 28/01/15 13:55, Martin Wortner wrote:

Hello there, 

      
I'm really fighting with Cargo remote deployment. I want
to use Cargo

Daemon and I finally suceeded, BUT the problem is now
with Tomcat(7x

btw.). Cargo daemon just drops the .war file in the
webapps, but the

autodeploy feature of Tomcat will not replace the
unpacked war

content(unless the context is deleted or you delete the
folder by

hand). Note I'm using existing configuration. But I have
seen this

behavior even for local deployment as it is how tomcat
behaves by default.


      

      
Is there way to use Cargo Daemon and redeploy properly, I
need to

mention that the redeployment is fired, but the content
is used from

the expanded war. Am I doing something wrong???

      

      

      
Please help I'm getting desperate.

      

      

      
M.W




---------------------------------------------------------------------

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: Unable to deploy to Tomcat

S. Ali Tokmen
Hi Martin

OK, give a try, then :) I believe it would do what you want to.

Thanks to this I discovered a brand new issue and that we need to change the Existing Local Configurations / Local Containers so they attempt redeployment of deployables (and not simple deployment). This is now fixed - see https://jira.codehaus.org/browse/CARGO-1303

If you want to try the SNAPSHOT version, check out: http://cargo.codehaus.org/Downloads#Downloads-continousBuilds

Have a great weekend

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 21:02, Wortner wrote:

Hi, thanks for insight. It is close to my solution with maven tomcat plugin. Will try that anyway. I like Cargo and really thanks for suport.

Regards
M.W.

Sent with AquaMail for Android
http://www.aqua-mail.com

On 30 January 2015 19:57:16 "S. Ali Tokmen" [hidden email] wrote:

Hi Martin

OK, I see the problem: the existing local container does a .deploy and not .redeploy; so I believe in Tomcat's case this makes the server miss the new file.

Here's what you could try: in your pom.xml, add a remote deployer and call redeploy right after the daemon-start - this will most likely nail it down.

Let me know if this helps.

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 09:16, Martin Wortner wrote:
So requested details. Just tried that one more not to
waste your time.

1. manually overwriting .war file locally without server restart properly
worked
2. using cargo:daemon-start failed as the old context even with old
probably restored session is used
3. manually overwriting .war file on remote works while server running works


Seems the restart causes Tomcat not to pick up the .war file.
Note I tried already deployOnStartup options, but then it deploys twice and
the old version is deployed:-/


So now some config
my maven

   <profile>
            <id>tomcat7daemon</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                       
<artifactId>cargo-maven2-plugin</artifactId>
                        <executions>
                            <!--execute after integration test this is
to deploy to container not test-->
                            <execution>
                                <id>deploy-after-build</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>daemon-start</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <configuration>
                                <type>existing</type>
                                <home>${remote-tomcat7.home}</home>
                                <properties>
                                   
<cargo.servlet.port>${servlet.port}</cargo.servlet.port>
                                </properties>
                            </configuration>
                            <container>
                                <containerId>tomcat7x</containerId>
                                <home>${remote-tomcat7.home}</home>
                                <dependencies>
                                    <dependency>
                                       
<groupId>org.hsqldb</groupId>
                                       
<artifactId>hsqldb</artifactId>
                                    </dependency>
                                </dependencies>
                            </container>
                            <deployables>
                                <deployable>
                                    <type>war</type>
                                    <pingURL>http://${hostname}:${servlet.port}/${application.name}/home</pingURL>
      //not working ignored
                                </deployable>
                            </deployables>
                            <daemon>
                                <properties>
                                    <cargo.daemon.url>http://${hostname}:${daemon.port}/</cargo.daemon.url>
                                   
<cargo.daemon.handleid>tomcat7-existing-remote-daemon</cargo.daemon.handleid>
                                </properties>
                            </daemon>
                        </configuration>
                    </plugin>
                </plugins>
                <finalName>${application.name}</finalName>
            </build>

        </profile>
  
in conf/context.xml i have this
<WatchedResource>META-INF/MANIFEST.MF</WatchedResource>
 as the app do not have web.xml I thought is good idea  to watch for some
other file

my conf/server.xml
   <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true" undeployOldVersions="true"
deployOnStartup="false">

I have wasted so much time on this issue. I was so long waiting for
opportunity to introduce cargo to our company, but
now with so much time lost I don't know if I will be able to defend this
solution.

One more thing I found out that Tomcat from 7.something do not auto deploy
wars placed outside of webapps(aka appbase),
can it be that Tomcat thinks webapps is not his doc base when started from
daemon, ie. deamon passes the doc base from config
and thus Tomcat thinks the folder is not appbase?:-/

"The documented and intended behaviour of unpackWARs is that it only applies to WARs in the appBase.  This is true for 5.5.x, 6.0.x and 7.0.x."

I have so many questions and cargo so many options. 

Thanks in advance for hints

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen 
Komu: [hidden email]
Datum: 30. 1. 2015 7:49:05
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin



Thanks for these details.



Would you be so kind to go, step by step, on what you do? There
are many combinations I can think of, and all that I tried worked
so there must be something different between what I try and what
you do.



Regards



S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 07:39, Martin Wortner wrote:



Hi,
the problem is simple Tomcat will not unpack the .war file
that is copied in place by Cargo. This happen when the unpacked
folder is already there ie. redeploy. So first time everything
is ok and .war file is unpacked, second time the redeploy
happens, but seems from the old unpacked folder, thus the old
version is then running. 





I'm using existing instalation. I don't know how cargo is
suppose to work, but if the folder is there it will not work.
Through the manager interface it works, but otherwise. My
solution for now is to undeploy using tomcat maven plugin, which
will remove the folder and then I'm doing cargo:daemon-start.





Maybe I'm missing something. I don't have the config here,
but is just uses existing config, and tomcat7x container will
add it after I will arive to work. Anyway thanks for answer.





Regards





M.W



---------- Původní zpráva ----------

Od: S. Ali Tokmen 

Komu: [hidden email]

Datum: 29. 1. 2015 22:41:23

Předmět: Re: [cargo-user] Unable to deploy to Tomcat



Hi Martin



Can you please explain a bit more in detail what you are doing
(steps,

screenshots, code examples, pom.xml extracts, etc.)?



Thank you



S. Ali Tokmen

http://ali.tokmen.com/

http://contact.ali.tokmen.com/



On 28/01/15 13:55, Martin Wortner wrote:

Hello there, 
I'm really fighting with Cargo remote deployment. I want
to use Cargo

Daemon and I finally suceeded, BUT the problem is now
with Tomcat(7x

btw.). Cargo daemon just drops the .war file in the
webapps, but the

autodeploy feature of Tomcat will not replace the
unpacked war

content(unless the context is deleted or you delete the
folder by

hand). Note I'm using existing configuration. But I have
seen this

behavior even for local deployment as it is how tomcat
behaves by default.

Is there way to use Cargo Daemon and redeploy properly, I
need to

mention that the redeployment is fired, but the content
is used from

the expanded war. Am I doing something wrong???
Please help I'm getting desperate.
M.W



---------------------------------------------------------------------

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: Unable to deploy to Tomcat

Martin Wortner
Just one more question, whenever I'm running the cargo:daemon-start it ends just as soon as it somehow realizes the container is up. The problem is that after that some tests follows, the container is up not the webapp. I thought it can be solved by using <pingURL> element. But it was not working for me, can you check the excerpt I sent bellow, if I'm using it correctly?
Again many thanks

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen <[hidden email]>
Komu: [hidden email]
Datum: 30. 1. 2015 23:45:59
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

OK, give a try, then :) I believe it would do what you want to.

Thanks to this I discovered a brand new issue and that we need to change the Existing Local Configurations / Local Containers so they attempt redeployment of deployables (and not simple deployment). This is now fixed - see https://jira.codehaus.org/browse/CARGO-1303

If you want to try the SNAPSHOT version, check out: http://cargo.codehaus.org/Downloads#Downloads-continousBuilds

Have a great weekend

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 21:02, Wortner wrote:

Hi, thanks for insight. It is close to my solution with maven tomcat plugin. Will try that anyway. I like Cargo and really thanks for suport.

Regards
M.W.

Sent with AquaMail for Android
http://www.aqua-mail.com

On 30 January 2015 19:57:16 "S. Ali Tokmen" [hidden email] wrote:

Hi Martin

OK, I see the problem: the existing local container does a .deploy and not .redeploy; so I believe in Tomcat's case this makes the server miss the new file.

Here's what you could try: in your pom.xml, add a remote deployer and call redeploy right after the daemon-start - this will most likely nail it down.

Let me know if this helps.

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 09:16, Martin Wortner wrote:
So requested details. Just tried that one more not to
waste your time.

1. manually overwriting .war file locally without server restart properly
worked
2. using cargo:daemon-start failed as the old context even with old
probably restored session is used
3. manually overwriting .war file on remote works while server running works


Seems the restart causes Tomcat not to pick up the .war file.
Note I tried already deployOnStartup options, but then it deploys twice and
the old version is deployed:-/


So now some config
my maven

   <profile>
            <id>tomcat7daemon</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                       
<artifactId>cargo-maven2-plugin</artifactId>
                        <executions>
                            <!--execute after integration test this is
to deploy to container not test-->
                            <execution>
                                <id>deploy-after-build</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>daemon-start</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <configuration>
                                <type>existing</type>
                                <home>${remote-tomcat7.home}</home>
                                <properties>
                                   
<cargo.servlet.port>${servlet.port}</cargo.servlet.port>
                                </properties>
                            </configuration>
                            <container>
                                <containerId>tomcat7x</containerId>
                                <home>${remote-tomcat7.home}</home>
                                <dependencies>
                                    <dependency>
                                       
<groupId>org.hsqldb</groupId>
                                       
<artifactId>hsqldb</artifactId>
                                    </dependency>
                                </dependencies>
                            </container>
                            <deployables>
                                <deployable>
                                    <type>war</type>
                                    <pingURL>http://${hostname}:${servlet.port}/${application.name}/home</pingURL>
      //not working ignored
                                </deployable>
                            </deployables>
                            <daemon>
                                <properties>
                                    <cargo.daemon.url>http://${hostname}:${daemon.port}/</cargo.daemon.url>
                                   
<cargo.daemon.handleid>tomcat7-existing-remote-daemon</cargo.daemon.handleid>
                                </properties>
                            </daemon>
                        </configuration>
                    </plugin>
                </plugins>
                <finalName>${application.name}</finalName>
            </build>

        </profile>
  
in conf/context.xml i have this
<WatchedResource>META-INF/MANIFEST.MF</WatchedResource>
 as the app do not have web.xml I thought is good idea  to watch for some
other file

my conf/server.xml
   <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true" undeployOldVersions="true"
deployOnStartup="false">

I have wasted so much time on this issue. I was so long waiting for
opportunity to introduce cargo to our company, but
now with so much time lost I don't know if I will be able to defend this
solution.

One more thing I found out that Tomcat from 7.something do not auto deploy
wars placed outside of webapps(aka appbase),
can it be that Tomcat thinks webapps is not his doc base when started from
daemon, ie. deamon passes the doc base from config
and thus Tomcat thinks the folder is not appbase?:-/

"The documented and intended behaviour of unpackWARs is that it only applies to WARs in the appBase.  This is true for 5.5.x, 6.0.x and 7.0.x."

I have so many questions and cargo so many options. 

Thanks in advance for hints

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen 
Komu: [hidden email]
Datum: 30. 1. 2015 7:49:05
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin



Thanks for these details.



Would you be so kind to go, step by step, on what you do? There
are many combinations I can think of, and all that I tried worked
so there must be something different between what I try and what
you do.



Regards



S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 07:39, Martin Wortner wrote:



Hi,
the problem is simple Tomcat will not unpack the .war file
that is copied in place by Cargo. This happen when the unpacked
folder is already there ie. redeploy. So first time everything
is ok and .war file is unpacked, second time the redeploy
happens, but seems from the old unpacked folder, thus the old
version is then running. 





I'm using existing instalation. I don't know how cargo is
suppose to work, but if the folder is there it will not work.
Through the manager interface it works, but otherwise. My
solution for now is to undeploy using tomcat maven plugin, which
will remove the folder and then I'm doing cargo:daemon-start.





Maybe I'm missing something. I don't have the config here,
but is just uses existing config, and tomcat7x container will
add it after I will arive to work. Anyway thanks for answer.





Regards





M.W



---------- Původní zpráva ----------

Od: S. Ali Tokmen 

Komu: [hidden email]

Datum: 29. 1. 2015 22:41:23

Předmět: Re: [cargo-user] Unable to deploy to Tomcat



Hi Martin



Can you please explain a bit more in detail what you are doing
(steps,

screenshots, code examples, pom.xml extracts, etc.)?



Thank you



S. Ali Tokmen

http://ali.tokmen.com/

http://contact.ali.tokmen.com/



On 28/01/15 13:55, Martin Wortner wrote:

Hello there, 
I'm really fighting with Cargo remote deployment. I want
to use Cargo

Daemon and I finally suceeded, BUT the problem is now
with Tomcat(7x

btw.). Cargo daemon just drops the .war file in the
webapps, but the

autodeploy feature of Tomcat will not replace the
unpacked war

content(unless the context is deleted or you delete the
folder by

hand). Note I'm using existing configuration. But I have
seen this

behavior even for local deployment as it is how tomcat
behaves by default.

Is there way to use Cargo Daemon and redeploy properly, I
need to

mention that the redeployment is fired, but the content
is used from

the expanded war. Am I doing something wrong???
Please help I'm getting desperate.
M.W

---------------------------------------------------------------------

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: Unable to deploy to Tomcat

S. Ali Tokmen
Hi Martin

PingUrl will work better with the remote deployer :)

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 31/01/15 09:26, Martin Wortner wrote:
Just one more question, whenever I'm running the cargo:daemon-start it ends just as soon as it somehow realizes the container is up. The problem is that after that some tests follows, the container is up not the webapp. I thought it can be solved by using <pingURL> element. But it was not working for me, can you check the excerpt I sent bellow, if I'm using it correctly?
Again many thanks

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen [hidden email]
Komu: [hidden email]
Datum: 30. 1. 2015 23:45:59
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

OK, give a try, then :) I believe it would do what you want to.

Thanks to this I discovered a brand new issue and that we need to change the Existing Local Configurations / Local Containers so they attempt redeployment of deployables (and not simple deployment). This is now fixed - see https://jira.codehaus.org/browse/CARGO-1303

If you want to try the SNAPSHOT version, check out: http://cargo.codehaus.org/Downloads#Downloads-continousBuilds

Have a great weekend

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 21:02, Wortner wrote:

Hi, thanks for insight. It is close to my solution with maven tomcat plugin. Will try that anyway. I like Cargo and really thanks for suport.

Regards
M.W.

Sent with AquaMail for Android
http://www.aqua-mail.com

On 30 January 2015 19:57:16 "S. Ali Tokmen" [hidden email] wrote:

Hi Martin

OK, I see the problem: the existing local container does a .deploy and not .redeploy; so I believe in Tomcat's case this makes the server miss the new file.

Here's what you could try: in your pom.xml, add a remote deployer and call redeploy right after the daemon-start - this will most likely nail it down.

Let me know if this helps.

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 09:16, Martin Wortner wrote:
So requested details. Just tried that one more not to
waste your time.

1. manually overwriting .war file locally without server restart properly
worked
2. using cargo:daemon-start failed as the old context even with old
probably restored session is used
3. manually overwriting .war file on remote works while server running works


Seems the restart causes Tomcat not to pick up the .war file.
Note I tried already deployOnStartup options, but then it deploys twice and
the old version is deployed:-/


So now some config
my maven

   <profile>
            <id>tomcat7daemon</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                       
<artifactId>cargo-maven2-plugin</artifactId>
                        <executions>
                            <!--execute after integration test this is
to deploy to container not test-->
                            <execution>
                                <id>deploy-after-build</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>daemon-start</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <configuration>
                                <type>existing</type>
                                <home>${remote-tomcat7.home}</home>
                                <properties>
                                   
<cargo.servlet.port>${servlet.port}</cargo.servlet.port>
                                </properties>
                            </configuration>
                            <container>
                                <containerId>tomcat7x</containerId>
                                <home>${remote-tomcat7.home}</home>
                                <dependencies>
                                    <dependency>
                                       
<groupId>org.hsqldb</groupId>
                                       
<artifactId>hsqldb</artifactId>
                                    </dependency>
                                </dependencies>
                            </container>
                            <deployables>
                                <deployable>
                                    <type>war</type>
                                    <pingURL>http://${hostname}:${servlet.port}/${application.name}/home</pingURL>
      //not working ignored
                                </deployable>
                            </deployables>
                            <daemon>
                                <properties>
                                    <cargo.daemon.url>http://${hostname}:${daemon.port}/</cargo.daemon.url>
                                   
<cargo.daemon.handleid>tomcat7-existing-remote-daemon</cargo.daemon.handleid>
                                </properties>
                            </daemon>
                        </configuration>
                    </plugin>
                </plugins>
                <finalName>${application.name}</finalName>
            </build>

        </profile>
  
in conf/context.xml i have this
<WatchedResource>META-INF/MANIFEST.MF</WatchedResource>
 as the app do not have web.xml I thought is good idea  to watch for some
other file

my conf/server.xml
   <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true" undeployOldVersions="true"
deployOnStartup="false">

I have wasted so much time on this issue. I was so long waiting for
opportunity to introduce cargo to our company, but
now with so much time lost I don't know if I will be able to defend this
solution.

One more thing I found out that Tomcat from 7.something do not auto deploy
wars placed outside of webapps(aka appbase),
can it be that Tomcat thinks webapps is not his doc base when started from
daemon, ie. deamon passes the doc base from config
and thus Tomcat thinks the folder is not appbase?:-/

"The documented and intended behaviour of unpackWARs is that it only applies to WARs in the appBase.  This is true for 5.5.x, 6.0.x and 7.0.x."

I have so many questions and cargo so many options. 

Thanks in advance for hints

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen 
Komu: [hidden email]
Datum: 30. 1. 2015 7:49:05
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin



Thanks for these details.



Would you be so kind to go, step by step, on what you do? There
are many combinations I can think of, and all that I tried worked
so there must be something different between what I try and what
you do.



Regards



S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 07:39, Martin Wortner wrote:



Hi,
the problem is simple Tomcat will not unpack the .war file
that is copied in place by Cargo. This happen when the unpacked
folder is already there ie. redeploy. So first time everything
is ok and .war file is unpacked, second time the redeploy
happens, but seems from the old unpacked folder, thus the old
version is then running. 





I'm using existing instalation. I don't know how cargo is
suppose to work, but if the folder is there it will not work.
Through the manager interface it works, but otherwise. My
solution for now is to undeploy using tomcat maven plugin, which
will remove the folder and then I'm doing cargo:daemon-start.





Maybe I'm missing something. I don't have the config here,
but is just uses existing config, and tomcat7x container will
add it after I will arive to work. Anyway thanks for answer.





Regards





M.W



---------- Původní zpráva ----------

Od: S. Ali Tokmen 

Komu: [hidden email]

Datum: 29. 1. 2015 22:41:23

Předmět: Re: [cargo-user] Unable to deploy to Tomcat



Hi Martin



Can you please explain a bit more in detail what you are doing
(steps,

screenshots, code examples, pom.xml extracts, etc.)?



Thank you



S. Ali Tokmen

http://ali.tokmen.com/

http://contact.ali.tokmen.com/



On 28/01/15 13:55, Martin Wortner wrote:

Hello there, 
I'm really fighting with Cargo remote deployment. I want
to use Cargo

Daemon and I finally suceeded, BUT the problem is now
with Tomcat(7x

btw.). Cargo daemon just drops the .war file in the
webapps, but the

autodeploy feature of Tomcat will not replace the
unpacked war

content(unless the context is deleted or you delete the
folder by

hand). Note I'm using existing configuration. But I have
seen this

behavior even for local deployment as it is how tomcat
behaves by default.

Is there way to use Cargo Daemon and redeploy properly, I
need to

mention that the redeployment is fired, but the content
is used from

the expanded war. Am I doing something wrong???
Please help I'm getting desperate.
M.W
---------------------------------------------------------------------

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: Unable to deploy to Tomcat

Martin Wortner
So no way how to wait for the app to deploy other then remote deployer and pingUrl. I'm using daemon to be able to stop start tomcat, omit the use of cumbersome scripts, so for me remote deployer is not enough I quess. Will try to resolve it somehow, with i.e. https://github.com/tacitknowledge/maven-wait-plugin


---------- Původní zpráva ----------
Od: S. Ali Tokmen <[hidden email]>
Komu: [hidden email]
Datum: 31. 1. 2015 10:01:37
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

PingUrl will work better with the remote deployer :)

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 31/01/15 09:26, Martin Wortner wrote:
Just one more question, whenever I'm running the cargo:daemon-start it ends just as soon as it somehow realizes the container is up. The problem is that after that some tests follows, the container is up not the webapp. I thought it can be solved by using <pingURL> element. But it was not working for me, can you check the excerpt I sent bellow, if I'm using it correctly?
Again many thanks

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen [hidden email]
Komu: [hidden email]
Datum: 30. 1. 2015 23:45:59
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

OK, give a try, then :) I believe it would do what you want to.

Thanks to this I discovered a brand new issue and that we need to change the Existing Local Configurations / Local Containers so they attempt redeployment of deployables (and not simple deployment). This is now fixed - see https://jira.codehaus.org/browse/CARGO-1303

If you want to try the SNAPSHOT version, check out: http://cargo.codehaus.org/Downloads#Downloads-continousBuilds

Have a great weekend

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 21:02, Wortner wrote:

Hi, thanks for insight. It is close to my solution with maven tomcat plugin. Will try that anyway. I like Cargo and really thanks for suport.

Regards
M.W.

Sent with AquaMail for Android
http://www.aqua-mail.com

On 30 January 2015 19:57:16 "S. Ali Tokmen" [hidden email] wrote:

Hi Martin

OK, I see the problem: the existing local container does a .deploy and not .redeploy; so I believe in Tomcat's case this makes the server miss the new file.

Here's what you could try: in your pom.xml, add a remote deployer and call redeploy right after the daemon-start - this will most likely nail it down.

Let me know if this helps.

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 09:16, Martin Wortner wrote:
So requested details. Just tried that one more not to
waste your time.

1. manually overwriting .war file locally without server restart properly
worked
2. using cargo:daemon-start failed as the old context even with old
probably restored session is used
3. manually overwriting .war file on remote works while server running works


Seems the restart causes Tomcat not to pick up the .war file.
Note I tried already deployOnStartup options, but then it deploys twice and
the old version is deployed:-/


So now some config
my maven

   <profile>
            <id>tomcat7daemon</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                       
<artifactId>cargo-maven2-plugin</artifactId>
                        <executions>
                            <!--execute after integration test this is
to deploy to container not test-->
                            <execution>
                                <id>deploy-after-build</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>daemon-start</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <configuration>
                                <type>existing</type>
                                <home>${remote-tomcat7.home}</home>
                                <properties>
                                   
<cargo.servlet.port>${servlet.port}</cargo.servlet.port>
                                </properties>
                            </configuration>
                            <container>
                                <containerId>tomcat7x</containerId>
                                <home>${remote-tomcat7.home}</home>
                                <dependencies>
                                    <dependency>
                                       
<groupId>org.hsqldb</groupId>
                                       
<artifactId>hsqldb</artifactId>
                                    </dependency>
                                </dependencies>
                            </container>
                            <deployables>
                                <deployable>
                                    <type>war</type>
                                    <pingURL>http://${hostname}:${servlet.port}/${application.name}/home</pingURL>
      //not working ignored
                                </deployable>
                            </deployables>
                            <daemon>
                                <properties>
                                    <cargo.daemon.url>http://${hostname}:${daemon.port}/</cargo.daemon.url>
                                   
<cargo.daemon.handleid>tomcat7-existing-remote-daemon</cargo.daemon.handleid>
                                </properties>
                            </daemon>
                        </configuration>
                    </plugin>
                </plugins>
                <finalName>${application.name}</finalName>
            </build>

        </profile>
  
in conf/context.xml i have this
<WatchedResource>META-INF/MANIFEST.MF</WatchedResource>
 as the app do not have web.xml I thought is good idea  to watch for some
other file

my conf/server.xml
   <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true" undeployOldVersions="true"
deployOnStartup="false">

I have wasted so much time on this issue. I was so long waiting for
opportunity to introduce cargo to our company, but
now with so much time lost I don't know if I will be able to defend this
solution.

One more thing I found out that Tomcat from 7.something do not auto deploy
wars placed outside of webapps(aka appbase),
can it be that Tomcat thinks webapps is not his doc base when started from
daemon, ie. deamon passes the doc base from config
and thus Tomcat thinks the folder is not appbase?:-/

"The documented and intended behaviour of unpackWARs is that it only applies to WARs in the appBase.  This is true for 5.5.x, 6.0.x and 7.0.x."

I have so many questions and cargo so many options. 

Thanks in advance for hints

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen 
Komu: [hidden email]
Datum: 30. 1. 2015 7:49:05
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin



Thanks for these details.



Would you be so kind to go, step by step, on what you do? There
are many combinations I can think of, and all that I tried worked
so there must be something different between what I try and what
you do.



Regards



S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 07:39, Martin Wortner wrote:



Hi,
the problem is simple Tomcat will not unpack the .war file
that is copied in place by Cargo. This happen when the unpacked
folder is already there ie. redeploy. So first time everything
is ok and .war file is unpacked, second time the redeploy
happens, but seems from the old unpacked folder, thus the old
version is then running. 





I'm using existing instalation. I don't know how cargo is
suppose to work, but if the folder is there it will not work.
Through the manager interface it works, but otherwise. My
solution for now is to undeploy using tomcat maven plugin, which
will remove the folder and then I'm doing cargo:daemon-start.





Maybe I'm missing something. I don't have the config here,
but is just uses existing config, and tomcat7x container will
add it after I will arive to work. Anyway thanks for answer.





Regards





M.W



---------- Původní zpráva ----------

Od: S. Ali Tokmen 

Komu: [hidden email]

Datum: 29. 1. 2015 22:41:23

Předmět: Re: [cargo-user] Unable to deploy to Tomcat



Hi Martin



Can you please explain a bit more in detail what you are doing
(steps,

screenshots, code examples, pom.xml extracts, etc.)?



Thank you



S. Ali Tokmen

http://ali.tokmen.com/

http://contact.ali.tokmen.com/



On 28/01/15 13:55, Martin Wortner wrote:

Hello there, 
I'm really fighting with Cargo remote deployment. I want
to use Cargo

Daemon and I finally suceeded, BUT the problem is now
with Tomcat(7x

btw.). Cargo daemon just drops the .war file in the
webapps, but the

autodeploy feature of Tomcat will not replace the
unpacked war

content(unless the context is deleted or you delete the
folder by

hand). Note I'm using existing configuration. But I have
seen this

behavior even for local deployment as it is how tomcat
behaves by default.

Is there way to use Cargo Daemon and redeploy properly, I
need to

mention that the redeployment is fired, but the content
is used from

the expanded war. Am I doing something wrong???
Please help I'm getting desperate.
M.W
---------------------------------------------------------------------

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: Unable to deploy to Tomcat

S. Ali Tokmen
Hi Martin

I'm afraid you hit another bug, CARGO-1304 - The daemon-start goal does not respect the pingUrl. Good news is that it is corrected in the SNAPSHOT version, which gives you two options:
Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 31/01/15 10:16, Martin Wortner wrote:
So no way how to wait for the app to deploy other then remote deployer and pingUrl. I'm using daemon to be able to stop start tomcat, omit the use of cumbersome scripts, so for me remote deployer is not enough I quess. Will try to resolve it somehow, with i.e. https://github.com/tacitknowledge/maven-wait-plugin


---------- Původní zpráva ----------
Od: S. Ali Tokmen [hidden email]
Komu: [hidden email]
Datum: 31. 1. 2015 10:01:37
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

PingUrl will work better with the remote deployer :)

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 31/01/15 09:26, Martin Wortner wrote:
Just one more question, whenever I'm running the cargo:daemon-start it ends just as soon as it somehow realizes the container is up. The problem is that after that some tests follows, the container is up not the webapp. I thought it can be solved by using <pingURL> element. But it was not working for me, can you check the excerpt I sent bellow, if I'm using it correctly?
Again many thanks

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen [hidden email]
Komu: [hidden email]
Datum: 30. 1. 2015 23:45:59
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

OK, give a try, then :) I believe it would do what you want to.

Thanks to this I discovered a brand new issue and that we need to change the Existing Local Configurations / Local Containers so they attempt redeployment of deployables (and not simple deployment). This is now fixed - see https://jira.codehaus.org/browse/CARGO-1303

If you want to try the SNAPSHOT version, check out: http://cargo.codehaus.org/Downloads#Downloads-continousBuilds

Have a great weekend

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 21:02, Wortner wrote:

Hi, thanks for insight. It is close to my solution with maven tomcat plugin. Will try that anyway. I like Cargo and really thanks for suport.

Regards
M.W.

Sent with AquaMail for Android
http://www.aqua-mail.com

On 30 January 2015 19:57:16 "S. Ali Tokmen" [hidden email] wrote:

Hi Martin

OK, I see the problem: the existing local container does a .deploy and not .redeploy; so I believe in Tomcat's case this makes the server miss the new file.

Here's what you could try: in your pom.xml, add a remote deployer and call redeploy right after the daemon-start - this will most likely nail it down.

Let me know if this helps.

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 09:16, Martin Wortner wrote:
So requested details. Just tried that one more not to
waste your time.

1. manually overwriting .war file locally without server restart properly
worked
2. using cargo:daemon-start failed as the old context even with old
probably restored session is used
3. manually overwriting .war file on remote works while server running works


Seems the restart causes Tomcat not to pick up the .war file.
Note I tried already deployOnStartup options, but then it deploys twice and
the old version is deployed:-/


So now some config
my maven

   <profile>
            <id>tomcat7daemon</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                       
<artifactId>cargo-maven2-plugin</artifactId>
                        <executions>
                            <!--execute after integration test this is
to deploy to container not test-->
                            <execution>
                                <id>deploy-after-build</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>daemon-start</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <configuration>
                                <type>existing</type>
                                <home>${remote-tomcat7.home}</home>
                                <properties>
                                   
<cargo.servlet.port>${servlet.port}</cargo.servlet.port>
                                </properties>
                            </configuration>
                            <container>
                                <containerId>tomcat7x</containerId>
                                <home>${remote-tomcat7.home}</home>
                                <dependencies>
                                    <dependency>
                                       
<groupId>org.hsqldb</groupId>
                                       
<artifactId>hsqldb</artifactId>
                                    </dependency>
                                </dependencies>
                            </container>
                            <deployables>
                                <deployable>
                                    <type>war</type>
                                    <pingURL>http://${hostname}:${servlet.port}/${application.name}/home</pingURL>
      //not working ignored
                                </deployable>
                            </deployables>
                            <daemon>
                                <properties>
                                    <cargo.daemon.url>http://${hostname}:${daemon.port}/</cargo.daemon.url>
                                   
<cargo.daemon.handleid>tomcat7-existing-remote-daemon</cargo.daemon.handleid>
                                </properties>
                            </daemon>
                        </configuration>
                    </plugin>
                </plugins>
                <finalName>${application.name}</finalName>
            </build>

        </profile>
  
in conf/context.xml i have this
<WatchedResource>META-INF/MANIFEST.MF</WatchedResource>
 as the app do not have web.xml I thought is good idea  to watch for some
other file

my conf/server.xml
   <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true" undeployOldVersions="true"
deployOnStartup="false">

I have wasted so much time on this issue. I was so long waiting for
opportunity to introduce cargo to our company, but
now with so much time lost I don't know if I will be able to defend this
solution.

One more thing I found out that Tomcat from 7.something do not auto deploy
wars placed outside of webapps(aka appbase),
can it be that Tomcat thinks webapps is not his doc base when started from
daemon, ie. deamon passes the doc base from config
and thus Tomcat thinks the folder is not appbase?:-/

"The documented and intended behaviour of unpackWARs is that it only applies to WARs in the appBase.  This is true for 5.5.x, 6.0.x and 7.0.x."

I have so many questions and cargo so many options. 

Thanks in advance for hints

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen 
Komu: [hidden email]
Datum: 30. 1. 2015 7:49:05
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin



Thanks for these details.



Would you be so kind to go, step by step, on what you do? There
are many combinations I can think of, and all that I tried worked
so there must be something different between what I try and what
you do.



Regards



S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 07:39, Martin Wortner wrote:



Hi,
the problem is simple Tomcat will not unpack the .war file
that is copied in place by Cargo. This happen when the unpacked
folder is already there ie. redeploy. So first time everything
is ok and .war file is unpacked, second time the redeploy
happens, but seems from the old unpacked folder, thus the old
version is then running. 





I'm using existing instalation. I don't know how cargo is
suppose to work, but if the folder is there it will not work.
Through the manager interface it works, but otherwise. My
solution for now is to undeploy using tomcat maven plugin, which
will remove the folder and then I'm doing cargo:daemon-start.





Maybe I'm missing something. I don't have the config here,
but is just uses existing config, and tomcat7x container will
add it after I will arive to work. Anyway thanks for answer.





Regards





M.W



---------- Původní zpráva ----------

Od: S. Ali Tokmen 

Komu: [hidden email]

Datum: 29. 1. 2015 22:41:23

Předmět: Re: [cargo-user] Unable to deploy to Tomcat



Hi Martin



Can you please explain a bit more in detail what you are doing
(steps,

screenshots, code examples, pom.xml extracts, etc.)?



Thank you



S. Ali Tokmen

http://ali.tokmen.com/

http://contact.ali.tokmen.com/



On 28/01/15 13:55, Martin Wortner wrote:

Hello there, 
I'm really fighting with Cargo remote deployment. I want
to use Cargo

Daemon and I finally suceeded, BUT the problem is now
with Tomcat(7x

btw.). Cargo daemon just drops the .war file in the
webapps, but the

autodeploy feature of Tomcat will not replace the
unpacked war

content(unless the context is deleted or you delete the
folder by

hand). Note I'm using existing configuration. But I have
seen this

behavior even for local deployment as it is how tomcat
behaves by default.

Is there way to use Cargo Daemon and redeploy properly, I
need to

mention that the redeployment is fired, but the content
is used from

the expanded war. Am I doing something wrong???
Please help I'm getting desperate.
M.W
---------------------------------------------------------------------

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: Unable to deploy to Tomcat

Martin Wortner
Checked with the SNAPSHOT, pingUrl works now, 
but I'm afraid the deployment is still not working read this please

http://stackoverflow.com/questions/17810083/tomcat-does-not-unpack-war-file-if-folder-with-the-same-name-with-war-file-is-ex

http://stackoverflow.com/questions/4604335/tomcat-not-autodeploying-war-file
or here where they wrote 

Any web application archive file within the application base (appBase) directory that does not have a corresponding directory of the same name (without the ".war" extension) will be automatically expanded, unless the unpackWARs property is set to false. If you redeploy an updated WAR file, be sure to delete the expanded directory when restarting Tomcat, so that the updated WAR file will be re-expanded (note that the auto deployer, if enabled, will automatically expand the updated WAR file once the previously expanded directory is removed).

Maybe the unpacked folder must really be deleted. 

If I will do the star-daemon and redeploy after there are several issue
- running same plugin with different configuration in one build
- the application will be deployed twice first with daemon-start second with redeploy

I can not do the undeploy before, as the server can be stopped for some reason and in that case the undeploy will not happen.

In my eyes this unpacking thingy for Tomcat is really pain.

Thank you 

M.

---------- Původní zpráva ----------
Od: S. Ali Tokmen <[hidden email]>
Komu: [hidden email]
Datum: 1. 2. 2015 12:30:33
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

I'm afraid you hit another bug, CARGO-1304 - The daemon-start goal does not respect the pingUrl. Good news is that it is corrected in the SNAPSHOT version, which gives you two options:
Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 31/01/15 10:16, Martin Wortner wrote:
So no way how to wait for the app to deploy other then remote deployer and pingUrl. I'm using daemon to be able to stop start tomcat, omit the use of cumbersome scripts, so for me remote deployer is not enough I quess. Will try to resolve it somehow, with i.e. https://github.com/tacitknowledge/maven-wait-plugin


---------- Původní zpráva ----------
Od: S. Ali Tokmen [hidden email]
Komu: [hidden email]
Datum: 31. 1. 2015 10:01:37
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

PingUrl will work better with the remote deployer :)

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 31/01/15 09:26, Martin Wortner wrote:
Just one more question, whenever I'm running the cargo:daemon-start it ends just as soon as it somehow realizes the container is up. The problem is that after that some tests follows, the container is up not the webapp. I thought it can be solved by using <pingURL> element. But it was not working for me, can you check the excerpt I sent bellow, if I'm using it correctly?
Again many thanks

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen [hidden email]
Komu: [hidden email]
Datum: 30. 1. 2015 23:45:59
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

OK, give a try, then :) I believe it would do what you want to.

Thanks to this I discovered a brand new issue and that we need to change the Existing Local Configurations / Local Containers so they attempt redeployment of deployables (and not simple deployment). This is now fixed - see https://jira.codehaus.org/browse/CARGO-1303

If you want to try the SNAPSHOT version, check out: http://cargo.codehaus.org/Downloads#Downloads-continousBuilds

Have a great weekend

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 21:02, Wortner wrote:

Hi, thanks for insight. It is close to my solution with maven tomcat plugin. Will try that anyway. I like Cargo and really thanks for suport.

Regards
M.W.

Sent with AquaMail for Android
http://www.aqua-mail.com

On 30 January 2015 19:57:16 "S. Ali Tokmen" [hidden email] wrote:

Hi Martin

OK, I see the problem: the existing local container does a .deploy and not .redeploy; so I believe in Tomcat's case this makes the server miss the new file.

Here's what you could try: in your pom.xml, add a remote deployer and call redeploy right after the daemon-start - this will most likely nail it down.

Let me know if this helps.

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 09:16, Martin Wortner wrote:
So requested details. Just tried that one more not to
waste your time.

1. manually overwriting .war file locally without server restart properly
worked
2. using cargo:daemon-start failed as the old context even with old
probably restored session is used
3. manually overwriting .war file on remote works while server running works


Seems the restart causes Tomcat not to pick up the .war file.
Note I tried already deployOnStartup options, but then it deploys twice and
the old version is deployed:-/


So now some config
my maven

   <profile>
            <id>tomcat7daemon</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                       
<artifactId>cargo-maven2-plugin</artifactId>
                        <executions>
                            <!--execute after integration test this is
to deploy to container not test-->
                            <execution>
                                <id>deploy-after-build</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>daemon-start</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <configuration>
                                <type>existing</type>
                                <home>${remote-tomcat7.home}</home>
                                <properties>
                                   
<cargo.servlet.port>${servlet.port}</cargo.servlet.port>
                                </properties>
                            </configuration>
                            <container>
                                <containerId>tomcat7x</containerId>
                                <home>${remote-tomcat7.home}</home>
                                <dependencies>
                                    <dependency>
                                       
<groupId>org.hsqldb</groupId>
                                       
<artifactId>hsqldb</artifactId>
                                    </dependency>
                                </dependencies>
                            </container>
                            <deployables>
                                <deployable>
                                    <type>war</type>
                                    <pingURL>http://${hostname}:${servlet.port}/${application.name}/home</pingURL>
      //not working ignored
                                </deployable>
                            </deployables>
                            <daemon>
                                <properties>
                                    <cargo.daemon.url>http://${hostname}:${daemon.port}/</cargo.daemon.url>
                                   
<cargo.daemon.handleid>tomcat7-existing-remote-daemon</cargo.daemon.handleid>
                                </properties>
                            </daemon>
                        </configuration>
                    </plugin>
                </plugins>
                <finalName>${application.name}</finalName>
            </build>

        </profile>
  
in conf/context.xml i have this
<WatchedResource>META-INF/MANIFEST.MF</WatchedResource>
 as the app do not have web.xml I thought is good idea  to watch for some
other file

my conf/server.xml
   <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true" undeployOldVersions="true"
deployOnStartup="false">

I have wasted so much time on this issue. I was so long waiting for
opportunity to introduce cargo to our company, but
now with so much time lost I don't know if I will be able to defend this
solution.

One more thing I found out that Tomcat from 7.something do not auto deploy
wars placed outside of webapps(aka appbase),
can it be that Tomcat thinks webapps is not his doc base when started from
daemon, ie. deamon passes the doc base from config
and thus Tomcat thinks the folder is not appbase?:-/

"The documented and intended behaviour of unpackWARs is that it only applies to WARs in the appBase.  This is true for 5.5.x, 6.0.x and 7.0.x."

I have so many questions and cargo so many options. 

Thanks in advance for hints

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen 
Komu: [hidden email]
Datum: 30. 1. 2015 7:49:05
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin



Thanks for these details.



Would you be so kind to go, step by step, on what you do? There
are many combinations I can think of, and all that I tried worked
so there must be something different between what I try and what
you do.



Regards



S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 07:39, Martin Wortner wrote:



Hi,
the problem is simple Tomcat will not unpack the .war file
that is copied in place by Cargo. This happen when the unpacked
folder is already there ie. redeploy. So first time everything
is ok and .war file is unpacked, second time the redeploy
happens, but seems from the old unpacked folder, thus the old
version is then running. 





I'm using existing instalation. I don't know how cargo is
suppose to work, but if the folder is there it will not work.
Through the manager interface it works, but otherwise. My
solution for now is to undeploy using tomcat maven plugin, which
will remove the folder and then I'm doing cargo:daemon-start.





Maybe I'm missing something. I don't have the config here,
but is just uses existing config, and tomcat7x container will
add it after I will arive to work. Anyway thanks for answer.





Regards





M.W



---------- Původní zpráva ----------

Od: S. Ali Tokmen 

Komu: [hidden email]

Datum: 29. 1. 2015 22:41:23

Předmět: Re: [cargo-user] Unable to deploy to Tomcat



Hi Martin



Can you please explain a bit more in detail what you are doing
(steps,

screenshots, code examples, pom.xml extracts, etc.)?



Thank you



S. Ali Tokmen

http://ali.tokmen.com/

http://contact.ali.tokmen.com/



On 28/01/15 13:55, Martin Wortner wrote:

Hello there, 
I'm really fighting with Cargo remote deployment. I want
to use Cargo

Daemon and I finally suceeded, BUT the problem is now
with Tomcat(7x

btw.). Cargo daemon just drops the .war file in the
webapps, but the

autodeploy feature of Tomcat will not replace the
unpacked war

content(unless the context is deleted or you delete the
folder by

hand). Note I'm using existing configuration. But I have
seen this

behavior even for local deployment as it is how tomcat
behaves by default.

Is there way to use Cargo Daemon and redeploy properly, I
need to

mention that the redeployment is fired, but the content
is used from

the expanded war. Am I doing something wrong???
Please help I'm getting desperate.
M.W
---------------------------------------------------------------------

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: Unable to deploy to Tomcat

Martin Wortner
And just tried the deamon-start, redeploy cycle, but it will not work either. 
The daemon in old version is not waiting for ping url so it finishes, and the redeploy starts
but the manager webapp is still not in place, thus failing during listing available contexts .


---------- Původní zpráva ----------
Od: Martin Wortner <[hidden email]>
Komu: [hidden email]
Datum: 2. 2. 2015 9:21:20
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Checked with the SNAPSHOT, pingUrl works now, 
but I'm afraid the deployment is still not working read this please

http://stackoverflow.com/questions/17810083/tomcat-does-not-unpack-war-file-if-folder-with-the-same-name-with-war-file-is-ex

http://stackoverflow.com/questions/4604335/tomcat-not-autodeploying-war-file
or here where they wrote 

Any web application archive file within the application base (appBase) directory that does not have a corresponding directory of the same name (without the ".war" extension) will be automatically expanded, unless the unpackWARs property is set to false. If you redeploy an updated WAR file, be sure to delete the expanded directory when restarting Tomcat, so that the updated WAR file will be re-expanded (note that the auto deployer, if enabled, will automatically expand the updated WAR file once the previously expanded directory is removed).

Maybe the unpacked folder must really be deleted. 

If I will do the star-daemon and redeploy after there are several issue
- running same plugin with different configuration in one build
- the application will be deployed twice first with daemon-start second with redeploy

I can not do the undeploy before, as the server can be stopped for some reason and in that case the undeploy will not happen.

In my eyes this unpacking thingy for Tomcat is really pain.

Thank you 

M.

---------- Původní zpráva ----------
Od: S. Ali Tokmen <[hidden email]>
Komu: [hidden email]
Datum: 1. 2. 2015 12:30:33
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

I'm afraid you hit another bug, CARGO-1304 - The daemon-start goal does not respect the pingUrl. Good news is that it is corrected in the SNAPSHOT version, which gives you two options:
Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 31/01/15 10:16, Martin Wortner wrote:
So no way how to wait for the app to deploy other then remote deployer and pingUrl. I'm using daemon to be able to stop start tomcat, omit the use of cumbersome scripts, so for me remote deployer is not enough I quess. Will try to resolve it somehow, with i.e. https://github.com/tacitknowledge/maven-wait-plugin


---------- Původní zpráva ----------
Od: S. Ali Tokmen [hidden email]
Komu: [hidden email]
Datum: 31. 1. 2015 10:01:37
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

PingUrl will work better with the remote deployer :)

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 31/01/15 09:26, Martin Wortner wrote:
Just one more question, whenever I'm running the cargo:daemon-start it ends just as soon as it somehow realizes the container is up. The problem is that after that some tests follows, the container is up not the webapp. I thought it can be solved by using <pingURL> element. But it was not working for me, can you check the excerpt I sent bellow, if I'm using it correctly?
Again many thanks

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen [hidden email]
Komu: [hidden email]
Datum: 30. 1. 2015 23:45:59
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

OK, give a try, then :) I believe it would do what you want to.

Thanks to this I discovered a brand new issue and that we need to change the Existing Local Configurations / Local Containers so they attempt redeployment of deployables (and not simple deployment). This is now fixed - see https://jira.codehaus.org/browse/CARGO-1303

If you want to try the SNAPSHOT version, check out: http://cargo.codehaus.org/Downloads#Downloads-continousBuilds

Have a great weekend

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 21:02, Wortner wrote:

Hi, thanks for insight. It is close to my solution with maven tomcat plugin. Will try that anyway. I like Cargo and really thanks for suport.

Regards
M.W.

Sent with AquaMail for Android
http://www.aqua-mail.com

On 30 January 2015 19:57:16 "S. Ali Tokmen" [hidden email] wrote:

Hi Martin

OK, I see the problem: the existing local container does a .deploy and not .redeploy; so I believe in Tomcat's case this makes the server miss the new file.

Here's what you could try: in your pom.xml, add a remote deployer and call redeploy right after the daemon-start - this will most likely nail it down.

Let me know if this helps.

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 09:16, Martin Wortner wrote:
So requested details. Just tried that one more not to
waste your time.

1. manually overwriting .war file locally without server restart properly
worked
2. using cargo:daemon-start failed as the old context even with old
probably restored session is used
3. manually overwriting .war file on remote works while server running works


Seems the restart causes Tomcat not to pick up the .war file.
Note I tried already deployOnStartup options, but then it deploys twice and
the old version is deployed:-/


So now some config
my maven

   <profile>
            <id>tomcat7daemon</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                       
<artifactId>cargo-maven2-plugin</artifactId>
                        <executions>
                            <!--execute after integration test this is
to deploy to container not test-->
                            <execution>
                                <id>deploy-after-build</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>daemon-start</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <configuration>
                                <type>existing</type>
                                <home>${remote-tomcat7.home}</home>
                                <properties>
                                   
<cargo.servlet.port>${servlet.port}</cargo.servlet.port>
                                </properties>
                            </configuration>
                            <container>
                                <containerId>tomcat7x</containerId>
                                <home>${remote-tomcat7.home}</home>
                                <dependencies>
                                    <dependency>
                                       
<groupId>org.hsqldb</groupId>
                                       
<artifactId>hsqldb</artifactId>
                                    </dependency>
                                </dependencies>
                            </container>
                            <deployables>
                                <deployable>
                                    <type>war</type>
                                    <pingURL>http://${hostname}:${servlet.port}/${application.name}/home</pingURL>
      //not working ignored
                                </deployable>
                            </deployables>
                            <daemon>
                                <properties>
                                    <cargo.daemon.url>http://${hostname}:${daemon.port}/</cargo.daemon.url>
                                   
<cargo.daemon.handleid>tomcat7-existing-remote-daemon</cargo.daemon.handleid>
                                </properties>
                            </daemon>
                        </configuration>
                    </plugin>
                </plugins>
                <finalName>${application.name}</finalName>
            </build>

        </profile>
  
in conf/context.xml i have this
<WatchedResource>META-INF/MANIFEST.MF</WatchedResource>
 as the app do not have web.xml I thought is good idea  to watch for some
other file

my conf/server.xml
   <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true" undeployOldVersions="true"
deployOnStartup="false">

I have wasted so much time on this issue. I was so long waiting for
opportunity to introduce cargo to our company, but
now with so much time lost I don't know if I will be able to defend this
solution.

One more thing I found out that Tomcat from 7.something do not auto deploy
wars placed outside of webapps(aka appbase),
can it be that Tomcat thinks webapps is not his doc base when started from
daemon, ie. deamon passes the doc base from config
and thus Tomcat thinks the folder is not appbase?:-/

"The documented and intended behaviour of unpackWARs is that it only applies to WARs in the appBase.  This is true for 5.5.x, 6.0.x and 7.0.x."

I have so many questions and cargo so many options. 

Thanks in advance for hints

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen 
Komu: [hidden email]
Datum: 30. 1. 2015 7:49:05
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin



Thanks for these details.



Would you be so kind to go, step by step, on what you do? There
are many combinations I can think of, and all that I tried worked
so there must be something different between what I try and what
you do.



Regards



S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 07:39, Martin Wortner wrote:



Hi,
the problem is simple Tomcat will not unpack the .war file
that is copied in place by Cargo. This happen when the unpacked
folder is already there ie. redeploy. So first time everything
is ok and .war file is unpacked, second time the redeploy
happens, but seems from the old unpacked folder, thus the old
version is then running. 





I'm using existing instalation. I don't know how cargo is
suppose to work, but if the folder is there it will not work.
Through the manager interface it works, but otherwise. My
solution for now is to undeploy using tomcat maven plugin, which
will remove the folder and then I'm doing cargo:daemon-start.





Maybe I'm missing something. I don't have the config here,
but is just uses existing config, and tomcat7x container will
add it after I will arive to work. Anyway thanks for answer.





Regards





M.W



---------- Původní zpráva ----------

Od: S. Ali Tokmen 

Komu: [hidden email]

Datum: 29. 1. 2015 22:41:23

Předmět: Re: [cargo-user] Unable to deploy to Tomcat



Hi Martin



Can you please explain a bit more in detail what you are doing
(steps,

screenshots, code examples, pom.xml extracts, etc.)?



Thank you



S. Ali Tokmen

http://ali.tokmen.com/

http://contact.ali.tokmen.com/



On 28/01/15 13:55, Martin Wortner wrote:

Hello there, 
I'm really fighting with Cargo remote deployment. I want
to use Cargo

Daemon and I finally suceeded, BUT the problem is now
with Tomcat(7x

btw.). Cargo daemon just drops the .war file in the
webapps, but the

autodeploy feature of Tomcat will not replace the
unpacked war

content(unless the context is deleted or you delete the
folder by

hand). Note I'm using existing configuration. But I have
seen this

behavior even for local deployment as it is how tomcat
behaves by default.

Is there way to use Cargo Daemon and redeploy properly, I
need to

mention that the redeployment is fired, but the content
is used from

the expanded war. Am I doing something wrong???
Please help I'm getting desperate.
M.W
---------------------------------------------------------------------

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: Unable to deploy to Tomcat

S. Ali Tokmen
Hi Martin

Which daemon version are you trying? Note that you need the latest SNAPSHOT of the daemon as well (that one has the fix for the expanded WAR directory issue you're mentioning), I'd suggest you download it from the continous integration system: http://cargo.codehaus.org/Downloads#Downloads-continousBuilds

Thank you

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

From: [hidden email]
Sent: ‎02/‎02/‎2015 09:39
To: [hidden email]
Subject: Re: [cargo-user] Unable to deploy to Tomcat

And just tried the deamon-start, redeploy cycle, but it will not work either. 
The daemon in old version is not waiting for ping url so it finishes, and the redeploy starts
but the manager webapp is still not in place, thus failing during listing available contexts .


---------- Původní zpráva ----------
Od: Martin Wortner <[hidden email]>
Komu: [hidden email]
Datum: 2. 2. 2015 9:21:20
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Checked with the SNAPSHOT, pingUrl works now, 
but I'm afraid the deployment is still not working read this please

http://stackoverflow.com/questions/17810083/tomcat-does-not-unpack-war-file-if-folder-with-the-same-name-with-war-file-is-ex

http://stackoverflow.com/questions/4604335/tomcat-not-autodeploying-war-file
or here where they wrote 

Any web application archive file within the application base (appBase) directory that does not have a corresponding directory of the same name (without the ".war" extension) will be automatically expanded, unless the unpackWARs property is set to false. If you redeploy an updated WAR file, be sure to delete the expanded directory when restarting Tomcat, so that the updated WAR file will be re-expanded (note that the auto deployer, if enabled, will automatically expand the updated WAR file once the previously expanded directory is removed).

Maybe the unpacked folder must really be deleted. 

If I will do the star-daemon and redeploy after there are several issue
- running same plugin with different configuration in one build
- the application will be deployed twice first with daemon-start second with redeploy

I can not do the undeploy before, as the server can be stopped for some reason and in that case the undeploy will not happen.

In my eyes this unpacking thingy for Tomcat is really pain.

Thank you 

M.

---------- Původní zpráva ----------
Od: S. Ali Tokmen <[hidden email]>
Komu: [hidden email]
Datum: 1. 2. 2015 12:30:33
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

I'm afraid you hit another bug, CARGO-1304 - The daemon-start goal does not respect the pingUrl. Good news is that it is corrected in the SNAPSHOT version, which gives you two options:
Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 31/01/15 10:16, Martin Wortner wrote:
So no way how to wait for the app to deploy other then remote deployer and pingUrl. I'm using daemon to be able to stop start tomcat, omit the use of cumbersome scripts, so for me remote deployer is not enough I quess. Will try to resolve it somehow, with i.e. https://github.com/tacitknowledge/maven-wait-plugin


---------- Původní zpráva ----------
Od: S. Ali Tokmen [hidden email]
Komu: [hidden email]
Datum: 31. 1. 2015 10:01:37
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

PingUrl will work better with the remote deployer :)

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 31/01/15 09:26, Martin Wortner wrote:
Just one more question, whenever I'm running the cargo:daemon-start it ends just as soon as it somehow realizes the container is up. The problem is that after that some tests follows, the container is up not the webapp. I thought it can be solved by using <pingURL> element. But it was not working for me, can you check the excerpt I sent bellow, if I'm using it correctly?
Again many thanks

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen [hidden email]
Komu: [hidden email]
Datum: 30. 1. 2015 23:45:59
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

OK, give a try, then :) I believe it would do what you want to.

Thanks to this I discovered a brand new issue and that we need to change the Existing Local Configurations / Local Containers so they attempt redeployment of deployables (and not simple deployment). This is now fixed - see https://jira.codehaus.org/browse/CARGO-1303

If you want to try the SNAPSHOT version, check out: http://cargo.codehaus.org/Downloads#Downloads-continousBuilds

Have a great weekend

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 21:02, Wortner wrote:

Hi, thanks for insight. It is close to my solution with maven tomcat plugin. Will try that anyway. I like Cargo and really thanks for suport.

Regards
M.W.

Sent with AquaMail for Android
http://www.aqua-mail.com

On 30 January 2015 19:57:16 "S. Ali Tokmen" [hidden email] wrote:

Hi Martin

OK, I see the problem: the existing local container does a .deploy and not .redeploy; so I believe in Tomcat's case this makes the server miss the new file.

Here's what you could try: in your pom.xml, add a remote deployer and call redeploy right after the daemon-start - this will most likely nail it down.

Let me know if this helps.

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 09:16, Martin Wortner wrote:
So requested details. Just tried that one more not to
waste your time.

1. manually overwriting .war file locally without server restart properly
worked
2. using cargo:daemon-start failed as the old context even with old
probably restored session is used
3. manually overwriting .war file on remote works while server running works


Seems the restart causes Tomcat not to pick up the .war file.
Note I tried already deployOnStartup options, but then it deploys twice and
the old version is deployed:-/


So now some config
my maven

   <profile>
            <id>tomcat7daemon</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                       
<artifactId>cargo-maven2-plugin</artifactId>
                        <executions>
                            <!--execute after integration test this is
to deploy to container not test-->
                            <execution>
                                <id>deploy-after-build</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>daemon-start</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <configuration>
                                <type>existing</type>
                                <home>${remote-tomcat7.home}</home>
                                <properties>
                                   
<cargo.servlet.port>${servlet.port}</cargo.servlet.port>
                                </properties>
                            </configuration>
                            <container>
                                <containerId>tomcat7x</containerId>
                                <home>${remote-tomcat7.home}</home>
                                <dependencies>
                                    <dependency>
                                       
<groupId>org.hsqldb</groupId>
                                       
<artifactId>hsqldb</artifactId>
                                    </dependency>
                                </dependencies>
                            </container>
                            <deployables>
                                <deployable>
                                    <type>war</type>
                                    <pingURL>http://${hostname}:${servlet.port}/${application.name}/home</pingURL>
      //not working ignored
                                </deployable>
                            </deployables>
                            <daemon>
                                <properties>
                                    <cargo.daemon.url>http://${hostname}:${daemon.port}/</cargo.daemon.url>
                                   
<cargo.daemon.handleid>tomcat7-existing-remote-daemon</cargo.daemon.handleid>
                                </properties>
                            </daemon>
                        </configuration>
                    </plugin>
                </plugins>
                <finalName>${application.name}</finalName>
            </build>

        </profile>
  
in conf/context.xml i have this
<WatchedResource>META-INF/MANIFEST.MF</WatchedResource>
 as the app do not have web.xml I thought is good idea  to watch for some
other file

my conf/server.xml
   <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true" undeployOldVersions="true"
deployOnStartup="false">

I have wasted so much time on this issue. I was so long waiting for
opportunity to introduce cargo to our company, but
now with so much time lost I don't know if I will be able to defend this
solution.

One more thing I found out that Tomcat from 7.something do not auto deploy
wars placed outside of webapps(aka appbase),
can it be that Tomcat thinks webapps is not his doc base when started from
daemon, ie. deamon passes the doc base from config
and thus Tomcat thinks the folder is not appbase?:-/

"The documented and intended behaviour of unpackWARs is that it only applies to WARs in the appBase.  This is true for 5.5.x, 6.0.x and 7.0.x."

I have so many questions and cargo so many options. 

Thanks in advance for hints

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen 
Komu: [hidden email]
Datum: 30. 1. 2015 7:49:05
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin



Thanks for these details.



Would you be so kind to go, step by step, on what you do? There
are many combinations I can think of, and all that I tried worked
so there must be something different between what I try and what
you do.



Regards



S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 07:39, Martin Wortner wrote:



Hi,
the problem is simple Tomcat will not unpack the .war file
that is copied in place by Cargo. This happen when the unpacked
folder is already there ie. redeploy. So first time everything
is ok and .war file is unpacked, second time the redeploy
happens, but seems from the old unpacked folder, thus the old
version is then running. 





I'm using existing instalation. I don't know how cargo is
suppose to work, but if the folder is there it will not work.
Through the manager interface it works, but otherwise. My
solution for now is to undeploy using tomcat maven plugin, which
will remove the folder and then I'm doing cargo:daemon-start.





Maybe I'm missing something. I don't have the config here,
but is just uses existing config, and tomcat7x container will
add it after I will arive to work. Anyway thanks for answer.





Regards





M.W



---------- Původní zpráva ----------

Od: S. Ali Tokmen 

Komu: [hidden email]

Datum: 29. 1. 2015 22:41:23

Předmět: Re: [cargo-user] Unable to deploy to Tomcat



Hi Martin



Can you please explain a bit more in detail what you are doing
(steps,

screenshots, code examples, pom.xml extracts, etc.)?



Thank you



S. Ali Tokmen

http://ali.tokmen.com/

http://contact.ali.tokmen.com/



On 28/01/15 13:55, Martin Wortner wrote:

Hello there, 
I'm really fighting with Cargo remote deployment. I want
to use Cargo

Daemon and I finally suceeded, BUT the problem is now
with Tomcat(7x

btw.). Cargo daemon just drops the .war file in the
webapps, but the

autodeploy feature of Tomcat will not replace the
unpacked war

content(unless the context is deleted or you delete the
folder by

hand). Note I'm using existing configuration. But I have
seen this

behavior even for local deployment as it is how tomcat
behaves by default.

Is there way to use Cargo Daemon and redeploy properly, I
need to

mention that the redeployment is fired, but the content
is used from

the expanded war. Am I doing something wrong???
Please help I'm getting desperate.
M.W
---------------------------------------------------------------------

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







[The entire original message is not included.]
Reply | Threaded
Open this post in threaded view
|

RE: Unable to deploy to Tomcat

Martin Wortner
Shame on me, I didn't realize that. So for the redeploy, is it possible just to change the daemon?
I can live for a while with the ping problem, as it will be problem here to use snapshots in the build, but 
the exchange of daemon for snapshot version is without problem, will download and try.

M.

---------- Původní zpráva ----------
Od: S. Ali Tokmen <[hidden email]>
Komu: [hidden email]
Datum: 2. 2. 2015 9:44:18
Předmět: RE: [cargo-user] Unable to deploy to Tomcat


Hi Martin

Which daemon version are you trying? Note that you need the latest SNAPSHOT of the daemon as well (that one has the fix for the expanded WAR directory issue you're mentioning), I'd suggest you download it from the continous integration system: http://cargo.codehaus.org/Downloads#Downloads-continousBuilds

Thank you

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

From: [hidden email]
Sent: ‎02/‎02/‎2015 09:39
To: [hidden email]
Subject: Re: [cargo-user] Unable to deploy to Tomcat

And just tried the deamon-start, redeploy cycle, but it will not work either. 
The daemon in old version is not waiting for ping url so it finishes, and the redeploy starts
but the manager webapp is still not in place, thus failing during listing available contexts .


---------- Původní zpráva ----------
Od: Martin Wortner <[hidden email]>
Komu: [hidden email]
Datum: 2. 2. 2015 9:21:20
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Checked with the SNAPSHOT, pingUrl works now, 
but I'm afraid the deployment is still not working read this please

http://stackoverflow.com/questions/17810083/tomcat-does-not-unpack-war-file-if-folder-with-the-same-name-with-war-file-is-ex

http://stackoverflow.com/questions/4604335/tomcat-not-autodeploying-war-file
or here where they wrote 

Any web application archive file within the application base (appBase) directory that does not have a corresponding directory of the same name (without the ".war" extension) will be automatically expanded, unless the unpackWARs property is set to false. If you redeploy an updated WAR file, be sure to delete the expanded directory when restarting Tomcat, so that the updated WAR file will be re-expanded (note that the auto deployer, if enabled, will automatically expand the updated WAR file once the previously expanded directory is removed).

Maybe the unpacked folder must really be deleted. 

If I will do the star-daemon and redeploy after there are several issue
- running same plugin with different configuration in one build
- the application will be deployed twice first with daemon-start second with redeploy

I can not do the undeploy before, as the server can be stopped for some reason and in that case the undeploy will not happen.

In my eyes this unpacking thingy for Tomcat is really pain.

Thank you 

M.

---------- Původní zpráva ----------
Od: S. Ali Tokmen <[hidden email]>
Komu: [hidden email]
Datum: 1. 2. 2015 12:30:33
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

I'm afraid you hit another bug, CARGO-1304 - The daemon-start goal does not respect the pingUrl. Good news is that it is corrected in the SNAPSHOT version, which gives you two options:
Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 31/01/15 10:16, Martin Wortner wrote:
So no way how to wait for the app to deploy other then remote deployer and pingUrl. I'm using daemon to be able to stop start tomcat, omit the use of cumbersome scripts, so for me remote deployer is not enough I quess. Will try to resolve it somehow, with i.e. https://github.com/tacitknowledge/maven-wait-plugin


---------- Původní zpráva ----------
Od: S. Ali Tokmen [hidden email]
Komu: [hidden email]
Datum: 31. 1. 2015 10:01:37
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

PingUrl will work better with the remote deployer :)

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 31/01/15 09:26, Martin Wortner wrote:
Just one more question, whenever I'm running the cargo:daemon-start it ends just as soon as it somehow realizes the container is up. The problem is that after that some tests follows, the container is up not the webapp. I thought it can be solved by using <pingURL> element. But it was not working for me, can you check the excerpt I sent bellow, if I'm using it correctly?
Again many thanks

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen [hidden email]
Komu: [hidden email]
Datum: 30. 1. 2015 23:45:59
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

OK, give a try, then :) I believe it would do what you want to.

Thanks to this I discovered a brand new issue and that we need to change the Existing Local Configurations / Local Containers so they attempt redeployment of deployables (and not simple deployment). This is now fixed - see https://jira.codehaus.org/browse/CARGO-1303

If you want to try the SNAPSHOT version, check out: http://cargo.codehaus.org/Downloads#Downloads-continousBuilds

Have a great weekend

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 21:02, Wortner wrote:

Hi, thanks for insight. It is close to my solution with maven tomcat plugin. Will try that anyway. I like Cargo and really thanks for suport.

Regards
M.W.

Sent with AquaMail for Android
http://www.aqua-mail.com

On 30 January 2015 19:57:16 "S. Ali Tokmen" [hidden email] wrote:

Hi Martin

OK, I see the problem: the existing local container does a .deploy and not .redeploy; so I believe in Tomcat's case this makes the server miss the new file.

Here's what you could try: in your pom.xml, add a remote deployer and call redeploy right after the daemon-start - this will most likely nail it down.

Let me know if this helps.

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 09:16, Martin Wortner wrote:
So requested details. Just tried that one more not to
waste your time.

1. manually overwriting .war file locally without server restart properly
worked
2. using cargo:daemon-start failed as the old context even with old
probably restored session is used
3. manually overwriting .war file on remote works while server running works


Seems the restart causes Tomcat not to pick up the .war file.
Note I tried already deployOnStartup options, but then it deploys twice and
the old version is deployed:-/


So now some config
my maven

   <profile>
            <id>tomcat7daemon</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                       
<artifactId>cargo-maven2-plugin</artifactId>
                        <executions>
                            <!--execute after integration test this is
to deploy to container not test-->
                            <execution>
                                <id>deploy-after-build</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>daemon-start</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <configuration>
                                <type>existing</type>
                                <home>${remote-tomcat7.home}</home>
                                <properties>
                                   
<cargo.servlet.port>${servlet.port}</cargo.servlet.port>
                                </properties>
                            </configuration>
                            <container>
                                <containerId>tomcat7x</containerId>
                                <home>${remote-tomcat7.home}</home>
                                <dependencies>
                                    <dependency>
                                       
<groupId>org.hsqldb</groupId>
                                       
<artifactId>hsqldb</artifactId>
                                    </dependency>
                                </dependencies>
                            </container>
                            <deployables>
                                <deployable>
                                    <type>war</type>
                                    <pingURL>http://${hostname}:${servlet.port}/${application.name}/home</pingURL>
      //not working ignored
                                </deployable>
                            </deployables>
                            <daemon>
                                <properties>
                                    <cargo.daemon.url>http://${hostname}:${daemon.port}/</cargo.daemon.url>
                                   
<cargo.daemon.handleid>tomcat7-existing-remote-daemon</cargo.daemon.handleid>
                                </properties>
                            </daemon>
                        </configuration>
                    </plugin>
                </plugins>
                <finalName>${application.name}</finalName>
            </build>

        </profile>
  
in conf/context.xml i have this
<WatchedResource>META-INF/MANIFEST.MF</WatchedResource>
 as the app do not have web.xml I thought is good idea  to watch for some
other file

my conf/server.xml
   <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true" undeployOldVersions="true"
deployOnStartup="false">

I have wasted so much time on this issue. I was so long waiting for
opportunity to introduce cargo to our company, but
now with so much time lost I don't know if I will be able to defend this
solution.

One more thing I found out that Tomcat from 7.something do not auto deploy
wars placed outside of webapps(aka appbase),
can it be that Tomcat thinks webapps is not his doc base when started from
daemon, ie. deamon passes the doc base from config
and thus Tomcat thinks the folder is not appbase?:-/

"The documented and intended behaviour of unpackWARs is that it only applies to WARs in the appBase.  This is true for 5.5.x, 6.0.x and 7.0.x."

I have so many questions and cargo so many options. 

Thanks in advance for hints

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen 
Komu: [hidden email]
Datum: 30. 1. 2015 7:49:05
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin



Thanks for these details.



Would you be so kind to go, step by step, on what you do? There
are many combinations I can think of, and all that I tried worked
so there must be something different between what I try and what
you do.



Regards



S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 07:39, Martin Wortner wrote:



Hi,
the problem is simple Tomcat will not unpack the .war file
that is copied in place by Cargo. This happen when the unpacked
folder is already there ie. redeploy. So first time everything
is ok and .war file is unpacked, second time the redeploy
happens, but seems from the old unpacked folder, thus the old
version is then running. 





I'm using existing instalation. I don't know how cargo is
suppose to work, but if the folder is there it will not work.
Through the manager interface it works, but otherwise. My
solution for now is to undeploy using tomcat maven plugin, which
will remove the folder and then I'm doing cargo:daemon-start.





Maybe I'm missing something. I don't have the config here,
but is just uses existing config, and tomcat7x container will
add it after I will arive to work. Anyway thanks for answer.





Regards





M.W



---------- Původní zpráva ----------

Od: S. Ali Tokmen 

Komu: [hidden email]

Datum: 29. 1. 2015 22:41:23

Předmět: Re: [cargo-user] Unable to deploy to Tomcat



Hi Martin



Can you please explain a bit more in detail what you are doing
(steps,

screenshots, code examples, pom.xml extracts, etc.)?



Thank you



S. Ali Tokmen

http://ali.tokmen.com/

http://contact.ali.tokmen.com/



On 28/01/15 13:55, Martin Wortner wrote:

Hello there, 
I'm really fighting with Cargo remote deployment. I want
to use Cargo

Daemon and I finally suceeded, BUT the problem is now
with Tomcat(7x

btw.). Cargo daemon just drops the .war file in the
webapps, but the

autodeploy feature of Tomcat will not replace the
unpacked war

content(unless the context is deleted or you delete the
folder by

hand). Note I'm using existing configuration. But I have
seen this

behavior even for local deployment as it is how tomcat
behaves by default.

Is there way to use Cargo Daemon and redeploy properly, I
need to

mention that the redeployment is fired, but the content
is used from

the expanded war. Am I doing something wrong???
Please help I'm getting desperate.
M.W
---------------------------------------------------------------------

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







[The entire original message is not included.]
Reply | Threaded
Open this post in threaded view
|

RE: Unable to deploy to Tomcat

Martin Wortner
The snapshot version of daemon works as expected. Sorry for bothering.

Thank you 

M.

---------- Původní zpráva ----------
Od: Martin Wortner <[hidden email]>
Komu: [hidden email]
Datum: 2. 2. 2015 9:49:56
Předmět: RE: [cargo-user] Unable to deploy to Tomcat


Shame on me, I didn't realize that. So for the redeploy, is it possible just to change the daemon?
I can live for a while with the ping problem, as it will be problem here to use snapshots in the build, but 
the exchange of daemon for snapshot version is without problem, will download and try.

M.

---------- Původní zpráva ----------
Od: S. Ali Tokmen <[hidden email]>
Komu: [hidden email]
Datum: 2. 2. 2015 9:44:18
Předmět: RE: [cargo-user] Unable to deploy to Tomcat


Hi Martin

Which daemon version are you trying? Note that you need the latest SNAPSHOT of the daemon as well (that one has the fix for the expanded WAR directory issue you're mentioning), I'd suggest you download it from the continous integration system: http://cargo.codehaus.org/Downloads#Downloads-continousBuilds

Thank you

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

From: [hidden email]
Sent: ‎02/‎02/‎2015 09:39
To: [hidden email]
Subject: Re: [cargo-user] Unable to deploy to Tomcat

And just tried the deamon-start, redeploy cycle, but it will not work either. 
The daemon in old version is not waiting for ping url so it finishes, and the redeploy starts
but the manager webapp is still not in place, thus failing during listing available contexts .


---------- Původní zpráva ----------
Od: Martin Wortner <[hidden email]>
Komu: [hidden email]
Datum: 2. 2. 2015 9:21:20
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Checked with the SNAPSHOT, pingUrl works now, 
but I'm afraid the deployment is still not working read this please

http://stackoverflow.com/questions/17810083/tomcat-does-not-unpack-war-file-if-folder-with-the-same-name-with-war-file-is-ex

http://stackoverflow.com/questions/4604335/tomcat-not-autodeploying-war-file
or here where they wrote 

Any web application archive file within the application base (appBase) directory that does not have a corresponding directory of the same name (without the ".war" extension) will be automatically expanded, unless the unpackWARs property is set to false. If you redeploy an updated WAR file, be sure to delete the expanded directory when restarting Tomcat, so that the updated WAR file will be re-expanded (note that the auto deployer, if enabled, will automatically expand the updated WAR file once the previously expanded directory is removed).

Maybe the unpacked folder must really be deleted. 

If I will do the star-daemon and redeploy after there are several issue
- running same plugin with different configuration in one build
- the application will be deployed twice first with daemon-start second with redeploy

I can not do the undeploy before, as the server can be stopped for some reason and in that case the undeploy will not happen.

In my eyes this unpacking thingy for Tomcat is really pain.

Thank you 

M.

---------- Původní zpráva ----------
Od: S. Ali Tokmen <[hidden email]>
Komu: [hidden email]
Datum: 1. 2. 2015 12:30:33
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

I'm afraid you hit another bug, CARGO-1304 - The daemon-start goal does not respect the pingUrl. Good news is that it is corrected in the SNAPSHOT version, which gives you two options:
Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 31/01/15 10:16, Martin Wortner wrote:
So no way how to wait for the app to deploy other then remote deployer and pingUrl. I'm using daemon to be able to stop start tomcat, omit the use of cumbersome scripts, so for me remote deployer is not enough I quess. Will try to resolve it somehow, with i.e. https://github.com/tacitknowledge/maven-wait-plugin


---------- Původní zpráva ----------
Od: S. Ali Tokmen [hidden email]
Komu: [hidden email]
Datum: 31. 1. 2015 10:01:37
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

PingUrl will work better with the remote deployer :)

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 31/01/15 09:26, Martin Wortner wrote:
Just one more question, whenever I'm running the cargo:daemon-start it ends just as soon as it somehow realizes the container is up. The problem is that after that some tests follows, the container is up not the webapp. I thought it can be solved by using <pingURL> element. But it was not working for me, can you check the excerpt I sent bellow, if I'm using it correctly?
Again many thanks

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen [hidden email]
Komu: [hidden email]
Datum: 30. 1. 2015 23:45:59
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

OK, give a try, then :) I believe it would do what you want to.

Thanks to this I discovered a brand new issue and that we need to change the Existing Local Configurations / Local Containers so they attempt redeployment of deployables (and not simple deployment). This is now fixed - see https://jira.codehaus.org/browse/CARGO-1303

If you want to try the SNAPSHOT version, check out: http://cargo.codehaus.org/Downloads#Downloads-continousBuilds

Have a great weekend

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 21:02, Wortner wrote:

Hi, thanks for insight. It is close to my solution with maven tomcat plugin. Will try that anyway. I like Cargo and really thanks for suport.

Regards
M.W.

Sent with AquaMail for Android
http://www.aqua-mail.com

On 30 January 2015 19:57:16 "S. Ali Tokmen" [hidden email] wrote:

Hi Martin

OK, I see the problem: the existing local container does a .deploy and not .redeploy; so I believe in Tomcat's case this makes the server miss the new file.

Here's what you could try: in your pom.xml, add a remote deployer and call redeploy right after the daemon-start - this will most likely nail it down.

Let me know if this helps.

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 09:16, Martin Wortner wrote:
So requested details. Just tried that one more not to
waste your time.

1. manually overwriting .war file locally without server restart properly
worked
2. using cargo:daemon-start failed as the old context even with old
probably restored session is used
3. manually overwriting .war file on remote works while server running works


Seems the restart causes Tomcat not to pick up the .war file.
Note I tried already deployOnStartup options, but then it deploys twice and
the old version is deployed:-/


So now some config
my maven

   <profile>
            <id>tomcat7daemon</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                       
<artifactId>cargo-maven2-plugin</artifactId>
                        <executions>
                            <!--execute after integration test this is
to deploy to container not test-->
                            <execution>
                                <id>deploy-after-build</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>daemon-start</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <configuration>
                                <type>existing</type>
                                <home>${remote-tomcat7.home}</home>
                                <properties>
                                   
<cargo.servlet.port>${servlet.port}</cargo.servlet.port>
                                </properties>
                            </configuration>
                            <container>
                                <containerId>tomcat7x</containerId>
                                <home>${remote-tomcat7.home}</home>
                                <dependencies>
                                    <dependency>
                                       
<groupId>org.hsqldb</groupId>
                                       
<artifactId>hsqldb</artifactId>
                                    </dependency>
                                </dependencies>
                            </container>
                            <deployables>
                                <deployable>
                                    <type>war</type>
                                    <pingURL>http://${hostname}:${servlet.port}/${application.name}/home</pingURL>
      //not working ignored
                                </deployable>
                            </deployables>
                            <daemon>
                                <properties>
                                    <cargo.daemon.url>http://${hostname}:${daemon.port}/</cargo.daemon.url>
                                   
<cargo.daemon.handleid>tomcat7-existing-remote-daemon</cargo.daemon.handleid>
                                </properties>
                            </daemon>
                        </configuration>
                    </plugin>
                </plugins>
                <finalName>${application.name}</finalName>
            </build>

        </profile>
  
in conf/context.xml i have this
<WatchedResource>META-INF/MANIFEST.MF</WatchedResource>
 as the app do not have web.xml I thought is good idea  to watch for some
other file

my conf/server.xml
   <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true" undeployOldVersions="true"
deployOnStartup="false">

I have wasted so much time on this issue. I was so long waiting for
opportunity to introduce cargo to our company, but
now with so much time lost I don't know if I will be able to defend this
solution.

One more thing I found out that Tomcat from 7.something do not auto deploy
wars placed outside of webapps(aka appbase),
can it be that Tomcat thinks webapps is not his doc base when started from
daemon, ie. deamon passes the doc base from config
and thus Tomcat thinks the folder is not appbase?:-/

"The documented and intended behaviour of unpackWARs is that it only applies to WARs in the appBase.  This is true for 5.5.x, 6.0.x and 7.0.x."

I have so many questions and cargo so many options. 

Thanks in advance for hints

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen 
Komu: [hidden email]
Datum: 30. 1. 2015 7:49:05
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin



Thanks for these details.



Would you be so kind to go, step by step, on what you do? There
are many combinations I can think of, and all that I tried worked
so there must be something different between what I try and what
you do.



Regards



S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 07:39, Martin Wortner wrote:



Hi,
the problem is simple Tomcat will not unpack the .war file
that is copied in place by Cargo. This happen when the unpacked
folder is already there ie. redeploy. So first time everything
is ok and .war file is unpacked, second time the redeploy
happens, but seems from the old unpacked folder, thus the old
version is then running. 





I'm using existing instalation. I don't know how cargo is
suppose to work, but if the folder is there it will not work.
Through the manager interface it works, but otherwise. My
solution for now is to undeploy using tomcat maven plugin, which
will remove the folder and then I'm doing cargo:daemon-start.





Maybe I'm missing something. I don't have the config here,
but is just uses existing config, and tomcat7x container will
add it after I will arive to work. Anyway thanks for answer.





Regards





M.W



---------- Původní zpráva ----------

Od: S. Ali Tokmen 

Komu: [hidden email]

Datum: 29. 1. 2015 22:41:23

Předmět: Re: [cargo-user] Unable to deploy to Tomcat



Hi Martin



Can you please explain a bit more in detail what you are doing
(steps,

screenshots, code examples, pom.xml extracts, etc.)?



Thank you



S. Ali Tokmen

http://ali.tokmen.com/

http://contact.ali.tokmen.com/



On 28/01/15 13:55, Martin Wortner wrote:

Hello there, 
I'm really fighting with Cargo remote deployment. I want
to use Cargo

Daemon and I finally suceeded, BUT the problem is now
with Tomcat(7x

btw.). Cargo daemon just drops the .war file in the
webapps, but the

autodeploy feature of Tomcat will not replace the
unpacked war

content(unless the context is deleted or you delete the
folder by

hand). Note I'm using existing configuration. But I have
seen this

behavior even for local deployment as it is how tomcat
behaves by default.

Is there way to use Cargo Daemon and redeploy properly, I
need to

mention that the redeployment is fired, but the content
is used from

the expanded war. Am I doing something wrong???
Please help I'm getting desperate.
M.W
---------------------------------------------------------------------

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







[The entire original message is not included.]
Reply | Threaded
Open this post in threaded view
|

RE: Unable to deploy to Tomcat

S. Ali Tokmen
Good news 😁 So, are they're more bugs you found?

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

From: [hidden email]
Sent: ‎02/‎02/‎2015 10:44
To: [hidden email]
Subject: RE: [cargo-user] Unable to deploy to Tomcat

The snapshot version of daemon works as expected. Sorry for bothering.

Thank you 

M.

---------- Původní zpráva ----------
Od: Martin Wortner <[hidden email]>
Komu: [hidden email]
Datum: 2. 2. 2015 9:49:56
Předmět: RE: [cargo-user] Unable to deploy to Tomcat


Shame on me, I didn't realize that. So for the redeploy, is it possible just to change the daemon?
I can live for a while with the ping problem, as it will be problem here to use snapshots in the build, but 
the exchange of daemon for snapshot version is without problem, will download and try.

M.

---------- Původní zpráva ----------
Od: S. Ali Tokmen <[hidden email]>
Komu: [hidden email]
Datum: 2. 2. 2015 9:44:18
Předmět: RE: [cargo-user] Unable to deploy to Tomcat


Hi Martin

Which daemon version are you trying? Note that you need the latest SNAPSHOT of the daemon as well (that one has the fix for the expanded WAR directory issue you're mentioning), I'd suggest you download it from the continous integration system: http://cargo.codehaus.org/Downloads#Downloads-continousBuilds

Thank you

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

From: [hidden email]
Sent: ‎02/‎02/‎2015 09:39
To: [hidden email]
Subject: Re: [cargo-user] Unable to deploy to Tomcat

And just tried the deamon-start, redeploy cycle, but it will not work either. 
The daemon in old version is not waiting for ping url so it finishes, and the redeploy starts
but the manager webapp is still not in place, thus failing during listing available contexts .


---------- Původní zpráva ----------
Od: Martin Wortner <[hidden email]>
Komu: [hidden email]
Datum: 2. 2. 2015 9:21:20
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Checked with the SNAPSHOT, pingUrl works now, 
but I'm afraid the deployment is still not working read this please

http://stackoverflow.com/questions/17810083/tomcat-does-not-unpack-war-file-if-folder-with-the-same-name-with-war-file-is-ex

http://stackoverflow.com/questions/4604335/tomcat-not-autodeploying-war-file
or here where they wrote 

Any web application archive file within the application base (appBase) directory that does not have a corresponding directory of the same name (without the ".war" extension) will be automatically expanded, unless the unpackWARs property is set to false. If you redeploy an updated WAR file, be sure to delete the expanded directory when restarting Tomcat, so that the updated WAR file will be re-expanded (note that the auto deployer, if enabled, will automatically expand the updated WAR file once the previously expanded directory is removed).

Maybe the unpacked folder must really be deleted. 

If I will do the star-daemon and redeploy after there are several issue
- running same plugin with different configuration in one build
- the application will be deployed twice first with daemon-start second with redeploy

I can not do the undeploy before, as the server can be stopped for some reason and in that case the undeploy will not happen.

In my eyes this unpacking thingy for Tomcat is really pain.

Thank you 

M.

---------- Původní zpráva ----------
Od: S. Ali Tokmen <[hidden email]>
Komu: [hidden email]
Datum: 1. 2. 2015 12:30:33
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

I'm afraid you hit another bug, CARGO-1304 - The daemon-start goal does not respect the pingUrl. Good news is that it is corrected in the SNAPSHOT version, which gives you two options:
Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 31/01/15 10:16, Martin Wortner wrote:
So no way how to wait for the app to deploy other then remote deployer and pingUrl. I'm using daemon to be able to stop start tomcat, omit the use of cumbersome scripts, so for me remote deployer is not enough I quess. Will try to resolve it somehow, with i.e. https://github.com/tacitknowledge/maven-wait-plugin


---------- Původní zpráva ----------
Od: S. Ali Tokmen [hidden email]
Komu: [hidden email]
Datum: 31. 1. 2015 10:01:37
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

PingUrl will work better with the remote deployer :)

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 31/01/15 09:26, Martin Wortner wrote:
Just one more question, whenever I'm running the cargo:daemon-start it ends just as soon as it somehow realizes the container is up. The problem is that after that some tests follows, the container is up not the webapp. I thought it can be solved by using <pingURL> element. But it was not working for me, can you check the excerpt I sent bellow, if I'm using it correctly?
Again many thanks

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen [hidden email]
Komu: [hidden email]
Datum: 30. 1. 2015 23:45:59
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

OK, give a try, then :) I believe it would do what you want to.

Thanks to this I discovered a brand new issue and that we need to change the Existing Local Configurations / Local Containers so they attempt redeployment of deployables (and not simple deployment). This is now fixed - see https://jira.codehaus.org/browse/CARGO-1303

If you want to try the SNAPSHOT version, check out: http://cargo.codehaus.org/Downloads#Downloads-continousBuilds

Have a great weekend

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 21:02, Wortner wrote:

Hi, thanks for insight. It is close to my solution with maven tomcat plugin. Will try that anyway. I like Cargo and really thanks for suport.

Regards
M.W.

Sent with AquaMail for Android
http://www.aqua-mail.com

On 30 January 2015 19:57:16 "S. Ali Tokmen" [hidden email] wrote:

Hi Martin

OK, I see the problem: the existing local container does a .deploy and not .redeploy; so I believe in Tomcat's case this makes the server miss the new file.

Here's what you could try: in your pom.xml, add a remote deployer and call redeploy right after the daemon-start - this will most likely nail it down.

Let me know if this helps.

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 09:16, Martin Wortner wrote:
So requested details. Just tried that one more not to
waste your time.

1. manually overwriting .war file locally without server restart properly
worked
2. using cargo:daemon-start failed as the old context even with old
probably restored session is used
3. manually overwriting .war file on remote works while server running works


Seems the restart causes Tomcat not to pick up the .war file.
Note I tried already deployOnStartup options, but then it deploys twice and
the old version is deployed:-/


So now some config
my maven

   <profile>
            <id>tomcat7daemon</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                       
<artifactId>cargo-maven2-plugin</artifactId>
                        <executions>
                            <!--execute after integration test this is
to deploy to container not test-->
                            <execution>
                                <id>deploy-after-build</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>daemon-start</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <configuration>
                                <type>existing</type>
                                <home>${remote-tomcat7.home}</home>
                                <properties>
                                   
<cargo.servlet.port>${servlet.port}</cargo.servlet.port>
                                </properties>
                            </configuration>
                            <container>
                                <containerId>tomcat7x</containerId>
                                <home>${remote-tomcat7.home}</home>
                                <dependencies>
                                    <dependency>
                                       
<groupId>org.hsqldb</groupId>
                                       
<artifactId>hsqldb</artifactId>
                                    </dependency>
                                </dependencies>
                            </container>
                            <deployables>
                                <deployable>
                                    <type>war</type>
                                    <pingURL>http://${hostname}:${servlet.port}/${application.name}/home</pingURL>
      //not working ignored
                                </deployable>
                            </deployables>
                            <daemon>
                                <properties>
                                    <cargo.daemon.url>http://${hostname}:${daemon.port}/</cargo.daemon.url>
                                   
<cargo.daemon.handleid>tomcat7-existing-remote-daemon</cargo.daemon.handleid>
                                </properties>
                            </daemon>
                        </configuration>
                    </plugin>
                </plugins>
                <finalName>${application.name}</finalName>
            </build>

        </profile>
  
in conf/context.xml i have this
<WatchedResource>META-INF/MANIFEST.MF</WatchedResource>
 as the app do not have web.xml I thought is good idea  to watch for some
other file

my conf/server.xml
   <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true" undeployOldVersions="true"
deployOnStartup="false">

I have wasted so much time on this issue. I was so long waiting for
opportunity to introduce cargo to our company, but
now with so much time lost I don't know if I will be able to defend this
solution.

One more thing I found out that Tomcat from 7.something do not auto deploy
wars placed outside of webapps(aka appbase),
can it be that Tomcat thinks webapps is not his doc base when started from
daemon, ie. deamon passes the doc base from config
and thus Tomcat thinks the folder is not appbase?:-/

"The documented and intended behaviour of unpackWARs is that it only applies to WARs in the appBase.  This is true for 5.5.x, 6.0.x and 7.0.x."

I have so many questions and cargo so many options. 

Thanks in advance for hints

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen 
Komu: [hidden email]
Datum: 30. 1. 2015 7:49:05
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin



Thanks for these details.



Would you be so kind to go, step by step, on what you do? There
are many combinations I can think of, and all that I tried worked
so there must be something different between what I try and what
you do.



Regards



S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 07:39, Martin Wortner wrote:



Hi,
the problem is simple Tomcat will not unpack the .war file
that is copied in place by Cargo. This happen when the unpacked
folder is already there ie. redeploy. So first time everything
is ok and .war file is unpacked, second time the redeploy
happens, but seems from the old unpacked folder, thus the old
version is then running. 





I'm using existing instalation. I don't know how cargo is
suppose to work, but if the folder is there it will not work.
Through the manager interface it works, but otherwise. My
solution for now is to undeploy using tomcat maven plugin, which
will remove the folder and then I'm doing cargo:daemon-start.





Maybe I'm missing something. I don't have the config here,
but is just uses existing config, and tomcat7x container will
add it after I will arive to work. Anyway thanks for answer.





Regards





M.W



---------- Původní zpráva ----------

Od: S. Ali Tokmen 

Komu: [hidden email]

Datum: 29. 1. 2015 22:41:23

Předmět: Re: [cargo-user] Unable to deploy to Tomcat



Hi Martin



Can you please explain a bit more in detail what you are doing
(steps,

screenshots, code examples, pom.xml extracts, etc.)?



Thank you



S. Ali Tokmen

http://ali.tokmen.com/

http://contact.ali.tokmen.com/



On 28/01/15 13:55, Martin Wortner wrote:

Hello there, 

[The entire original message is not included.]
Reply | Threaded
Open this post in threaded view
|

RE: Unable to deploy to Tomcat

Martin Wortner
Nope, you fixed all of them:) Thanks for support and looking forward for new release.

Best regards

M.

---------- Původní zpráva ----------
Od: S. Ali Tokmen <[hidden email]>
Komu: [hidden email]
Datum: 2. 2. 2015 10:55:48
Předmět: RE: [cargo-user] Unable to deploy to Tomcat


Good news � So, are they're more bugs you found?

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

From: [hidden email]
Sent: ‎02/‎02/‎2015 10:44
To: [hidden email]
Subject: RE: [cargo-user] Unable to deploy to Tomcat

The snapshot version of daemon works as expected. Sorry for bothering.

Thank you 

M.

---------- Původní zpráva ----------
Od: Martin Wortner <[hidden email]>
Komu: [hidden email]
Datum: 2. 2. 2015 9:49:56
Předmět: RE: [cargo-user] Unable to deploy to Tomcat


Shame on me, I didn't realize that. So for the redeploy, is it possible just to change the daemon?
I can live for a while with the ping problem, as it will be problem here to use snapshots in the build, but 
the exchange of daemon for snapshot version is without problem, will download and try.

M.

---------- Původní zpráva ----------
Od: S. Ali Tokmen <[hidden email]>
Komu: [hidden email]
Datum: 2. 2. 2015 9:44:18
Předmět: RE: [cargo-user] Unable to deploy to Tomcat


Hi Martin

Which daemon version are you trying? Note that you need the latest SNAPSHOT of the daemon as well (that one has the fix for the expanded WAR directory issue you're mentioning), I'd suggest you download it from the continous integration system: http://cargo.codehaus.org/Downloads#Downloads-continousBuilds

Thank you

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

From: [hidden email]
Sent: ‎02/‎02/‎2015 09:39
To: [hidden email]
Subject: Re: [cargo-user] Unable to deploy to Tomcat

And just tried the deamon-start, redeploy cycle, but it will not work either. 
The daemon in old version is not waiting for ping url so it finishes, and the redeploy starts
but the manager webapp is still not in place, thus failing during listing available contexts .


---------- Původní zpráva ----------
Od: Martin Wortner <[hidden email]>
Komu: [hidden email]
Datum: 2. 2. 2015 9:21:20
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Checked with the SNAPSHOT, pingUrl works now, 
but I'm afraid the deployment is still not working read this please

http://stackoverflow.com/questions/17810083/tomcat-does-not-unpack-war-file-if-folder-with-the-same-name-with-war-file-is-ex

http://stackoverflow.com/questions/4604335/tomcat-not-autodeploying-war-file
or here where they wrote 

Any web application archive file within the application base (appBase) directory that does not have a corresponding directory of the same name (without the ".war" extension) will be automatically expanded, unless the unpackWARs property is set to false. If you redeploy an updated WAR file, be sure to delete the expanded directory when restarting Tomcat, so that the updated WAR file will be re-expanded (note that the auto deployer, if enabled, will automatically expand the updated WAR file once the previously expanded directory is removed).

Maybe the unpacked folder must really be deleted. 

If I will do the star-daemon and redeploy after there are several issue
- running same plugin with different configuration in one build
- the application will be deployed twice first with daemon-start second with redeploy

I can not do the undeploy before, as the server can be stopped for some reason and in that case the undeploy will not happen.

In my eyes this unpacking thingy for Tomcat is really pain.

Thank you 

M.

---------- Původní zpráva ----------
Od: S. Ali Tokmen <[hidden email]>
Komu: [hidden email]
Datum: 1. 2. 2015 12:30:33
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

I'm afraid you hit another bug, CARGO-1304 - The daemon-start goal does not respect the pingUrl. Good news is that it is corrected in the SNAPSHOT version, which gives you two options:
Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 31/01/15 10:16, Martin Wortner wrote:
So no way how to wait for the app to deploy other then remote deployer and pingUrl. I'm using daemon to be able to stop start tomcat, omit the use of cumbersome scripts, so for me remote deployer is not enough I quess. Will try to resolve it somehow, with i.e. https://github.com/tacitknowledge/maven-wait-plugin


---------- Původní zpráva ----------
Od: S. Ali Tokmen [hidden email]
Komu: [hidden email]
Datum: 31. 1. 2015 10:01:37
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

PingUrl will work better with the remote deployer :)

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 31/01/15 09:26, Martin Wortner wrote:
Just one more question, whenever I'm running the cargo:daemon-start it ends just as soon as it somehow realizes the container is up. The problem is that after that some tests follows, the container is up not the webapp. I thought it can be solved by using <pingURL> element. But it was not working for me, can you check the excerpt I sent bellow, if I'm using it correctly?
Again many thanks

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen [hidden email]
Komu: [hidden email]
Datum: 30. 1. 2015 23:45:59
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin

OK, give a try, then :) I believe it would do what you want to.

Thanks to this I discovered a brand new issue and that we need to change the Existing Local Configurations / Local Containers so they attempt redeployment of deployables (and not simple deployment). This is now fixed - see https://jira.codehaus.org/browse/CARGO-1303

If you want to try the SNAPSHOT version, check out: http://cargo.codehaus.org/Downloads#Downloads-continousBuilds

Have a great weekend

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 21:02, Wortner wrote:

Hi, thanks for insight. It is close to my solution with maven tomcat plugin. Will try that anyway. I like Cargo and really thanks for suport.

Regards
M.W.

Sent with AquaMail for Android
http://www.aqua-mail.com

On 30 January 2015 19:57:16 "S. Ali Tokmen" [hidden email] wrote:

Hi Martin

OK, I see the problem: the existing local container does a .deploy and not .redeploy; so I believe in Tomcat's case this makes the server miss the new file.

Here's what you could try: in your pom.xml, add a remote deployer and call redeploy right after the daemon-start - this will most likely nail it down.

Let me know if this helps.

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 09:16, Martin Wortner wrote:
So requested details. Just tried that one more not to
waste your time.

1. manually overwriting .war file locally without server restart properly
worked
2. using cargo:daemon-start failed as the old context even with old
probably restored session is used
3. manually overwriting .war file on remote works while server running works


Seems the restart causes Tomcat not to pick up the .war file.
Note I tried already deployOnStartup options, but then it deploys twice and
the old version is deployed:-/


So now some config
my maven

   <profile>
            <id>tomcat7daemon</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                       
<artifactId>cargo-maven2-plugin</artifactId>
                        <executions>
                            <!--execute after integration test this is
to deploy to container not test-->
                            <execution>
                                <id>deploy-after-build</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>daemon-start</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <configuration>
                                <type>existing</type>
                                <home>${remote-tomcat7.home}</home>
                                <properties>
                                   
<cargo.servlet.port>${servlet.port}</cargo.servlet.port>
                                </properties>
                            </configuration>
                            <container>
                                <containerId>tomcat7x</containerId>
                                <home>${remote-tomcat7.home}</home>
                                <dependencies>
                                    <dependency>
                                       
<groupId>org.hsqldb</groupId>
                                       
<artifactId>hsqldb</artifactId>
                                    </dependency>
                                </dependencies>
                            </container>
                            <deployables>
                                <deployable>
                                    <type>war</type>
                                    <pingURL>http://${hostname}:${servlet.port}/${application.name}/home</pingURL>
      //not working ignored
                                </deployable>
                            </deployables>
                            <daemon>
                                <properties>
                                    <cargo.daemon.url>http://${hostname}:${daemon.port}/</cargo.daemon.url>
                                   
<cargo.daemon.handleid>tomcat7-existing-remote-daemon</cargo.daemon.handleid>
                                </properties>
                            </daemon>
                        </configuration>
                    </plugin>
                </plugins>
                <finalName>${application.name}</finalName>
            </build>

        </profile>
  
in conf/context.xml i have this
<WatchedResource>META-INF/MANIFEST.MF</WatchedResource>
 as the app do not have web.xml I thought is good idea  to watch for some
other file

my conf/server.xml
   <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true" undeployOldVersions="true"
deployOnStartup="false">

I have wasted so much time on this issue. I was so long waiting for
opportunity to introduce cargo to our company, but
now with so much time lost I don't know if I will be able to defend this
solution.

One more thing I found out that Tomcat from 7.something do not auto deploy
wars placed outside of webapps(aka appbase),
can it be that Tomcat thinks webapps is not his doc base when started from
daemon, ie. deamon passes the doc base from config
and thus Tomcat thinks the folder is not appbase?:-/

"The documented and intended behaviour of unpackWARs is that it only applies to WARs in the appBase.  This is true for 5.5.x, 6.0.x and 7.0.x."

I have so many questions and cargo so many options. 

Thanks in advance for hints

M.W.

---------- Původní zpráva ----------
Od: S. Ali Tokmen 
Komu: [hidden email]
Datum: 30. 1. 2015 7:49:05
Předmět: Re: [cargo-user] Unable to deploy to Tomcat


Hi Martin



Thanks for these details.



Would you be so kind to go, step by step, on what you do? There
are many combinations I can think of, and all that I tried worked
so there must be something different between what I try and what
you do.



Regards



S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
On 30/01/15 07:39, Martin Wortner wrote:



Hi,
the problem is simple Tomcat will not unpack the .war file
that is copied in place by Cargo. This happen when the unpacked
folder is already there ie. redeploy. So first time everything
is ok and .war file is unpacked, second time the redeploy
happens, but seems from the old unpacked folder, thus the old
version is then running. 





I'm using existing instalation. I don't know how cargo is
suppose to work, but if the folder is there it will not work.
Through the manager interface it works, but otherwise. My
solution for now is to undeploy using tomcat maven plugin, which
will remove the folder and then I'm doing cargo:daemon-start.





Maybe I'm missing something. I don't have the config here,
but is just uses existing config, and tomcat7x container will
add it after I will arive to work. Anyway thanks for answer.





Regards





M.W



---------- Původní zpráva ----------

Od: S. Ali Tokmen 

Komu: [hidden email]

Datum: 29. 1. 2015 22:41:23

Předmět: Re: [cargo-user] Unable to deploy to Tomcat



Hi Martin



Can you please explain a bit more in detail what you are doing
(steps,

screenshots, code examples, pom.xml extracts, etc.)?



Thank you



S. Ali Tokmen

http://ali.tokmen.com/

http://contact.ali.tokmen.com/



On 28/01/15 13:55, Martin Wortner wrote:

Hello there, 

[The entire original message is not included.]