从Web控制台添加资源时Glassfish 5.1.0错误 [英] Glassfish 5.1.0 error when adding resources from web console
问题描述
Glassfish服务器已启动并正在运行.我想添加一些数据源,并从Web控制台->资源中进行操作.
Glassfish server up and running. I want to add some data source, and do it from web console->Resources.
单击按钮添加资源",然后从我的计算机中选择文件(与服务器中的文件相同),然后单击确定".GUI给我错误:
Click button "Add Resources" then choose file from my computer (same to the file from server) and click OK. GUI gives me error:
发生了错误系统找不到指定的路径:
在日志中,我得到:
[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部署:uploadToTempfile]]
[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] [严重] [][org.glassfish.admingui] [tid:_ThreadID = 69_ThreadName = admin-listener(3)] [timeMillis:1574241983165] [levelValue:1000] [[RestResponse.getResponse()给失败.端点=' https:// localhost: 4848/管理/域/资源/添加资源';attrs='{ id= ;,target= mdmcluster}']]
[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}']]
请提出任何解决此问题的想法.
Please, give any ideas how to fix this issue.
推荐答案
《 Glassfish应用程序部署指南》第191页概述了 glassfish-resources.xml
文件的正确格式.可以下载该文件.此处: https://javaee.github.io/glassfish/doc/5.0/application-deployment-guide.pdf
The correct format for the glassfish-resources.xml
file is outlined in the Glassfish Application Deployment Guide page 191. It can be downloaded here: https://javaee.github.io/glassfish/doc/5.0/application-deployment-guide.pdf
以下是定义JDBC连接池的示例:
Here is an example for defining a JDBC connection pool:
<?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>
这篇关于从Web控制台添加资源时Glassfish 5.1.0错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!