Home » Support » Forum » Problem with log file in an embedded db with netbeans platform application

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

#1

Hello,

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:

java.io.FileNotFoundException: 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 java.io.RandomAccessFile.open(Native Method)
    at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212)
    at com.objectdb.o.LFL.K(LFL.java:813)
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(MSG.java:74)
    at com.objectdb.o.LFL.K(LFL.java:826)
    at com.objectdb.o.LFL.H(LFL.java:766)
    at com.objectdb.o.LFL.H(LFL.java:735)
    at com.objectdb.o.LGM.<init>(LGM.java:120)
    at com.objectdb.o.CFG.t(CFG.java:267)
    at com.objectdb.o.CFG.r(CFG.java:179)
    at com.objectdb.o.CFG.q(CFG.java:125)
    at com.objectdb.o.RCL.<clinit>(RCL.java:33)
Caused: java.lang.ExceptionInInitializerError
    at com.objectdb.o.UNM$z.<init>(UNM.java:165)
    at com.objectdb.o.UNM.x(UNM.java:105)
    at com.objectdb.o.UNM.w(UNM.java:75)
    at com.objectdb.jpa.Provider.createEntityManagerFactory(Provider.java:56)
    at com.objectdb.jpa.Provider.createEntityManagerFactory(Provider.java:32)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:78)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
    at proteo.explorer.ProteoExplorerTopComponent.componentOpened(ProteoExplorerTopComponent.java:282)

Follows my persistence.xml file:

<persistence-unit name="proteoLibraryPU" transaction-type="RESOURCE_LOCAL">
        <description>ObjectDB Persistence Unit</description>
        <provider>com.objectdb.jpa.Provider</provider>
        <class>...</class>
        <properties>
            <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"/>
        </properties>
    </persistence-unit>

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

#2

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
ObjectDB - Fast Object Database for Java (JPA/JDO)
#3

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", ".");

 

#4

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
ObjectDB - Fast Object Database for Java (JPA/JDO)
#5

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

Thanks


Post Reply

To post a reply and/or subscribe to update notifications - please login