gpt4 book ai didi

java - 为什么我的 JDBC 和 Netbeans 权限被拒绝?

转载 作者:行者123 更新时间:2023-12-02 07:55:12 29 4
gpt4 key购买 nike

我们是三个开发人员,都使用 Netbeans 和 Java。一名开发人员可以很好地访问远程 DB2 服务器(使用相同的代码)。其他两个(包括我)不能。

这是 context.xml 文件:

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/app_web">
<Resource name="jdbc/admin"
auth="Container"
type="javax.sql.DataSource"
maxActive="500"
initialSize="10"
maxIdle="50"
maxWait="10000"
username="theusername"
password="xxxxxxxxx"
driverClassName="com.ibm.as400.access.AS400JDBCDriver"
removeAbandoned="true"
removeAbandonedTimeout="60"
logAbandoned="true"
url="jdbc:as400://192.168.1.1;prompt=false;naming=system;prompt=false;naming=system;libraries=*libl;date format=iso;time format=iso"
/>

以下是我们收到的异常:

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (The application requester cannot establish the connection. (Permission denied: connect))
Caused by: java.sql.SQLException: The application requester cannot establish the connection. (Permission denied: connect)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:528)
WARNING: Failed to register in JMX: javax.naming.NamingException: Cannot create PoolableConnectionFactory (The application requester cannot establish the connection. (Permission denied: connect))
WARNING: Unexpected exception resolving reference
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (The application requester cannot establish the connection. (Permission denied: connect))
Caused by: java.sql.SQLException: The application requester cannot establish the connection. (Permission denied: connect)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:528)
WARNING: Failed to register in JMX: javax.naming.NamingException: Cannot create PoolableConnectionFactory (The application requester cannot establish the connection. (Permission denied: connect))

我已经把jt400.jar文件放在了C:\Program Files\Apache Software Foundation\apache-tomcat-6.0.35\lib文件夹下,把它在 ...\web\WEB-INF\lib 文件夹等中。似乎没有任何效果。

最佳答案

我找到了解决方案。显然,我必须在防火墙上打开端口 449。我之前看过那里,但由于这是一台公司计算机,我没有注意到配置了另一个防火墙(F-Secure)来阻止它。

关于java - 为什么我的 JDBC 和 Netbeans 权限被拒绝?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9742829/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com