2015-05-09 146 views
0

我运行简单的OpenShift实例与WildFly应用和PostgreSQL不断得到 Caused by: org.postgresql.util.PSQLException: Connection rejected: could not fork new process for connection: Resource temporarily unavailableWildFly不能派生新进程连接

,我在我的server.log我观察

我怎样才能解决这个问题?应用程序试图连接Postgre并获得线程

我的persistence.xml

<?xml version="1.0" encoding="UTF-8"?> 
<persistence version="2.1" 
      xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:schemaLocation=" 
     http://xmlns.jcp.org/xml/ns/persistence 
     http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> 
    <persistence-unit name="primary"> 
     <!-- The datasource is deployed as WEB-INF/tp-ds.xml, you 
      can find it in the source at src/main/webapp/WEB-INF/tp-ds.xml --> 
     <jta-data-source>java:jboss/datasources/PostgreSQLDS</jta-data-source> 
     <properties> 
      <property name="hibernate.hbm2ddl.auto" value="create-drop" /> 
      <property name="hibernate.show_sql" value="false" /> 
      <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/> 
     </properties> 

    </persistence-unit> 
</persistence> 

我datasources.xml出来

<?xml version="1.0" encoding="UTF-8"?> 
<datasources xmlns="http://www.jboss.org/ironjacamar/schema" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:schemaLocation="http://www.jboss.org/ironjacamar/schema http://docs.jboss.org/ironjacamar/schema/datasources_1_0.xsd"> 
    <datasource jndi-name="java:jboss/datasources/TpDS" 
       pool-name="TpDs" enabled="true" 
       use-java-context="true"> 
     <connection-url>jdbc:h2:mem:tp;DB_CLOSE_DELAY=-1</connection-url> 
     <driver>h2</driver> 
     <security> 
      <user-name>sa</user-name> 
      <password>sa</password> 
     </security> 
    </datasource> 
    <datasource jndi-name="java:jboss/datasources/PostgreSQLDS" enabled="${postgresql.enabled}" use-java-context="true" pool-name="PostgreSQLDS" use-ccm="true"> 
     <connection-url>jdbc:postgresql://${env.OPENSHIFT_POSTGRESQL_DB_HOST}:${env.OPENSHIFT_POSTGRESQL_DB_PORT}/${env.OPENSHIFT_APP_NAME}</connection-url> 
     <driver>postgresql</driver> 
     <security> 
      <user-name>${env.OPENSHIFT_POSTGRESQL_DB_USERNAME}</user-name> 
      <password>${env.OPENSHIFT_POSTGRESQL_DB_PASSWORD}</password> 
     </security> 
    </datasource> 
    <drivers> 
     <driver name="postgresql" module="org.postgresql.jdbc"> 
      <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class> 
     </driver> 
    </drivers> 
</datasources> 

回答