How to start derby server from within my java application - java

i have been working with EclipseLink of recent and after creating my java application, without me starting the derby server manually from netbeans (Services>Databases>JavaDB> Start Server) my application will not be able to connect to the database, i don't know what is wrong or how to go about this. i used this code from a new thread and this is what i get.
public static class DBServerStarter extends Thread {
NetworkServerControl serverControl;
public DBServerStarter(){
try {
serverControl = new NetworkServerControl();
} catch (Exception ex) {
Logger.getLogger(ContactManager.class.getName()).log(Level.SEVERE, null, ex);
}
}
#Override
public void run(){
try {
serverControl.start(new PrintWriter(System.out));
} catch (Exception ex) {
Logger.getLogger(ContactManager.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
and my log look like
Tue Mar 25 12:50:33 WAT 2014 : Apache Derby Network Server - 10.9.1.0 - (1344872) started and ready to accept connections on port 1527
[EL Info]: 2014-03-25 12:50:36.098--ServerSession(21798543)--EclipseLink, version: Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5
[EL Severe]: ejb: 2014-03-25 12:50:36.583--ServerSession(21798543)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLNonTransientConnectionException: The connection was refused because the database Contact was not found.
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.prodigy4440.contactmanager.ContactManager.main(ContactManager.java:28)
Error Code: 40000
Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLNonTransientConnectionException: The connection was refused because the database Contact was not found.
Error Code: 40000
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:766)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:204)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getDatabaseSession(EntityManagerFactoryDelegate.java:182)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getDatabaseSession(EntityManagerFactoryImpl.java:527)
at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactoryImpl(PersistenceProvider.java:140)
at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:177)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:79)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
at com.prodigy4440.contactmanager.MainJFrame.<clinit>(MainJFrame.java:38)
... 1 more
Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLNonTransientConnectionException: The connection was refused because the database Contact was not found.
Error Code: 40000
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:331)
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:326)
at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:138)
at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.setOrDetectDatasource(DatabaseSessionImpl.java:204)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:741)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:239)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:685)
... 9 more
Caused by: java.sql.SQLNonTransientConnectionException: The connection was refused because the database Contact was not found.
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:571)
at java.sql.DriverManager.getConnection(DriverManager.java:187)
at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:98)
... 14 more
Caused by: org.apache.derby.client.am.DisconnectException: The connection was refused because the database Contact was not found.
at org.apache.derby.client.net.NetConnectionReply.parseRDBNFNRM(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.flowUSRIDPWDconnect(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)
... 18 more
Java Result: 1
BUILD SUCCESSFUL (total time: 5 seconds)

The answer is in the log message:
java.sql.SQLNonTransientConnectionException: The connection was
refused because the database Contact was not found.
So you need to manually create Contact database or add create=true to javax.persistence.jdbc.url property in your persistence.xml:
<property name="javax.persistence.jdbc.url" value="jdbc:derby:/path/to/db/Contact;create=true" />
It allows derby to create database if it doesn't exist.

Related

Migrating data from sql server to postgres generated: java.net.SocketException: Software caused connection abort: recv failed

I'm trying to migrate my current SQL server (2017) to postgres (14.5) using migration toolkit (version 55).
I set up he configuration file as follows:
SRC_DB_URL=jdbc:jtds:sqlserver://localhost:55555/EFDemoDB;integratedSecurity=true;
SRC_DB_USER=
SRC_DB_PASSWORD=
TARGET_DB_URL=jdbc:postgresql://localhost:55555/EFDemoDB
TARGET_DB_USER=postgres
TARGET_DB_PASSWORD=55555
And ran the migration tool using the following command line:
.\runMTK.bat -sourcedbtype sqlserver -targetdbtype postgresql guest
The migration tool stared executing and successfully:
connected to the SRC DB
connected to the TARGET DB
Created the schema on the TARGET DB (tables, indexes and FK)
And here comes the funny part:
The Data loader started to work and immediately generated this error:
com.edb.MTKException: MTK-11009: Error Connecting Database "SQL Server"
DB-08S01: java.sql.SQLException: I/O Error: Software caused connection abort: recv failed
Please note: it doesn't matter if I use SQL authentication or windows authentication against SQL Server, I get the same results!
Here is the full log file of the migration
2022-09-01 23:58:18 Running EnterpriseDB Migration Toolkit (Build 55.2.3) ...
2022-09-01 23:58:18 Source database connectivity info...
2022-09-01 23:58:18 conn=jdbc:jtds:sqlserver://localhost:*****/EFDemoDB;integratedSecurity=true;
2022-09-01 23:58:18 user =
2022-09-01 23:58:18 password=******
2022-09-01 23:58:18 Connecting with source SQL Server database server...
2022-09-01 23:58:18 Connected to Microsoft SQL Server, version '14.00.3445'
2022-09-01 23:58:18 Importing sql server schema guest...
2022-09-01 23:58:18 Getting Table Definitions
2022-09-01 23:58:19 Creating Tables...
2022-09-01 23:58:19 Creating Table: guest.addresses
2022-09-01 23:58:19 Creating Table: guest.emailaddresses
2022-09-01 23:58:19 Creating Table: guest.people
**2022-09-01 23:58:19 Created 3 tables.**
2022-09-01 23:58:19 Initializing Data Loader 1...
**2022-09-01 23:58:19 Data loader task failed to initialize. Reason: MTK-11009: Error Connecting Database "SQL Server"
DB-08S01: java.sql.SQLException: I/O Error: Software caused connection abort: recv failed
java.net.SocketException: Software caused connection abort: recv failed**
**2022-09-01 23:58:19 MTK-11009: Error Connecting Database "SQL Server"
DB-08S01: java.sql.SQLException: I/O Error: Software caused connection abort: recv failed
java.net.SocketException: Software caused connection abort: recv failed**
2022-09-01 23:58:19 Stack Trace:
com.edb.MTKException: MTK-11009: Error Connecting Database "SQL Server"
DB-08S01: java.sql.SQLException: I/O Error: Software caused connection abort: recv failed
java.net.SocketException: Software caused connection abort: recv failed
at com.edb.common.MTKFactory.createMTKConnection(MTKFactory.java:277) ~[edb-migrationtoolkit.jar:?]
at com.edb.MigrationToolkit.createNewSourceConnection(MigrationToolkit.java:7242) ~[edb-migrationtoolkit.jar:?]
at com.edb.DataLoader.initialize(DataLoader.java:287) ~[edb-migrationtoolkit.jar:?]
at com.edb.DataLoader.<init>(DataLoader.java:225) ~[edb-migrationtoolkit.jar:?]
at com.edb.MigrationToolkit.copyTables(MigrationToolkit.java:5073) ~[edb-migrationtoolkit.jar:?]
at com.edb.MigrationToolkit.copyTables(MigrationToolkit.java:4831) ~[edb-migrationtoolkit.jar:?]
at com.edb.MigrationToolkit.importSchema(MigrationToolkit.java:4383) ~[edb-migrationtoolkit.jar:?]
at com.edb.MigrationToolkit.main(MigrationToolkit.java:2166) [edb-migrationtoolkit.jar:?]
Caused by: java.sql.SQLException: I/O Error: Software caused connection abort: recv failed
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2481) ~[jtds-1.3.1.jar:1.3.1]
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:632) ~[jtds-1.3.1.jar:1.3.1]
at net.sourceforge.jtds.jdbc.JtdsConnection.<init>(JtdsConnection.java:371) ~[jtds-1.3.1.jar:1.3.1]
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184) ~[jtds-1.3.1.jar:1.3.1]
at java.sql.DriverManager.getConnection(DriverManager.java:664) ~[?:1.8.0_341]
at java.sql.DriverManager.getConnection(DriverManager.java:247) ~[?:1.8.0_341]
at com.edb.common.JTDSConnection.<init>(JTDSConnection.java:50) ~[edb-migrationtoolkit.jar:?]
at com.edb.common.MTKFactory.createMTKConnection(MTKFactory.java:274) ~[edb-migrationtoolkit.jar:?]
... 7 more
Caused by: java.net.SocketException: Software caused connection abort: recv failed
at java.net.SocketInputStream.socketRead0(Native Method) ~[?:1.8.0_341]
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) ~[?:1.8.0_341]
at java.net.SocketInputStream.read(SocketInputStream.java:171) ~[?:1.8.0_341]
at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[?:1.8.0_341]
at java.io.DataInputStream.readFully(DataInputStream.java:195) ~[?:1.8.0_341]
at java.io.DataInputStream.readFully(DataInputStream.java:169) ~[?:1.8.0_341]
at net.sourceforge.jtds.jdbc.SharedSocket.readPacket(SharedSocket.java:850) ~[jtds-1.3.1.jar:1.3.1]
at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:731) ~[jtds-1.3.1.jar:1.3.1]
at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:477) ~[jtds-1.3.1.jar:1.3.1]
at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:114) ~[jtds-1.3.1.jar:1.3.1]
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2368) ~[jtds-1.3.1.jar:1.3.1]
at net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:632) ~[jtds-1.3.1.jar:1.3.1]
at net.sourceforge.jtds.jdbc.JtdsConnection.<init>(JtdsConnection.java:371) ~[jtds-1.3.1.jar:1.3.1]
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184) ~[jtds-1.3.1.jar:1.3.1]
at java.sql.DriverManager.getConnection(DriverManager.java:664) ~[?:1.8.0_341]
at java.sql.DriverManager.getConnection(DriverManager.java:247) ~[?:1.8.0_341]
at com.edb.common.JTDSConnection.<init>(JTDSConnection.java:50) ~[edb-migrationtoolkit.jar:?]
at com.edb.common.MTKFactory.createMTKConnection(MTKFactory.java:274) ~[edb-migrationtoolkit.jar:?]
... 7 more
2022-09-01 23:58:19
2022-09-01 23:58:19 One or more schema objects could not be imported during the migration process. Please review the migration output for more details.
2022-09-01 23:58:19 Total Elapsed Migration Time (sec): 1.122

How to fix Unchecked throwable in managedConnectionReconnected() in Wildfly?

We see in our logs a big amount of these errors (1k per second)
ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper]
(EE-ManagedScheduledExecutorService-default-Thread-1)
javax.resource.ResourceException: IJ000457: Unchecked throwable in
managedConnectionReconnected()
cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener#7cf06c5e[state=NORMAL
managed
connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection#6cecd5f4
connection handles=0 lastReturned=1589648691492
lastValidated=1589648383871 lastCheckedOut=1589648390322
trackByTx=false
pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool#5755db92
mcp=SemaphoreConcurrentLinkedQueueManagedConnectionPool#7c0f33f2[pool=OAPIDS]
xaResource=LocalXAResourceImpl#458307ec[connectionListener=7cf06c5e
connectionManager=180e08c1 warned=false currentXid=null
productName=PostgreSQL productVersion=9.5.14 jndiName=java:/OAPIDS]
txSync=null]
Is it signal that the datasource under big load or App server bug, fixed in later versions?
Our App server is Wildfly 12
DB is Postgres
And some of database queries do not work at the same time with errors "Unable to acquire connection"
Caused by: org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:87)
at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getPhysicalConnection(LogicalConnectionManagedImpl.java:109)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.connection(StatementPreparerImpl.java:47)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:146)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:172)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:148)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1934)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1903)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1881)
at org.hibernate.loader.Loader.doQuery(Loader.java:925)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:342)
at org.hibernate.loader.Loader.doList(Loader.java:2622)
at org.hibernate.loader.Loader.doList(Loader.java:2605)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2434)
at org.hibernate.loader.Loader.list(Loader.java:2429)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:336)
at org.hibernate.internal.SessionImpl.listCustomQuery(SessionImpl.java:1980)
at org.hibernate.internal.AbstractSessionImpl.list(AbstractSessionImpl.java:322)
at org.hibernate.internal.SQLQueryImpl.list(SQLQueryImpl.java:125)
at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:606)
at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:483)
... 81 more
Caused by: java.sql.SQLException: javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener#43697861[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection#58a27593 connection handles=0 lastReturned=1589649243598 lastValidated=1589648924489 lastCheckedOut=1589649243527 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool#5755db92 mcp=SemaphoreConcurrentLinkedQueueManagedConnectionPool#7c0f33f2[pool=OAPIDS] xaResource=LocalXAResourceImpl#2e150b3f[connectionListener=43697861 connectionManager=180e08c1 warned=false currentXid=null productName=PostgreSQL productVersion=9.5.14 jndiName=java:/OAPIDS] txSync=null]
at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:146)
at org.jboss.as.connector.subsystems.datasources.WildFlyDataSource.getConnection(WildFlyDataSource.java:64)
at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)
at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:386)
at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:84)
... 101 more
Caused by: javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener#43697861[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection#58a27593 connection handles=0 lastReturned=1589649243598 lastValidated=1589648924489 lastCheckedOut=1589649243527 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool#5755db92 mcp=SemaphoreConcurrentLinkedQueueManagedConnectionPool#7c0f33f2[pool=OAPIDS] xaResource=LocalXAResourceImpl#2e150b3f[connectionListener=43697861 connectionManager=180e08c1 warned=false currentXid=null productName=PostgreSQL productVersion=9.5.14 jndiName=java:/OAPIDS] txSync=null]
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.reconnectManagedConnection(AbstractConnectionManager.java:975)
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:792)
at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:138)
... 105 more
Caused by: javax.resource.ResourceException: IJ000461: Could not enlist in transaction on entering meta-aware object
at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.managedConnectionReconnected(TxConnectionManagerImpl.java:561)
at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.reconnectManagedConnection(AbstractConnectionManager.java:970)
... 107 more
Caused by: java.lang.IllegalStateException: Transaction Local transaction (delegate=TransactionImple < ac, BasicAction: 0:ffffc0a8cf9f:1902a63b:5ebfdd0d:c3e3c status: ActionStatus.ABORTED >, owner=Local transaction context for provider JBoss JTA transaction provider) is not active STATUS_ROLLEDBACK
at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener.enlist(TxConnectionListener.java:296)
at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.managedConnectionReconnected(TxConnectionManagerImpl.java:554)
... 108 more

Couldn't start gremlin server from JanusGraps (GraphFactory warning)

I try to start JanusGraph and I have a problem with TinkerPop gremlin server. I try both "release (0.1.1)" and "from source (0.2.0)" versions.
When I run /bin/janusgraph.sh start there is no error but I can't connect to gremlin with my application.
When I start TinkerPop version downloaded from Apache site I have no problem with connection. I think that the problem is with a config file. The Apache version uses tinkergraph-empty.properties, the JanusGraph version: janusgraph-cassandra-es-server.properties (Of course, I want to use Cassandra).
A result of executing gremlin-server.sh with Cassandra config don't return any errors but returns warnings:
718 [main] WARN org.apache.tinkerpop.gremlin.server.GremlinServer - Graph [graph] configured at [conf/gremlin-server/janusgraph-cassandra-es-server.properties] could not be instantiated and will not be available in Gremlin Server. GraphFactory message: GraphFactory could not instantiate this Graph implementation [class org.janusgraph.core.JanusGraphFactory]
java.lang.RuntimeException: GraphFactory could not instantiate this Graph implementation [class org.janusgraph.core.JanusGraphFactory]
at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:82)
at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:70)
at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:104)
at org.apache.tinkerpop.gremlin.server.GraphManager.lambda$new$0(GraphManager.java:55)
at java.util.LinkedHashMap$LinkedEntrySet.forEach(LinkedHashMap.java:671)
at org.apache.tinkerpop.gremlin.server.GraphManager.<init>(GraphManager.java:53)
at org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.<init>(ServerGremlinExecutor.java:83)
at org.apache.tinkerpop.gremlin.server.GremlinServer.<init>(GremlinServer.java:110)
at org.apache.tinkerpop.gremlin.server.GremlinServer.main(GremlinServer.java:344)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:78)
... 8 more
Caused by: java.lang.IllegalArgumentException: Could not instantiate implementation: org.janusgraph.diskstorage.cassandra.thrift.CassandraThriftStoreManager
at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:69)
at org.janusgraph.diskstorage.Backend.getImplementationClass(Backend.java:477)
at org.janusgraph.diskstorage.Backend.getStorageManager(Backend.java:409)
at org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration.<init>(GraphDatabaseConfiguration.java:1353)
at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:107)
at org.janusgraph.core.JanusGraphFactory.open(JanusGraphFactory.java:87)
... 13 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.janusgraph.util.system.ConfigurationUtil.instantiate(ConfigurationUtil.java:58)
... 18 more
Caused by: org.janusgraph.diskstorage.TemporaryBackendException: Temporary failure in storage backend
at org.janusgraph.diskstorage.cassandra.thrift.CassandraThriftStoreManager.getCassandraPartitioner(CassandraThriftStoreManager.java:219)
at org.janusgraph.diskstorage.cassandra.thrift.CassandraThriftStoreManager.<init>(CassandraThriftStoreManager.java:198)
... 23 more
Caused by: org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused (Connection refused)
at org.apache.thrift.transport.TSocket.open(TSocket.java:185)
at org.apache.thrift.transport.TFramedTransport.open(TFramedTransport.java:81)
at org.janusgraph.diskstorage.cassandra.thrift.thriftpool.CTConnectionFactory.makeRawConnection(CTConnectionFactory.java:102)
at org.janusgraph.diskstorage.cassandra.thrift.thriftpool.CTConnectionFactory.makeObject(CTConnectionFactory.java:66)
at org.janusgraph.diskstorage.cassandra.thrift.thriftpool.CTConnectionFactory.makeObject(CTConnectionFactory.java:35)
at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1220)
at org.janusgraph.diskstorage.cassandra.thrift.CassandraThriftStoreManager.getCassandraPartitioner(CassandraThriftStoreManager.java:216)
... 24 more
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.thrift.transport.TSocket.open(TSocket.java:180)
... 30 more
How can I start JanusGraph with Cassanda without warnings?
There is a problem with starting Cassandra which you one observe by running:
bin/nodetool enablethrift
as #Ashraful Islam suggested.
One need to uncomment following line(I set address to localhost) in conf/cassandra/cassandra-env.sh :
JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=127.0.0.1"
Enable Thrift server of Cassandra
Use the below command to enable thrift in cassandra
nodetool enablethrift

tomcat server getting hanged randomly(no logs come) and after Ctrl+c it starts working and even logs atart coming

I have deployed my application on tomcat server, but randomly my server stops giving the logs and intermittently the application hangs but after doing Ctrl+c the logs again start coming and application starts working. The logs are as:
2017-04-13 12:50:42,711 [http-nio-8080-exec-12] WARN org.hibernate.engine.jdbc.spi.SqlExceptionHelper - SQL Error: 17002, SQLState: 08006
2017-04-13 12:50:42,711 WARN - SqlExceptionHelper - SQL Error: 17002, SQLState: 08006
2017-04-13 12:50:42,711 [http-nio-8080-exec-12] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - IO Error: Socket read timed out
2017-04-13 12:50:42,711 ERROR - SqlExceptionHelper - IO Error: Socket read timed out
2017-04-13 12:50:42,711 [http-nio-8080-exec-12] ERROR org.springframework.transaction.interceptor.TransactionInterceptor - Application exception overridden by rollback exception
org.springframework.dao.DataAccessResourceFailureException: could not extract ResultSet; nested exception is org.hibernate.exception.JDBCConnectionException: could not extract ResultSet
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:257)
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:244)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:491)
at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59)
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy112.list(Unknown Source)
at com.parkwaypantai.spos.backend.common.service.impl.ClinicUserServiceImpl.list(ClinicUserServiceImpl.java:96)
Caused by: org.hibernate.exception.JDBCConnectionException: could not extract ResultSet
at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:115)
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:79)
at org.hibernate.loader.Loader.getResultSet(Loader.java:2123)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1911)
Caused by: java.sql.SQLRecoverableException: IO Error: Socket read timed out
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:899)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1175)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1296)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3613)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3657)
Caused by: oracle.net.ns.NetException: Socket read timed out
at oracle.net.ns.Packet.receive(Packet.java:347)
at oracle.net.ns.DataPacket.receive(DataPacket.java:106)
at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:324)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:268)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:190)
I tried getting the thread dumps also but as the server hangs so not even dumps are coming for that point of time...Please help me as I have got stuck in this case...Thanks in advance...

IJ000305: Connection error occured: org.jboss.jca.core.connectionmanager.listener.TxConnectionListener

We are using Wildfly8.2 server. The DB connection pool managed by Wildfly server is not able to reconnect (or to regenerate a valid/managed connection pool) after the connections are invalidated by the database server.
Please see the below error:
2016-05-03 11:35:43,662 WARN [org.jboss.jca.core.connectionmanager.listener.TxConnectionListener] (NRG) IJ000305: Connection error occured: org.jboss.jca.core.connectionmanager.listener.TxConnectionListener#231fd521[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection#7ea688d0 connection handles=1 lastUse=1462286812044 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool#794f665c mcp=SemaphoreArrayListManagedConnectionPool#43e70a99[pool=DSNAME] xaResource=LocalXAResourceImpl#7482a7a7[connectionListener=231fd521 connectionManager=3d2232ff warned=false currentXid=null productName=Oracle productVersion=Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options jndiName=java:jboss/DSNAME] txSync=null]: javax.resource.spi.ResourceAdapterInternalException: Unexpected error<br>
at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.broadcastConnectionError(BaseWrapperManagedConnection.java:644)<br>
at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.connectionError(BaseWrapperManagedConnection.java:610)<br>
at org.jboss.jca.adapters.jdbc.WrappedConnection.checkException(WrappedConnection.java:1640)
at org.jboss.jca.adapters.jdbc.WrappedStatement.checkException(WrappedStatement.java:1267)<br>
at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:467)
at com.abc.app.beans.ReconcileInfo.getNextMessage(ReconcileInfo.java:412) [classes:]
at com.abc.app.beans.GroupInfo.sendMessage(GroupInfo.java:819) [classes:]<br>
at com.abc.app.app.GroupSendThread.send(GroupSendThread.java:112) <br>[classes:]
at com.ctsu.rdts.app.GroupSendThread.run(GroupSendThread.java:66) [classes:]
Caused by: java.lang.ThreadDeath<br>
at java.lang.Thread.stop(Thread.java:850) [rt.jar:1.8.0_31]
at com.abc.app.app.HttpDequeue.stopThread(HttpDequeue.java:876) [classes:]
at com.abc.app.app.HttpDequeue.clearLocks(HttpDequeue.java:397) [classes:]
at com.abc.app.app.HttpDequeue.run(HttpDequeue.java:383) [classes:]

Categories