需要将Postgresql 9.1 DB连接到Tomcat 8服务器的帮助吗
我想知道是否有任何教程教我如何将POSTGRESQL 9.1 DB连接到Windows上的Tomcat 8服务器。我找到了这个教程,但我没有完全理解它,没有真正的DBA经验。我目前正试图在Tomcat中运行一个连接到POSTGRESQL数据库的web应用程序。web应用出现在我的浏览器中,但当我尝试登录时,我收到以下错误:需要将Postgresql 9.1 DB连接到Tomcat 8服务器的帮助吗,postgresql,tomcat,tomcat8,Postgresql,Tomcat,Tomcat8,我想知道是否有任何教程教我如何将POSTGRESQL 9.1 DB连接到Windows上的Tomcat 8服务器。我找到了这个教程,但我没有完全理解它,没有真正的DBA经验。我目前正试图在Tomcat中运行一个连接到POSTGRESQL数据库的web应用程序。web应用出现在我的浏览器中,但当我尝试登录时,我收到以下错误: ===========> Msg.initMsg: No DB Connection [12] ===========> PreparedStatementPro
===========> Msg.initMsg: No DB Connection [12]
===========> PreparedStatementProxy.init: SELECT Name, PO_Name FROM AD_Element WHERE UPPER(ColumnName)=? [12]
java.lang.IllegalStateException: DB.getConnectionRO - @NoDBConnection@
at org.compiere.util.DB.createConnection(DB.java:451)
at org.compiere.util.DB.getConnectionRO(DB.java:381)
at org.compiere.db.PreparedStatementProxy.init(PreparedStatementProxy.java:66)
at org.compiere.db.PreparedStatementProxy.<init>(PreparedStatementProxy.java:44)
at org.compiere.db.ProxyFactory.newCPreparedStatement(ProxyFactory.java:54)
at org.compiere.util.DB.prepareStatement(DB.java:744)
at org.compiere.util.DB.prepareStatement(DB.java:713)
at org.compiere.util.Msg.getElement(Msg.java:479)
at org.compiere.util.Msg.translate(Msg.java:574)
at org.compiere.util.Msg.translate(Msg.java:617)
at org.compiere.util.Msg.parseTranslation(Msg.java:664)
10:16:44.368 ManagerBase.processExpires: Start expire sessions StandardManager at 1433341004368 sessioncount 0 [32]
10:16:44.369 ManagerBase.processExpires: End expire sessions StandardManager processingTime 1 expired sessions: 0 [32]
任何帮助都将不胜感激
将以下内容添加到context.xml:
<Context>
<Resource name="jdbc/postgres" auth="Container"
type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://127.0.0.1:5432/a1ehr"
username="adempiere" password="abc123" maxTotal="20" maxIdle="10" maxWaitMillis="-1"/>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
</Context>
并将以下内容添加到Web.xml:
<resource-ref>
<description>a1ehr</description>
<res-ref-name>jdbc/postgres</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
我得到了NullPointerException。我无法复制错误以给出完整的消息。这允许mt登录到应用程序中,但仍在修复错误。我不知道你走了多远
cd /home/postgres/Adempiere/postgresql/8.1.4/pgdata
edit pg_hba.conf
# CAUTION: Configuring the system for local "trust" authentication allows
# any local user to connect as any PostgreSQL user, including the database
# superuser. If you do not trust all your local users, use another
# authentication method.
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
host all all {Set your IP}/32 trust