tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Huang <mailbru...@gmail.com>
Subject Re: Get fail response by using the Tomcat manager command to deploy a war
Date Mon, 24 Apr 2017 12:52:01 GMT
Thanks for the information that Chris has provided.

I have found that the deployment has not always being succeeded.

The situation is, if I hit the /stop and then /deploy?update=true, even I
always got a fail message as below

*FAIL - Deployed application at context path /test but context failed to
start*

But, sometimes the deployment works and sometimes it doesn't. If it is
failed to deploy, the folder of the web application will have a file
remains which is the \WEB-INF\lib\licensor-1.0.0-RC.jar.

What if I hit the /stop and then /undeploy before doing the
/deploy?update=true, the response of the /undeploy request is always as
below

FAIL - Unable to delete
[D:\Tomcat8\apache-tomcat-8.0.23\webapps\test]. The continued presence
of this file may cause problems.

And yes, the file remains is \WEB-INF\lib\licensor-1.0.0-RC.jar.

The licensor-1.0.0-RC.jar(Developed by ourself) dependents to the
bouncycastle <https://www.bouncycastle.org/> and log4j2
<https://logging.apache.org/log4j/2.x/> as below pom shows.

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>${log4j.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies></dependencyManagement>
<dependencies>
    <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcprov-jdk15on</artifactId>
        <version>1.51</version>
    </dependency>
    <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcprov-ext-jdk15on</artifactId>
        <version>1.51</version>
    </dependency>
    <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcpg-jdk15on</artifactId>
        <version>1.51</version>
    </dependency>

    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-jcl</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-slf4j-impl</artifactId>
    </dependency>

    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>18.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
    </dependency>

    <dependency>
        <groupId>commons-cli</groupId>
        <artifactId>commons-cli</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>commons-configuration</groupId>
        <artifactId>commons-configuration</artifactId>
        <version>1.10</version>
    </dependency>

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-core</artifactId>
        <version>1.3</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>1.10.19</version>
        <scope>test</scope>
    </dependency></dependencies>

And our webapp uses log4j 1.2 as the logging system, the pom as below

<dependency>
    <groupId>com.company</groupId>
    <artifactId>licensor</artifactId>
    <version>1.0.0-RC</version></dependency><dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>1.2.14</version></dependency>

As mentioned above, everytime when we try to undeploy the webapp from
tomcat manager, it always failed to undeploy the webapp and return the
failed message as below

FAIL - Unable to delete
[D:\Tomcat8\apache-tomcat-8.0.23\webapps\test]. The continued presence
of this file may cause problems.

The remains file is always the WEB-INF\lib\licensor-1.0.0-RC.jar and it
always being locked and unable to be deleted until we have shutdown the
tomcat.

The tomcat log only complains about the directory could not be completely
deleted.

19-Apr-2017 18:49:56.976 INFO
[ContainerBackgroundProcessor[StandardEngine[Catalina]]]
org.apache.catalina.startup.HostConfig.undeploy Undeploying context
[/2.2]
19-Apr-2017 18:49:56.981 SEVERE
[ContainerBackgroundProcessor[StandardEngine[Catalina]]]
org.apache.catalina.startup.ExpandWar.deleteDir
[D:\CI\Tomcat8\CI1\apache-tomcat-8.0.23\webapps\2.2\WEB-INF\lib] could
not be completely deleted. The presence of the remaining files may
cause problems
19-Apr-2017 18:49:56.982 SEVERE
[ContainerBackgroundProcessor[StandardEngine[Catalina]]]
org.apache.catalina.startup.ExpandWar.deleteDir
[D:\CI\Tomcat8\CI1\apache-tomcat-8.0.23\webapps\2.2\WEB-INF] could not
be completely deleted. The presence of the remaining files may cause
problems
19-Apr-2017 18:49:56.982 SEVERE
[ContainerBackgroundProcessor[StandardEngine[Catalina]]]
org.apache.catalina.startup.ExpandWar.deleteDir
[D:\CI\Tomcat8\CI1\apache-tomcat-8.0.23\webapps\2.2] could not be
completely deleted. The presence of the remaining files may cause
problems
19-Apr-2017 18:49:56.983 SEVERE
[ContainerBackgroundProcessor[StandardEngine[Catalina]]]
org.apache.catalina.startup.ExpandWar.delete
[D:\CI\Tomcat8\CI1\apache-tomcat-8.0.23\webapps\2.2] could not be
completely deleted. The presence of the remaining files may cause
problems

Is there any conflict problem if the webapp is using log4j 1.2 and its
dependency lib has log4j2? Or the bouncycastle has some file locking issue
(Since it seems to contain some native code)?

Any help is appreciated

Bruce Huang <mailbruced@gmail.com> 於 2017年4月9日 週日 下午7:47寫道:

> Hi Christopher,
>
> I have checked the tomcat log, there is no error as below and the
> application is started successfully.
>
> Manager.log
>
> 09-Apr-2017 17:37:53.295 INFO [http-nio-3030-exec-342]
> org.apache.catalina.core.ApplicationContext.log Manager: stop: Stopping web
> application '/2.1.2-C1'
> 09-Apr-2017 17:38:23.769 INFO [http-nio-3030-exec-326]
> org.apache.catalina.core.ApplicationContext.log Manager: deploy: Deploying
> web application '/2.1.2-C1'
> 09-Apr-2017 17:38:23.769 INFO [http-nio-3030-exec-326]
> org.apache.catalina.core.ApplicationContext.log Manager: Uploading WAR file
> to D:\CI\Tomcat8\CI6\apache-tomcat-8.0.23\webapps\2.1.2-C1.war.tmp
>
> localhost.log
>
> 09-Apr-2017 17:37:53.344 INFO [http-nio-3030-exec-342]
> org.apache.catalina.core.ApplicationContext.log Shutting down log4j
> 09-Apr-2017 17:38:05.573 INFO [http-nio-3030-exec-342]
> org.apache.catalina.core.ApplicationContext.log Closing Spring root
> WebApplicationContext
> 09-Apr-2017 17:43:05.372 INFO [localhost-startStop-32]
> org.apache.catalina.core.ApplicationContext.log No Spring
> WebApplicationInitializer types detected on classpath
> 09-Apr-2017 17:43:05.833 INFO [localhost-startStop-32]
> org.apache.catalina.core.ApplicationContext.log Initializing Spring root
> WebApplicationContext
> 09-Apr-2017 17:44:00.206 INFO [localhost-startStop-32]
> org.apache.catalina.core.ApplicationContext.log Initializing log4j from
> [D:\CI\Tomcat8\CI6\apache-tomcat-8.0.23\webapps\2.1.2-C1\WEB-INF\classes\log4j.properties]
>
> catalina.log
>
> 09-Apr-2017 17:38:34.989 INFO
> [ContainerBackgroundProcessor[StandardEngine[Catalina]]]
> org.apache.catalina.startup.HostConfig.undeploy Undeploying context
> [/2.1.2-C1]
> 09-Apr-2017 17:38:45.037 INFO [localhost-startStop-32]
> org.apache.catalina.startup.HostConfig.deployWAR Deploying web application
> archive D:\CI\Tomcat8\CI6\apache-tomcat-8.0.23\webapps\2.1.2-C1.war
> 09-Apr-2017 17:43:05.365 INFO [localhost-startStop-32]
> org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned
> for TLDs yet contained no TLDs. Enable debug logging for this logger for a
> complete list of JARs that were scanned but no TLDs were found in them.
> Skipping unneeded JARs during scanning can improve startup time and JSP
> compilation time.
> 09-Apr-2017 17:44:01.106 INFO [localhost-startStop-32]
> org.apache.catalina.startup.HostConfig.deployWAR Deployment of web
> application archive
> D:\CI\Tomcat8\CI6\apache-tomcat-8.0.23\webapps\2.1.2-C1.war has finished in
> 316,068 ms
>
>
> The log from my app for deploying the war file
>
> 2017-04-09 17:38:23,766 [main] INFO c.u.m.i.deployer.catalina.DeployTask -
> Deployed pacakge to
> http://localhost:3030/manager/text/deploy?update=true&path=/2.1.2-C1
> Sun Apr 09 17:38:24 CST 2017 -> FAIL - Deployed application at context
> path /2.1.2-C1 but context failed to start
>
> It looks like the deploying and uploading is started at around 17:38:23,
> and at the 17:38:24 the response is received and says failed to start. At
> 17:38:34, the app went to undeploying and at 17:38:45 it went to
> deploying and started successfully.
>
> Is that because my webapp taking too much time to be undeployed?
>
> Thanks
>
>
> Christopher Schultz <chris@christopherschultz.net> 於 2017年4月7日 週五
> 下午9:25寫道:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>>
>> Bruce,
>>
>> On 4/7/17 4:08 AM, Bruce Huang wrote:
>> > I want to use the tomcat supported manager command
>> > <https://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html#Supported
>> _Manager_Commands>
>> >
>> >
>> to deploy a war file. The Tomcat server is Tomcat v8.0.23.
>> >
>> > The application is sure to be deployed and started successfully,
>> > I, however, got the failed message of the response as below
>> >
>> > *FAIL - Deployed application at context path /test but context
>> > failed to start*
>> >
>> > The way I used is the HttpURLConnection in Java to PUT a file by an
>> > HTTP request as below code
>>
>> Re-read the error message you got. The upload was fine. The
>> application just didn't start properly. So the problem isn't with the
>> upload/deploy... it's with the application itself.
>>
>> Do onto the server and look at the log files to find out why the
>> application failed to start.
>>
>> - -chris
>> -----BEGIN PGP SIGNATURE-----
>> Comment: GPGTools - http://gpgtools.org
>> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>>
>> iQIcBAEBCAAGBQJY55NWAAoJEBzwKT+lPKRY23cQAKYEyu0KdyZeSSthSTrE+bCU
>> EgQEuFr36EjsdTc3hW8UYjJITzRgvjj7OUd/D/TTQmW9PsiRQQNmrjYDigpmnE6w
>> PlxkqhskbXX1iHJTcuIHKtUxvIGe67zMeJsZE2mlklOM9bJuPBcrORse185EBJyq
>> 543TZ/2GZkOqf3MuoKDTvrpaKL/hm70IeoMXKLv7MPEDMw/+MTI1OeNag/4pCgtw
>> b2WnemWNIO16msvaWWE7ZK7rcroQgX4ky2CvZ0COJjy2St8PfsnaBAYmzD1PCPtu
>> IkHdPHb8oAtJJoANPAmAQolg4SbNlzm9xL78tJvwgiY7hA8HKBC4STiIc7zM88nm
>> JhmzIfFScLGAEQ/qG4dGxTHctT4F/eE/DrTxKXwMai7z2Y1KjHfW7mn4eGmTIBLO
>> 2hWrTnfGUqhe/wM9D0nJJ8NuTCEt44JKSlMoBVqCzybHemykZKafxcKSa9ne5Yev
>> VQyTX3/CrbVqNIOD1oEuycuMDX8pXQfPWaFFWlcIu/1GOZNnHbXAr1GkNUM0cXSx
>> WcLAYK5SUs0x80ls06iZlyUNFQrH/Y94GFsIpu4alamIXyNC8G6gcagXOppKo8He
>> gvDcyDzrFCijZt7OW0j/toNH0U7AR/PHWF0+pf6qM/zDU2ewZRmFeCI0pD47eged
>> EVjBnqA2O5/nWhq08TGS
>> =V6R6
>> -----END PGP SIGNATURE-----
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message