从 Web 控制台添加资源时出现 Glassfish 5.1.0 错误
Glassfish 5.1.0 error when adding resources from web console
Glassfish 服务器已启动并且 运行。我想添加一些数据源,并从 Web 控制台-> 资源中进行。
点击按钮"Add Resources"然后从我的电脑中选择文件(与来自服务器的文件相同)并点击确定。 GUI 给我错误:
发生错误
系统找不到指定的路径:
在日志中我得到:
[2019-11-20T12:26:23.149+0300] [glassfish 5.1] [INFO] []
[org.glassfish.admingui] [tid: _ThreadID=69
_ThreadName=admin-listener(3)] [timeMillis: 1574241983149] [levelValue: 800] [[ GUI deployment: uploadToTempfile]]
[2019-11-20T12:26:23.165+0300] [glassfish 5.1] [SEVERE] []
[org.glassfish.admingui] [tid: _ThreadID=69
_ThreadName=admin-listener(3)] [timeMillis: 1574241983165] [levelValue: 1000] [[ RestResponse.getResponse() gives
FAILURE. endpoint =
'https://localhost:4848/management/domain/resources/add-resources';
attrs = '{id=,
target=mdmcluster}']]
请给出解决此问题的任何想法。
Glassfish 应用程序部署指南第 191 页概述了 glassfish-resources.xml
文件的正确格式。可在此处下载:https://javaee.github.io/glassfish/doc/5.0/application-deployment-guide.pdf
这里是一个定义 JDBC 连接池的例子:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
<!-- Connects to MySql database called 'test' on a server called 'database' -->
<jdbc-connection-pool name="jdbc/testConnPool"
res-type="javax.sql.DataSource"
datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
pool-resize-quantity="2"
max-pool-size="32"
steady-pool-size="8">
<property name="URL" value="jdbc:mysql://database:3306/test"/>
<property name="User" value="root"/>
<property name="Password" value="password"/>
</jdbc-connection-pool>
<jdbc-resource enabled="true" jndi-name="jdbc/testDS" object-type="user" pool-name="jdbc/testConnPool">
<description>Test DataSource jdbc/testDS for Connection Pool jdbc/testConnPool</description>
</jdbc-resource>
</resources>
Glassfish 服务器已启动并且 运行。我想添加一些数据源,并从 Web 控制台-> 资源中进行。
点击按钮"Add Resources"然后从我的电脑中选择文件(与来自服务器的文件相同)并点击确定。 GUI 给我错误:
发生错误 系统找不到指定的路径:
在日志中我得到:
[2019-11-20T12:26:23.149+0300] [glassfish 5.1] [INFO] [] [org.glassfish.admingui] [tid: _ThreadID=69 _ThreadName=admin-listener(3)] [timeMillis: 1574241983149] [levelValue: 800] [[ GUI deployment: uploadToTempfile]]
[2019-11-20T12:26:23.165+0300] [glassfish 5.1] [SEVERE] [] [org.glassfish.admingui] [tid: _ThreadID=69 _ThreadName=admin-listener(3)] [timeMillis: 1574241983165] [levelValue: 1000] [[ RestResponse.getResponse() gives FAILURE. endpoint = 'https://localhost:4848/management/domain/resources/add-resources'; attrs = '{id=, target=mdmcluster}']]
请给出解决此问题的任何想法。
Glassfish 应用程序部署指南第 191 页概述了 glassfish-resources.xml
文件的正确格式。可在此处下载:https://javaee.github.io/glassfish/doc/5.0/application-deployment-guide.pdf
这里是一个定义 JDBC 连接池的例子:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
<!-- Connects to MySql database called 'test' on a server called 'database' -->
<jdbc-connection-pool name="jdbc/testConnPool"
res-type="javax.sql.DataSource"
datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
pool-resize-quantity="2"
max-pool-size="32"
steady-pool-size="8">
<property name="URL" value="jdbc:mysql://database:3306/test"/>
<property name="User" value="root"/>
<property name="Password" value="password"/>
</jdbc-connection-pool>
<jdbc-resource enabled="true" jndi-name="jdbc/testDS" object-type="user" pool-name="jdbc/testConnPool">
<description>Test DataSource jdbc/testDS for Connection Pool jdbc/testConnPool</description>
</jdbc-resource>
</resources>