如何使用REST接口在Glassfish 3.1.2中创建连接器连接池

如何使用REST接口在Glassfish 3.1.2中创建连接器连接池,rest,glassfish,Rest,Glassfish,对于多个Glassfish 3.1.2.2实例的远程管理,我想配置资源适配器连接池和连接器资源。这些配置只能在资源适配器部署之后完成 如果我和asadmin一起做事,一切都会好起来 按预期通过REST获得访问权限。 例如: 现在,我想使用以下命令和REST创建一个连接池 asadmin create-connector-connection-pool --raname MulticastDNS-connector --connectiondefinition multicast

对于多个Glassfish 3.1.2.2实例的远程管理,我想配置资源适配器连接池和连接器资源。这些配置只能在资源适配器部署之后完成

如果我和asadmin一起做事,一切都会好起来

按预期通过REST获得访问权限。 例如:

现在,我想使用以下命令和REST创建一个连接池

asadmin create-connector-connection-pool --raname MulticastDNS-connector
         --connectiondefinition multicastdns.outbound.MulticastDNSRegistry multicastdns/pool 
我遵循了一些Oracle示例或 但我试过的所有东西都收到了400个坏请求。 例如:

如果要删除现有资源,则会产生模拟结果

curl --user admin:pwd -X DELETE -H "Accept: application/JSON" \ 
     http://localhost:4848/management/domain/resources/connector-connection-pool/multicastdns%2fpool -v

# other try
curl --user admin:pwd -X DELETE -H "Accept: application/JSON" \
     -d id=multicastdns%2fpool \
     http://localhost:4848/management/domain/resources/connector-connection-pool -v
如果使用连接器资源尝试第二步,则会出现相同问题 asadmin创建连接器资源-池名多播DNS/池jca/多播DNS

通过REST获取工作,但添加和删除条目将不起作用

塔克斯弗洛里安

curl --user admin:pwd -X POST -H "Accept: application/JSON" -H "Content-Type: application/json"
     -d '{"id":"multicastdn%2fspool","connectiondefinitionname":"multicastdns.outbound.MulticastDNSRegistry","resourceAdapterName":"MulticastDNS-connector"}'\
     http://localhost:4848/management/domain/resources/connector-connection-pool -v

# other check
curl --user admin:pwd -X POST -H "Accept: application/JSON" \
    -d id=multicastdns%2fpool \
    -d connectiondefinitionname=multicastdns.outbound.MulticastDNSRegistry \
    -d resourceAdapterName=MulticastDNS-connector \
    http://localhost:4848/management/domain/resources/connector-connection-pool -v
curl --user admin:pwd -X DELETE -H "Accept: application/JSON" \ 
     http://localhost:4848/management/domain/resources/connector-connection-pool/multicastdns%2fpool -v

# other try
curl --user admin:pwd -X DELETE -H "Accept: application/JSON" \
     -d id=multicastdns%2fpool \
     http://localhost:4848/management/domain/resources/connector-connection-pool -v