Axis2 keeps generating files in temp folder when running on tomcat

4.5k views Asked by At

When deploying a web application on tomcat which uses Axis2 for SOAP communication, then in the tomcat temp directory 'apache-tomcat-6.0.29\temp' we keep getting a folder such as 'axis2-tmp-21936.tmp' holding jars for the deployed Axis2 modules such as Rampart (for e.g. axis21098rampart-mar-1.5.1.jar).

The files keep growing until they fill up your hard drive.

I have attempted using the same context and stub for the subsequent calls, but that doesn't fix the issue.

It turns out this is a known issue in Axis2, fixed in version 1.7, which is not yet released and may not even fix it according to some people.

Note, when deploying on eclipse, these files go to C:\users\User\appdata\local\temp\; also, on standalone non-web applications, the files get generated only once and get deleted on restart.

The issue turned out to be invalid as the context was always being re-created - details in the answer below.

1

There are 1 answers

0
abdelrahman-sinno On BEST ANSWER

This turned out to be caused by a class being constantly re-created which is initializing a new Context on each service call.

In a nutshell:

  • The Axis2 (temp files) issue does not reproduce on Axis2 1.5.4.
  • Temp fles are generated only on the creation of a new Axis2 Context.
  • Temp files are NOT generated when a new stub class is created.