db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Damian Hofmann <damian.hofm...@gmx.ch>
Subject Re: XBM0J Directory already exists
Date Thu, 31 Dec 2009 11:00:42 GMT
Hi,

Today I found the problem. The Exception was a bit missleading, because 
it seemed to me, that derby tries to create the database at 
C:\db-derby-10.5.1.1-bin\bin\C:\myapp\db. At that location realy no such 
directory existed and I was wondering, why it tries to create the db at 
this location. Now it seems, that only path in the Exception message is 
wrong.

Derby realy tried to create the database at the *correct* location 
(C:\myapp\db). There an empty directory "db" already existed. I have not 
expcepted, that the empty directory could be a problem, but derby seems 
to insists on creating it's own directory and the creation of the 
database fails, if it can't do that.

Lesson learned: Make sure, derby can create it's database directory. Do 
not create your own database directory. Derby doesn't like that.
Possible improvement: Make the Exception message more clear. Why does 
derby tell me, that it tries to create the database at 
"C:\db-derby-10.5.1.1-bin\bin\C:\myapp\db" instead of the correct location?


Damian

Am 30.12.09 18:58, schrieb Damian Hofmann:
> Hi,
>
> On a Windows Vista machine I get an SQLException, when my application 
> is connecting to the derby network server. The Server runs on the same 
> machine, as my application (localhost on port 1527).
>
> The exception is:
> java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ041, 
> SQLERRMC: Failed to create database 'C:\myapp\db', see the next 
> exception for details.::SQLSTATE: XBM0JDirectory 
> C:\db-derby-10.5.1.1-bin\bin\C:\myapp\db already exists.
>
> The connection url looks like this:
> jdbc:derby://127.0.1.1:1527/C:\myapp\db;create=true
>
> It seems the Server is trying to create the database under 
> C:\db-derby-10.5.1.1-bin\bin\C:\myapp\db what isn't the place i 
> excepted the database to live. Derby is not only using the wrong 
> place, but the directory also doesn't exist, contrary to the 
> exceptions claim, that the directory is already there.
>
> If I start the network server from a different working directory, the 
> path before the second C:\ changes to the current working directory. 
> So I belive, that this is actualy a problem with my derby server 
> configuration, not with the my application.
>
> The problem doesent' occur if I run the application on my Windows XP 
> machine.
>
> Any ideas, what causes the derby server to search for the database at 
> the wrong place?
>
> Thanks Damian
>
>
>
> Here is the complete Stacktrace:
>
> java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ041, 
> SQLERRMC: Failed to create database 'C:\verteilcenter\db\licenses', 
> see the next exception for details.::SQLSTATE: XBM0JDirectory 
> C:\Development\Galileo\SR1\eclipse\C:\verteilcenter\db\licenses 
> already exists.
>       at 
> org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown 
> Source)
>       at 
> org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
>       at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
>       at java.sql.DriverManager.getConnection(DriverManager.java:582)
>       at java.sql.DriverManager.getConnection(DriverManager.java:154)
>       at 
> org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)

>
>       at 
> org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:111)
>       at 
> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119) 
>
>       at 
> org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2115)
>       at 
> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1339) 
>
>       at 
> ag.leonardo.judocu.verteilcenter.model.util.HibernateUtil.buildSessionFactory(HibernateUtil.java:37)

>
>       at 
> ag.leonardo.judocu.verteilcenter.model.util.HibernateUtil.<clinit>(HibernateUtil.java:29)

>
>       at 
> ag.leonardo.judocu.verteilcenter.model.ModelProvider.getSession(ModelProvider.java:104)

>
>       at 
> ag.leonardo.judocu.verteilcenter.model.ModelProvider.getBenutzerListe(ModelProvider.java:35)

>
>       at 
> ag.leonardo.judocu.verteilcenter.essentials.ui.editors.BenutzerEditor.createViewer(BenutzerEditor.java:156)

>
>       at 
> ag.leonardo.judocu.verteilcenter.essentials.ui.editors.BenutzerEditor.createControls(BenutzerEditor.java:103)

>
>       at 
> ag.leonardo.judocu.verteilcenter.essentials.ui.editors.BenutzerEditor.createPartControl(BenutzerEditor.java:73)

>
>       at 
> org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:658) 
>
>       at 
> org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:429) 
>
>       at 
> org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:594)

>
>       at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:312)
>       at 
> org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:185)

>
>       at 
> org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:265)

>
>       at 
> org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:64)

>
>       at 
> org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:478)

>
>       at 
> org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1267) 
>
>       at 
> org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1220)
>       at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1619)
>       at org.eclipse.ui.internal.PartStack.add(PartStack.java:508)
>       at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103)
>       at org.eclipse.ui.internal.PartStack.add(PartStack.java:494)
>       at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112)
>       at 
> org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:64) 
>
>       at 
> org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:217) 
>
>       at 
> org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:207) 
>
>       at 
> org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:782) 
>
>       at 
> org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:680)

>
>       at 
> org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:640)
>       at 
> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2716)

>
>       at 
> org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2630) 
>
>       at 
> org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2622)
>       at 
> org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2574)
>       at 
> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:66)
>       at 
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2569)
>       at 
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2553)
>       at 
> org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2536)
>       at 
> ag.leonardo.judocu.verteilcenter.essentials.ui.views.Navigation.selectionChanged(Navigation.java:120)

>
>       at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:163)
>       at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
>       at org.eclipse.core.runtime.Platform.run(Platform.java:888)
>       at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)
>       at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
>       at 
> org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:161)
>       at 
> org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:2060)

>
>       at 
> org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1136) 
>
>       at 
> org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1166)

>
>       at 
> org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:223) 
>
>       at 
> org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:217)
>       at 
> org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:394)
>       at 
> org.eclipse.swt.internal.widgets.UntypedEventAdapter.dispatchEvent(UntypedEventAdapter.java:594)

>
>       at 
> org.eclipse.swt.internal.widgets.UntypedEventAdapter.widgetSelected(UntypedEventAdapter.java:85)

>
>       at 
> org.eclipse.swt.events.SelectionEvent.dispatchToObserver(SelectionEvent.java:194) 
>
>       at 
> org.eclipse.rwt.internal.events.Event.processEvent(Event.java:44)
>       at 
> org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.java:129)
>       at 
> org.eclipse.swt.events.TypedEvent.executeNext(TypedEvent.java:169)
>       at 
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.readAndDispatch(RWTLifeCycle.java:240)

>
>       at 
> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:981)
>       at 
> org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2396)
>       at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2355)
>       at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:2206)
>       at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:424)
>       at 
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) 
>
>       at 
> org.eclipse.jface.internal.databinding.realmadapter.RealmAdapter.run(RealmAdapter.java:44)

>
>       at 
> org.eclipse.rap.ui.internal.RealmAdapterHook.runWithDefault(RealmAdapterHook.java:48)

>
>       at 
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:427) 
>
>       at 
> org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:157)
>       at 
> ag.leonardo.judocu.verteilcenter.essentials.application.EntryPoint.createUI(EntryPoint.java:13)

>
>       at 
> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createUI(EntryPointManager.java:92)

>
>       at 
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:227) 
>
>       at 
> org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:115)

>
>       at java.lang.Thread.run(Thread.java:619)
>       at 
> org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:80)
> Caused by: org.apache.derby.client.am.SqlException: DERBY SQL error: 
> SQLCODE: -1, SQLSTATE: XJ041, SQLERRMC: Failed to create database 
> 'C:\verteilcenter\db\licenses', see the next exception for 
> details.::SQLSTATE: XBM0JDirectory 
> C:\Development\Galileo\SR1\eclipse\C:\verteilcenter\db\licenses 
> already exists.
>       at org.apache.derby.client.am.Connection.completeSqlca(Unknown 
> Source)
>       at 
> org.apache.derby.client.net.NetConnectionReply.parseRdbAccessFailed(Unknown 
> Source)
>       at 
> org.apache.derby.client.net.NetConnectionReply.parseAccessRdbError(Unknown 
> Source)
>       at 
> org.apache.derby.client.net.NetConnectionReply.parseACCRDBreply(Unknown Source) 
>
>       at 
> org.apache.derby.client.net.NetConnectionReply.readAccessDatabase(Unknown 
> Source)
>       at 
> org.apache.derby.client.net.NetConnection.readSecurityCheckAndAccessRdb(Unknown 
> Source)
>       at 
> org.apache.derby.client.net.NetConnection.flowSecurityCheckAndAccessRdb(Unknown 
> Source)
>       at 
> org.apache.derby.client.net.NetConnection.flowUSRIDONLconnect(Unknown 
> Source)
>       at org.apache.derby.client.net.NetConnection.flowConnect(Unknown 
> Source)
>       at org.apache.derby.client.net.NetConnection.<init>(Unknown Source)
>       at org.apache.derby.client.net.NetConnection40.<init>(Unknown 
> Source)
>       at 
> org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(Unknown 
> Source)
>       ... 80 more
>

Mime
View raw message