Skip to main content

Embedded - creates gfembedtmp with installation root set

13 replies [Last post]
dwsmith75
Offline
Joined: 2006-02-07

According to the documentation

http://docs.sun.com/app/docs/doc/821-1208/gjldt?a=view

"If the installation root directory is not specified, embedded Sun GlassFish Enterprise Server creates a directory named gfembedrandom-numbertmp in the current working directory, where random-number is a randomly generated 19-digit number. Embedded Sun GlassFish Enterprise Server then copies configuration files into this directory."

in org.glassfish.api.embedded.Server:
if (builder.fileSystem==null || builder.fileSystem.instanceRoot==null) {
File f;
try {
String tmpDir = System.getProperty("glassfish.embedded.tmpdir");
if (tmpDir==null) {
tmpDir = System.getProperty("user.dir");
}
f = File.createTempFile("gfembed", "tmp", new File(tmpDir));
} catch (IOException e) {
throw new RuntimeException(e);
}

Even if I set the instanceRoot property EJBContainerProviderImpl never passes this to the Server class, is there anyway to get around this?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Jerome Dochez

On Jan 6, 2010, at 2:01 PM, Marina Vatkina wrote:

> Jerome Dochez wrote:
>> On Jan 6, 2010, at 12:55 PM, glassfish@javadesktop.org wrote:
>>> Should I file a RFE?
>> yes
>>> Quite annoying to have a gfembedrandom-numbertmp directory in the root of my project for every time I have run unit tests.
>>>
>>> The code deletes the directory, but the directory remains with the following files:
>>>
>> and file a bug for these files not cleaned up when shutdown the embedded EJB container.
>
> These are tx log files - they should not depend on the whether the embedded GF is started by the EJBContainer or directly.
what do you mean by that sentence ? can you clarify...
all I was suggesting is that these files should be cleaned when the user requested that instance root be deleted upon termination.

thanks, jerome

>
> -marina
>
>> thx
>>> gfembed662505334826609491tmp/logs/server/tx/control
>>> gfembed662505334826609491tmp/logs/server/tx/extent.001
>>> [Message sent by forum member 'dwsmith75' (dsmith@nesmi.com)]
>>>
>>> http://forums.java.net/jive/thread.jspa?messageID=379107
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Marina Vatkina

Jerome Dochez wrote:
> On Jan 6, 2010, at 2:01 PM, Marina Vatkina wrote:
>
>
>> Jerome Dochez wrote:
>>
>>> On Jan 6, 2010, at 12:55 PM, glassfish@javadesktop.org wrote:
>>>
>>>> Should I file a RFE?
>>>>
>>> yes
>>>
>>>> Quite annoying to have a gfembedrandom-numbertmp directory in the root of my project for every time I have run unit tests.
>>>>
>>>> The code deletes the directory, but the directory remains with the following files:
>>>>
>>>>
>>> and file a bug for these files not cleaned up when shutdown the embedded EJB container.
>>>
>> These are tx log files - they should not depend on the whether the embedded GF is started by the EJBContainer or directly.
>>
> what do you mean by that sentence ? can you clarify...
>

Yes. You said "files not cleaned up when shutdown the embedded EJB
container", but the listed files are the transaction logs, so do not
depend on the EJB container.

> all I was suggesting is that these files should be cleaned when the user requested that instance root be deleted upon termination.
>

Right. But you are deleting everything else, so why are they still
there? Do you use deleteOnExit() or explicitly delete a predefined list?

thanks,
-marina
> thanks, jerome
>
>
>> -marina
>>
>>
>>> thx
>>>
>>>> gfembed662505334826609491tmp/logs/server/tx/control
>>>> gfembed662505334826609491tmp/logs/server/tx/extent.001
>>>> [Message sent by forum member 'dwsmith75' (dsmith@nesmi.com)]
>>>>
>>>> http://forums.java.net/jive/thread.jspa?messageID=379107
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Jerome Dochez

On Jan 7, 2010, at 1:44 PM, Marina Vatkina wrote:

> Jerome Dochez wrote:
>> On Jan 6, 2010, at 2:01 PM, Marina Vatkina wrote:
>>
>>
>>> Jerome Dochez wrote:
>>>
>>>> On Jan 6, 2010, at 12:55 PM, glassfish@javadesktop.org wrote:
>>>>
>>>>> Should I file a RFE?
>>>>>
>>>> yes
>>>>
>>>>> Quite annoying to have a gfembedrandom-numbertmp directory in the root of my project for every time I have run unit tests.
>>>>>
>>>>> The code deletes the directory, but the directory remains with the following files:
>>>>>
>>>>>
>>>> and file a bug for these files not cleaned up when shutdown the embedded EJB container.
>>>>
>>> These are tx log files - they should not depend on the whether the embedded GF is started by the EJBContainer or directly.
>>>
>> what do you mean by that sentence ? can you clarify...
>>
>
> Yes. You said "files not cleaned up when shutdown the embedded EJB container", but the listed files are the transaction logs, so do not depend on the EJB
> container.
>
>> all I was suggesting is that these files should be cleaned when the user requested that instance root be deleted upon termination.
>>
>
> Right. But you are deleting everything else, so why are they still there? Do you use deleteOnExit() or explicitly delete a predefined list?
no we don't use deleteOnExit() because the embedded container can be shutdown and yet the hosting process can carry on other tasks not shutting down itself.
the reason why those files stay around is probably because they are not closed (open file handle). When the embedded container is shutdown, necessary events are sent, the file handles should be released by the transaction manager.
>
> thanks,
> -marina
>> thanks, jerome
>>
>>
>>> -marina
>>>
>>>
>>>> thx
>>>>
>>>>> gfembed662505334826609491tmp/logs/server/tx/control
>>>>> gfembed662505334826609491tmp/logs/server/tx/extent.001
>>>>> [Message sent by forum member 'dwsmith75' (dsmith@nesmi.com)]
>>>>>
>>>>> http://forums.java.net/jive/thread.jspa?messageID=379107
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>>>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Marina Vatkina

Jerome Dochez wrote:
> On Jan 7, 2010, at 1:44 PM, Marina Vatkina wrote:
>
>
>> Jerome Dochez wrote:
>>
>>> On Jan 6, 2010, at 2:01 PM, Marina Vatkina wrote:
>>>
>>>
>>>
>>>> Jerome Dochez wrote:
>>>>
>>>>
>>>>> On Jan 6, 2010, at 12:55 PM, glassfish@javadesktop.org wrote:
>>>>>
>>>>>
>>>>>> Should I file a RFE?
>>>>>>
>>>>>>
>>>>> yes
>>>>>
>>>>>
>>>>>> Quite annoying to have a gfembedrandom-numbertmp directory in the root of my project for every time I have run unit tests.
>>>>>>
>>>>>> The code deletes the directory, but the directory remains with the following files:
>>>>>>
>>>>>>
>>>>>>
>>>>> and file a bug for these files not cleaned up when shutdown the embedded EJB container.
>>>>>
>>>>>
>>>> These are tx log files - they should not depend on the whether the embedded GF is started by the EJBContainer or directly.
>>>>
>>>>
>>> what do you mean by that sentence ? can you clarify...
>>>
>>>
>> Yes. You said "files not cleaned up when shutdown the embedded EJB container", but the listed files are the transaction logs, so do not depend on the EJB
>> container.
>>
>>
>>> all I was suggesting is that these files should be cleaned when the user requested that instance root be deleted upon termination.
>>>
>>>
>> Right. But you are deleting everything else, so why are they still there? Do you use deleteOnExit() or explicitly delete a predefined list?
>>
> no we don't use deleteOnExit() because the embedded container can be shutdown and yet the hosting process can carry on other tasks not shutting down itself.
> the reason why those files stay around is probably because they are not closed (open file handle). When the embedded container is shutdown, necessary events are sent, the file handles should be released by the transaction manager.
>

Do you have already events that TM can rely on, or do you plan to add them?

thanks,
-marina

>> thanks,
>> -marina
>>
>>> thanks, jerome
>>>
>>>
>>>
>>>> -marina
>>>>
>>>>
>>>>
>>>>> thx
>>>>>
>>>>>
>>>>>> gfembed662505334826609491tmp/logs/server/tx/control
>>>>>> gfembed662505334826609491tmp/logs/server/tx/extent.001
>>>>>> [Message sent by forum member 'dwsmith75' (dsmith@nesmi.com)]
>>>>>>
>>>>>> http://forums.java.net/jive/thread.jspa?messageID=379107
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>>>>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>>>>>
>>>>>>
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>>>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Jerome Dochez

the usual Events as defined in the org.glassfish.api.events package should be sent on shutdown. let me know if that's not the case.

On Jan 7, 2010, at 6:44 PM, Marina Vatkina wrote:

> Jerome Dochez wrote:
>> On Jan 7, 2010, at 1:44 PM, Marina Vatkina wrote:
>>
>>
>>> Jerome Dochez wrote:
>>>
>>>> On Jan 6, 2010, at 2:01 PM, Marina Vatkina wrote:
>>>>
>>>>
>>>>> Jerome Dochez wrote:
>>>>>
>>>>>> On Jan 6, 2010, at 12:55 PM, glassfish@javadesktop.org wrote:
>>>>>>
>>>>>>> Should I file a RFE?
>>>>>>>
>>>>>> yes
>>>>>>
>>>>>>> Quite annoying to have a gfembedrandom-numbertmp directory in the root of my project for every time I have run unit tests.
>>>>>>>
>>>>>>> The code deletes the directory, but the directory remains with the following files:
>>>>>>>
>>>>>>>
>>>>>> and file a bug for these files not cleaned up when shutdown the embedded EJB container.
>>>>>>
>>>>> These are tx log files - they should not depend on the whether the embedded GF is started by the EJBContainer or directly.
>>>>>
>>>> what do you mean by that sentence ? can you clarify...
>>>>
>>> Yes. You said "files not cleaned up when shutdown the embedded EJB container", but the listed files are the transaction logs, so do not depend on the EJB
>>> container.
>>>
>>>
>>>> all I was suggesting is that these files should be cleaned when the user requested that instance root be deleted upon termination.
>>>>
>>> Right. But you are deleting everything else, so why are they still there? Do you use deleteOnExit() or explicitly delete a predefined list?
>>>
>> no we don't use deleteOnExit() because the embedded container can be shutdown and yet the hosting process can carry on other tasks not shutting down itself. the reason why those files stay around is probably because they are not closed (open file handle). When the embedded container is shutdown, necessary events are sent, the file handles should be released by the transaction manager.
>>
>
> Do you have already events that TM can rely on, or do you plan to add them?
>
> thanks,
> -marina
>
>>> thanks,
>>> -marina
>>>
>>>> thanks, jerome
>>>>
>>>>
>>>>> -marina
>>>>>
>>>>>
>>>>>> thx
>>>>>>
>>>>>>> gfembed662505334826609491tmp/logs/server/tx/control
>>>>>>> gfembed662505334826609491tmp/logs/server/tx/extent.001
>>>>>>> [Message sent by forum member 'dwsmith75' (dsmith@nesmi.com)]
>>>>>>>
>>>>>>> http://forums.java.net/jive/thread.jspa?messageID=379107
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>>>>>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>>>>>>
>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>>>>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>>>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

andersaab
Offline
Joined: 2009-12-22

Hi guys
Was a RFE filed for this issue? If so I would like to follow (and contribute to if possible) the issue.

I managed to override the path by modifying the domain.xml that we use with embedded glassfish, it seemed to work but generated some exceptions in the log so it was not ideal. Any other workarounds?

-Anders

andersaab
Offline
Joined: 2009-12-22

Found a better workaround that just sets the path to the transaction log files. I put the log files in the target folder so that they don't come up in the subversion views.

I changed this line in domain.xml:

to:

Still dirty, but works.

Marina Vatkina

This property applies only when you use GlassFish embedded API directly,
not with the EJBContainer.

regards,
-marina

glassfish@javadesktop.org wrote:
> According to the documentation
>
> http://docs.sun.com/app/docs/doc/821-1208/gjldt?a=view
>
> "If the [b]installation root[/b] directory is not specified, embedded Sun GlassFish Enterprise Server creates a directory named gfembedrandom-numbertmp in the current working directory, where random-number is a randomly generated 19-digit number. Embedded Sun GlassFish Enterprise Server then copies configuration files into this directory."
>
> in org.glassfish.api.embedded.Server:
> if (builder.fileSystem==null || builder.fileSystem.[b]instanceRoot[/b]==null) {
> File f;
> try {
> String tmpDir = System.getProperty("glassfish.embedded.tmpdir");
> if (tmpDir==null) {
> tmpDir = System.getProperty("user.dir");
> }
> f = File.createTempFile("gfembed", "tmp", new File(tmpDir));
> } catch (IOException e) {
> throw new RuntimeException(e);
> }
>
> Even if I set the instanceRoot property EJBContainerProviderImpl never passes this to the Server class, is there anyway to get around this?
> [Message sent by forum member 'dwsmith75' (dsmith@nesmi.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=379097
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

dwsmith75
Offline
Joined: 2006-02-07

Should I file a RFE?

Quite annoying to have a gfembedrandom-numbertmp directory in the root of my project for every time I have run unit tests.

The code deletes the directory, but the directory remains with the following files:

gfembed662505334826609491tmp/logs/server/tx/control
gfembed662505334826609491tmp/logs/server/tx/extent.001

Jerome Dochez

On Jan 6, 2010, at 12:55 PM, glassfish@javadesktop.org wrote:

> Should I file a RFE?
yes
>
> Quite annoying to have a gfembedrandom-numbertmp directory in the root of my project for every time I have run unit tests.
>
> The code deletes the directory, but the directory remains with the following files:
>
and file a bug for these files not cleaned up when shutdown the embedded EJB container.

thx

> gfembed662505334826609491tmp/logs/server/tx/control
> gfembed662505334826609491tmp/logs/server/tx/extent.001
> [Message sent by forum member 'dwsmith75' (dsmith@nesmi.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=379107
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Marina Vatkina

Jerome Dochez wrote:
> On Jan 6, 2010, at 12:55 PM, glassfish@javadesktop.org wrote:
>
>
>>Should I file a RFE?
>
> yes
>
>>Quite annoying to have a gfembedrandom-numbertmp directory in the root of my project for every time I have run unit tests.
>>
>>The code deletes the directory, but the directory remains with the following files:
>>
>
> and file a bug for these files not cleaned up when shutdown the embedded EJB container.

These are tx log files - they should not depend on the whether the embedded GF
is started by the EJBContainer or directly.

-marina

>
> thx
>
>
>>gfembed662505334826609491tmp/logs/server/tx/control
>>gfembed662505334826609491tmp/logs/server/tx/extent.001
>>[Message sent by forum member 'dwsmith75' (dsmith@nesmi.com)]
>>
>>http://forums.java.net/jive/thread.jspa?messageID=379107
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>For additional commands, e-mail: users-help@glassfish.dev.java.net
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

dwsmith75
Offline
Joined: 2006-02-07

So, do I need to file a bug report, about the directory not getting deleted?

in: org/glassfish/api/embedded/Server.java

fsBuilder.autoDelete(true); when if (builder.fileSystem==null || builder.fileSystem.instanceRoot==null)

in: org/glassfish/api/embedded/EmbeddedFileSystem.java

public void preDestroy() {
Logger.getAnonymousLogger().fine("delete " + instanceRoot + " = " + autoDelete);
if (autoDelete) {
// recursively delete instanceRoot directory
Logger.getAnonymousLogger().fine("Deleting recursively" + instanceRoot);
deleteAll(instanceRoot);
}

}

Marina Vatkina

glassfish@javadesktop.org wrote:
> So, do I need to file a bug report, about the directory not getting deleted?
>

Yes. Please.

thanks,
-marina
> in: org/glassfish/api/embedded/Server.java
>
> fsBuilder.autoDelete(true); when if (builder.fileSystem==null || builder.fileSystem.instanceRoot==null)
>
> in: org/glassfish/api/embedded/EmbeddedFileSystem.java
>
> public void preDestroy() {
> Logger.getAnonymousLogger().fine("delete " + instanceRoot + " = " + autoDelete);
> if (autoDelete) {
> // recursively delete instanceRoot directory
> Logger.getAnonymousLogger().fine("Deleting recursively" + instanceRoot);
> deleteAll(instanceRoot);
> }
>
> }
> [Message sent by forum member 'dwsmith75' (dsmith@nesmi.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=379336
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net