Aspose-slides-23.9-jdk16.jar Keeps Running on the Server

I am using Aspose.Slide for Java for my university assignment.
Everything is prefect except aspose-slides-23.9-jdk16.jar keep running on the server.

The assignment needs me to upload the project (web application that can share slides online with only school personnel) to the school server (that I can’t do anything besides upload the war file and delete it), and if I want to update my project, I need to delete the previous version.
If I want to delete the previous version after I have had run the web application and used the function that use the jar file, the jar file cannot be deleted because of it is in use (told by my professor). So I am wondering is there anything that I can do.

FYI, I am developing with eclipse/Spring MVC/maven v4.0.0, and I import Aspose.Slide by maven using pom.xml

<repositories>
    <repository>
	<id>AsposeJavaAPI</id>
	<name>Aspose Java API</name>
	<url>https://releases.aspose.com/java/repo/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.aspose</groupId>
        <artifactId>aspose-slides</artifactId>
        <version>23.9</version>
        <classifier>jdk16</classifier>
    </dependency>
    <dependency>
        <groupId>com.aspose</groupId>
        <artifactId>aspose-slides</artifactId>
        <version>23.9</version>
        <classifier>javadoc</classifier>
    </dependency>
</dependencies>

Also, I am using dispose method, but not Interruptable Library (because my method need to have parameter which getting information from the website

@nanatori,
Thank you for contacting support.

Unfortunately, the issue is not directly related to Aspose.Slides for Java. You should find out how to update your web server project based on the technology stack you are using.

Thank you for responding.

After your response, I have done a lot of digging and tried a lot of method, including using Interruptable Library. However, none of it able to fix the problem.
So I started to doubt about the Java version causing the problem (because I am not using the newest one). And eventually, I found out that starting from Aspose Slide For Java version 21.4, the javaw.exe will keep the aspose-slides-xx.x-jdk16.jar in use for some reason. Therefore, I am using 21.3 now, and the problem is fixed.

FYI, here is the one of the method that use Aspose Slide Library.

//convert ppt to image
@RequestMapping(value="/fileConvert",method=RequestMethod.POST,produces="text/json;charset=UTF8")
@ResponseBody
public String fileConvert(@ModelAttribute("LoginSession")LoginSession log,@ModelAttribute("SlideFile")SlideFile sf,@RequestParam MultipartFile file) {
    Presentation present=null;
    try {
        SlideDao dao=new SlideDao();
        dao.getLastRecord();
        String ofn=file.getOriginalFilename();
        sf.setFileOrgName(ofn.substring(0,ofn.indexOf(".")));
        String ext=ofn.substring(ofn.indexOf("."),ofn.length());
        //create dir path
        // String path = System.getProperty("user.home")+"\\git\\2023GroupJ_KMSMK\\2023GroupJ\\src\\main\\webapp\\resources\\slides\\"+log.getUserID();
        String path=sc.getRealPath("\\resources\\slides")+"\\"+log.getUserID()+"\\tmp";
        String imgPath=path+"\\img";
        Path p=Paths.get(path);
        Path pngP=Paths.get(imgPath);
        if(!Files.exists(p)||!Files.exists(pngP))Files.createDirectories(pngP);
        //save file
        sf.setFpath(path+"\\"+ofn);
        byte[] fb=file.getBytes();
        FileOutputStream fos=new FileOutputStream(sf.getFpath());
        fos.write(fb);
        fos.flush();
        fos.close();
        //convert
        present=new Presentation(sf.getFpath());
        ISlide firstSlide=present.getSlides().get_Item(0);
        BufferedImage thumbnail=firstSlide.getThumbnail(1f,1f);
        File op=new File(imgPath+"\\"+firstSlide.getSlideNumber()+".png");
        if(ImageIO.write(thumbnail,"png", op)) {
            return "resources\\slides\\"+log.getUserID()+"\\tmp\\img\\"+firstSlide.getSlideNumber()+".png";
        }
    }catch(Exception e) {
        e.printStackTrace();
    }finally {
        present.dispose();
    }
    return null;
}

@nanatori,
Thank you for the details. Could you also please describe step by step how to reproduce the issue you encountered?

I am not so sure can I explain it clearly, but I will try my best. And because I am studying aboard in Japan, some words in the image will be Japanese, please don’t mind it.

So as I mentioned, I am developing the web application on eclipse, and the server I am using is Tomcat v8.5.

image.jpg (222.1 KB)

this is the page that user can click to choose the ppt file to call the method I wrote in previous reply by ajax.
And here is the ajax function in jQuery. (I am not familiar with ajax, if there is any proper way to do the same, I am very happy to know it.)

    $("#up").change(function(){
        var file=$(this)[0].files[0]
		var fFullName=file.name;
		var fname=fFullName.split(".")[0];
        $(this).prev().children().animate({opacity:0},300,function(){
            $("#up").parent().css("display","none");
            $("#uploadForm,#uploadConf").css("display","flex");
            $("#slideName").text(fFullName);
			$("#slideTitle").attr("placeholder",fname);
            $("#uploadForm").children().animate({opacity:1},300);
        });
		var formData=new FormData();
		formData.append("file",file);
		$.ajax({
			url:"./fileConvert",
			type:"POST",
			dataType:"html",
			data:formData,
			processData:false,
			contentType:false,
			success:function(data){
				var img="<img src='"+data+"'>";
				$("#tmpThumb").append(img);
			},
			error:function(XMLHttpRequest,textStatus,errorThrown){
				console.log("error:"+XMLHttpRequest);
				console.log("status:"+textStatus);
				console.log("errorThrown:"+errorThrown);
			}
		});
		$(document).ajaxStop(function(){
			if($("#tmpThumb").children().length>0){
				$("#tmpThumb").css("height","fit-content");
			}
		});
    });

When I monitoring program resources by resource monitor (Window 10), javaw.exe will use the aspose-slides-23.9-jdk16.jar (using 23.9 for example) only when the ajax function above being called. However, after that, the jar file will keep using by the javaw.exe even after the conversion and ajax request stopped.

Please let me know if there is any other information you want to have.

@nanatori,
Thank you for the details. I am working on the issue and will get back to you soon.

@nanatori,
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESJAVA-39378

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@nanatori,
Could you please share the simplest project that reproduces the problem?

Thank you for your reply. Hope you don’t mind I used the issue ID for the simple project that reproduces the problem.

image.png (372.4 KB)
When the server is running before using the convert method being used.

image.png (389.8 KB)
And this is after using the method.

And this is the project to reproduces the problem, choose a file should be able to reproduce the problem. (I have tried 21.3, 21.4 and 23.9 on this simple project, 21.4 and 23.9 are having the problem)

I’ve tried to upload a zip, but it said the file is too large… I am sorry about that.

@nanatori,
Thank you for the sample project, we will continue to work on this issue.

@nanatori,
Please try using the following instructions:

  1. Go to Run / Edit Configurations / “Deployment” tab, click + icon / select an “exploded artifact”.
  2. Select “Server” tab, update the following options:
    On “Update” action → Update classes and resources
    On frame deactivation → Update classes and resources
  3. Run the web application in Debug mode. Try to modify some codes or resources (Java files, …). The modified classes and resources will be reloaded automatically without any redeploy or something like that.