user1604064
user1604064

Reputation: 807

Glassfish, add new property to jndi custom-resource via command line

Hi I have got question about glassfish and command line. I create a new properties for example like this:

asadmin> create-custom-resource --restype java.util.Properties --factoryclass org.glassfish.resources.custom.factory.PropertiesFactory --property firstName=John Person

and now I want to add a new property for example surname, can you tell me how can I do it? I know that I can drop the resources and create new, but I need only add new properties, Thanks for all

Upvotes: 3

Views: 1943

Answers (1)

Michel
Michel

Reputation: 21

First, seems you have a missing part (JNDI name of the PropertiesFactory ) in the commande line you have given. So if you have something like

asadmin --user=admin --passwordfile=myPassFile --host=localhost --port=4848 create-custom-resource --restype java.util.Properties --factoryclass org.glassfish.resources.custom.factory.PropertiesFactory --property "firstName=myFirstName" myGroup/myLastPart

You can add a new property to it like this:

asadmin --user=admin --passwordfile=myPassFile  --host=localhost --port=4848 set resources.custom-resource.myGroup/myLastPart.property.lastName=myLastName

As you can see, I have intentionaly named my JNDI PropertiesFactory with a complex name (myGroup/myLastPart) to show exactly how you must proceed in that case. (I'm using GlassFish 3, so ....)

Upvotes: 2

Related Questions