neo4j/community — Issue #147: Neo4j command doesnt handle invalid commands
Author: abdulazeez1984
Created: 2011-12-23 12:21:51+00:00
State: open

Dear all,

Neo4j.bat command is raising exceptions whenever there is some invalid command.
for ex:
"Neo4j.bat status" or "Neo4j.bat blahblah" commands(which are invalid) raises below exceptions. Kindly handle the invalid commands so that user can understand that he has given wrong commands. Below exceptions gives userimpression that there is some problem with the installation and might waste his time in digging the problem. I hope you will consider this issue. Thanks in advance.

D:\Softwares\Neo4j_Home\neo4j-community-1.6.M02\bin>Neo4j.bat blah
12/23/11 5:32:04 PM org.neo4j.server.NeoServerWithEmbeddedWebServer INFO: Starti
ng Neo Server on port [7474] with [20] threads available
12/23/11 5:32:04 PM org.neo4j.server.database.Database INFO: Using database at D
:\Softwares\Neo4j_Home\neo4j-community-1.6.M02\data\graph.db
org.neo4j.graphdb.TransactionFailureException: Could not create data source [nio
neodb], see nested exception for cause of error
at org.neo4j.kernel.impl.transaction.TxModule.registerDataSource(TxModul
e.java:161)
at org.neo4j.kernel.GraphDbInstance.start(GraphDbInstance.java:104)
at org.neo4j.kernel.EmbeddedGraphDbImpl.(EmbeddedGraphDbImpl.java:
190)
at org.neo4j.kernel.EmbeddedGraphDatabase.(EmbeddedGraphDatabase.j
ava:78)
at org.neo4j.server.NeoServerBootstrapper$1.createDatabase(NeoServerBoot
strapper.java:65)
at org.neo4j.server.database.Database.createDatabase(Database.java:81)
at org.neo4j.server.database.Database.(Database.java:64)
at org.neo4j.server.NeoServerWithEmbeddedWebServer.startDatabase(NeoServ
erWithEmbeddedWebServer.java:176)
at org.neo4j.server.NeoServerWithEmbeddedWebServer.start(NeoServerWithEm
beddedWebServer.java:86)
at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:87)
at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:52)
Caused by: java.lang.IllegalStateException: Unable to lock store [D:\Softwares\N
eo4j_Home\neo4j-community-1.6.M02\data\graph.db\neostore], this is usually a res
ult of some other Neo4j kernel running using the same store.
at org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore.checkStorage(C
ommonAbstractStore.java:174)
at org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore.(CommonA
bstractStore.java:102)
at org.neo4j.kernel.impl.nioneo.store.AbstractStore.(AbstractStore
.java:119)
at org.neo4j.kernel.impl.nioneo.store.NeoStore.(NeoStore.java:78)
at org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource.(NeoStoreX
aDataSource.java:164)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.neo4j.kernel.impl.transaction.XaDataSourceManager.create(XaDataSo
urceManager.java:77)
at org.neo4j.kernel.impl.transaction.TxModule.registerDataSource(TxModul
e.java:155)
... 10 more
org.neo4j.graphdb.TransactionFailureException: Could not create data source [nio
neodb], see nested exception for cause of error
at org.neo4j.kernel.impl.transaction.TxModule.registerDataSource(TxModul
e.java:161)
at org.neo4j.kernel.GraphDbInstance.start(GraphDbInstance.java:104)
at org.neo4j.kernel.EmbeddedGraphDbImpl.(EmbeddedGraphDbImpl.java:
190)
at org.neo4j.kernel.EmbeddedGraphDatabase.(EmbeddedGraphDatabase.j
ava:78)
at org.neo4j.server.NeoServerBootstrapper$1.createDatabase(NeoServerBoot
strapper.java:65)
at org.neo4j.server.database.Database.createDatabase(Database.java:81)
at org.neo4j.server.database.Database.(Database.java:64)
at org.neo4j.server.NeoServerWithEmbeddedWebServer.startDatabase(NeoServ
erWithEmbeddedWebServer.java:176)
at org.neo4j.server.NeoServerWithEmbeddedWebServer.start(NeoServerWithEm
beddedWebServer.java:86)
at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:87)
at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:52)
Caused by: java.lang.IllegalStateException: Unable to lock store [D:\Softwares\N
eo4j_Home\neo4j-community-1.6.M02\data\graph.db\neostore], this is usually a res
ult of some other Neo4j kernel running using the same store.
at org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore.checkStorage(C
ommonAbstractStore.java:174)
at org.neo4j.kernel.impl.nioneo.store.CommonAbstractStore.(CommonA
bstractStore.java:102)
at org.neo4j.kernel.impl.nioneo.store.AbstractStore.(AbstractStore
.java:119)
at org.neo4j.kernel.impl.nioneo.store.NeoStore.(NeoStore.java:78)
at org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource.(NeoStoreX
aDataSource.java:164)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.neo4j.kernel.impl.transaction.XaDataSourceManager.create(XaDataSo
urceManager.java:77)
at org.neo4j.kernel.impl.transaction.TxModule.registerDataSource(TxModul
e.java:155)
... 10 more
Exception in thread "main" java.lang.NullPointerException
at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:96)
at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:52)

Regards,
Abdul