317 words

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

#1
2011-09-21 16:04

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

paolutus
paolutus's picture
Joined on 2011-09-21
User Post #1
#2
2011-09-22 00:23

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)
support
support's picture
Joined on 2010-05-03
User Post #621
#3
2011-09-23 16:07

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

 

paolutus
paolutus's picture
Joined on 2011-09-21
User Post #2
#4
2011-09-25 04:11

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)
support
support's picture
Joined on 2010-05-03
User Post #629
#5
2011-09-29 08:24

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

Thanks

paolutus
paolutus's picture
Joined on 2011-09-21
User Post #3

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel