Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete apache axis tmp files without restarting

We're using apache axis to talk to a web service. It works fine, but over the course of a day we're generating 1GB of temp files. These files are deleted if we restart the service, but needing to restart the service every day so we don't run out of disk space seems a bit silly.

Is there an easy fix for this?

like image 205
Programming Guy Avatar asked Feb 03 '26 04:02

Programming Guy


1 Answers

We found a programmatic way to avoid generation of those files - which sounds like a better way to do the housekeeping. I posted that in the comments of AXIS2-3919 issue, but will copy it here just in case:


Actually, the files are deployed to the temp folder each time AXIS configuration context is created. Also, it appears that the generated Stub can accept existing configuration object via the constructor. So, the following Spring configuration helped us to solve the issue (irrelevant bean and class names dropped):

<bean id="....Stub" factory-bean="...." factory-method="...." scope="request">
    <!-- this next element effects the proxying of the surrounding bean, 
        needed because .... will try to set the stub out of request scope -->
    <aop:scoped-proxy/>
    <constructor-arg index="0" >
        <!-- The WS stub is created here, and passed to the factory-method of ... as a parameter -->
        <bean class="com......ws.....Stub" scope="prototype">
            <constructor-arg ref="axisConfigContext" />
        </bean>
    </constructor-arg>
</bean>

<!-- Exists to avoid deployment of axis jar into temp dir for each request. See     AXIS2-3919 for more details. -->
<bean id="axisConfigContext" 
        class="org.apache.axis2.context.ConfigurationContextFactory" 
        factory-method="createConfigurationContextFromFileSystem">
    <constructor-arg index="0"><null /></constructor-arg>
    <constructor-arg index="1"><null /></constructor-arg>
</bean>
like image 114
Anton Avatar answered Feb 05 '26 21:02

Anton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!