• Post Reply Bookmark Topic Watch Topic
  • New Topic

Throw exception of the java scheduler program code  RSS feed

 
Raymond Chiu Wing Hing
Ranch Hand
Posts: 91
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

I have deployed the program to weblogic server but when run it failed.
I have below sample code but it has exception in connection that I think.

public void performDataFileClosing(Session hibernateSession) throws IOException, InterruptedException, Exception
{
SDatafile sDatafile = null;
DatafileManager datafileManager = new DatafileManager();
List unDataFileList = datafileManager.getUnDataFile(hibernateSession);    <--- throw exception here

...............

public List getUnDataFile(Session hibernateSession) throws HibernateException
{
try
{
String sql = "select sDatafile from SDatafile sDatafile ";
sql += " where sDatafile.isClosed = 'N' ";
sql += " order by sDatafile.sequence desc";

Query query = hibernateSession.createQuery(sql);

List list = query.list();

if (list.size() > 0)
{
return list;
}
else
{
return null;
}

} catch (HibernateException he) {
logger.error("HibernateException Error getTodayDataFile(Session hibernateSession): " + he.getMessage(), he);
throw he;
}
}


//---------------------------------------------------

2017-06-27 00:00:00,033 ERROR (org.hibernate.util.JDBCExceptionReporter:78) - Pool connect failed : weblogic.common.ResourceException: No good connections available.
2017-06-27 00:00:00,033 ERROR (org.hibernate.util.JDBCExceptionReporter:78) - Cannot obtain connection: driverURL = jdbc:weblogic:pool:ABC_DB_ALL, props = {EmulateTwoPhaseCommit=false, connectionPoolID=ABC_DB_ALL, jdbcTxDataSource=true, LoggingLastResource=false, dataSourceName=ABC_DB_ALL}
2017-06-27 00:00:00,033 ERROR (com.core.manager.DatafileManager:205) - HibernateException Error getTodayDataFile(Session hibernateSession): Cannot open connection
org.hibernate.exception.GenericJDBCException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:420)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1538)
at org.hibernate.loader.Loader.doQuery(Loader.java:661)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2211)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
at org.hibernate.loader.Loader.list(Loader.java:2090)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:388)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at.........................................
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:534)
Caused by: java.sql.SQLException: Pool connect failed : weblogic.common.ResourceException: No good connections available.
at weblogic.jdbc.common.internal.JDBCUtil.wrapAndThrowResourceException(JDBCUtil.java:277)
at weblogic.jdbc.pool.Driver.connect(Driver.java:153)
at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:662)
at weblogic.jdbc.jts.Driver.connect(Driver.java:128)
at weblogic.jdbc.common.internal.RmiDataSource.getConnectionInternal(RmiDataSource.java:589)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:545)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:538)
at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)
... 18 more
Caused by: weblogic.common.ResourceException: No good connections available.
at weblogic.jdbc.common.internal.MultiPool.findPool(MultiPool.java:199)
at weblogic.jdbc.common.internal.ConnectionPoolManager.reserve(ConnectionPoolManager.java:128)
at weblogic.jdbc.common.internal.ConnectionPoolManager.reserve(ConnectionPoolManager.java:166)
at weblogic.jdbc.pool.Driver.connect(Driver.java:143)
... 25 more
 
Raymond Chiu Wing Hing
Ranch Hand
Posts: 91
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is solved. Due to I have the master-staging db. One master db is down. And I need to remove master db from main db pool. It is working now. Thanks
 
Paul Clapham
Sheriff
Posts: 22835
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for posting the solution to your problem, Raymond!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!