Eclipse开发时出现HTTP 403 错误(禁止访问)的解决方法

1. 打开项目的页面如下:

可以从tomcat log中发现Connection has been abandoned PooledConnection和Too many connections。

2017-08-03 18:28:48.022  WARN 6396 --- [o-8080-exec-170] o.a.tomcat.jdbc.pool.ConnectionPool      : Connection has been abandoned PooledConnection[[email protected]]:java.lang.Exception
	at org.apache.tomcat.jdbc.pool.ConnectionPool.getThreadDump(ConnectionPool.java:1065)
	at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:707)
	at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:634)
	at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:488)
	at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:144)
	at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)
	at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)
	at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)
	......
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

2017-08-03 18:28:48 ERROR [com.xxx.yyy.a.b] -- <Too many connections>
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Too many connections
	at sun.reflect.GeneratedConstructorAccessor295.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
	at com.mysql.jdbc.Util.getInstance(Util.java:384)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3562)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3494)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:920)
	at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4000)
	at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1285)
	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2186)
	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:787)
	at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:49)
	at sun.reflect.GeneratedConstructorAccessor288.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:357)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
	at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:278)
	at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)
	at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:702)
	at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:634)
	at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:488)
	at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:144)
	at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)
	at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)
	at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:127)
	......
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

2. 解决方案

重启一下Eclipse,重新跑一下项目即可(Ctrl+Alt+D)。引起这个问题得主要原因是修改代码保存时Eclipse会自动重新编译代码,而此时你又修改代码再保存,就很容易出现这个HTTP 403错误。 

时间: 2024-10-05 06:34:45

Eclipse开发时出现HTTP 403 错误(禁止访问)的解决方法的相关文章

apache服务器 403错误 禁止访问解决办法

打开网页,结果访问提示:403错误!关闭了IE的"显示友好的HTTP错误",显示没有权限访问(You don't have permission to access / on this server)! Apache,版本2.2.8,安装完成后,进行相关测试: 配置了下php的php.in文件,再次localhost打开发现错误: HTTP 错误 403 - 禁止访问,即403 Forbidden:You don't have permission to access / on thi

WAMP 403 Forbidden禁止访问 的解决办法

修改httpd.conf文件 # onlineoffline tag - don't remove Require local To # onlineoffline tag - don't remove Require all granted 参考:http://stackoverflow.com/questions/28560452/403-forbidden-wamp-server-2-5

记录我在百度地图开发和ArcGIS for Android开发时出现的一些错误及解决方案(后续更新)

[1]The import com.baidu.mapapi.map.Geometry conflicts with a type defined in the same file 解决:百度api包下的Geometry和某个类名相冲突,将类名换成另外的名字,不要和百度相关类里面的类名相同 [2]java.lang.ClassCastException: 解决:类型转换错误.查看Test_Geometry项目的Mainfest.xml清单文件,在<applicaiton>标签里面少了对Myap

winserver2003环境发布ASP程序报错(HTTP 错误 403.1 - 禁止访问:执行访问被拒绝)

问题: 在Windows Server 2003 + IIS6.0上布署.Net 2.0网站时发生如下错误: 该页无法显示 您试图从目录中执行 CGI.ISAPI 或其他可执行程序,但该目录不允许执行程序. -------------------------------------------------------------------------------- 请尝试以下操作: 如果您认为该目录应该允许执行访问权限,请与网站管理员联系. HTTP 错误 403.1 - 禁止访问:执行访问被

WAMP 403 Forbidden禁止访问

2015.06.23 WAMP 2.5修改方法 修改httpd.conf文件 # onlineoffline tag - don't remove Require local To # onlineoffline tag - don't remove Require all granted 参考:http://stackoverflow.com/questions/28560452/403-forbidden-wamp-server-2-5 ---------------------------

cocos2d-x 3.2 for wp8-xaml应用商店提交应用时出现的API错误(不能用CreateEventExA)解决办法

好不容易做完一个游戏,提交到商店显示"本地API不支持CreateEventExA"之类的错误提示 于是我在整个解决方案里查找CreateEventExA,发现没有,却在Audio.h找到了CreateEventEx: StreamingVoiceContext() : hBufferEndEvent(CreateEventEx(NULL, FALSE, FALSE, NULL)) { } 刚开始由于懒,直接注释掉了这些,然后发现运行时出现闪退. 然后我查看CreateEventEx,

SQL Server附加数据库出现错误5123的正确解决方法

SQL Server附加数据库出现错误5123的正确解决方法 因为自己有一本基于SQL Server 2005的数据库教程,里边使用的示例数据库是AdventureWorks for SQL Server 2005,而我的机子上装的是SQL Server 2008,示例数据库是AdventureWorks for SQL Server 2008.起初我以为示例数据库AdventureWorks for SQL Server 2005 与AdventureWorks for SQL Server

[转]eclipse启动tomcat无法访问的解决方法

这篇文章介绍了eclipse启动tomcat无法访问的解决方法,有需要的朋友可以参考一下 症状: tomcat在eclipse里面能正常启动,而在浏览器中访问http://localhost:8080/不能访问,且报404错误.同时其他项目页面也不能访问. 关闭eclipse里面的tomcat,在tomcat安装目录下双击startup.bat手动启动tomcat服务器.访问htt://localhost:8080/能正常访问tomcat管理页面. 症状原因: eclipse将tomcat的项目

PowerShell因为在此系统中禁止执行脚本解决方法

PowerShell因为在此系统中禁止执行脚本解决方法 在Powershell直接脚本时会出现: 无法加载文件 ******.ps1,因为在此系统中禁止执行脚本.有关详细信息,请参阅 "get-help about_signing". 所在位置 行:1 字符: 17 + E:\Test\test.ps1 <<<<     + CategoryInfo          : NotSpecified: (:) [], PSSecurityException