Skip to main content

How to create a connector-connection-pool in Glassfish 3.1.2.2 with REST interface

No replies
floris2013
Offline
Joined: 2013-01-28
Points: 0

For a remote administration of multible Glassfish 3.1.2.2 instances I want to configure resource adapter connection pool and connector resources. These configuration can only be done after the resource adapter deployment.

All works if I do things with asadmin.

Get Access via REST works as aspected.
Example:

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

Now I want to create following command doing a REST call

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

I followed some of the Orcale examples
http://docs.oracle.com/cd/E18930_01/html/821-2416/gjipx.html#gjijx or
http://docs.oracle.com/cd/E19798-01/821-1751/gjijx/index.html
But for all things I tried I got 400 Bad Request.

Example
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

Simular results if I want to delete a existing resource.

curl --user admin:pwd -X DELETE -H "Accept: application/JSON" \
http://localhost:4848/management/domain/resources/connector-connection-p... -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

Same issue if try the second step with connector resource asadmin create-connector-resource --poolname multicastdns/pool jca/multicastdns

Summary
Get via REST works but add and delete a entry into connetor-connection-pool List won't work.

I try so many things I don't see my mistake doing the add and delete stuff.
Or found I a bug in Glassfish 3.1.2.2 for administrate connector-connection-pool and connector-resource via REST.

florian