1

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

如果我用 asadmin 做事,一切正常。

通过 REST 获取访问权限按预期工作。
例子:

curl --user admin:pwd -X GET -H "Accept: application/JSON" 
     http://localhost:4848/management/domain/resources/connector-connection-pool

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

asadmin create-connector-connection-pool --raname MulticastDNS-connector
         --connectiondefinition multicastdns.outbound.MulticastDNSRegistry multicastdns/pool 

我遵循了一些 Oracle 示例
http://docs.oracle.com/cd/E18930_01/html/821-2416/gjipx.html#gjijx
http://docs.oracle.com/cd/E19798-01/821 -1751/gjijx/index.html
但我尝试过的所有事情都收到了 400 个错误请求。
例子:

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


如果使用连接器资源 asadmin create-connector-resource --poolname multicastdns/pool jca/multicastdns 尝试第二步,同样的问题

通过 REST 获取有效,但添加和删除条目无效。

谢谢弗洛里安

4

0 回答 0