Java.sql.SQLException: This object was closed() and cannot be used anymore.

Hello All,
The code bellow works fine on our production server (WebLogic 5.1 sp12, SQL Server
7), but it fails on our development server (same configuration):
Product.java
383: java.sql.ResultSet rs = null;
384: java.sql.CallableStatement cs = null;
405: cs.execute();
406: rs = cs.getResultSet();
407: while (rs.next()) {
445: cs.getMoreResults();
446: rs = cs.getResultSet();
447: if (rs != null) {
448: while (rs.next()) {   <<<<<< ERROR LINE
The trace follows:
java.sql.SQLException: This object was closed() and cannot be used anymore. at
weblogic.jdbcbase.mssqlserver4.BaseHandler.complainIfClosed(BaseHandler.java:115)
at weblogic.jdbcbase.mssqlserver4.TdsResultSet.next(TdsResultSet.java:68) at weblogic.jdbcbase.pool.ResultSet.next(ResultSet.java:158)
at weblogic.jdbc20.rmi.internal.ResultSetImpl.next(ResultSetImpl.java:44) at weblogic.jdbc20.rmi.SerialResultSet.next(SerialResultSet.java:38)
at com.visitrade.Product.getProduct(Product.java:448) at com.visitrade.ProductDetailAction.perform(ProductDetailAction.java:74)
at org.apache.struts.action.ActionServlet.processActionInstance(ActionServlet.java:794)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:702) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:314)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at com.visitrade.VisitradeServlet.service(VisitradeServlet.java:58)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:945)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:909)
at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:392)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:274) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:130)
Any clues?
Thanks in advance,
Wagner DosAnjos CMC, Tampa, FL

Wagner DosAnjos wrote:
Hello All,
The code bellow works fine on our production server (WebLogic 5.1 sp12, SQL Server
7), but it fails on our development server (same configuration):
Product.java
383: java.sql.ResultSet rs = null;
384: java.sql.CallableStatement cs = null;
405: cs.execute();
406: rs = cs.getResultSet();
407: while (rs.next()) {
445: cs.getMoreResults();
446: rs = cs.getResultSet();
447: if (rs != null) {
448: while (rs.next()) {   <<<<<< ERROR LINEThat looks like a driver bug. Duplicate it in a standalone program using the MS driver.
If getResultSet() returns a non-null, and the first thing yo do afterwards is call rs.next()
it shouldn't throw an exception. Download our latest driver from our site, and make sure it's
ahead of all our server stuff in the weblogic.classpath, by editing the startWeblogic script.
Joe
>
>
The trace follows:
java.sql.SQLException: This object was closed() and cannot be used anymore. at
weblogic.jdbcbase.mssqlserver4.BaseHandler.complainIfClosed(BaseHandler.java:115)
at weblogic.jdbcbase.mssqlserver4.TdsResultSet.next(TdsResultSet.java:68) at weblogic.jdbcbase.pool.ResultSet.next(ResultSet.java:158)
at weblogic.jdbc20.rmi.internal.ResultSetImpl.next(ResultSetImpl.java:44) at weblogic.jdbc20.rmi.SerialResultSet.next(SerialResultSet.java:38)
at com.visitrade.Product.getProduct(Product.java:448) at com.visitrade.ProductDetailAction.perform(ProductDetailAction.java:74)
at org.apache.struts.action.ActionServlet.processActionInstance(ActionServlet.java:794)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:702) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:314)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at com.visitrade.VisitradeServlet.service(VisitradeServlet.java:58)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:945)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:909)
at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:392)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:274) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:130)
Any clues?
Thanks in advance,
Wagner DosAnjos CMC, Tampa, FL

Similar Messages

  • Java.sql.SQLException: Result set already closed

    Hi,
    Our application is getting migrated to weblogic 10.3.5 and java 1.6.
    We use Ibatis(2.3.0.677.jar) in our application, when i am running my application, I get below exception in weblogic 10.3.5 with TransactionManager as JNDI.
    NOTE: This applicaiton runs very well in weblogic 9.2. And I have even tried locally using the JUnit with transactionManager as SIMPLE which works well too.
    BFSCITWA170546|CSI_APP_ID_NA|ERROR |0|2011-09-06 18:02:16,464|[ACTIVE] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'|AbstractMessageConsumerMdb.java|:- [System] Failed processing message - rolling back
    com.citi.eztop.ezengine.refactoring.common.exception.MessageProcessingException: DAOException received
         at com.citi.eztop.ezengine.refactoring.workpublishing.mdb.WorkPublisherQueueConsumerMDB.handleTextMessage(WorkPublisherQueueConsumerMDB.java:87)
         at com.citi.eztop.ezengine.refactoring.common.mdb.AbstractMessageConsumerMdb.onMessage(AbstractMessageConsumerMdb.java:163)
         at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:574)
         at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:477)
         at weblogic.ejb.container.internal.NewJMSMessagePoller.processOneMessage(NewJMSMessagePoller.java:282)
         at weblogic.ejb.container.internal.NewJMSMessagePoller.run(NewJMSMessagePoller.java:120)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: com.citi.eztop.ezengine.refactoring.common.exception.DAOException: Failed to queryForObject [WorkItem.getWorkItemById]
         at com.citi.eztop.ezengine.refactoring.common.persistence.sqlmapdao.BaseSqlMapDao.queryForObject(BaseSqlMapDao.java:60)
         at com.citi.eztop.ezengine.refactoring.common.persistence.sqlmapdao.WorkItemSqlMapDao.getWorkItemById(WorkItemSqlMapDao.java:15)
         at com.citi.eztop.ezengine.refactoring.workpublishing.businesslayer.WorkPublisher.process(WorkPublisher.java:73)
         at com.citi.eztop.ezengine.refactoring.workpublishing.mdb.WorkPublisherQueueConsumerMDB.handleTextMessage(WorkPublisherQueueConsumerMDB.java:83)
         ... 8 more
    Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
    --- The error occurred in com/citi/eztop/ezengine/refactoring/common/persistence/sqlmapdao/sql/WorkItem.xml.
    --- The error occurred while applying a result map.
    --- Check the WorkItem.workItemResultMap.
    --- The error happened while setting a property on the result object.
    --- Cause: java.sql.SQLException: Result set already closed
         at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:185)
         at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:104)
         at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:566)
         at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:541)
         at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
         at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:83)
         at com.citi.eztop.ezengine.refactoring.common.persistence.sqlmapdao.BaseSqlMapDao.queryForObject(BaseSqlMapDao.java:56)
         ... 11 more
    Caused by: java.sql.SQLException: Result set already closed
         at weblogic.jdbc.wrapper.ResultSet.checkResultSet(ResultSet.java:144)
         at weblogic.jdbc.wrapper.ResultSet.preInvocationHandler(ResultSet.java:97)
         at weblogic.jdbc.wrapper.ResultSet_oracle_jdbc_driver_OracleResultSetImpl.next(Unknown Source)
         at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.ibatis.common.jdbc.logging.ResultSetLogProxy.invoke(ResultSetLogProxy.java:47)
         at $Proxy78.next(Unknown Source)
         at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:380)
         at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(SqlExecutor.java:301)
         at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:190)
         at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
         at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
         ... 17 more
    Please help me to resolve this issue, as I am stuck with this.

    Hi Joe,
    Thanks alot for your reply, but the same code is working in weblogic 9.2 and it is in production as well.
    I have even replicated the settings of 9.2 to 10.3, but still was not able to fnd out the issue.
    Anyways will file an SR and provide it for you.
    Thanks,
    Addhankkiv

  • Exception java.sql.SQLException: This Connection has either timed out

    I am using JRUN 4 & SQL Server 2000
    and Driver is Type 4 SQL Server 2000.
    Type 4 driver : com.microsoft.jdbc.sqlserver.SQLServerDriver
    I am able to connect & fire the query but while insertion record it gives me this error.
    Exception java.sql.SQLException: This Connection has either timed out
    or been closed, and it has returned to its pool. You must re-acquire the Connect
    ion.
    java.sql.SQLException: This Connection has either timed out or been closed, and
    it has returned to its pool. You must re-acquire the Connection.
    at jrun.sql.JRunConnectionHandle.assertConnectionExists(JRunConnectionHa
    ndle.java:50)
    at jrun.sql.JRunConnectionHandle.rollback(JRunConnectionHandle.java:107)
    at krisolshipping.common.LMaintain.postData(LMaintain.java:563)
    at krisolshipping.securities.SUser.doPost(SUser.java:186)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:
    226)
    at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:
    527)
    at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
    at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.j
    ava:451)
    Krisol 03 Exception java.sql.SQLException: This Connection has either timed out
    or been closed, and it has returned to its pool. at jrunx.scheduler.Worke
    rThread.run(WorkerThread.java:66)
    You must re-acquire the Connection.
    java.sql.SQLException: This Connection has either timed out or been closed, and
    it has returned to its pool. You must re-acquire the Connection.

    Did you by any chance close the connection?
    The following appendix in the connection URL is recommended for M$ SQL:
    jdbc:microsoft:sqlserver://mssql:1433;SelectMethod=Cursor

  • Java.sql.SQLException: No ResultSet was produced

    HCAF_PLCaddEngName = EngiNameTextField.getText();
                 Connection connection = null;
                 Statement statement = null;
                 try
                     // Load the JDBC driver
                     // Create a statement
                     statement = connection.createStatement();
                     // Execute a statement
                    resultSet = statement.executeQuery("INSERT INTO Table_name (Emp_name) VALUES ('"+ HCAF_PLCaddEngName+"' )");
                     Move = resultSet.next();why is it that i keep getting this erros:
    java.sql.SQLException: No ResultSet was produced
    at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(JdbcOdbcStatement.java:259)
    at RevisionIn$addButton.actionPerformed(RevisionIn.java:176)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.java:5517)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
    at java.awt.Component.processEvent(Component.java:5282)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3984)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3819)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Window.dispatchEventImpl(Window.java:1791)
    at java.awt.Component.dispatchEvent(Component.java:3819)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 8 seconds)

    what cmd should i used in this caseYou never stated your requirements.
    Let's start over. Forget the code you posted and tell
    us: what are
    your requirements? What is your goal?I'm trying to pass the value of EngiNameTextField to the table_name table
    HCAF_PLCaddEngName = EngiNameTextField.getText();
    this is the line of code, but i guess i have to used executeupdate
    to insert values in to a table
    resultSet = statement.executeQuery("INSERT INTO Table_name (Emp_name) VALUES ('"+ HCAF_PLCaddEngName+"' )");
                     Move = resultSet.next();

  • "java.sql.SQLException: Result set already closed"    on weblogic 9.1

    Hello together,
    i'm using hibernate 3.2.5ga on weblogic 9.1 through a data source with JTA defined to access oracle 10 with the Oracle's Thin XA Driver. Sporadically i get this:
    Caused by: java.sql.SQLException: Result set already closed
         at weblogic.jdbc.wrapper.ResultSet.checkResultSet(ResultSet.java:102)
         at weblogic.jdbc.wrapper.ResultSet.preInvocationHandler(ResultSet.java:58)
         at weblogic.jdbc.wrapper.ResultSet_oracle_jdbc_driver_OracleResultSetImpl.getInt(Unknown Source)
         at org.hibernate.type.IntegerType.get(IntegerType.java:28)
         at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:163)
         at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:154)
         at org.hibernate.type.AbstractType.hydrate(AbstractType.java:81)
         at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2096)
         at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1380)
         at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1308)
         at org.hibernate.loader.Loader.getRow(Loader.java:1206)
         at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:580)
         at org.hibernate.loader.Loader.doQuery(Loader.java:701)
         at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
         at org.hibernate.loader.Loader.doList(Loader.java:2220)
         at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
         at org.hibernate.loader.Loader.list(Loader.java:2099)
         at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
         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)
    This exception is thrown when i try to execute a named query for retrieving some data.
    Does anybody know what is wrong?
    Edited by eazy_rida at 12/17/2007 8:32 AM

    Hi Joe
    Here is the full stack trace:
    org.springframework.orm.hibernate3.HibernateSystemException: Exception occurred inside setter of uk.co.cpp.ptarmigan.domain.npp.NppCoveredParty.assets; nested exception is org.hibernate.PropertyAccessException: Exception occurred inside setter of uk.co.cpp.ptarmigan.domain.npp.NppCoveredParty.assets
         at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:661)
         at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
         at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:379)
         at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:872)
         at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:868)
         at uk.co.cpp.ptarmigan.business.dao.hibernate.HibernateNppPolicyDAOImpl.findPolicyByPolicyNumber(HibernateNppPolicyDAOImpl.java:109)
         at uk.co.cpp.testptarmigan.PartyServiceTest.testFetchPhoneAngelUser(PartyServiceTest.java:79)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76)
         at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
    Caused by: org.hibernate.PropertyAccessException: Exception occurred inside setter of uk.co.cpp.ptarmigan.domain.npp.NppCoveredParty.assets
         at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:65)
         at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:337)
         at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:200)
         at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3571)
         at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:133)
         at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:854)
         at org.hibernate.loader.Loader.doQuery(Loader.java:729)
         at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
         at org.hibernate.loader.Loader.loadCollection(Loader.java:1994)
         at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
         at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:565)
         at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:63)
         at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1716)
         at org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:454)
         at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:844)
         at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:241)
         at org.hibernate.loader.Loader.doList(Loader.java:2213)
         at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
         at org.hibernate.loader.Loader.list(Loader.java:2099)
         at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:912)
         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 org.springframework.orm.hibernate3.HibernateTemplate$30.doInHibernate(HibernateTemplate.java:881)
         at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:374)
         ... 28 more
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:42)
         ... 52 more
    Caused by: org.hibernate.exception.GenericJDBCException: could not initialize a collection: [uk.co.cpp.ptarmigan.domain.npp.NppCoveredParty.assets#component[partyId,policyId]{partyId=77951, policyId=78632}]
         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.loader.Loader.loadCollection(Loader.java:2001)
         at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
         at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:565)
         at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:63)
         at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1716)
         at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344)
         at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
         at org.hibernate.collection.PersistentBag.toArray(PersistentBag.java:257)
         at java.util.Collections.sort(Collections.java:158)
         at uk.co.cpp.ptarmigan.domain.npp.NppCoveredParty.setAssets(NppCoveredParty.java:54)
         ... 57 more
    Caused by: java.sql.SQLException: Result set already closed
         at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
         at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:137)
         at weblogic.jdbc.rmi.internal.ResultSetImpl_weblogic_jdbc_wrapper_ResultSet_oracle_jdbc_driver_OracleResultSetImpl_922_WLStub.next(Unknown Source)
         at weblogic.jdbc.rmi.internal.ResultSetStub_weblogic_jdbc_rmi_internal_ResultSetImpl_weblogic_jdbc_wrapper_ResultSet_oracle_jdbc_driver_OracleResultSetImpl_922_WLStub.next(Unknown Source)
         at weblogic.jdbc.rmi.internal.ResultSetStraightReader.next(ResultSetStraightReader.java:27)
         at weblogic.jdbc.rmi.SerialResultSet.next(SerialResultSet.java:84)
         at org.hibernate.loader.Loader.doQuery(Loader.java:697)
         at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
         at org.hibernate.loader.Loader.loadCollection(Loader.java:1994)
         ... 66 more
    Caused by: java.sql.SQLException: Result set already closed
         at weblogic.jdbc.wrapper.ResultSet.checkResultSet(ResultSet.java:102)
         at weblogic.jdbc.wrapper.ResultSet.preInvocationHandler(ResultSet.java:58)
         at weblogic.jdbc.wrapper.ResultSet_oracle_jdbc_driver_OracleResultSetImpl.next(Unknown Source)
         at weblogic.jdbc.rmi.internal.ResultSetImpl_weblogic_jdbc_wrapper_ResultSet_oracle_jdbc_driver_OracleResultSetImpl.next(Unknown Source)
         at weblogic.jdbc.rmi.internal.ResultSetImpl_weblogic_jdbc_wrapper_ResultSet_oracle_jdbc_driver_OracleResultSetImpl_WLSkel.internalInvoke1(Unknown Source)
         at weblogic.jdbc.rmi.internal.ResultSetImpl_weblogic_jdbc_wrapper_ResultSet_oracle_jdbc_driver_OracleResultSetImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:550)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:440)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:436)
         at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:58)
         at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:975)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    We are using using a connection within a client application (in our case we are executing this from a jUnit Integration test) so could this be caused by the handling of these remote connections?

  • ERROR: The cabinet file 'Sql.cab' required for this installation is corrupt and cannot be used

    As the title indicates, I'm having this error during installation. It occurs when I try to install
    the "Management Studio" part of the program. I've tried a bunch of things like
    copying to hard drive and installing, but to no avail. To isolate the problem, i've even tried removing Reporting services, since at the time of failure it seems to be trying to install/configure the Microsoft.Reporting Services dll.
    Additionally, I have SQL Express installed (installed it separately, not as part of the SQL 2005 DVD), VS 2005, .NET Framework 2.0, SQL Management Studio Express CTP. Could the Management Studio Express be causing a problem?
    Please note:
    Although the error is about missing / corrupt Sql.cab, I have searched the entire dvd for the said file, but there is no file called Sql.cab on the dvd. Am I missing something?
    Any solution would be greatly appreciated.
    TIA

    I was installing SQLServer2014_Developer which I had just purchased as a 64bit iso download to VirtualBox Windows_10_64bit Instance that i had just created.
    I got the following error about 90% through the SQLServer2014_Developer install:
    >>> ===================================================================
    >>> SQL Server 2014
    >>> ===================================================================
    >>> TITLE: Microsoft SQL Server 2014 Setup
    >>> ------------------------------
    >>> The following error has occurred:
    >>> The cabinet file 'Sql.cab' required for this installation is corrupt and cannot be used.
    >>> This could indicate a network error, an error reading from the CD-ROM, or a problem with this package.
    >>> For help, click:
    >>> h t t p ://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft%20SQL%20Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=0xDF039760%25401201%25401
    >>> ------------------------------
    A quick rerun of failed SQLServer2014_Developer install just for the Management_Tools and review of the SQLServer2014_Developer install logs
      confirmed error still prelevant:
    C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\...
    >>> ...
    >>> Detailed results:
    >>>   Feature:                       Management Tools - Complete
    >>>   Status:                        Failed: see logs for details
    >>>   Reason for failure:            An error occurred for a dependency of the feature causing the setup process for the feature to fail.
    >>>   Next Step:                     Use the following information to resolve the error, and then try the setup process again.
    >>>   Component name:                SQL Server Management Services
    >>>   Component error code:          1335
    >>>   Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20150206_223659\sql_ssms_Cpu64_1.log
    >>>   Error description:             The cabinet file 'Sql.cab' required for this installation is corrupt and cannot be used. This could indicate a network error, an error reading
    from the CD-ROM, or a problem with this package.
    >>>   Error help link:               h t t p ://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=sql_ssms.msi%40InstallFiles%401335
    >>>
    >>>   Feature:                       Management Tools - Basic
    >>>   Status:                        Failed: see logs for details
    >>>   Reason for failure:            An error occurred during the setup process of the feature.
    >>>   Next Step:                     Use the following information to resolve the error, and then try the setup process again.
    >>>   Component name:                SQL Server Management Services
    >>>   Component error code:          1335
    >>>   Component log file:            C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20150206_223659\sql_ssms_Cpu64_1.log
    >>>   Error description:             The cabinet file 'Sql.cab' required for this installation is corrupt and cannot be used. This could indicate a network error, an error reading
    from the CD-ROM, or a problem with this package.
    >>>   Error help link:               h t t p ://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=12.0.2000.8&EvtType=sql_ssms.msi%40InstallFiles%401335
    >>> ...
    Reading though the many Google hits going way back AD-2000/AD-2006/AD-2011/AD-2014 for various installs including SQLserver_2008/2012 etc
    I noted that in the main there were x2 common themes.
    1. Problem with corruption the original download.
    --- Although I had not run the download checksum
    --- I had previously just installed SQLServer2014_Developer successfully, so at the minute, I was confident downloads were ok.
    --- Many hits mentioned this 'Sql.cab' file and 90% of the install had been successfull -
    --- I figured the chances of us all having corruption of this one files were agaianst the odds and
    ---   probably re-downloading it would not fix this - but I kicked a re-download off anyhow .
    While it was running ...
    2. Network issue when installing - some of the hits asked if could be related to Virtual drives.
    --- This struck a chord
    --- I had downloaded the SQLServer2014 .iso to my host PC and then copied it onto one OneDrive so I could access it within the VirtualBox_Windows_10.
    --- From within the VirtualBox_Windows_10 I had then used SetupVirtualCloneDrive5450.exe to mount the OneDrive SQLServer2014 .iso and then autorun the install.
    What worked for me ...
    --- I decided to
    --- 1. Copy the same SQLServer2014 .iso that had failed to install x2 from OneDrive to the c:\ root of the VirtualBox_Windows_10.
    --- 2. Remount the same SQLServer2014 .iso from c:\ again using SetupVirtualCloneDrive5450.exe.
    --- 3. Re-run the SQLServer2014 install using the repair mode.
    This time the [Maintenance] [Repair] install completed with all elements showing installed successfully.
    Hope this helps
    Andy

  • Error: the cabinet file required for this installation is corrupt and cannot be used.

    Hi, ive recently just built a brand new computer and purchased windows 7 64 bit. the system runs fine except for the fact that i cannot install any games (these include command and conquer 4, red alert 3 and sims 3. i go to install and partway through it stops with a message saying:
     "the cabinet file 'name.cab' required for this installation is corrupt and cannot be used. this could indicate a network error, an error reading from the CD ROM, or a problem with this package."
    At first i suspectd a faulty cd rom drive, but the same thing happend wen i tried it with another drive. i know the disks are fine because theyr new. iv searced online and tried things such as disabling the antivirus, going into command prompt and deleting the .....\SQMClient\DisabledSessions as administrator and anything else that was recommended, but it still cant seem to like cabinet files (btw when the installation stops it doesnt always stop on the same .cab as a previous attempt, sometimes it gets further through the installation than others). they install fine on other computes with windows 7 64bit.
    Any help is appreciated! Thanx

    Hi Dazattack, I suggest you check the following KB article first:
    Error message during Office 2000 or Office XP installation: "Error 1335 - Cannot Copy Cab File Office1.cab"
    http://support.microsoft.com/kb/314810
    Note: Though it's for Office, some steps in the article can still be used in such scenario.
    Meanwhile, can you install other applications that downloaded from the Internet ?
    Sean Zhu - MSFT

  • Jsf datatable component + java.sql.SQLException

    I get the following error when implementing a JSF DataTable component using
    JDeveloper 10.1.3.1.
    javax.faces.FacesException: java.sql.SQLException: Io exception: Socket closed
    I am able to follow the article in this link:
    http://www.oracle.com/technology/oramag/oracle/06-jan/o16jsf.html
    I can get the table generated, but it occurred to me that the example in this article does not include logic to close the statement, resultset, and connection. Sure enough, I jumped out to the database and there were numerous inactive connections hanging around from my application.
    I added the following code before the return null statement from the article:
    finally {
    try {
    rs.close();
    stmt.close();
    c.close();
    catch (Exception e) {
    System.out.println("after close");
    So I need to know the proper procedure to closing the resultset, statement, and connection using a jsf datatable component.

    You need to make sure you're using the Oracle9i JDBC driver, or using the Oracle 8.1.7.2 JDBC driver as I mentioned above.
    If you are using JDeveloper9i release 9.0.2 or 9.0.3, the driver you need is in <jdevhome>\jdbc\lib
    Otherwise, you can also download the drivers from OTN.

  • Java.sql.SQLException: Invalid cursor position on saving

    Dear all
    I'm having a problem with saving components on a JSF page. The page is plit in two parts:
    1. Save report details, which are being saved correctly. Here is the code
    public String btnSaveReport_action() {
            // TODO: Process the button click action. Return value is a navigation
            // case name where null will return to the same page.
            System.out.println("Saving the report ... forsi");
            int seqNumber = SequenceNumber.getNextSequenceNo("TB_REPORTS");
            getSessionBean1().setReportFK(seqNumber);
            String reportId = "REP_" + ((String)tfReportName.getText()).replace(' ', '_').trim();
            System.out.println("ReportFK in btnSaveReport: " + getSessionBean1().getReportFK());
            //SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
            System.out.println("Start Date: " + calRepStartDate.getSelectedDate());
            //error(calRepStartDate.getValue().toString());
            //System.out.println("getvalue" + calRepStartDate.getValue());
            try {
                rk = tb_reportsDataProvider.appendRow();
                tb_reportsDataProvider.setCursorRow(rk);
                System.out.println("Setting Values ...");
                tb_reportsDataProvider.setValue("REP_PK", new Integer(seqNumber));
                tb_reportsDataProvider.setValue("REP_ID", reportId);
                tb_reportsDataProvider.setValue("REP_ACTIVE", "Y");
                tb_reportsDataProvider.setValue("REP_SESSION_FK", new Integer(getSessionBean1().getSessionId()));
                tb_reportsDataProvider.setValue("REP_NAME", (String)tfReportName.getText());
                tb_reportsDataProvider.setValue("REP_START_DATE", new java.sql.Date(calRepStartDate.getSelectedDate().getTime()));
                tb_reportsDataProvider.setValue("REP_END_DATE", new java.sql.Date(calRepEndDate.getSelectedDate().getTime()));
                System.out.println("Committing Changes ...");
                tb_reportsDataProvider.commitChanges();
                System.out.println("Refreshing Row ...");
                tb_reportsDataProvider.getCachedRowSet().refreshRow();
                getSessionBean1().getTb_reportsRowSet().refreshRow();           
    //            tb_reportsDataProvider.refresh();
    //            System.out.println("Refreshing Row ...");
    //            tb_reportsDataProvider.setCursorRow(tb_reportsDataProvider.findFirst("REP_PK",new Integer(seqNumber)));
                info("Report Data Saved Successfully!");
            } catch (SQLException sqle) {
                /* error("Cannot update report (SQLException): " +
                        reportId +
                        " : " + sqle.getMessage()); */
                log("Cannot update report (SQLException): " +
                        reportId +
                        " : " + sqle);
                info("Could not save report: " + sqle.getMessage());
                sqle.printStackTrace();
            //tfReportName.setValueBinding("sourceData", getApplication().
            //    createValueBinding("#{newReport.tb_reportsDataProvider}"));
            //tfReportName.setValueBinding("text", getApplication().createValueBinding            ("#{newReport.tb_reportsDataProvider.value['REP_NAME']}"));
            // calRepStartDate.setValueBinding("sourceData", getApplication().
            //    createValueBinding("#{newReport.tb_reportsDataProvider}"));
            //calRepStartDate.setValueBinding("selectedDate", getApplication().createValueBinding            ("#{newReport.tb_reportsDataProvider.value['REP_START_DATE']}"));
            //calRepEndDate.setValueBinding("sourceData", getApplication().
            //    createValueBinding("#{newReport.tb_reportsDataProvider}"));
            //calRepEndDate.setValueBinding("selectedDate", getApplication().createValueBinding            ("#{newReport.tb_reportsDataProvider.value['REP_END_DATE']}"));
            info("Report Name: " + tb_reportsDataProvider.getValue("REP_NAME"));
            tfReportName.validate(this.getFacesContext());
            calRepStartDate.validate(this.getFacesContext());
            calRepEndDate.validate(this.getFacesContext());
            tfReportName.setDisabled(true);
            calRepStartDate.setDisabled(true);
            calRepEndDate.setDisabled(true);
            btnNewQuery.setDisabled(false);
            btnSaveReport.setDisabled(true);
            return null;
        }The problem is that the reportFK is losing its value when I submit the page the second time! I am trying to get the value from the provider or from the rowset, but none work. Here is the code I am trying ...
    public String btnSaveQuery_action() {
            // TODO: Process the button click action. Return value is a navigation
            // case name where null will return to the same page.
            int seqNumber  = 0;
            // Save the query header details to the database  
            try {
                // Start with the query - needed for the link table
                seqNumber = SequenceNumber.getNextSequenceNo("TB_QUERY");
                String queryId = "QRY_" + ((String)tfQueryName.getText()).replace(' ', '_').trim();
                tb_queryDataProvider.setCursorRow(queryRowKey);
                tb_queryDataProvider.setValue("QRY_PK", new BigDecimal(seqNumber));
                tb_queryDataProvider.setValue("QRY_CODE", queryId);
                tb_queryDataProvider.setValue("QRY_NAME", (String)tfQueryName.getText());
                tb_queryDataProvider.setValue("QRY_ACTIVE", "Y");
                tb_queryDataProvider.setValue("QRY_SESS_FK", new BigDecimal(getSessionBean1().getSessionId()));
                System.out.println("Committing Changes ...");
                tb_queryDataProvider.commitChanges();
                System.out.println("Refreshing Row ...");
                tb_queryDataProvider.setCursorRow(tb_queryDataProvider.findFirst("QRY_PK",new Integer(seqNumber)));
                getSessionBean1().getTb_queryRowSet().refreshRow();
                info("Query Data Saved Successfully!");
            } catch (Exception ex) {
                error("Error while saving query: " + ex.getMessage());
                log("Error while saving query" + ex);
                ex.printStackTrace();
            // Now save the link
            try {
                // Start with the query - needed for the link table
                String sql = "INSERT INTO TB_LINK_REPORT_QUERY ( " +
                   "LRQ_PK, LRQ_REP_FK, LRQ_QRY_FK, " +
                   "LRQ_TYPE, LRQ_START_DATE, LRQ_END_DATE, " +
                   "LRQ_ACTIVE, LRQ_SESS_FK) " +
                   "VALUES (?,?,?,?,?,?,?,?)";
                System.out.println("Trying to do the link");
                int linkSeqNumber = SequenceNumber.getNextSequenceNo("TB_LINK_REPORT_QUERY");           
                PreparedStatement pstmt = DBConnection.getConnection().prepareStatement(sql);
                if (getSessionBean1().getReportFK() == -1 || getSessionBean1().getReportFK() == 0)
                    System.out.println("reportFK = -1 or 0!!! Trying from provider.");
                    System.out.println("Report PK is: " + getSessionBean1().getTb_reportsRowSet().getBigDecimal("REP_PK"));
                    getSessionBean1().setReportFK(((Integer)tb_reportsDataProvider.getValue("REP_PK")).intValue());
                System.out.println("Report Foreign Key: " + getSessionBean1().getReportFK());
                System.out.println("Query Foreign Key: " + seqNumber);
                pstmt.setInt(1, linkSeqNumber);
                pstmt.setInt(2, getSessionBean1().getReportFK());
                pstmt.setInt(3, seqNumber);
                pstmt.setString(4, (String)dropDownQueryType.getSelected());
                pstmt.setDate(5, new java.sql.Date(calendarQueryStartDate.getSelectedDate().getTime()));
                pstmt.setDate(6, new java.sql.Date(calendarQueryEnd.getSelectedDate().getTime()));
                pstmt.setString(7, "Y");
                pstmt.setInt(8, getSessionBean1().getSessionId());
                System.out.println("Committing Changes for Link ...");
                pstmt.executeUpdate();
                DBConnection.getConnection().commit();
                System.out.println("Refreshing Row in link ...");
                getSessionBean1().getTb_link_report_queryRowSet().setObject(
                        1, new Integer(linkSeqNumber));
                getSessionBean1().getTb_link_report_queryRowSet().setObject(
                        2, new Integer(getSessionBean1().getReportFK()));
                getSessionBean1().getTb_link_report_queryRowSet().setObject(
                        3, calendarQueryStartDate.getSelectedDate());
                getSessionBean1().getTb_link_report_queryRowSet().setObject(
                        4, calendarQueryEnd.getSelectedDate());
                tb_link_report_queryDataProvider.refresh();
                info("Link Data Saved Successfully!");
            } catch (Exception ex) {
                error("Error while saving query: " + ex.getMessage());
                log("Error while saving link: " + ex);
                ex.printStackTrace();
            return null;
        }The part saving the query with the provider is working correctly. But the part with the link is not working at all (the part with the PreparedStatement). The fact is that the PreparedStatement cannot be executed because I am getting the error at the line
    System.out.println("Report PK is: " + getSessionBean1().getTb_reportsRowSet().getBigDecimal("REP_PK"));Can anyone help please?
    Thanks and Regards
    Joseph

    guys if any of you have an idea just post it. It would be of great help for me. I can't figure out my mistake and its been 2days already and still i am stuck with my problem.
    It displays the table but there is an error "java.sql.SQLException: Invalid cursor position" so i cannot put the counter to the session.

  • Java.sql.SQLException: statement handle not executed

    hello,
    i am calling a stored procedure and its returns a REF CURSOR and i am getting intermittent exceptions below,
    org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not execute query; uncategorized SQLException for SQL [{call
    xxxx_pkg(?,?)}]; SQL state [99999]; error code [17144]; statement handle not executed; nested exception is java.sql.SQLException: statement handle not executed
    and
    org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not execute query; uncategorized SQLException for SQL [{call
    xxxx_pkg(?,?,?)}]; SQL state [99999]; error code [17009]; Closed Statement; nested exception is java.sql.SQLException: Closed Statement
    any clue what could be the issue,
    Regards
    GG

    its pretty simple have a java class calling hibernateTemplate's findByNamedQueryAndNamedParam method by passing the procedure name and binding parameters/values, and here is the stack
    org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not execute query; uncategorized SQLException for SQL [{call
    xxx_pkg(?,?)}]; SQL state [99999]; error code [17144]; statement handle not executed; nested exception is java.sql.SQLException: statement handle not executed
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    at org.springframework.orm.hibernate3.HibernateAccessor.convertJdbcAccessException(HibernateAccessor.java:424)
    at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:410)
    at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
    at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
    at org.springframework.orm.hibernate3.HibernateTemplate.findByNamedQueryAndNamedParam(HibernateTemplate.java:1006)
    Caused by: java.sql.SQLException: statement handle not executed
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:229)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:403)
    at oracle.jdbc.driver.T4CStatement.doDescribe(T4CStatement.java:701)
    at oracle.jdbc.driver.OracleStatement.getColumnIndex(OracleStatement.java:3355)
    at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:2009)
    at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:494)
    at org.hibernate.type.StringType.get(StringType.java:18)
    at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:163)
    at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:154)
    at org.hibernate.type.AbstractType.hydrate(AbstractType.java:81)
    at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2091)
    at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1380)
    at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1308)
    at org.hibernate.loader.Loader.getRow(Loader.java:1206)
    at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:580)
    at org.hibernate.loader.Loader.doQuery(Loader.java:701)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
    at org.hibernate.loader.Loader.doList(Loader.java:2217)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2108)
    at org.hibernate.loader.Loader.list(Loader.java:2103)
    at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
    at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1696)
    at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
    at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
    at org.springframework.orm.hibernate3.HibernateTemplate$34.doInHibernate(HibernateTemplate.java:1015)
    at org.springframework.orm.hibernate3.HibernateTemplate$34.doInHibernate(HibernateTemplate.java:1)
    at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)

  • How to resolve the java.sql.SQLException: OALL8 is in an inconsistent state

    Hi All,
    I am getting the SQLException "java.sql.SQLException: OALL8 is in an inconsistent state." and in finally block while I am trying to execute another operation on the same database getting another exception "java.sql.SQLException: Io exception: Broken pipe".
    I am using a connection from the connection pool configured in Oracle Application server. I am using the Oracle App server 10.1.3.4 and my database is Oracle Database 11g Enterprise Edition Release 11.1.0.7.0.
    Any help in resolving this issue would really be appreciated.
    Thank you.

    Hi,
    What version of the driver are you using? The "OALL8 is in an inconsistent state" exception usually indicates a problem in the protocol. When this exception occurs the protocol is broken and the connection can't be used anymore. I would suggest that you try using the 11.2.0.1 JDBC driver that you can download from:
    http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html
    Regards,
    Jean

  • DataSource invalid: "java.sql.SQLException: No suitable driver"

    Hi,
    I created a JDBC resource called "jdbc/gms" under SUN JSAS admin. I am trying SQL query using JSTL tag in a JSP page as follows.
    <sql:query var="learning" dataSource="jdbc/gms">
    Query
    </sql:query>
    I am getting the error as DataSource invalid: "java.sql.SQLException: No suitable driver".
    Instead, If I use the following code it is working properly.
    <%
    Connection connection = null;
    InitialContext ctx = new InitialContext();
    DataSource ds = (DataSource) ctx.lookup("jdbc/gms");
    connection=ds.getConnection();
    Statement stmt = connection.createStatement();
    String sqlquery="My Query";
    ResultSet rs = stmt.executeQuery(sqlquery);
    %>
    I am not sure why JSTL SQL Query is not working. Please help.

    I haven't actually used JSAS. I am extrapolating the error from symptoms seen on other web containers (Tomcat, Weblogic, JBoss...)
    Unfortunately when it comes to setting up JNDI resources, each is quite different.
    What version of JSAS are you using? but here is the link to the documentation for setup that google found:
    http://docs.sun.com/source/819-0076/jdbc.html#wp1016617
    The documentation seems to indicate that resources should automatically be put in the java:comp/env subcontext. Obviously this is not happening as your code is retrieving it from the initial context.
    Check the section where you have defined the JDBC Resources that you have typed the right name - maybe you added a "/" onto the front of the name?
    Maybe you can find the file that it is editing when you edit through the interface, and see what is in there?
    Good luck,
    evnafets

  • Java.sql.SQLException:Cannot open any more tables.

    I have such exception(java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Cannot open any more tables.) when I try to make request to database:
    if(null!=con)
    try{
    Statement stmt;
    stmt = con.createStatement ( ResultSet.TYPE_SCROLL_INSENSITIVE,
    ResultSet.CONCUR_UPDATABLE);
    ResultSet rs= stmt.executeQuery(quary);
    } catch(SQLException ex) {
    System.err.println("SQLException: " + ex.getMessage());
    ex.printStackTrace();
    }//try
    But exception occurs after several requests(about 20). First 20 requests work fine. What is it? Thanks.

    Statement stmt;
    stmt = con.createStatement ( ResultSet.TYPE_SCROLL_INSENSITIVE,
    try{
    ResultSet.CONCUR_UPDATABLE);
    ResultSet rs= stmt.executeQuery(quary);
    } catch(SQLException ex) {
    System.err.println("SQLException: " + ex.getMessage());
    ex.printStackTrace();
    }//tryyou should reuse the statement rather than opening it for every query
    Good Luck

  • Java.sql.SQLException: Closed Statement

    I'm having a problem with my Java code trying to access an Oracle 10g database through the JDBC driver using the Oracle XML Publisher.
    We generate a number of different reports, but one report consistently fails with the error: java.sql.SQLException: Closed Statement
    It only happens in the production environment, which has significantly more data than the test and development environments.
    One interesting (!) observation is that the error occurs after 10 minutes to the second (almost). Which leads me to think it is a timeout related problem, but am aware that this could be a red herring.
    And finally, the code is being run within a job sheduled using the Quartz Scheduler v1.6.5.
    Any help would be appreciated.
    Many Thanks
    Lawrence
    Here is the stack trace:
    java.sql.SQLException: Closed Statement: getMetaData
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.OracleResultSetImpl.getMetaData(OracleResultSetImpl.java:128)
    at com.mchange.v2.c3p0.impl.NewProxyResultSet.getMetaData(NewProxyResultSet.java:47)
    at oracle.apps.xdo.dataengine.XMLPGEN.processSQLDataSource(Unknown Source)
    at oracle.apps.xdo.dataengine.XMLPGEN.writeData(Unknown Source)
    at oracle.apps.xdo.dataengine.XMLPGEN.writeGroup(Unknown Source)
    at oracle.apps.xdo.dataengine.XMLPGEN.writeGroup(Unknown Source)
    at oracle.apps.xdo.dataengine.XMLPGEN.processSQLDataSource(Unknown Source)
    at oracle.apps.xdo.dataengine.XMLPGEN.writeData(Unknown Source)
    at oracle.apps.xdo.dataengine.XMLPGEN.writeGroupStructure(Unknown Source)
    at oracle.apps.xdo.dataengine.XMLPGEN.processData(Unknown Source)
    at oracle.apps.xdo.dataengine.XMLPGEN.processXML(Unknown Source)
    at oracle.apps.xdo.dataengine.XMLPGEN.writeXML(Unknown Source)
    at oracle.apps.xdo.dataengine.DataProcessor.processDataStructre(Unknown Source)
    at oracle.apps.xdo.dataengine.DataProcessor.processData(Unknown Source)
    at com.tmobile.sett.file.invoice.InvoiceFileFactory.generateXML(InvoiceFileFactory.java:157)
    at com.tmobile.sett.file.invoice.InvoiceFileFactory.generateStatements(InvoiceFileFactory.java:365)
    at com.tmobile.sett.file.invoice.InvoiceFileFactory.generateInvoices(InvoiceFileFactory.java:457)
    at com.tmobile.sett.file.invoice.StatementGeneratorJob.execute(StatementGeneratorJob.java:34)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
    Here is the code:
    private void generateXML(String xmlTemplate, String xmlFilename, Hashtable parameters) {
    DataProcessor dataProcessor = new DataProcessor();
    log.debug("generateXML: xmlTemplate {}, xmlFilename {}", xmlTemplate, xmlFilename);
    try {
    // Set Data Template to be executed
    dataProcessor.setDataTemplate(xmlTemplate);
    // Obtain a new Connection from the Pool
    Connection conn = HibernateUtil.getConnection();
    if (conn == null)
    log.debug("conn is null after getCall");
    if (conn.isClosed())
    log.debug("conn is closed after getCall");
    // Set the Connection for the dataProcessor
    dataProcessor.setConnection(conn);
    if (conn.isClosed())
    log.debug("conn is closed after setConnection");
    dataProcessor.setParameters(parameters);
    if (conn.isClosed())
    log.debug("conn is closed after setParameters");
    // Specify the output directory and file for the data file
    dataProcessor.setOutput(xmlFilename);
    if (conn.isClosed())
    log.debug("conn is closed after setOutput");
    // Process the data template
    dataProcessor.processData();
    if (conn.isClosed())
    log.debug("conn is closed after processData");
    // Return the connection to the pool
    conn.close();
    } catch (Exception e) {
    System.err.println("Error generating XML with the following parameters:");
    System.err.println("xmlTemplate=" + xmlTemplate);
    System.err.println("xmlFilename=" + xmlFilename);
    System.err.println("Here's the stack trace");
    e.printStackTrace();
    System.exit(1);
    }

    I have made some progress in understanding the problem...
    Basically, your comment about threads made me look at the code from a threads perspective. There are only three objects used, log4j, oracleXML Publisher and hibernate. Discounting log4j, the Oracle object is created, opened and closed within the procedure, so I concluded that hibernate was the most likely cause of the problem (i know, theres an element of educated guesswork in this).
    Anyway, I found the hibernate timeouts (all around 300 seconds) and increased them to 3000 seconds... and lo and behold the reports are generated successfully, although some of them take over 20 minutes each.
    So, this is a performance problem with the SQL itself:
    SELECT service
    , reply
    , ROUND(SUM(DECODE(op, 3, 0, count))* :uplift,0) x_events
    , ROUND(SUM(DECODE(op, 3, count, 0))* :uplift,0) y_events
    FROM aggregate
    WHERE ref_time >= :period_start
    AND ref_time < :period_end
    AND feed = 13
    AND agreement = :agreement
    AND line = 1
    GROUP BY service, reply
    ORDER BY 1,2
    The SQL in question is querying data for a specific month from a monthly partitioned table that contains about 11 million records a month. We currently have 99 partitions.
    Executing the sql in Toad / Sql developer / sqlplus takes around 20 seconds...so why 20 minutes?
    Looking in the session browser, I can see that the 20 minute query is looking through all 99 partitions where the 20 second query is only looking at 1 partition for the month in question.
    I'm not sure if this is heading off topic for the forum thread, but the question now is...
    Why is Oracle using a clearly innefficient execution plan when we are using a query with bound variables and how do we get it to use a more efficient execution plan?

  • Java.sql.SQLException: Closed Connection error when invoking web service

    Hi
    I've assembled a simple web service for an Oracle PL/SQL package and deployed it on a Standalone OC4J, when I come to invoke it on the Oracle Enterprise Manager screen I'm getting the following returned within the envelope body:
    <env:Body>
    <env:Fault>
    <faultcode>env:Server</faultcode>
    <faultstring>Internal Server Error (serialization error: java.sql.SQLException: java.sql.SQLException: Closed Connection)</faultstring>
    </env:Fault>
    </env:Body>
    The function that is called within the database returns a user defined object that consists of a RAW value and an XMLTYPE. The function takes a string as a parameter, when I enter a string that I know will not return an object there is no error in the envelope body, only when there is an object to return does the error appear.
    Anyone have any suggestion as to why this is?

    I'm no further forward with this: has anyone assembled, deployed and invoked a web service that returns a XMLTYPE?? I know this should be possible but I think there's maybe some manual intervention required with the classes created with webservicesassembler: I'd really appreciate it if anyone with any experience of this kind of thing could help me think this through.

Maybe you are looking for

  • How can i do scheduled automatic backups to an ftp server in ios xr?

    Hello guys! As the title says im looking forward to automatically back up my running config on a cisco CRS-1 to an FTP server. I was only able to find this config example: Configuration commit auto-save filename ftp://A.B.C.D/myconfig.txt This allows

  • How do I consolidate multiple iCloud IDs?

    How do I consolidate multiple iCloud IDs?

  • Is there a way to edit text in a smart object brought in from illustrator?

    Is there a way to edit text in a smart object brought in from illustrator? Many thanks for the help! And can anyone recommend learning resources for someone (me) who is an AI user for a decade who needs to work in PS for web mockups? Something other

  • Apple TV & Homehub 3 Home Sharing Drop Out

    Good morning all and my apologies for posting this in the BT Vision section but I didn't know where else to go. I've had BT Infinity for a few months now and been generally happy with the service.  I'm a Mac user and at the weekend I decided to purch

  • DATE Feild error

    Hi guru's and Expert I have a date field in which is in hte following format 25-4-2012 i get the below error Error View Display Error Odbc driver returned an error (SQLExecDirectW). Error Details Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P State: HY000.