connect to existing neo4j database in java - java

I newly start to work with neo4j.when I want to connect to existing db on windows everything work fine, my app find db and run my business, but in Linux I catch Error starting org.neo4j.kernel.impl.factory.CommunityFacadeFactory, /opt/neo4j-community-3.0.0-M04/data/databases/graph.db exception.
I use version 2.3.3
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>2.3.3</version>
</dependency>
my code:
GraphDatabaseService graphDb = null;
try {
// graphDb = new GraphDatabaseFactory().newEmbeddedDatabase("/opt/neo4j-community-3.0.0-M04/data/databases/graph.db");
graphDb = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(new File("/opt/neo4j-community-3.0.0-M04/data/databases/graph.db")).
setConfig("org.neo4j.server.database.location", "/opt/neo4j-community-3.0.0-M04/data/databases/graph.db").
setConfig("allow_store_upgrade","true").
// loadPropertiesFromFile("/opt/neo4j-community-3.0.0-M04/conf/neo4j.conf").
newGraphDatabase();
} catch (Exception e) {
System.out.println("e = " + e.getMessage());
e.printStackTrace();
}
registerShutdownHook(graphDb);
how can I connect to existing db in linux.
thank you.
adding stacktrace
e = Error starting org.neo4j.kernel.impl.factory.CommunityFacadeFactory, /opt/neo4j-community-3.0.0-M04/data/databases/graph.db
java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.CommunityFacadeFactory, /opt/neo4j-community-3.0.0-M04/data/databases/graph.db
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:143)
at org.neo4j.kernel.impl.factory.CommunityFacadeFactory.newFacade(CommunityFacadeFactory.java:43)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:108)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:129)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:117)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:185)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:79)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:74)
at ir.isc.mot.BigDataWorkGroup.main(BigDataWorkGroup.java:28)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.NeoStoreDataSource#32b7faea' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:462)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
at org.neo4j.kernel.impl.transaction.state.DataSourceManager.start(DataSourceManager.java:112)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:139)
... 8 more
Caused by: org.neo4j.kernel.impl.storemigration.UpgradeNotAllowedByConfigurationException: Failed to start Neo4j with an older data store version. To enable automatic upgrade, please set configuration parameter "allow_store_upgrade=true"
at org.neo4j.kernel.impl.storemigration.ConfigMapUpgradeConfiguration.checkConfigurationAllowsAutomaticUpgrade(ConfigMapUpgradeConfiguration.java:39)
at org.neo4j.kernel.impl.storemigration.StoreUpgrader.migrateIfNeeded(StoreUpgrader.java:135)
at org.neo4j.kernel.NeoStoreDataSource.upgradeStore(NeoStoreDataSource.java:636)
at org.neo4j.kernel.NeoStoreDataSource.start(NeoStoreDataSource.java:527)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)
... 13 more

Related

SVNKit using ssh throws IOException

I installed a new subversion repository but I am unable to connect to the repository.
In the old repository it is working as expected. The new repository thorws an exception:
org.eclipse.team.svn.core.connector.SVNConnectorException: svn: E210002: There was a problem while connecting to xn--x7h.example.com:22
at org.polarion.team.svn.connector.svnkit.SVNKitService.handleClientException(SVNKitService.java:59)
at org.polarion.team.svn.connector.svnkit.SVNKitConnector.listEntries(SVNKitConnector.java:1758)
at org.eclipse.team.svn.core.extension.factory.ThreadNameModifier.listEntries(ThreadNameModifier.java:324)
at org.eclipse.team.svn.core.utility.SVNUtility.list(SVNUtility.java:440)
at org.eclipse.team.svn.core.svnstorage.SVNRepositoryContainer.getChildren(SVNRepositoryContainer.java:79)
at org.eclipse.team.svn.core.operation.remote.GetRemoteFolderChildrenOperation.runImpl(GetRemoteFolderChildrenOperation.java:76)
at org.eclipse.team.svn.core.operation.AbstractActionOperation.run(AbstractActionOperation.java:82)
at org.eclipse.team.svn.core.utility.ProgressMonitorUtility.doTask(ProgressMonitorUtility.java:104)
at org.eclipse.team.svn.core.operation.CompositeOperation.runImpl(CompositeOperation.java:99)
at org.eclipse.team.svn.core.operation.AbstractActionOperation.run(AbstractActionOperation.java:82)
at org.eclipse.team.svn.core.operation.LoggedOperation.run(LoggedOperation.java:40)
at org.eclipse.team.svn.core.utility.ProgressMonitorUtility.doTask(ProgressMonitorUtility.java:104)
at org.eclipse.team.svn.core.utility.ProgressMonitorUtility.doTaskExternal(ProgressMonitorUtility.java:90)
at org.eclipse.team.svn.ui.utility.DefaultCancellableOperationWrapper.run(DefaultCancellableOperationWrapper.java:55)
at org.eclipse.team.svn.ui.utility.ScheduledOperationWrapper.run(ScheduledOperationWrapper.java:37)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: org.apache.subversion.javahl.ClientException: svn: E210002: There was a problem while connecting to xn--x7h.example.com:22
at org.apache.subversion.javahl.ClientException.fromException(ClientException.java:117)
at org.tmatesoft.svn.core.javahl17.SVNClientImpl.getClientException(SVNClientImpl.java:1539)
at org.tmatesoft.svn.core.javahl17.SVNClientImpl.list(SVNClientImpl.java:189)
at org.polarion.team.svn.connector.svnkit.SVNKitConnector.listEntries(SVNKitConnector.java:1745)
... 14 more
Caused by: org.tmatesoft.svn.core.SVNException: svn: E210002: There was a problem while connecting to xn--x7h.example.com:22
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:70)
at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:57)
at org.tmatesoft.svn.core.internal.io.svn.SVNSSHConnector.open(SVNSSHConnector.java:145)
at org.tmatesoft.svn.core.internal.io.svn.SVNConnection.open(SVNConnection.java:77)
at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVNRepositoryImpl.java:1273)
at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.getLatestRevision(SVNRepositoryImpl.java:172)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.getRevisionNumber(SvnNgRepositoryAccess.java:119)
at org.tmatesoft.svn.core.internal.wc2.SvnRepositoryAccess.getLocations(SvnRepositoryAccess.java:195)
at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgRepositoryAccess.createRepositoryFor(SvnNgRepositoryAccess.java:46)
at org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteList.run(SvnRemoteList.java:36)
at org.tmatesoft.svn.core.internal.wc2.remote.SvnRemoteList.run(SvnRemoteList.java:1)
at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:21)
at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1235)
at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
at org.tmatesoft.svn.core.javahl17.SVNClientImpl.list(SVNClientImpl.java:187)
... 15 more
Caused by: java.io.IOException: There was a problem while connecting to xn--x7h.example.com:22
at com.trilead.ssh2.Connection.connect(Connection.java:817)
at org.tmatesoft.svn.core.internal.io.svn.ssh.SshHost.openConnection(SshHost.java:225)
at org.tmatesoft.svn.core.internal.io.svn.ssh.SshHost.openSession(SshHost.java:153)
at org.tmatesoft.svn.core.internal.io.svn.ssh.SshSessionPool.openSession(SshSessionPool.java:85)
at org.tmatesoft.svn.core.internal.io.svn.SVNSSHConnector.open(SVNSSHConnector.java:122)
... 27 more
Caused by: java.io.IOException: Key exchange was not finished, connection is closed.
at com.trilead.ssh2.transport.KexManager.getOrWaitForConnectionInfo(KexManager.java:92)
at com.trilead.ssh2.transport.TransportManager.getConnectionInfo(TransportManager.java:231)
at com.trilead.ssh2.Connection.connect(Connection.java:769)
... 31 more
Caused by: java.io.IOException: Cannot negotiate, proposals do not match.
at com.trilead.ssh2.transport.KexManager.handleMessage(KexManager.java:413)
at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:765)
at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:480)
at java.base/java.lang.Thread.run(Thread.java:834)
Any ideas?
I checked on server-side what is going on. So I called tail -f /var/log/auth.log and discovered a message that the client and the server was not able to agree on matching kex-algorithms.
Finally my solution was to enable the line
KexAlgorithms +diffie-hellman-group1-sha1
to the corresponding
/etc/ssh/sshd_config
File and restart the sshd-server.

Exception in thread "reader" java.lang.NoClassDefFoundError: org/bouncycastle/crypto/ec/CustomNamedCurves

I've used 'net.schmizz.sshj.SSHClient' package to connect to a server.
Below is my code:
public class ConnectToServer {
String hostName = "10.250.176.6";
int port = 22;
public ConnectToServer(String hostName, int port) {
this.hostName = hostName;
this.port = port;
}
public void ssh() {
SSHClient ssh = new SSHClient();
String cmd = "ipconfig";
try {
ssh.connect(this.hostName, this.port);
ssh.isConnected();
final Process process = Runtime.getRuntime().exec(cmd);
ssh.disconnect();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
However, I faced to an error: "Exception in thread "reader" java.lang.NoClassDefFoundError: org/bouncycastle/crypto/ec/CustomNamedCurves".
I added bcprov-jdk15on-1.49 and bouncycastle.jar into my classpath.
Please help me to resolve this error.
Complete exception:
08:46:05.526 [main] DEBUG net.schmizz.concurrent.Promise - Awaiting <<kex done>>
08:46:05.528 [reader] DEBUG n.s.sshj.transport.KeyExchanger - Received SSH_MSG_KEXINIT
08:46:05.528 [reader] DEBUG n.s.sshj.transport.KeyExchanger - Negotiated algorithms: [ kex=curve25519-sha256#libssh.org; sig=ecdsa-sha2-nistp256; c2sCipher=aes128-ctr; s2cCipher=aes128-ctr; c2sMAC=hmac-sha1; s2cMAC=hmac-sha1; c2sComp=none; s2cComp=none ]
**Exception in thread "reader" java.lang.NoClassDefFoundError: org/bouncycastle/crypto/ec/CustomNamedCurves**
at net.schmizz.sshj.transport.kex.Curve25519DH.getCurve25519Params(Curve25519DH.java:60)
at net.schmizz.sshj.transport.kex.Curve25519SHA256.initDH(Curve25519SHA256.java:44)
at net.schmizz.sshj.transport.kex.AbstractDHG.init(AbstractDHG.java:46)
at net.schmizz.sshj.transport.KeyExchanger.gotKexInit(KeyExchanger.java:236)
at net.schmizz.sshj.transport.KeyExchanger.handle(KeyExchanger.java:356)
at net.schmizz.sshj.transport.TransportImpl.handle(TransportImpl.java:503)
at net.schmizz.sshj.transport.Decoder.decode(Decoder.java:102)
at net.schmizz.sshj.transport.Decoder.received(Decoder.java:170) at net.schmizz.sshj.transport.Reader.run(Reader.java:59)
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.crypto.ec.CustomNamedCurves
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Your jar is probably missing its dependencies (or some of it.) If its a maven project i suggest you rather switch to Maven.
A nice tutorial can be found here: Maven in 5 Minutes
I think, the SSH Client is missing org.Bouncycastle.crypto as libary (dependency). Quick way to fix this is to get the jar for it too.
This issue might be occurred due to use of different versions of bouncycastle jars in the project.
the solution is ,
to find the different versions of bouncycastle jars getting used directly or indirectly in the project.
try to use one version of bouncycastle jars in whole project.
make changes according to version which you have chosen to use across project as code written with one version of bouncycastle jar may not work for other version of bouncycastle.
Clean your project or rebuild it again.
If the problem is not solved, please post complete exception so that we will get more clarity.

Unable to create a connection pool in Java + MySQL + Vibur-dbcp

I am trying to create a conection pool whit vibur-dbcp for an app for desktop in JavaFX , i got a MySQL database in AWS and works great when i connect from Workbench butt when i connect from the app the response time increments, i check my code and the reason is because the app creates to many connections creating to much overheat (firts the app have a embedded SQLite databese and the conections weren't a problem) i remake the estructure of my code butt i still need to make alot of conections.
looking for a solution i find that conection pool is the way, i find a good number of solutions Apache commons, C3P0, HikariCP and Vibur DBCP i try to use all but at the moment i can't make one to work, i look for a tutorial but i only can find old implementations (Java 6 or older) for servlets and only snippets and all are very confusing for me (im a begginer in DB), my favorite option is HikariCP but i can make the pool to work, my next option is Vibur at the moment i have this code for the conection.
private Connection connection;
//creates the pool
public DataSource createDataSourceWithStatementsCache() {
ViburDBCPDataSource ds = new ViburDBCPDataSource();
ds.setJdbcUrl("dbURL");
ds.setUsername("dbUser");
ds.setPassword("dbPass");
ds.setPoolInitialSize(10);
ds.setPoolMaxSize(100);
ds.setConnectionIdleLimitInSeconds(30);
ds.setTestConnectionQuery("isValid");
ds.setLogQueryExecutionLongerThanMs(500);
ds.setLogStackTraceForLongQueryExecution(true);
ds.setStatementCacheMaxSize(200);
ds.start();
return ds;
}
//Getts the conection
public Connection conectarBD(){
try {
connection = createDataSourceWithStatementsCache().getConnection();
} catch (SQLException ex) {
Logger.getLogger(coneccionBD.class.getName()).log(Level.SEVERE, null, ex);
}
return connection;
}
public void desconectarBD(){
try {
connection.close();
} catch (SQLException ex) {
Logger.getLogger(coneccionBD.class.getName()).log(Level.SEVERE, null, ex);
}
}
i get this error
Exception in thread "JavaFX Application Thread" java.lang.NoClassDefFoundError: org/vibur/objectpool/listener/Listener
at HE.MVC.Modelo.Laboratoriales.Conexion.createDataSourceWithStatementsCache(Conexion.java:36)
at HE.MVC.Modelo.Laboratoriales.Conexion.conectarBD(Conexion.java:63)
at HE.MVC.Modelo.MedicamentosAbituales.cargaTabla(MedicamentosAbituales.java:186)
at HE.MVC.Vistas.Paciente.NuevopacienteController.iniciaTablas(NuevopacienteController.java:351)
at HE.MVC.Vistas.Paciente.NuevopacienteController.initialize(NuevopacienteController.java:1156)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409)
at HE.HEstadistica.LanzaNuevoPaciente(HEstadistica.java:304)
at HE.MVC.Vistas.Paciente.EscenaPacientesController$7$1.run(EscenaPacientesController.java:347)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.vibur.objectpool.listener.Listener
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 17 more
what im asking is two things
1.- what i making wrong in this code?.
2.- is there a book, manual, page o videos for learning conecction pool (HikariCP explanation for begginers it would be wonderful) where i can learn how to make this work?
#CorrOrtiz, regarding your first question, what #hotzst suggests in his comment below your question is correct. For Vibur DBCP there are two jar files that you need as dependencies for your application: vibur-dbcp-9.0.jar and vibur-object-pool-9.0.jar. The exception that you're getting means that you're most likely missing the second dependency, although if you've added the vibur-dbcp dependency via Maven then you should have transitively got the second dependency, too.

My java programme is getting failed to update Neo4j DB

my local neo4j db path is C:\neo4j-community-1.9.3_bup
I have created a simple java program to connect to neo4j DB and insert some nodes.
But after insertion when
i am trying to retrive these nodes through Neo4jDataBrower these are not listing.
The code i have used is taken from neo4j portal itself,
String DB_PATH = "C\\neo4j-community-1.9.3_bup";
Map<String, String> config = new HashMap<String, String>();
config.put( "neostore.nodestore.db.mapped_memory", "10M" );
config.put( "string_block_size", "60" );
config.put( "array_block_size", "300" );
graphDb = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(DB_PATH).setConfig(config).newGraphDatabase();
registerShutdownHook( graphDb );
Transaction tx = graphDb.beginTx();
try
{
firstNode = graphDb.createNode();
firstNode.setProperty( "message", "Hello, " );
secondNode = graphDb.createNode();
secondNode.setProperty( "message", "World!" );
relationship = firstNode.createRelationshipTo( secondNode, RelTypes.KNOWS );
relationship.setProperty( "message", "brave Neo4j " );
tx.success();
}
finally
{
tx.finish();
}
Why its not working?
please suggest me..is there some problem vth path i have given or problem vth code?
Hi Werner,
The runtime exception is
Exception in thread "main" java.lang.RuntimeException:
org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.StoreLockerLifecycleAdapter#406199' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:280)
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:106)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:88)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:207)
at com.Neo4J.src.EmbeddedNeo4j.createDb(EmbeddedNeo4j.java:54)
at com.Neo4J.src.EmbeddedNeo4j.main(EmbeddedNeo4j.java:38)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.StoreLockerLifecycleAdapter#406199' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:497)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:104)
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:258)
... 5 more
Caused by: org.neo4j.kernel.StoreLockException: Could not create lock file
at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:74)
at org.neo4j.kernel.StoreLockerLifecycleAdapter.start(StoreLockerLifecycleAdapter.java:40)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:491)
... 7 more
New Log,
Exception in thread "main" java.lang.RuntimeException:
org.neo4j.kernel.lifecycle.LifecycleException:
Component 'org.neo4j.kernel.impl.transaction.TxManager#1827284' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:280)
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:106)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:88)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:207)
at com.Neo4J.src.EmbeddedNeo4j.createDb(EmbeddedNeo4j.java:57)
at com.Neo4J.src.EmbeddedNeo4j.main(EmbeddedNeo4j.java:41)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component
'org.neo4j.kernel.impl.transaction.TxManager#1827284' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:497)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:104)
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:258)
... 5 more
Caused by: org.neo4j.graphdb.TransactionFailureException:
Unable to start TM, no active tx log file found but found either tm_tx_log.1 or tm_tx_log.2 file, please set one of them as active or remove them.
at org.neo4j.kernel.impl.transaction.TxManager.openLog(TxManager.java:750)
at org.neo4j.kernel.impl.transaction.TxManager.start(TxManager.java:138)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:491)
... 7 more
New exception,
Sep 27, 2013 11:09:27 AM org.neo4j.server.logging.Logger log
INFO: Starting Neo Server on port [7474] with [40] threads available
2013-09-27 11:09:27.665:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
Sep 27, 2013 11:09:27 AM org.neo4j.server.logging.Logger log
INFO: Using database at C:\neo4j-community-1.9.3_bup\data\graph.db
Exception in thread "main" java.lang.NoSuchFieldError: remote_shell_enabled
at org.neo4j.server.database.Database.createDatabase(Database.java:77)
at org.neo4j.server.database.Database.<init>(Database.java:55)
at org.neo4j.server.NeoServerWithEmbeddedWebServer.startDatabase(NeoServerWithEmbeddedWebServer.java:179)
at org.neo4j.server.NeoServerWithEmbeddedWebServer.start(NeoServerWithEmbeddedWebServer.java:93)
at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:87)
at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:76)
at com.Neo4J.src.EmbeddedNeo4j.createDb(EmbeddedNeo4j.java:69)
at com.Neo4J.src.EmbeddedNeo4j.main(EmbeddedNeo4j.java:41)
C\\neo4j-community-1.9.3_bup is not a valid path. It should be C:\\neo4j-community-1.9.3_bup.
But still, it may not be valid, if you are pointing to your Neo4J installation directory, and not the database directory itself. If that is the case, the path should be C:\\neo4j-community-1.9.3_bup\data\graph.db
Edited:
To prevent the locking situation, stop your running Neo4J instance, and start your own database with its own web console, by inserting these lines after the line where you initialize your embedded database:
Configurator configurator = new ServerConfigurator((GraphDatabaseAPI)graphDb);
configurator.configuration().setProperty(Configurator.WEBSERVER_ADDRESS_PROPERTY_KEY, "127.0.0.1");
configurator.configuration().setProperty(Configurator.WEBSERVER_PORT_PROPERTY_KEY, 7474);
WrappingNeoServerBootstrapper bootstrapper = new WrappingNeoServerBootstrapper((GraphDatabaseAPI)graphDb, configurator);
bootstrapper.start();

oracle 11g r2 on CentOS linux 6 : Got minus one from a read call

I'm getting an error while attempting to get a connection to a local(same computer) database "oracle.net.ns.NetException: Got minus one from a read call".
here's the code
OracleDataSource ods = new OracleDataSource();
String jdbcURL = "jdbc:oracle:thin:username/userpass#mylinux:1522:sid";
ods.setURL(jdbcURL);
Connection conn = ods.getConnection();
Caused by: oracle.net.ns.NetException: Got minus one from a read call
at oracle.net.ns.Packet.receive(Packet.java:286)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:287)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1054)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:308)
... 8 more
What am I missing here ? My brief search on the net didn't turn up anything helpful. I'm linking ojdbc6.jar with the test app.
I can connect just fine from sqlplus using the above credentials.
UPDATE 1 : Am getting the following exception stack trace
Exception in thread "main" java.sql.SQLRecoverableException: IO Error: Got minus one from a read call
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:419)
at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:536)
at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:228)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:280)
at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:207)
at oracle.jdbc.pool.OracleDataSource.getConnection(OracleDataSource.java:157)
at TestOraConn.main(TestOraConn.java:17)
Caused by: oracle.net.ns.NetException: Got minus one from a read call
at oracle.net.ns.Packet.receive(Packet.java:286)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:287)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1054)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:308)
... 8 more
UPDATE 2:
lsnrctl status
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 28-MAY-2013 22:34:16
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused

Categories