Skip to main content



      Home
Home » Eclipse Projects » Virgo » java.io.tmpdir points to an unexsiting folder
java.io.tmpdir points to an unexsiting folder [message #1692523] Thu, 16 April 2015 06:47 Go to next message
Eclipse UserFriend
Hello,

I had a runtime error in a third-party library because Virgo sets the variable java.io.tmpdir to a subfolder named tmp within its working directory, but such folder is not created.

In other words, user code that assumes that the java.io.tmpdir folder exists may fail. Of course this is not a big issue, one can always write a line of code like the following:

  new File(System.getProperty("java.io.tmpdir")).mkdirs();


but it's not clear to me what is the correct behaviour: I checked the javadoc for the File class but it's not mentioning whether the user code should (or should not) assume that the temporary folder exists. However, common experience is that in Java SE applications and in other application servers that folder always exists.

As such I would suggest to have Virgo automatically create the folder upon startup, especially since it's Virgo that sets the variable in dmk.sh

GianMaria.



Re: java.io.tmpdir points to an unexsiting folder [message #1692528 is a reply to message #1692523] Thu, 16 April 2015 07:03 Go to previous messageGo to next message
Eclipse UserFriend
I like your suggestion. Would you mind creating a bugzilla item?
Re: java.io.tmpdir points to an unexsiting folder [message #1692531 is a reply to message #1692528] Thu, 16 April 2015 07:20 Go to previous messageGo to next message
Eclipse UserFriend
I double checked the shell scripts, and I now believe that this is probably an issue in the Virgo Tools rather than Virgo.

A deeper look at dmk.sh reveals that at some point the start scripts try to create the folder:

	# If we get here we have the correct Java version.
	
	if [ -z "$NO_START_FLAG" ]
	then
		TMP_DIR=$KERNEL_HOME/work/tmp
		# Ensure that the tmp directory exists
		mkdir -p $TMP_DIR


At this point I think I should open the bugzilla entry against the Virgo Tools, right?

GianMaria.

[Updated on: Thu, 16 April 2015 09:06] by Moderator

Re: java.io.tmpdir points to an unexsiting folder [message #1692535 is a reply to message #1692531] Thu, 16 April 2015 07:26 Go to previous messageGo to next message
Eclipse UserFriend
And at first sight this may be the right place to apply the fix in the Virgo tools:

https://github.com/eclipse/virgo.ide/blob/82e3dd95c387b170a38ec978c477cfe26a14b32b/org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/runtime/internal/core/ServerLaunchConfigurationDelegate.java#L79

unless you prefer to move the initialization logic from the shell script into the server Java code.

GianMaria.
Re: java.io.tmpdir points to an unexsiting folder [message #1692561 is a reply to message #1692535] Thu, 16 April 2015 09:35 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for looking deeper into this. Any chance you can spare some more minutes and create a pull request?
Re: java.io.tmpdir points to an unexsiting folder [message #1692565 is a reply to message #1692561] Thu, 16 April 2015 10:11 Go to previous messageGo to next message
Eclipse UserFriend

I'll try to have a look at it in the next days. Meanwhile I'll open the bugzilla entry against the Virgo IDE project.

GianMaria.
Re: java.io.tmpdir points to an unexsiting folder [message #1692597 is a reply to message #1692565] Thu, 16 April 2015 12:54 Go to previous message
Eclipse UserFriend
I created the bugzilla entry https://bugs.eclipse.org/bugs/show_bug.cgi?id=464814

Previous Topic:Virgo 3.6.2 library load error (folder is expected as jar archive)
Next Topic:Requesting to be started bundle list to virgo
Goto Forum:
  


Current Time: Wed Jul 23 19:28:02 EDT 2025

Powered by FUDForum. Page generated in 0.04602 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top