-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Bruce,
(CC'ing the list this time. TB changed their REPLY semantics and I'm still getting used to them.) On 4/24/17 8:52 AM, Bruce Huang wrote: > 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. Interesting. > 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. It seems like that file is being kept-open by some part of the code. I suspect it's being held-open by some code from within that JAR file -- maybe opening a file and not closing it, etc. > 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)? There should be no log4j/log4j2 issues. I'm not sure about Bouncy Castle, but I suspect that their implementation is good. native code can't be loaded from a JAR file so I don't think that's going to be a part of the problem. You may need to attach a debugger/profiler to the application and look at the open files to see what code is holding that file open. An option for Tomcat is to set "antiJARLocking" to "true" in your <Context> element in META-INF/context.xml [1]. Note that there may be some other implications to using this, so please read the documentation. - -chris [1] https://tomcat.apache.org/tomcat-7.0-doc/config/context.html -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJY/ki1AAoJEBzwKT+lPKRYaYsP/2i4tkOaVgsdVwJEih8AVAuX F6GQOuu+rrCWH0KBT5engib0AJjLvVI7KPgwRSFQ170MC3apswYRSaUg5LLOS02p RTmOkzfv+B2rp4BU/j2bOJHf0oLtXAJBMNsTczAgybQyDGmLzUafLl9+hYEIaGaq pCf4mmdi0wi9CECx57HDfpSJKSH3ZtpQ3PFet2GXhiHhViYRpCiuZG3U3h8BLFpb 9Nad+RZ14esEdXc57I9qvOjYUfDNkhjNebMrXQglvlMX/qVIffu+oiqUge9KQDb9 SAN4onLQtPpp0PxP8vkTFl/MLoo4tAVs5h9ARmFUX+UzPf3TllrJIp3K2IBHENf+ xluJ6U5Gio1MIx/CJjts3jnDR/A7/dATJzWyjlP+iTME1U+6OT4YOdVnuE6c1g3u vyYJgsSkIMM4A5ixflJ/OCX5GlvOJeTA/2mIcrFvMW1WjPD/i7urhOH8KuTcSVBV I8wzR75Zrq9JHWN7PgmrSoF3osVPfBwcJEnYi+v4S9VIzbpIS2xg0TKAhXMpI6xc WYv2vegjPs8fsZGWdv+plumVauaki18ysLE4066foRqyh7kGb0GNEu097rowBis0 KnUyGbHDCBGPe162kShKAOqkDP1AG0ySKPq4y4di9jT+lApS+xxbXnD1MEvfbEwK homOkesGo+M+M6CigY5k =qf+H -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org