我客户的一台机器,linux9,昨天系统崩溃。连夜重装。环境造就出来了,但是jdbc就是连接不上postgresql。
我在服务器上直接命令行是可以连接的,不管是password方式还是trust所有。
psql -U LoginName MyDB
但是resin却老是报错:
[15:02:19.878] java.lang.NullPointerException
[15:02:19.878]  at _jsp._gb._index__jsp._jspService(_index__jsp.java:50)
[15:02:19.878]  at com.caucho.jsp.JavaPage.service(JavaPage.java:61)
[15:02:19.878]  at com.caucho.jsp.Page.pageservice(Page.java:577)
[15:02:19.878]  at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:192)
[15:02:19.878]  at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:175)
[15:02:19.878]  at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:240)
[15:02:19.878]  at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:263)
[15:02:19.878]  at com.caucho.server.port.TcpConnection.run(TcpConnection.java:477)
[15:02:19.878]  at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:600)
[15:02:19.878]  at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:522)
[15:02:19.878]  at java.lang.Thread.run(Thread.java:619)Let's print a stack trace, and exit.
Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
        at org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Connection.java:167)
        at org.postgresql.Driver.connect(Driver.java:122)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:185)
        at com.***.***.dbcon.sqlBean.setConnection(sqlBean.java:22)
        at _jsp._gb._index__jsp._jspService(_index__jsp.java:47)
        at com.caucho.jsp.JavaPage.service(JavaPage.java:61)
        at com.caucho.jsp.Page.pageservice(Page.java:577)
        at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:192)
        at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:175)
        at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:240)
        at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:263)
        at com.caucho.server.port.TcpConnection.run(TcpConnection.java:477)
        at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:600)
        at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:522)
        at java.lang.Thread.run(Thread.java:619)
[15:02:22.597] java.lang.NullPointerException
[15:02:22.597]  at _jsp._gb._index__jsp._jspService(_index__jsp.java:50)
[15:02:22.597]  at com.caucho.jsp.JavaPage.service(JavaPage.java:61)
[15:02:22.597]  at com.caucho.jsp.Page.pageservice(Page.java:577)
[15:02:22.597]  at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:192)
[15:02:22.597]  at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:175)
[15:02:22.597]  at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:240)
[15:02:22.597]  at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:263)
[15:02:22.597]  at com.caucho.server.port.TcpConnection.run(TcpConnection.java:477)
[15:02:22.597]  at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:600)
[15:02:22.597]  at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:522)
[15:02:22.597]  at java.lang.Thread.run(Thread.java:619)各位jsp和postgresql的高手帮帮我吧,再拖下去,客户和我们老大都要吃了我了。