wake-up-neo.net

SQLException: Kein passender Treiber gefunden für jdbc: Oracle: thin: @ // localhost: 1521/orcl

Ich versuche, eine Java EE-Anwendung zu entwickeln, die eine Verbindung zu einer Oracle-Datenbank von der eb-Serviceklasse herstellt, aber ich stoße auf eine 

SQLException: No suitable driver found for jdbc:Oracle:thin:@//localhost:1521/orcl

Ich habe den ojdbc6.jar im Klassenpfad und habe dies auch im Bereitstellungsordner JBoss überprüft. 

Meine Anwendung EAR besteht aus einer WAR. Was ist daran falsch? Bitte helfen 

Verbindungs-URL in persistence.xml: 

> "jdbc:Oracle:thin:@//localhost:1521/orcl"

Stapelverfolgung: 

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[email protected]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-Datenbankversion: 11.2.0. 

Muss die Treiberversion mit der Datenbankversion übereinstimmen?

BEARBEITEN:

  1. Wie kann ich nachverfolgen, von welchem ​​Dateipfad das Programm den Treiber lädt? Dies hilft mir, die Ursache zu finden. Vielen Dank.

  2. Wie kann ich die Protokollierung von ojdbc6-g aktivieren? Es wird versucht, Folgendes zu folgen: Oracle_JDBC Ich weiß jedoch nicht, wie ich es abschließen soll. So legen Sie die Java-Systemeigenschaft global fest: Ich weiß, dass die Umgebungsvariable keine gute Wahl ist. Irgendeine andere Idee? Ich möchte einfach -Doracle.jdbc.Trace = true und -Djava.util.logging.config.file zur jvm-Erstellung hinzufügen, wenn Sie dieses Java verwenden. Ist die Oracle-Datenbank während des Startvorgangs eingerichtet?

  3. Wie aktiviere ich die Protokollierung im Ruhezustand? 

  4. Ich verwende Hibernate-4.1.1 und JBoss 7.1.

Bitte helfen 

Vielen Dank. 

20
nicholas

Die "ojdbc.jar" befindet sich nicht in der CLASSPATH Ihres Anwendungsservers.

Sagen Sie uns einfach, um welchen Anwendungsserver es sich handelt, und wir werden Ihnen sagen, wo der Treiber platziert werden soll.

Edit: Ich habe das Tag jboss gesehen. Es muss also im Ordner "$JBOSS_HOME/server/default/lib/" abgelegt werden.

19
user1593705

"Kein geeigneter Treiber" bedeutet normalerweise, dass die JDBC URL, die Sie für die Verbindung angegeben haben, eine falsche Syntax aufweist oder der Treiber überhaupt nicht geladen ist.

Wenn die Methode getConnection aufgerufen wird, versucht DriverManager, einen geeigneten Treiber unter den Treibern zu finden, die bei der Initialisierung geladen wurden, und unter denen, die explizit mit demselben Klassenladeprogramm wie das aktuelle Applet oder die aktuelle Anwendung geladen wurden (mit Class.forName()).

Zum Beispiel

import Oracle.jdbc.driver.OracleDriver;

Class.forName("Oracle.jdbc.driver.­OracleDriver");

Überprüfen Sie auch, ob Sie ojdbc6.jar in Ihrem Klassenpfad haben. Ich würde vorschlagen, .jar am physischen Standort des JBoss "$JBOSS_HOME/server/default/lib/" -Verzeichnisses Ihres Projekts abzulegen.

BEARBEITEN:

Sie haben in letzter Zeit hibernate erwähnt.

Überprüfen Sie, ob Ihre hibernate.cfg.xml -Datei Verbindungseigenschaften wie diese aufweist:

<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>
7
Hardik Mishra

Manchmal sind es die einfachen Dinge. In meinem Fall hatte ich eine ungültige URL. Ich hatte einen Doppelpunkt vor dem at-Zeichen (@) . Ich hatte "jdbc: Oracle: thin @ // localhost" anstelle von "jdbc: Oracle: thin: @ // localhost". Hoffe, das hilft jemand anderem bei diesem Problem.

3
Rick Ryker

Für mich habe ich eine ungültige URL eingegeben: orcl nur anstelle von jdbc:Oracle:thin:@//localhost:1521/orcl

2
Thomas

mach das so

set classpath=%classpath%(ur jarfile);
1
Abhinai

Laden Sie den JDBC-Treiber herunter und fügen Sie ihn in Bibliotheken ein . Download-Link http://www.Oracle.com/technetwork/apps-tech/jdbc-112010-090769.html

0
Vazgen Torosyan

Wenn Sie eine Anwendung mit Java EE 6 auf einem Server (JBoss) entwickeln,..., Sollten Sie eine DataSource verwenden. Dann können Sie die Verbindung von dieser DataSource erhalten. Es ist besser, Verbindungspools zu verwenden.

Ab JBoss AS 7 muss dann der JDBC-Treiber als Modul ..__ deklariert werden. Dies wird hier beschrieben.

Bei OJDBC 6 (11.x) sollte der Name des Treibers "Oracle.jdbc.OracleDriver" ..__ sein. Dies ist der im Modus SPI registrierte Name (siehe Inhalt dieser Datei: META -INF/services/Java.sql.Driver).
Seit Java 6 und JDBC 4.0 sind die JDBC-Treiber automatisch registriert.

Schließlich müssen Sie in JBoss eine DataSource deklarieren: DataSource-Konfiguration .

Verweise :

  • Herstellen einer Verbindung ( link ) (JDBC 4.0 <=> Java 6)
  • JDBC 4.0-Erweiterungen in Java SE 6> Automatisches Laden des JDBC-Treibers ( link )
0
Guillaume Husta