I have a resource type that has custom properties identified in an rmd
file. Some of the property elements are defined as <xs:element
ref="..." minOccurs="1" maxOccurs="1"/>, meaning they must exist and
only exist once. I have a capability class which has get/set methods
for each property. When Muse starts, it initializes the resource, and I
get the following error:
org.apache.muse.ws.resource.properties.schema.faults.SchemaValidationFau
lt: [ID = 'BelowMinimum'] The property
'{http://schemas.cmp.cisco.com/2006/07/Chameleon/LogicalResource}adminis
teredState' has a minOccurs value of 1, but there are only 0 instances
in the document.
at
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollec
tion.validateSchema(SimpleResourcePropertyCollection.java:1209)
at
org.apache.muse.ws.resource.impl.SimpleWsResource.initialize(SimpleWsRes
ource.java:223)
...
What I'm trying to do is have the resource properties pulled dynamically
from an external source, like from a database. Also, the properties
should only be pulled when the client calls the
GetResourcePropertyDocument operation. This is because the property
values can differ at any point in time, so it should not be "cached" in
the Muse application layer.
But, from the error I'm getting above, it seems as if Muse is explicitly
calling the capability methods to get the resource properties when the
resource is initialized, and not when the client actually makes a call
to get the properties.
Is there a reason why Muse must call to get the properties so early,
instead of when really needed? In my case, the dynamic properties will
always be null until the client makes the call, so Muse will always
throw an error on startup because it is encountering 0 property values
where it expects 1.