ObjectDB ObjectDB

Undeployment of an remote Glassfish application locks objectdb log file

#1

System:
Netbeans 7.1
Oracle Glassfish 3.1.2
ObjectDB 2.3.7_04

Senario:
Create a simple WebApplication with a "hello world" web service interface in Netbeans.
Add objectDB test code to the web service:


@WebService(serviceName = "NewWebService")
public class NewWebService {
    @PersistenceContext(unitName = "testdb")
    private EntityManager em;
   
    /** This is a sample web service operation */
    @WebMethod(operationName = "hello")
    public String hello(@WebParam(name = "name") String txt) {
        em.persist(new NewEntity()); // just store anything...
        return "Hello " + txt + " !";
    }
}

Create a new entity class (NewEntity) with default values.


Modify persistence.xml to contain:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

  <persistence-unit name="testdb" transaction-type="JTA">
    <provider>com.objectdb.jpa.Provider</provider>
    <properties>
      <property name="javax.persistence.jdbc.url" value="testdb.odb"/>
      <property name="javax.persistence.jdbc.user" value="admin"/>
      <property name="javax.persistence.jdbc.password" value="admin"/>
    </properties>
  </persistence-unit>

</persistence>

 

Compile and deploy the WebApplication to an remote Glassfish server. Don't forget to set an admin password on
the Glassfish server and enable "secure admin".

Now, log in remotely to the Glassfish server web managment interface http://ipaddress:4848/ and
undeploy your WebApplication.

Look into the "domain1\applications" folder on the Glassfish server and find that the WebApplication is still there.
If you try to manually delete the folder, you will get an "Folder in use" error message. Because
the "odbxxxxxx.log" file is in use by an java process. If I restart Glassfish, I can delete the folder.

The locked file problem does not exist if I deploy the WebApplication on an local Glassfish server.

How can I undeploy the application without getting the logfile locked ?

// Parwing

 

edit
delete
#2

Could you please check what happens if you configure ObjectDB to use a log file in an external directory (not in the web application under Glassfish)?

ObjectDB Support
edit
delete
#3

I tested to set the logpath to "c:/" and then it worked to undeploy the webapplication.
But now is the logfile at c:/ locked.

The problem from the begining was that because glassfish could't undeploy the webapp in a
correct way, which resulted in problems when deploying a new webapp. That problem is now gone.

Thanks!

// Parwing

edit
delete
#4

> But now is the logfile at c:/ locked.

It is probably still locked. Anyway, until this is solved the workaround of using a log file outside the web application directory should be used.

ObjectDB Support
edit
delete

Reply

To post on this website please sign in.