SQL 예외:jdbc:oracle:thin:@//localhost:1521/orcl에 적합한 드라이버를 찾을 수 없습니다.
어플리케이션을 하려고 합니다.Oracle
eb 서비스 클래스의 데이터베이스를 사용하지만 다음과 같은 문제가 발생했습니다.
SQLException: No suitable driver found for jdbc:oracle:thin:@//localhost:1521/orcl
나는 가지고 있습니다.ojdbc6.jar
수업 경로에서 그리고 나는 또한 이것을 확인했습니다.JBoss
배포 폴더.
어플 ㅠㅠㅠㅠEAR
는 로구니다됩으로 되어 있습니다.WAR
이것에 무슨 문제가 있습니까?제발 도와주세요.
persistence.xml의 연결 URL:
> "jdbc:oracle:thin:@//localhost:1521/orcl"
스택 추적:
16:06:32,687 WARN [com.arjuna.ats.arjuna] (default-workqueue-1) ARJUNA012125: TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple< 0:ffffc0a80106:-3e8b2d6f:5037338f:15, org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization@4d1082 >: javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: Could not open connection
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1361) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
at
Caused by: java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@//localhost:1521/orcl
at java.sql.DriverManager.getConnection(DriverManager.java:602) [rt.jar:1.6.0_26]
at java.sql.DriverManager.getConnection(DriverManager.java:154) [rt.jar:1.6.0_26]
at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.getConnection(DriverManagerConnectionProviderImpl.java:173) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:276) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:297) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
... 70 more
16:06:32,796 ERROR [org.jboss.ejb3.invocation] (default-workqueue-1) JBAS014134: EJB Invocation failed on component CreditcardFacade for method public abstract void com.peter.ejb.CreditcardFacadeLocal.addCreditCard(com.peter.entity.Creditcard): javax.ejb.EJBTransactionRolledbackException: Transaction rolled back
at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleEndTransactionException(CMTTxInterceptor.java:115) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:95) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:232) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:32) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:173) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at com.peter.ejb.CreditcardFacadeLocal$$$view2.addCreditCard(Unknown Source) [classes:]
com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)
at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:164)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
... 46 more
Caused by: org.hibernate.exception.JDBCConnectionException: Could not open connection
at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:131) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:304) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:169) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.extractPhysicalConnection(ConnectionProxyHandler.java:82) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.continueInvocation(ConnectionProxyHandler.java:138) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at $Proxy96.prepareStatement(Unknown Source) at org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.buildBatchStatement(AbstractBatchImpl.java:144) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.getBatchStatement(AbstractBatchImpl.java:127) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2827) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3290) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:80) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:272) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:264) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:186) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:326) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1081) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:315) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:104) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
... 52 more
Caused by: java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@//localhost:1521/orcl
at java.sql.DriverManager.getConnection(DriverManager.java:602) [rt.jar:1.6.0_26]
at java.sql.DriverManager.getConnection(DriverManager.java:154) [rt.jar:1.6.0_26]
at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.getConnection(DriverManagerConnectionProviderImpl.java:173) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:276) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:297) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
... 70 more
16:06:32,953 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (default-workqueue-1) Application {http://service.peter.com/}CreditCardServiceService#{http://service.peter.com/}addCreditCard has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault: Transaction rolled back
at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155) [cxf-2.4.1.jar:2.4.1]
at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:86) [cxf-2.4.1.jar:2.4.1]
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:121) [cxf-2.4.1.jar:2.4.1]
at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:61) [cxf-2.4.1.jar:2.4.1]
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75) [cxf-2.4.1.jar:2.4.1]
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) [cxf-2.4.1.jar:2.4.1]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [rt.jar:1.6.0_26]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0_26]
at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0_26]
at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) [cxf-2.4.1.jar:2.4.1]
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106) [cxf-2.4.1.jar:2.4.1]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) [cxf-2.4.1.jar:2.4.1]
at org.apache.cxf.phase.PhaseInterceptorChain.resume(PhaseInterceptorChain.java:232) [cxf-2.4.1.jar:2.4.1]
at org.apache.cxf.interceptor.OneWayProcessorInterceptor$1.run(OneWayProcessorInterceptor.java:109) [cxf-2.4.1.jar:2.4.1]
at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$2.run(AutomaticWorkQueueImpl.java:332) [cxf-2.4.1.jar:2.4.1]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26]
at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]
Caused by: javax.ejb.EJBTransactionRolledbackException: Transaction rolled back
at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleEndTransactionException(CMTTxInterceptor.java:115) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:95) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:232) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:32) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:173) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]
at com.peter.ejb.CreditcardFacadeLocal$$$view2.addCreditCard(Unknown Source) [classes:]
at com.peter.service.CreditCardService.addCreditCard(CreditCardService.java:56) [classes:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_26]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_26]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_26]
at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_26]
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173) [cxf-2.4.1.jar:2.4.1]
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89) [cxf-2.4.1.jar:2.4.1]
... 15 more
Caused by: javax.transaction.RollbackException: ARJUNA016053: Could not commit transaction.
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1177)
at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117)
at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:92) [jboss-as-ejb3-7.1.1.Final.jar:7.1.1.Final]
... 43 more
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: Could not open connection
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1361) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1289) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1295) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.ejb.AbstractEntityManagerImpl$CallbackExceptionMapperImpl.mapManagedFlushFailure(AbstractEntityManagerImpl.java:1481) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:109) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:53) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)
at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:164)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
... 46 more
Caused by: org.hibernate.exception.JDBCConnectionException: Could not open connection
at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:131) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:304) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:169) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.extractPhysicalConnection(ConnectionProxyHandler.java:82) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.continueInvocation(ConnectionProxyHandler.java:138) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at $Proxy96.prepareStatement(Unknown Source) at org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.buildBatchStatement(AbstractBatchImpl.java:144) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.getBatchStatement(AbstractBatchImpl.java:127) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2827) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3290) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:80) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:272) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:264) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:186) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:326) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1081) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:315) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:104) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
... 52 more
Caused by: java.sql.SQLException: No suitable driver found for jdbc:oracle:thin:@//localhost:1521/orcl
at java.sql.DriverManager.getConnection(DriverManager.java:602) [rt.jar:1.6.0_26]
at java.sql.DriverManager.getConnection(DriverManager.java:154) [rt.jar:1.6.0_26]
at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.getConnection(DriverManagerConnectionProviderImpl.java:173) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:276) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:297) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
... 70 more
Oracle 데이터베이스 버전: 11.2.0.
드라이버 버전이 데이터베이스 버전과 일치해야 합니까?
편집:
프로그램이 드라이버를 로드하는 파일 경로를 추적하는 방법은 무엇입니까?이것은 근본 원인을 찾는 데 도움이 됩니다.감사해요.
ojdbc6-g 로깅을 활성화하는 방법은 무엇입니까?저는 이 오라클을 따르려고 노력합니다.JDBC 하지만 어떻게 완성해야 할지 모르겠습니다.Java 시스템 속성을 글로벌하게 설정하는 방법은 무엇입니까?저는 환경 변수가 좋은 선택이 아닐 수도 있다는 것을 알고 있습니다.다른 생각은?-Doracle.jdbc를 추가하고 싶습니다.Trace=true 및 -Djava.util.logging.config.이 Java를 사용할 때 파일을 jvm에 생성합니다.시작하는 동안 오라클 데이터베이스를 설정합니까?
최대 절전 모드 로깅을 활성화하는 방법은 무엇입니까?
Hibernate-4.1.1과 JBoss 7.1을 사용하고 있습니다.
제발 도와주세요.
감사해요.
는 "ojdbc.jar"에 .CLASSPATH
응용 프로그램 서버의.
어떤 애플리케이션 서버인지만 알려주시면 드라이버를 어디에 배치해야 하는지 알려드리겠습니다.
편집: 태그 jboss를 보고 폴더에 넣어야 합니다."$JBOSS_HOME/server/default/lib/"
"운전자 은 보통 " 없음"을 JDBC
연결하기 위해 제공한 URL에 구문이 잘못되었거나 드라이버가 전혀 로드되지 않은 경우.
되면 getConnection이 됩니다.DriverManager
초기화 시 로드된 드라이버와 현재 애플릿 또는 응용 프로그램과 동일한 클래스 로더를 사용하여 명시적으로 로드된 드라이버 중에서 적합한 드라이버를 찾습니다.(사용)Class.forName()
)
예를들면
import oracle.jdbc.driver.OracleDriver;
Class.forName("oracle.jdbc.driver.OracleDriver");
또한 당신이 가지고 있는 것을 확인하세요.ojdbc6.jar
당신의 수업 경로에서.제가 제안하고 싶은 장소는.jar
JBoss의 "$JBOSS_HOME/server/default/lib/"
프로젝트의 디렉터리입니다.
편집:
은 말하신대로를 했습니다.hibernate
최근에.
다음 항목을 확인합니다.hibernate.cfg.xml
파일에 다음과 같은 연결 속성이 있습니다.
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:orcl</property>
<property name="hibernate.connection.username">scott</property>
<property name="hibernate.connection.password">tiger</property>
때때로 그것은 간단한 것들입니다.저의 경우, URL이 잘못되었습니다.저는 앳 마크(@) 앞에 결장을 빠뜨렸습니다.저는 "jdbc:oracle:thin:@/localhost" 대신 "jdbc:oracle@/localhost"를 먹었습니다. 이것이 이 문제에 대해 다른 사람에게 도움이 되기를 바랍니다.
저는 다음과 같은 잘못된 URL을 입력했습니다.orcl
대신에 만jdbc:oracle:thin:@//localhost:1521/orcl
먼저, 서버(JBoss) 내에서 Java EE 6으로 애플리케이션을 개발하는 경우에는 DataSource를 사용하는 것이 좋습니다.그런 다음 이 데이터 원본에서 연결을 가져올 수 있습니다.연결 풀을 사용하는 것이 좋습니다.
그러면 JBoss AS 7부터는 JDBC 드라이버를 모듈로 선언해야 합니다.여기에 설명되어 있습니다.
OJDBC 6(11.x)의 경우 드라이버 이름은 "oracle.jdbc"여야 합니다.Oracle Driver"SPI 모드에 등록된 이름입니다(이 파일의 내용: META-INF/services/java.sql 참조).드라이버).
Java 6 및 JDBC 4.0 이후 JDBC 드라이버는 자동으로 등록됩니다.
마지막으로 JBoss: DataSource 구성 내에서 DataSource를 선언해야 합니다.
참조:
이와 같이 하라
set classpath=%classpath%(ur jarfile);
JDBC 드라이버를 다운로드하여 라이브러리에 추가합니다.다운로드 링크 http://www.oracle.com/technetwork/apps-tech/jdbc-112010-090769.html
저 또한 같은 문제에 직면하고 있었습니다.저는 필요한 병도 모두 가지고 있었습니다.
하지만 추가한 후에.
Class.forName("oracle.jdbc.driver.OracleDriver");
그것은 나에게 효과가 있었다.
package com.jdbc;
import java.sql.Connection;
import java.sql.DriverManager;
public class TestJdbc {
public static void main(String[] args) {
String url = "jdbc:oracle:thin:@127.0.0.1:1521:xe";
String user ="SYSTEM";
String password = "root";
try {
System.out.println("Connecting to DAtabase");
Class.forName("oracle.jdbc.driver.OracleDriver"); /*added this line*/
Connection connection = DriverManager.getConnection(url, user, password);
System.out.println( connection.toString());
System.out.println("Connection Success");
} catch (Exception e) {
e.printStackTrace();
}
}
}
참고: JDK 8을 사용하는 경우 OJDBC14 대신 OJDBC8을 사용하면 Class.forName도 추가할 필요가 없습니다.
저도 같은 문제가 있었습니다.Jboss 7 AS에서 수정하기 위해 Oracle driver jar 파일을 Jboss 모듈 폴더에 복사합니다.예:../jboss-as-7.1.1.Final/modules/org/hibernate/main
.
또한 "module.xml"을 변경해야 합니다.
<module xmlns="urn:jboss:module:1.1" name="org.hibernate">
<resources>
<resource-root path="hibernate-core-4.0.1.Final.jar"/>
<resource-root path="hibernate-commons-annotations-4.0.1.Final.jar"/>
<resource-root path="hibernate-entitymanager-4.0.1.Final.jar"/>
<resource-root path="hibernate-infinispan-4.0.1.Final.jar"/>
<resource-root path="ojdbc6.jar"/>
</resources>
<dependencies>
<module name="asm.asm"/>
<module name="javax.api"/>
<module name="javax.persistence.api"/>
<module name="javax.transaction.api"/>
<module name="javax.validation.api"/>
<module name="org.antlr"/>
<module name="org.apache.commons.collections"/>
<module name="org.dom4j"/>
<module name="org.infinispan" optional="true"/>
<module name="org.javassist"/>
<module name="org.jboss.as.jpa.hibernate" slot="4" optional="true"/>
<module name="org.jboss.logging"/>
<module name="org.hibernate.envers" services="import" optional="true"/>
</dependencies>
또한 동일한 오류가 발생하여 먼저 Oracle URL이 jdbc:oracle:thin:@localhost:1521:xe와 동일하거나 그렇지 않습니다.
그런 다음 OJDBC6.jar에 프로젝트 수준에서 경로를 빌드할 수 있으며 Tomcat으로 작업하는 경우 이 jar를 WEB-INF/lib 폴더에 복사할 수도 있습니다.
Class.forName("oracle.jdbc.driver")도 사용합니다.OracleDriver"); 드라이버 클래스를 명시적으로 로드합니다.
이전 경로를 변경했습니다. jdbc:filename:thin:@localhost:1521:orcl
새로 만들기: jdbc:hostname:thin:@//localhost:1521/orcl
그리고 그것은 나에게 효과가 있었습니다... 만세!!이미지
언급URL : https://stackoverflow.com/questions/12103369/sqlexception-no-suitable-driver-found-for-jdbcoraclethin-localhost1521-or
'programing' 카테고리의 다른 글
여러 스레드가 동일한 메모리에 액세스하지 않도록 하여 잠금을 방지할 수 있습니까? (0) | 2023.06.09 |
---|---|
엑셀 파일을 열 때 계산 모드를 수동으로 설정하는 방법은 무엇입니까? (0) | 2023.06.09 |
Check if all items are the same in a List (0) | 2023.06.04 |
What does @@variable mean in Ruby? (0) | 2023.06.04 |
How to increase request timeout in IIS? (0) | 2023.06.04 |