Unable to delete old config file

The public knowledge pool and discussion forum of the OWS community. Do not post confidential information here!
Andrej
Posts: 5
Joined: 22 May 2020, 09:51

Unable to delete old config file

Post by Andrej »

Hello,

i'm having issues with running multiple jnlps. In an application we use, 2 jnlp files are called. During the startup process, OWS generates an Error.
In the log file both are accessing cache.json at the same time and thus creating this error. I also had the same issue with deployment.properties. I think this applies to all files which will be edited and saved.
Error.png
Error.png (35.81 KiB) Viewed 102 times
We did look into this and think the issue could be here

https://github.com/karakun/OpenWebStart ... nager.java

/**
* Load runtimes from filesystem into cache. Do some housekeeping by checking if a runtime is still present
* on the file system as stated in the cache json file. If not present any more, it will be removed from the
* json file and the cache.
*/
private void saveRuntimes() throws IOException {
jsonStoreLock.lock();
try {
[...]
}

final File jsonFile = new File(cachePath, RuntimeManagerConstants.JSON_STORE_FILENAME);

if (jsonFile.exists()) {
if (!jsonFile.delete()) { <- A second process can't delete the file, since it's locked
throw new IOException("Unable to delete old config file!");
}
}
[...]
} finally {
jsonStoreLock.unlock();
}
}

Regards,
Andrej

Janak Mulani
Posts: 40
Joined: 24 Mar 2020, 13:37

Re: Unable to delete old config file

Post by Janak Mulani »

Hi Andrej,

>
i'm having issues with running multiple jnlps. In an application we use, 2 jnlp files are called. During the startup process,
>

Can you please elaborate above? What do you mean by running multiple jnlps? How do you run them? Are these extension jnlps? You say two jnlps are called. How are you doing this. Please provide more details.

Thanks

Andrej
Posts: 5
Joined: 22 May 2020, 09:51

Re: Unable to delete old config file

Post by Andrej »

Hi Janak,

in Microsoft Windows I have associated jnlp to open with OWS. ("C:\Program Files\OpenWebStart\javaws.exe" -nosecurity -Xnofork -Xignoreheaders -allowredirect -jnlp "%1"). Optional Parameters don't matter, issue also happens with "-jnlp" only. It is a WebApplication running in Firefox. It is based on JavaServerFaces, which after login Downloads immediately JNLP files from the backendmiddleware Server and then opens them via Firefox/Windows on the client machine. It's basically the same as opening the JNLP files in Windows Explorer. Mark both and press "Enter".
Explorer.png
Explorer.png (17.43 KiB) Viewed 70 times
In Firefox they are downloaded to your temp and executed via default firefox/windows "open".
Firefox.png
Firefox.png (6.09 KiB) Viewed 70 times
If futher information is required I will try to get them.

Regards,
Andrej

Janak Mulani
Posts: 40
Joined: 24 Mar 2020, 13:37

Re: Unable to delete old config file

Post by Janak Mulani »

Thanks Andrej.

So basically it is like starting two instances of OWS's javaws simultaneously. I will try this and get back to you.

Janak Mulani
Posts: 40
Joined: 24 Mar 2020, 13:37

Re: Unable to delete old config file

Post by Janak Mulani »

I tried running two jnlps simultaneously but I could not reproduce it. There seems to be a timing issue. But we will review the code pointed out by you.

Are you getting this Exception always, consistently whenever you run your JSF application? What happens if you introduce a slight delay between downloads of jnlps in your application? does it work that way?

Andrej
Posts: 5
Joined: 22 May 2020, 09:51

Re: Unable to delete old config file

Post by Andrej »

Always after reboot, on the first start. Otherwise sporadically. Via windows explorer (mark and enter) I can reproduce always. With delay it is working. So yes it looks like a timing issue.

Janak Mulani
Posts: 40
Joined: 24 Mar 2020, 13:37

Re: Unable to delete old config file

Post by Janak Mulani »

We have created an issue. It will be fixed in future release.

Andrej
Posts: 5
Joined: 22 May 2020, 09:51

Re: Unable to delete old config file

Post by Andrej »

Thank you very much!
Do you know in which version this will be presumably fixed ?

Post Reply