Restarting the app server getting error? - java

we are getting error when restarting the app server.
generally when we restart the app server it will create connections itself.
but it was throwing below error.
2013-11-05 04:06:00,029 WARN [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (pool-11-thread-1) Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: null, message from server: "Host 'jade2.ftdi.com' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'")
Observed below log also:
2013-11-05 04:07:18,074 INFO [STDOUT] (pool-11-thread-1) DEBUG 2013-11-05 04:07:18,074 [pool-11-thread-1] com.ftd.core.datasource.model.DataSourceHealthMonitor: doDBServerMaintenance path to db server maintenance files jboss.server.data.dir
2013-11-05 04:07:18,074 ERROR [STDERR] (Thread-12) java.lang.OutOfMemoryError: Java heap space
2013-11-05 04:07:20,844 INFO [STDOUT] (http-0.0.0.0-8713-2) ERROR 2013-11-05 04:07:16,673 [http-0.0.0.0-8713-2] com.ftd.core.datasource.exceptionhandlers.NormalExecutionHandler: Caught TransactionException.org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is com.ftd.core.datasource.exceptions.ConnectionException: nested exception is com.ftd.core.datasource.exceptions.DataSourceException: All Databases are down!!!
After this error Our DBA'S issued flush hosts; in DB side but no luck still we are getting same error.how fix it

java.lang.OutOfMemoryError: Java heap space
Maybe you should try to increase the heap size of VM

Related

project not geting deployed in glassfish server

i am trying to debug my project but its showing error message as such :
"cannot Deploy WebForm
Deployment Error for module: WebForm: Error occurred during deployment: Exception while preparing the app : Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
Error Code: 0."
i have done every possible step with the persistence.xml as well as the JPA tables but still it's not deploying.
Help!
You have some sort of DB-connection configured in your app. The message "Error connecting to server localhost on port 1527 with message Connection refused: connect. Error Code: 0" says, your program tries to reach a DB on port 1527. The possibilities are:
on the production server is no DB running: install and configure DB
the program does not have the rights to access DB
the DB-connection on production-server is reached differently than in development - adjust your configuration

Could not create oracle database connection from jboss

During my development, server(jboss4.0) was restarted because of some changes in java source and server failed to restart with the below stacktrace.
[JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=186647552)(ERR=12514)(ERROR_STACK=(ERROR=(CODE=12514)(EMFI=4)))))
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:179)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:565)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:250)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:491)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:341)
at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:301)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1881)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1174)
Caused by: java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=186647552)(ERR=12514)(ERROR_STACK=(ERROR=(CODE=12514)(EMFI=4))))
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:404)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:171)
... 150 more
17:51:19,271 WARN [SettingsFactory] Could not obtain connection metadata
org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=
I have even successfully tested connection with a standalone java program and with ping. Also it is connecting from my oracle sql developer. I'm using oracle 9i.
What could be the reason as its suddenly getting into this error?

Frequently getting Read timed out in SQL Server 2008 Hibernate 4.1

We are facing one strange issue with sql server 2008r2 and hibernate. Frequently getting read timeout error from the database, here is the error details:
10:02:11,368 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/55.2.0.180:443-36) SQL Error: 0, SQLState: 08S01
10:02:11,368 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/55.2.0.180:443-36) Read timed out
10:02:11,368 ERROR [stderr] (http-/55.2.0.180:443-36) org.hibernate.exception.JDBCConnectionException: Read timed out10:02:11,368 ERROR [stderr] (http-/55.2.0.180:443-36) at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:131)10:02:11,368 ERROR [stderr] (http-/55.2.0.180:443-36)
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)10:02:11,368 ERROR [stderr] (http-/55.2.0.180:443-36)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)10:02:11,368 ERROR [stderr] (http-/55.2.0.180:443-36)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)10:02:11,384 ERROR [stderr] (http-/55.2.0.180:443-36)
at org.hibernate.engine.jdbc.internal.proxy.AbstractStatementProxyHandler.continueInvocation(AbstractStatementProxyHandler.java:129)10:02:11,384 ERROR [stderr] (http-/55.2.0.180:443-36)
... 131 more10:02:11,727 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/55.2.0.180:443-36) SQL Error: 0, SQLState: null
10:02:11,727 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/55.2.0.180:443-36) The connection is closed.
10:02:11,727 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/CastrolCubedUnit].[spring]] (http-/55.2.0.180:443-36) JBWEB000236: Servlet.service() for servlet spring threw exception: com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
Few More information if its related:
We are using C3P0 connection pooling with hibernate. And configured
connection testing as well. We have checked the DB with(in the time
of exception occurring) exec sp_lock command DB is only holding S or
IS lock
We are not getting this in local environment in local its running
fine
Application is hosted in Amazon aws with two application server and
one load balancer where the issue persist.
We are stuck into this help is much appreciated.
MS SQl server keeps statistical information about all queries. table sys.dm_exec_query_stats having the statistics about each query but before that I suggest you to run DBCC command which restarts logging of the query running time and some cache clear work is done.
DNDC Command DBCC FREEPROCCACHE
And following is the query to find long query
SELECT DISTINCT TOP 10
t.TEXT QueryName,
s.execution_count AS ExecutionCount,
s.max_elapsed_time AS MaxElapsedTime,
ISNULL(s.total_elapsed_time / s.execution_count, 0) AS AvgElapsedTime,
s.creation_time AS LogCreatedOn,
ISNULL(s.execution_count / DATEDIFF(s, s.creation_time, GETDATE()), 0) AS FrequencyPerSec
FROM sys.dm_exec_query_stats s
CROSS APPLY sys.dm_exec_sql_text( s.sql_handle ) t
ORDER BY
s.max_elapsed_time DESC
GO
You can go through This Link for optimizing query.

Java Derby DB error 'Exception in thread "index-stat-thread"' and "Could not get JDBC Connection" error

We have a stand-alone single user desktop application that has a Swing front-end and uses an embedded Derby database (10.8.2.2 1181258). Spring (3.0.4) is used as the go between the application and the database. A customer (in Hebrew/Israel locale iw_IL) running the application using JRE 1.7.0_21 ran into an issue. The following stack trace was logged:
ERROR [index-stat-thread] stderr - Exception in thread "index-stat-thread"
ERROR [index-stat-thread] stderr - java.lang.ClassCastException: org.apache.derby.impl.store.access.btree.BranchControlRow cannot be cast to org.apache.derby.impl.store.access.btree.LeafControlRow
ERROR [index-stat-thread] stderr - at org.apache.derby.impl.store.access.btree.BTreeScan.positionAtNextPage(Unknown Source)
ERROR [index-stat-thread] stderr - at org.apache.derby.impl.store.access.btree.BTreeForwardScan.fetchRows(Unknown Source)
ERROR [index-stat-thread] stderr - at org.apache.derby.impl.store.access.btree.BTreeScan.fetchNextGroup(Unknown Source)
ERROR [index-stat-thread] stderr - at org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl$KeyComparator.fetchRows(Unknown Source)
ERROR [index-stat-thread] stderr - at org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.updateIndexStatsMinion(Unknown Source)
ERROR [index-stat-thread] stderr - at org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.generateStatistics(Unknown Source)
ERROR [index-stat-thread] stderr - at org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.processingLoop(Unknown Source)
ERROR [index-stat-thread] stderr - at org.apache.derby.impl.services.daemon.IndexStatisticsDaemonImpl.run(Unknown Source)
ERROR [index-stat-thread] stderr - at java.lang.Thread.run(Thread.java:722)
Any idea what might cause such an error?
Subsequently, Spring logged the following:
org.springframework.jdbc.support.SQLErrorCodesFactory - Error while extracting database product name - falling back to empty error codes
org.springframework.jdbc.support.MetaDataAccessException: Could not get Connection for extracting meta data; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLNonTransientConnectionException: No current connection.
at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:293)
at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:320)
at org.springframework.jdbc.support.SQLErrorCodesFactory.getErrorCodes(SQLErrorCodesFactory.java:212)
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.setDataSource(SQLErrorCodeSQLExceptionTranslator.java:141)
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.<init>(SQLErrorCodeSQLExceptionTranslator.java:104)
at org.springframework.jdbc.support.JdbcAccessor.getExceptionTranslator(JdbcAccessor.java:99)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:602)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:636)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:665)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:673)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:713)
at org.springframework.jdbc.core.JdbcTemplate.queryForList(JdbcTemplate.java:796)
at org.springframework.jdbc.core.simple.SimpleJdbcTemplate.queryForList(SimpleJdbcTemplate.java:235)
Given that the application uses an embedded Derby database on the same machine and file system as the application, the JDBC connection error is baffling. Could the first Derby error be the reason for this?
Following this is another error from Spring while loading entries for one table, which essentially seems to be the same as the first error from Derby:
ERROR [main] org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [select * from XYZ where scresult_id=?]; SQL state [XJ001]; error code [0]; Java exception:
'org.apache.derby.impl.store.access.btree.BranchControlRow cannot be cast to org.apache.derby.impl.store.access.btree.LeafControlRow: java.lang.ClassCastException'.; nested exception is java.sql.SQLException: Java exception:
'org.apache.derby.impl.store.access.btree.BranchControlRow cannot be cast to org.apache.derby.impl.store.access.btree.LeafControlRow: java.lang.ClassCastException'.
The same application has been used successfully by other customers for several months. This is the first time a customer has run into these problems.
It looks like your database has become corrupt. Those are internal messages that you should never see.
Here is information about how to use your backups and logs to recover your database: http://db.apache.org/derby/docs/10.10/adminguide/cadminhubbkup98797.html
Before you restore the database, you should retain a copy of the damaged database, the derby.log file, and any other information about the circumstances under which the database became corrupt, as they may give you important clues about how to prevent this problem in the future.
In general, it should not be possible to corrupt a Derby database like this; hence arriving at such a situation might indicate a bug in Derby itself. But there could be other possible explanations, such as damaged or misconfigured hardware.
I assume from your initial question that you do not know how to reproduce this problem? In that case, preserving as much information as you can about the incident, and about what was occurring at the moment that the corruption occurred (did the power fail? Was the machine hard-rebooted? did a disk become full? was a virus-checker running on the machine? There are a million possible questions like this to ask...) may give you clues about how to reproduce the problem yourself.

jboss OutOfMemory

We have a java application which use JBoss 4.2.0, EJB, Hibernate.
In one of our production server, getting OutOfMemory error at regular interval.
We are seeing user defined exceptions in the jboss and server log files. we intentionally throwing this user defined exception from our code when the user hit the particular piece of code. But the number of users and usage is more for this customer. so it throws 400-500 exceptions. After that we are getting a
WARN org.jboss.mq.SpyJMSException: No pong received;
We have already implemented the ExceptionListener to reconnect the topicConnection in case of failure. And also some of the socketexception as below.
2012-10-12 10:33:57,824 ERROR [org.apache.tomcat.util.net.PoolTcpEndpoint] (http-0.0.0.0-8880-Processor1436) Socket error caused by remote host /125.236.40.205 java.net.SocketException: Connection reset
Have analysed the heap dump generated. 4.5 GB memory is occupied by jmsspyobject exception.
We have got the thread dump from jmx console. Do we need to load the copied thread dump to TDA(Thread Dump Analyzer) tool?
Is OOM because of user defined exception in so many numbers? do we need to reduce it ? or user defined exceptions are not cause for the OOM error?
Please find the attached thread log. I am very new to analyze the jboss thread logs. Could anyone help me to do this?
http://www.4shared.com/file/toRiqF1n/perf-info.html
Thanks.

Categories

Resources