3

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

user1604064
  • 809
  • 1
  • 9
  • 29

1 Answers1

2

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 ....)

Michel
  • 21
  • 2