SQLException - 没有为jdbc:postgresql找到合适的驱动程序

时间:2018-03-12 03:43:03

标签: java postgresql jpa java-ee persistence.xml

我有问题。我创建了具有Persistence.xml凭据的EntityManager但是我给出了消息错误“找不到适合的jdbc驱动程序:postgresql / localhost:9999 / DB”。

我不明白我做错了什么,请你帮我或者给我一些如何解决这个问题的建议。提前谢谢。

我使用的配置是:

的persistence.xml:

    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
                      http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
             version="2.0">
  <persistence-unit name="DB-dev">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <class>com.development.rrhh.model.entity.entity1</class>
    <class>com.development.rrhh.model.entity.entity2</class>
    ...
    <properties>
      <property name="hibernate.connection.driver_class" value="org.postgresql.Driver" />
      <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
      <property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/DB_RRHH" />
      <property name="hibernate.connection.username" value="developer" />
      <property name="hibernate.connection.password" value="deve.951741" />
      <property name="hibernate.show_sql" value="true"/>
    </properties>
  </persistence-unit>
</persistence>

的pom.xml

<project ...>
    <dependencies>
        ...
        <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <version>9.4.1212.jre7</version>
    </dependency>
    <dependency>
      <groupId>org.hibernate.javax.persistence</groupId>
      <artifactId>hibernate-jpa-2.0-api</artifactId>
      <version>LATEST</version>
    </dependency>
       ....
    </dependencies>
</project>

JPAUtility.java

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class JPAUtility {

  private static final EntityManagerFactory EMF;

  static {
    EMF = Persistence.createEntityManagerFactory("DB-dev");
  }

  public static EntityManager getEntityManager() {
    return EMF.createEntityManager();
  }

  public static void close() {
    EMF.close();
  }

}

JBoss日志错误:

22:55:52,806 INFO  [org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl] (http-localhost-127.0.0.1-8080-3) HHH000402: Using Hibernate built-in connection pool (not for production use!)
22:55:52,811 INFO  [org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl] (http-localhost-127.0.0.1-8080-3) HHH000115: Hibernate connection pool size: 20
22:55:52,815 INFO  [org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl] (http-localhost-127.0.0.1-8080-3) HHH000006: Autocommit mode: true
22:55:52,818 INFO  [org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl] (http-localhost-127.0.0.1-8080-3) HHH000401: using driver [org.postgresql.Driver] at URL [jdbc:postgresql://localhost:5432/DB_RRHH]
22:55:52,821 INFO  [org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl] (http-localhost-127.0.0.1-8080-3) HHH000046: Connection properties: {user=developer, password=****, autocommit=true, release_mode=auto}
22:55:52,826 WARN  [org.hibernate.engine.jdbc.internal.JdbcServicesImpl] (http-localhost-127.0.0.1-8080-3) HHH000342: Could not obtain connection to query metadata : No suitable driver found for jdbc:postgresql://localhost:5432/DB_RRHH
22:55:52,830 INFO  [org.hibernate.dialect.Dialect] (http-localhost-127.0.0.1-8080-3) HHH000400: Using dialect: org.hibernate.dialect.PostgreSQLDialect
22:55:52,832 INFO  [org.hibernate.engine.jdbc.internal.LobCreatorBuilder] (http-localhost-127.0.0.1-8080-3) HHH000422: Disabling contextual LOB creation as connection was null
22:55:52,835 INFO  [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (http-localhost-127.0.0.1-8080-3) HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionFactory
22:55:52,838 INFO  [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (http-localhost-127.0.0.1-8080-3) HHH000397: Using ASTQueryTranslatorFactory
22:55:52,863 WARN  [org.hibernate.ejb.internal.EntityManagerFactoryRegistry] (http-localhost-127.0.0.1-8080-3) HHH000436: Entity manager factory name (development-dev-test) is already registered.  If entity manager will be clustered or passivated, specify a unique value for property 'hibernate.ejb.entitymanager_factory_name'
22:55:52,868 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-localhost-127.0.0.1-8080-3) SQL Error: 0, SQLState: 08001
22:55:52,869 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-localhost-127.0.0.1-8080-3) No suitable driver found for jdbc:postgresql://localhost:5432/DB_RRHH
22:55:52,872 INFO  [org.hibernate.event.internal.DefaultLoadEventListener] (http-localhost-127.0.0.1-8080-3) HHH000327: Error performing load command : org.hibernate.exception.JDBCConnectionException: Could not open connection
22:55:52,875 ERROR [org.jboss.ejb3.invocation] (http-localhost-127.0.0.1-8080-3) JBAS014134: EJB Invocation failed on component UsuarioImpl for method public abstract com.development.rrhh.model.entity.Usuario com.development.rrhh.core.serv.UsuarioServ.find(java.lang.String) throws com.development.rrhh.exceptions.ServiceException: javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: Could not open connection
  at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:166) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]
  at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:230) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]
  at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:304) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]
  at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:190) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.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.0.Final.jar:7.1.0.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.0.Final.jar:7.1.0.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.0.Final.jar:7.1.0.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.0.Final.jar:7.1.0.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.0.Final.jar:7.1.0.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.0.Final.jar:7.1.0.Final]
  at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:173) [jboss-as-ee-7.1.0.Final.jar:7.1.0.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.0.Final.jar:7.1.0.Final]
  at com.development.rrhh.core.serv.UsuarioServ$$$view102.find(Unknown Source) [development-rrhh-core-1.0.0.jar:]
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_80]
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_80]
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_80]
  at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_80]
  at org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:508) [wicket-ioc-7.9.0.jar:7.9.0]
  at com.sun.proxy.$Proxy57.find(Unknown Source)
  at com.development.rrhh.session.SignIn$SignInForm.loadUser(SignIn.java:85) [classes:]
  at com.development.rrhh.session.SignIn$SignInForm.onSubmit(SignIn.java:56) [classes:]
  at org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1316) [wicket-core-7.9.0.jar:7.9.0]
  at org.apache.wicket.markup.html.form.Form.process(Form.java:976) [wicket-core-7.9.0.jar:7.9.0]
  at org.apache.wicket.markup.html.form.StatelessForm.process(StatelessForm.java:100) [wicket-core-7.9.0.jar:7.9.0]
  at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:797) [wicket-core-7.9.0.jar:7.9.0]
  at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:708) [wicket-core-7.9.0.jar:7.9.0]
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_80]
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_80]
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_80]
  at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_80]
  at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:258) [wicket-core-7.9.0.jar:7.9.0]
  at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:216) [wicket-core-7.9.0.jar:7.9.0]
  at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:241) [wicket-core-7.9.0.jar:7.9.0]
  at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234) [wicket-core-7.9.0.jar:7.9.0]
  at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:895) [wicket-core-7.9.0.jar:7.9.0]
  at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64) [wicket-request-7.9.0.jar:7.9.0]
  at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:265) [wicket-core-7.9.0.jar:7.9.0]
  at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:222) [wicket-core-7.9.0.jar:7.9.0]
  at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:293) [wicket-core-7.9.0.jar:7.9.0]
  at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:261) [wicket-core-7.9.0.jar:7.9.0]
  at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:203) [wicket-core-7.9.0.jar:7.9.0]
  at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:284) [wicket-core-7.9.0.jar:7.9.0]
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.10.Final.jar:]
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.10.Final.jar:]
  at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.0.Final.jar:7.1.0.Final]
  at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:154) [jboss-as-web-7.1.0.Final.jar:7.1.0.Final]
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.10.Final.jar:]
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.10.Final.jar:]
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.10.Final.jar:]
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.10.Final.jar:]
  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.10.Final.jar:]
  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.10.Final.jar:]
  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.10.Final.jar:]
  at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_80]
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.find(AbstractEntityManagerImpl.java:816) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
  at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:770) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
  at com.development.rrhh.core.impl.UsuarioImpl.find(UsuarioImpl.java:53) [development-rrhh-core-1.0.0.jar:]
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_80]
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_80]
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_80]
  at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_80]
  at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee-7.1.0.Final.jar:7.1.0.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.InterceptorContext$Invocation.proceed(InterceptorContext.java:374) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
  at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:127) [jboss-as-weld-7.1.0.Final.jar:7.1.0.Final]
  at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:135) [jboss-as-weld-7.1.0.Final.jar:7.1.0.Final]
  at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36) [jboss-as-ee-7.1.0.Final.jar:7.1.0.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.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
  at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36) [jboss-as-ee-7.1.0.Final.jar:7.1.0.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.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47) [jboss-as-jpa-7.1.0.Final.jar:7.1.0.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.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:84) [jboss-as-weld-7.1.0.Final.jar:7.1.0.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.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation-1.1.1.Final.jar:1.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.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee-7.1.0.Final.jar:7.1.0.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.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.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.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228) [jboss-as-ejb3-7.1.0.Final.jar:7.1.0.Final]
  ... 63 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 com.sun.proxy.$Proxy55.prepareStatement(Unknown Source)
  at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:147) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
  at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:166) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
  at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:145) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
  at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1739) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
  at org.hibernate.loader.Loader.doQuery(Loader.java:828) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
  at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:289) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
  at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
  at org.hibernate.loader.Loader.loadEntity(Loader.java:2058) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
  at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:82) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
  at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:72) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
  at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3697) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
  at org.hibernate.event.internal.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:439) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
  at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:420) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
  at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:204) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
  at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:251) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
  at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:148) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
  at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:954) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
  at org.hibernate.internal.SessionImpl.get(SessionImpl.java:870) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
  at org.hibernate.internal.SessionImpl.get(SessionImpl.java:863) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
  at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:795) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
  ... 91 more
Caused by: java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost:5432/DB_RRHH
  at java.sql.DriverManager.getConnection(DriverManager.java:596) [rt.jar:1.7.0_80]
  at java.sql.DriverManager.getConnection(DriverManager.java:187) [rt.jar:1.7.0_80]
  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]
  ... 116 more

我正在使用:Java 1.7,Jee7,JBoss 7.1.0 Final,Posgresql 9.5,Maven 3.3.9和Wicket 7.9(尽管后者与问题无关)。

感谢您的时间

1 个答案:

答案 0 :(得分:0)

您需要将DriverC Description Liabilities Payment Date ----------------------------------------------------------- D001 form A to B 40.00 8/3 D002 form C to D 30.00 11/3 添加到jar服务器的classpath。有一个名为jboss的目录,您可以放置​​您的罐子。这可能会有所帮助:Install a Module in jBoss