cannot open connection while exporting the data to database using hibernate
I have written a service to export jcr data to database. The service starts itself when I start the server of my application previously It was exporting the data with no any problem since two days whenever I start the server it get successfull for exporting the data but again I get following exception I tried to find the problem but I could not make it.
23:31:55,562 ERROR [STDERR] org.springframework.dao.InvalidDataAccessResourceUsageException: Cannot open connection; nested exception is org.hibernate.exception.SQLGrammarException: Cannot open connection 23:31:55,562 ERROR [STDERR] at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:615) 23:31:55,562 ERROR [STDERR] at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412) 23:31:5开发者_JS百科5,562 ERROR [STDERR] at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424) 23:31:55,562 ERROR [STDERR] at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374) 23:31:55,562 ERROR [STDERR] at org.springframework.orm.hibernate3.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:744) 23:31:55,562 ERROR [STDERR] at nl.gx.snsbank.jcrreport.dao.PageDAOImp.store(PageDAOImp.java:39) 23:31:55,562 ERROR [STDERR] at nl.gx.snsbank.jcrobjectsbuilder.PageBuilder.createDomainObject(PageBuilder.java:88) 23:31:55,562 ERROR [STDERR] at nl.gx.snsbank.jcrobjectsbuilder.PageBuilder.SaveToDB(PageBuilder.java:57) 23:31:55,562 ERROR [STDERR] at nl.gx.snsbank.service.JCRExporterService.exportToDB(JCRExporterService.java:91) 23:31:55,562 ERROR [STDERR] at nl.gx.snsbank.service.SchedulerJobServiceImpl.run(SchedulerJobServiceImpl.java:114) 23:31:55,562 ERROR [STDERR] at nl.gx.snsbank.service.SchedulerJobServiceImpl.scheduleJob(SchedulerJobServiceImpl.java:153) 23:31:55,562 ERROR [STDERR] at nl.gx.snsbank.service.SchedulerJobServiceImpl.onStart(SchedulerJobServiceImpl.java:78) 23:31:55,562 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 23:31:55,562 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 23:31:55,562 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 23:31:55,562 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.ServiceImpl.invoke(ServiceImpl.java:484) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.ServiceImpl.activateService(ServiceImpl.java:441) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.ServiceImpl.access$000(ServiceImpl.java:44) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.ServiceImpl$1.run(ServiceImpl.java:113) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.SerialExecutor$1.run(SerialExecutor.java:47) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.SerialExecutor.scheduleNext(SerialExecutor.java:84) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.SerialExecutor.access$000(SerialExecutor.java:33) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.SerialExecutor$1.run(SerialExecutor.java:50) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.SerialExecutor.scheduleNext(SerialExecutor.java:84) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.SerialExecutor.execute(SerialExecutor.java:68) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.ServiceImpl.calculateStateChanges(ServiceImpl.java:147) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.ServiceImpl.start(ServiceImpl.java:257) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.DependencyManager.add(DependencyManager.java:56) 23:31:55,562 ERROR [STDERR] at nl.gx.webmanager.wcb.foundation.ComponentBundleImpl.startComponent(ComponentBundleImpl.java:621) 23:31:55,562 ERROR [STDERR] at nl.gx.webmanager.wcb.foundation.ComponentBundleImpl.startComponents(ComponentBundleImpl.java:379) 23:31:55,562 ERROR [STDERR] at nl.gx.webmanager.wcb.foundation.ComponentBundleImpl.doStart(ComponentBundleImpl.java:211) 23:31:55,562 ERROR [STDERR] at nl.gx.webmanager.wcb.foundation.ComponentBundleImpl.start(ComponentBundleImpl.java:160) 23:31:55,562 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor123.invoke(Unknown Source) 23:31:55,562 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 23:31:55,562 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.ServiceImpl.invoke(ServiceImpl.java:484) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.ServiceImpl.activateService(ServiceImpl.java:441) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.ServiceImpl.access$000(ServiceImpl.java:44) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.ServiceImpl$1.run(ServiceImpl.java:113) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.SerialExecutor$1.run(SerialExecutor.java:47) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.SerialExecutor.scheduleNext(SerialExecutor.java:84) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.SerialExecutor.access$000(SerialExecutor.java:33) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.SerialExecutor$1.run(SerialExecutor.java:50) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.SerialExecutor.scheduleNext(SerialExecutor.java:84) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.SerialExecutor.execute(SerialExecutor.java:68) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.ServiceImpl.calculateStateChanges(ServiceImpl.java:147) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.ServiceImpl.start(ServiceImpl.java:257) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.DependencyManager.add(DependencyManager.java:56) 23:31:55,562 ERROR [STDERR] at nl.gx.webmanager.wcb.foundation.ComponentBundleActivatorBase.init(ComponentBundleActivatorBase.java:70) 23:31:55,562 ERROR [STDERR] at org.apache.felix.dependencymanager.DependencyActivatorBase.start(DependencyActivatorBase.java:76) 23:31:55,562 ERROR [STDERR] at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:589) 23:31:55,562 ERROR [STDERR] at org.apache.felix.framework.Felix.startBundle(Felix.java:1458) 23:31:55,562 ERROR [STDERR] at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:774) 23:31:55,562 ERROR [STDERR] at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:755) 23:31:55,562 ERROR [STDERR] at nl.gx.webmanager.services.bundlemanager.service.impl.BundleManager.internalStart(BundleManager.java:825) 23:31:55,562 ERROR [STDERR] at nl.gx.webmanager.services.bundlemanager.service.impl.BundleManager.resolveAndStart(BundleManager.java:534) 23:31:55,562 ERROR [STDERR] at nl.gx.webmanager.services.bundlemanager.service.impl.BundleManager.handleStateChanges(BundleManager.java:516) 23:31:55,562 ERROR [STDERR] at nl.gx.webmanager.services.bundlemanager.service.impl.BundleManager.updateBundle(BundleManager.java:425) 23:31:55,562 ERROR [STDERR] at nl.gx.webmanager.services.bundlemanager.service.impl.BundleManager.createBundle(BundleManager.java:399) 23:31:55,562 ERROR [STDERR] at nl.gx.webmanager.services.bundlemanager.service.impl.BundleManager.createBundleFromCachedBundle(BundleManager.java:678) 23:31:55,562 ERROR [STDERR] at nl.gx.webmanager.services.bundlemanager.service.impl.BundleManager.synchronizeBundle(BundleManager.java:655) 23:31:55,562 ERROR [STDERR] at nl.gx.webmanager.services.bundlemanager.service.impl.BundleManager.synchronizeBundleState(BundleManager.java:630) 23:31:55,562 ERROR [STDERR] at nl.gx.webmanager.services.bundlemanager.service.impl.BundleManager.frameworkEvent(BundleManager.java:340) 23:31:55,562 ERROR [STDERR] at org.apache.felix.framework.util.EventDispatcher.invokeFrameworkListenerCallback(EventDispatcher.java:738) 23:31:55,562 ERROR [STDERR] at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:696) 23:31:55,562 ERROR [STDERR] at org.apache.felix.framework.util.EventDispatcher.run(EventDispatcher.java:900) 23:31:55,562 ERROR [STDERR] at org.apache.felix.framework.util.EventDispatcher.access$000(EventDispatcher.java:50) 23:31:55,562 ERROR [STDERR] at org.apache.felix.framework.util.EventDispatcher$1.run(EventDispatcher.java:102) 23:31:55,562 ERROR [STDERR] at java.lang.Thread.run(Thread.java:619) 23:31:55,562 ERROR [STDERR] Caused by: org.hibernate.exception.SQLGrammarException: Cannot open connection 23:31:55,562 ERROR [STDERR] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67) 23:31:55,562 ERROR [STDERR] at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) 23:31:55,562 ERROR [STDERR] at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29) 23:31:55,562 ERROR [STDERR] at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426) 23:31:55,562 ERROR [STDERR] at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144) 23:31:55,562 ERROR [STDERR] at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:95) 23:31:55,562 ERROR [STDERR] at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.prepare(IdentityGenerator.java:69) 23:31:55,562 ERROR [STDERR] at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:30) 23:31:55,562 ERROR [STDERR] at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2158) 23:31:55,562 ERROR [STDERR] at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2638) 23:31:55,562 ERROR [STDERR] at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48) 23:31:55,562 ERROR [STDERR] at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250) 23:31:55,562 ERROR [STDERR] at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298) 23:31:55,562 ERROR [STDERR] at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181) 23:31:55,562 ERROR [STDERR] at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107) 23:31:55,562 ERROR [STDERR] at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187) 23:31:55,562 ERROR [STDERR] at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172) 23:31:55,562 ERROR [STDERR] at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94) 23:31:55,562 ERROR [STDERR] at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70) 23:31:55,562 ERROR [STDERR] at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507) 23:31:55,562 ERROR [STDERR] at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499) 23:31:55,562 ERROR [STDERR] at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:495) 23:31:55,562 ERROR [STDERR] at org.springframework.orm.hibernate3.HibernateTemplate$16.doInHibernate(HibernateTemplate.java:747) 23:31:55,562 ERROR [STDERR] at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419) 23:31:55,562 ERROR [STDERR] ... 67 more 23:31:55,562 ERROR [STDERR] Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot open database "JCRRepository" requested by the login. The login failed. 23:31:55,562 ERROR [STDERR] at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source) 23:31:55,562 ERROR [STDERR] at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source) 23:31:55,562 ERROR [STDERR] at com.microsoft.sqlserver.jdbc.SQLServerConnection.processLogon(Unknown Source) 23:31:55,562 ERROR [STDERR] at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(Unknown Source) 23:31:55,562 ERROR [STDERR] at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source) 23:31:55,562 ERROR [STDERR] at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source) 23:31:55,562 ERROR [STDERR] at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source) 23:31:55,562 ERROR [STDERR] at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source) 23:31:55,562 ERROR [STDERR] at java.sql.DriverManager.getConnection(DriverManager.java:582) 23:31:55,562 ERROR [STDERR] at java.sql.DriverManager.getConnection(DriverManager.java:154) 23:31:55,562 ERROR [STDERR] at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:174) 23:31:55,562 ERROR [STDERR] at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:165) 23:31:55,562 ERROR [STDERR] at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:149) 23:31:55,562 ERROR [STDERR] at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:119) 23:31:55,562 ERROR [STDERR] at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:82) 23:31:55,562 ERROR [STDERR] at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423) 23:31:55,562 ERROR [STDERR] ... 87 more
The root cause seems to be:
"com.microsoft.sqlserver.jdbc.SQLServerException: Cannot open database "JCRRepository" requested by the login. The login failed. 23:31:55,562 ERROR [STDERR] at "
Are you able to manually login to the database?
精彩评论