- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我最近在我的本地主机上部署了一个工作网络应用程序到亚马逊网络服务。我遇到的问题是 - 尽管 context.xml 的用户名是“james”,但异常堆栈跟踪另有说明。
org.apache.jasper.JasperException: org.apache.jasper.JasperException: org.apache.jasper.JasperException: javax.servlet.ServletException: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES))
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:491)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:401)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
它正在尝试使用用户名“root”连接到数据库。是因为文件(context.xml)的缓存吗?我该如何解决?我也重新启动了网络服务器,但它没有生效。
提前致谢。
编辑:
这是 context.xml 的内容:
<?xml version="1.0" encoding="UTF-8"?>
<Context antiResourceLocking="false" privileged="true" >
<Resource
name="jdbc/NetmarketDB"
auth="Container"
type="javax.sql.DataSource"
removeAbandoned="true"
removeAbandonedTimeout="30"
maxActive="100"
maxIdle="30"
maxWait="1000"
username="james"
password="xxxxxxxxxx"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/ams"/>
</Context>
您可以通过单击页面上的Login
或Register
来查看它的发生: http://184.73.118.76/Links.jsp
我需要做些什么才能使 context.xml 更改生效吗?我执行了两个操作:
1. touch web.xml
在WEB-INF
2.重启tomcat服务器。
在这里迫切需要帮助。
再次感谢。詹姆斯。
最佳答案
检查你的 $CATALINA_BASE/conf/[enginename]/[hostname]/[webapp].xml,在默认的 Tomcat 上这应该是 $CATALINA_BASE/conf/Catalina/localhost/[webapp].xml,tomcat 创建一个副本你的 context.xml 并且这可能在你更新你的 context.xml 时没有更新
Tomcat Context Container Reference
$CATALINA_BASE/conf/[enginename]/[hostname]/, in an individual file at /META-INF/context.xml inside the application files. If the web application is packaged as a WAR then /META-INF/context.xml will be copied to $CATALINA_BASE/conf/[enginename]/[hostname]/ and renamed to match the application's context path. Once this file exists, it will not be replaced if a new WAR with a newer /META-INF/context.xml is placed in the host's appBase.
关于java - 无法创建 PoolableConnectionFactory(用户 'root' @'localhost' 的访问被拒绝(使用密码 : YES)),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3299317/
我有一个工作代码,它在另外两台机器上运行良好。这些机器上运行着本地 mysql 服务器实例。 现在购买了一台新机器并在其上安装了 Mysql 服务器,并尝试运行相同的代码,该代码在其他机器上运行良好。
我正在新盒子上部署旧应用程序。第一次访问数据库时,我得到了 File input error: Cannot create PoolableConnectionFactory (Invalid han
有什么问题?无法连接数据库? org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactor
所以,我意识到数据库池可能有比 JDBC 更好的选择,但仍然有一些东西让我发疯。在所有示例代码中,他们建议像这样进行池化。 GenericObjectPool connectionPool = new
这个问题已经有答案了: Error: Client does not support authentication protocol requested by server; consider upg
我花了很多时间还是想不通。我知道,如果我使用 BasicDataSource,则需要在 openjpa.ConnectionProperties 属性中传递配置。 openjpa.Connection
这就是我使用 DBCP 1.4 连接工厂创建数据源的方式: PoolableConnectionFactory factory = new PoolableConnectionFactory( n
我正在尝试使用数据库创建 Web 应用程序,但收到此错误: org.apache.tomcat.dbcp.dbcp.SQLNestedException:无法创建 PoolableConnection
我正在将 Sonarqube 与 MySql 一起使用。我有 Jenkins,我想将 Sonar runner 与 TC 集成,主要用于不同的项目(Java、PHP)。我做了以下工作: 在 Windo
我正在尝试在 jmeter 中运行选择查询。我在监听器中收到此响应“无法创建 PoolableConnectionFactory” 我附上了我用来创建数据库的 myphpadmin 页面。提前致谢。
我一直在尝试在 AWS EC2 Ubuntu t1.micro 实例上托管 Web 应用程序。 MySQL版本:5.5.35 Tomcat 版本:7.0.52 JDK 版本:7.0_51 webapp
我有一个连接到数据库的 jar。我第一次连接到机器时,jar 运行良好,连接到数据库并正确查询表等。但是,当我尝试第二次和第三次等时,jar 开始运行,但在连接到数据库时卡住,然后收到以下错误: or
有人遇到过这个错误吗? Cannot create PoolableConnectionFactory (unknown system variable 'language') 使用java、mysq
当我将 Java 应用程序部署到 IBM Bluemix 后,由于以下错误,它无法创建初始数据库连接: Building new Hibernate SessionFactory 2015-04-11
我想升级 GWT-JDO 应用程序以使用 DBCP2 而不是 DBCP。配置部分工作得很好,但我在控制台中看到警告 WARN [org.apache.commons.dbcp2.PoolingData
我使用的是 Tomcat 版本 8 和 MySQL 连接器版本 6。这是我的 context.xml: WEB-INF/web.xml ${catalina.base}/conf/web.xml 这
我整天都在想办法解决这个问题。我正在尝试让 JasperReports Server 在 Tomcat 6 服务器上工作。 我不断收到此错误 ERROR JDBCExceptionReporter,h
我正在使用 pgAdmin3 并使用 pkg 安装 postgreSQL 和 pg。我正在尝试通过 tomcat 连接到 postgreSQL。当我从我的 tomcat/bin 目录执行 ./star
我试图从本地系统获取文件,然后通过 PutDatabaseRecord 将其放入 mysql 数据库中,但它抛出以下错误: Full error i am getting in PutDatabase
有什么问题吗?我使用H2数据库 有人可以解决我的问题吗?我使用 H2 数据库,Hibernate 5 这就是 HibernateConfig.java package com.train.shopon
我是一名优秀的程序员,十分优秀!