我正在尝试连接到绑定到Cloud Foundry中的Spring启动应用程序的postgres服务。但是当我将代码部署到CF时,我一直低于错误。有时我能连接但是,80%的时间我一直低于错误。有什么建议吗?
ERR Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
ERR at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:62)
ERR at java.lang.Thread.run(Thread.java:745)
ERR Caused by: java.lang.reflect.InvocationTargetException
ERR at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
ERR at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
ERR at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
ERR at java.lang.reflect.Method.invoke(Method.java:498)
ERR at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:54)
ERR ... 1 more
ERR Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [META-INF/applicationContext.xml]: Invocation of init method failed; nested exception is <openjpa-2.4.0-r42
ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
ERR at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
ERR at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
ERR at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
ERR at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
ERR at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1054)
ERR at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:829)
ERR at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
ERR at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
ERR at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766)
ERR at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361)
ERR at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
ERR at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
ERR at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
ERR at com.ge.og.poa.vmap.Application.main(Application.java:42)
ERR ... 6 more
ERR Caused by: <openjpa-2.4.0-r422266:1674604 fatal user error> org.apache.openjpa.persistence.ArgumentException: Could not invoke the static newInstance method on the named factory class "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".
ERR at org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(Bootstrap.java:76)
ERR at org.apache.openjpa.persistence.PersistenceProviderImpl.getBrokerFactory(PersistenceProviderImpl.java:149)
ERR at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:191)
ERR at org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:63)
ERR at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:343)
ERR at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:319)
ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
ERR at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
ERR ... 22 more
ERR Caused by: <openjpa-2.4.0-r422266:1674604 fatal general error> org.apache.openjpa.persistence.PersistenceException: Driver:org.postgresql.Driver@1ed0e7b0 returned null for URL:undefined
ERR at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:106)
ERR at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:603)
ERR at org.apache.openjpa.jdbc.meta.MappingRepository.endConfiguration(MappingRepository.java:1518)
ERR at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:533)
ERR at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:458)
ERR at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:121)
ERR at org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
ERR at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
ERR at org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:967)
ERR at org.apache.openjpa.conf.OpenJPAConfigurationImpl.getMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:958)
ERR at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly(AbstractBrokerFactory.java:642)
ERR at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:202)
ERR at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:184)
ERR at org.apache.openjpa.kernel.AbstractBrokerFactory.postCreationCallback(AbstractBrokerFactory.java:872)
ERR at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.postCreationCallback(JDBCBrokerFactory.java:105)
ERR at org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(Bootstrap.java:67)
ERR ... 29 more
ERR Caused by: java.sql.SQLException: Driver:org.postgresql.Driver@1ed0e7b0 returned null for URL:undefined
ERR at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:326)
ERR at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:200)
ERR at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:708)
ERR at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:642)
ERR at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:464)
ERR at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:141)
ERR at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:115)
ERR at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:102)
ERR at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:126)
ERR at org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:110)
ERR at org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:86)
ERR at org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:90)
ERR ... 44 more