Problem with log file in an embedded db with netbeans platform application



I'm starting a new desktop application built with netbeans platform 7 and objectdb/JPA as embedded db (version 2.3).

I haven't had any problem with the domain class library project, but running the netbeans platform application that use the same domain class library an error occurs that crash the application.

This is part of the stack trace: file:\C:\Users\Ce\Desktop\ProteoB\ProteoApp\build\cluster\modules\ext\log\odb20110921.log (The filename, directory name, or volume label syntax is incorrect)
    at Method)
    at com.objectdb.o.LFL.K(
Caused: com.objectdb.o.UserException: Failed to create a new file 'file:\C:\Users\Ce\Desktop\ProteoB\ProteoApp\build\cluster\modules\ext\log\odb20110921.log'
    at com.objectdb.o.MSG.d(
    at com.objectdb.o.LFL.K(
    at com.objectdb.o.LFL.H(
    at com.objectdb.o.LFL.H(
    at com.objectdb.o.LGM.<init>(
    at com.objectdb.o.CFG.t(
    at com.objectdb.o.CFG.r(
    at com.objectdb.o.CFG.q(
    at com.objectdb.o.RCL.<clinit>(
Caused: java.lang.ExceptionInInitializerError
    at com.objectdb.o.UNM$z.<init>(
    at com.objectdb.o.UNM.x(
    at com.objectdb.o.UNM.w(
    at com.objectdb.jpa.Provider.createEntityManagerFactory(
    at com.objectdb.jpa.Provider.createEntityManagerFactory(
    at javax.persistence.Persistence.createEntityManagerFactory(
    at javax.persistence.Persistence.createEntityManagerFactory(
    at proteo.explorer.ProteoExplorerTopComponent.componentOpened(

Follows my persistence.xml file:

<persistence-unit name="proteoLibraryPU" transaction-type="RESOURCE_LOCAL">
        <description>ObjectDB Persistence Unit</description>
            <property name="javax.persistence.jdbc.url" value="proteo.odb"/>
            <property name="javax.persistence.jdbc.password" value="admin"/>
            <property name="javax.persistence.jdbc.user" value="admin"/>

It seems that the objectdb logging, that occurs only when I run objectdb with the netbeans platform application, has a wrong file name (this starts with "file:" and ":" is not allowed in ntfs filesystem).

I can't understand if the problem is with objectdb or with the netbeans platform but a workaround could be to disable the objectdb logging.

Can anyone help me with any suggestion or to find a solution?

Thanks in advance


A possible workaround would be to set either the ObjectDB home directory (which is a system property) or the log and log-archive directories (in objectdb.conf) explicitly.

ObjectDB Support

Thanks for the answer, I managed the problem adding the following line of code before the instantiation of the EntityManagerFactory in a service layer.

System.setProperty("objectdb.home", ".");



Thank you for the update.

FYI, build 2.3.0_02 fixes this problem, and now ObjectDB Home path ($objectdb) is expected to be set correctly automatically also in NetBeans RCP applications.

Still defining it explicitly as you did may be preferred.

ObjectDB Support

Ok, just to confirm that ObjectDB build 2.3.0_02 works in Netbeans RCP without any workaround.