You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-user@ws.apache.org by Christian Ewers <CE...@de.ibm.com> on 2006/11/15 10:27:18 UTC

WSN-Producer example with wsrf-sg:Content property

Hi,
I'm trying to extend the wsn-producer example by adding the WS-Resource to
a remote ServiceGroup.
For doing so, I added the wsrf-sg:Content property to the existing resource
properties, extended the MyCapabilityImpl.java class by adding the
getContent(), setContent(Element e) methods and I added the WssgConstants.
CONTENT_QNAMEto the _PROPERTIESarray.

Property in the WSDL-File:

<xsd:element ref="wsrf-sg:Content" minOccurs="0" maxOccurs="1"/>

I added the following test-content to the WsResource.rmd file (also added
the wsrf-sg namespace)

<Property name="wsrf-sg:Content" modifiability="read-write" mutability=
"mutable">
 <InitialValues>
  <wsrf-sg:Content>
   <wsrf-sg:RPDoc>
    <myns:ServerName>TestServerName</myns:ServerName>
   </wsrf-sg:RPDoc>
  </wsrf-sg:Content>
 </InitialValues>
</Property>

Now I'm getting the following exception when initializing the resource by
using the WsnTestclient. I didn't add any ServiceGroup related code so far.

java.lang.NullPointerException
      at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source)
      at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source)
      at
org.apache.muse.ws.notification.properties.ResourcePropertyChangeEvent.toXML(ResourcePropertyChangeEvent.java:97)
      at
org.apache.muse.ws.notification.properties.ResourcePropertyChangeEvent.toXML(ResourcePropertyChangeEvent.java:80)
      at
org.apache.muse.ws.notification.impl.SimpleNotificationProducer.publish(SimpleNotificationProducer.java:452)
      at
org.apache.muse.ws.notification.properties.ChangeNotificationListener.propertyChanged(ChangeNotificationListener.java:99)
      at
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.changeCompleted(SimpleResourcePropertyCollection.java:337)
      at
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.insertResourceProperty(SimpleResourcePropertyCollection.java:718)
      at
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.insertResourceProperty(SimpleResourcePropertyCollection.java:681)
      at
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.addInitialValues(SimpleResourcePropertyCollection.java:169)
      at
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.applyMetadata(SimpleResourcePropertyCollection.java:297)
      at
org.apache.muse.ws.resource.impl.SimpleWsResource.initialize(SimpleWsResource.java:215)
      at
org.apache.muse.core.routing.RouterFilePersistence.reloadResource(RouterFilePersistence.java:139)
      at
org.apache.muse.core.AbstractFilePersistence.reloadResources(AbstractFilePersistence.java:393)
      at
org.apache.muse.core.AbstractFilePersistence.reload(AbstractFilePersistence.java:334)
      at
org.apache.muse.core.routing.SimpleResourceRouter.initialize(SimpleResourceRouter.java:248)
      at
org.apache.muse.core.platform.AbstractIsolationLayer.initialize(AbstractIsolationLayer.java:176)
      at
org.apache.muse.core.platform.axis2.AxisIsolationLayer.setOperationContext(AxisIsolationLayer.java:138)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at
org.apache.axis2.engine.DependencyManager.configureBusinessLogicProvider(DependencyManager.java:70)
      at
org.apache.axis2.receivers.RawXMLINOutMessageReceiver.invokeBusinessLogic(RawXMLINOutMessageReceiver.java:79)
      at
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:39)
      at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:504)
      at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:324)
      at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:234)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
      at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      at java.lang.Thread.run(Thread.java:595)

What am I doing wrong?

Thx,
Christian


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


ServiceGroupRegistration/Add invocation

Posted by Christian Ewers <CE...@de.ibm.com>.
Hi,

thx, for your answers and I'm sorry for not answering for so long, I had to
work on something else for a while. But now I can try to work with Muse 2.1

I still have the same problem with the ServiceGroupRegistration. I used the
nightliy-build from 12/10/2006.
I still want to deploy an Registry-Service with the
ServiceGroupRegistration capability to allow "remote-adding" of resources.
For testing I use two versions of the wsrf-sample. For the RegistryService
I deleted all non ServiceGroup and ServiceGroupEntry related stuff in the
muse.xml and added the following capability to the ServiceGroup
resource-type:

<capability>
      <capability-uri>
http://docs.oasis-open.org/wsrf/sgw-2/ServiceGroupRegistration</
capability-uri>
      <java-capability-class>
org.apache.muse.ws.resource.sg.impl.SimpleServiceGroupRegistration</
java-capability-class>
</capability>
<capability>
      <capability-uri>
http://docs.oasis-open.org/wsrf/sgw-2/ServiceGroupRegistration/AddRequest</
capability-uri>
      <java-capability-class>
org.apache.muse.ws.resource.sg.impl.SimpleServiceGroupRegistration</
java-capability-class>
</capability>


Or do I have to declare an extra resource-type for
ServiceGroupRegistration?
I deleted all static-MemberShipContentRule Properties from the rmd-file for
testing.

In the second wsrf-sample project I changed the MyFactoryImpl.java to add
the created WsResource-instance to the RegistryService from above. I also
removed the loop.
[...]
try
{
//  while (true)
//  {
//  Thread.currentThread().sleep(10000);
    Resource next = manager.createResource("WsResource");
    next.initialize();
    manager.addResource(next.getEndpointReference(), next);
    EndpointReference epr = new EndpointReference(new URI(
"http://localhost:8080/RegistryService/services/ServiceGroupRegistration"
));

    ServiceGroupClient sg = new ServiceGroupClient(epr);
    sg.setTrace(true);

    sg.getResourcePropertyDocument();
    Calendar cal = Calendar.getInstance();
    cal.add(Calendar.HOUR_OF_DAY, 1);
    sg.add(next.getEndpointReference(), cal.getTime());
//                    }
}
[...]


But when using the WsrfTestClient to initialize the factor, I get the
following at the end of this post:
I wonder why the ServiceGroupClient tries to get the
wsrf-sg:Content-Property from the Ws-resource.
Am I calling the right method?

Why is the toXml(Document factory) method trying to acces the
Content-Property? (AddRequest.java line 136)
[..]
        //
        // if no content recorded, retrieve content values at runtime using
        // remote client
        //
        try
        {
            if (content == null)
            {
                Element[] results =
member.getResourceProperty(WssgConstants.CONTENT_QNAME);
                content = results[0];
            }
        }
[...]

I wonder why, but since Muse 2.1 some logging-entries are going into the
catalina.log and some are going into the stdout.log. Does anybody know why?

Thx again,
Christian


##########
catalina.out
##########
Dec 11, 2006 11:02:05 AM org.apache.muse.core.SimpleResource
initializeCapabilities
FINE: [ID = 'CapabilityInitializationComplete'] The resource at
'ServiceGroupRegistration' has completed initialization of capability
'http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata.
Dec 11, 2006 11:02:05 AM org.apache.muse.core.SimpleResource
initializeCapabilities
FINE: [ID = 'CapabilityInitializationComplete'] The resource at
'ServiceGroupRegistration' has completed initialization of capability
'http://docs.oasis-open.org/wsrf/rpw-2/Get.
Dec 11, 2006 11:02:05 AM org.apache.muse.core.SimpleResource
initializeCapabilities
FINE: [ID = 'CapabilityInitializationComplete'] The resource at
'ServiceGroupRegistration' has completed initialization of capability
'http://docs.oasis-open.org/wsrf/rpw-2/Query.
Dec 11, 2006 11:02:05 AM org.apache.muse.core.SimpleResource
initializeCapabilities
FINE: [ID = 'CapabilityInitializationComplete'] The resource at
'ServiceGroupRegistration' has completed initialization of capability
'http://docs.oasis-open.org/wsrf/sgw-2/ServiceGroup.
Dec 11, 2006 11:02:05 AM org.apache.muse.core.SimpleResource
initializeCapabilities
FINE: [ID = 'CapabilityInitializationComplete'] The resource at
'ServiceGroupRegistration' has completed initialization of capability
'http://docs.oasis-open.org/wsrf/sgw-2/ServiceGroupRegistration.
Dec 11, 2006 11:02:05 AM org.apache.muse.core.SimpleResource
initializeCapabilities
FINE: [ID = 'CapabilityInitializationComplete'] The resource at
'ServiceGroupRegistration' has completed initialization of capability
'http://docs.oasis-open.org/wsrf/sgw-2/ServiceGroupRegistration/AddRequest.
Dec 11, 2006 11:02:05 AM org.apache.muse.core.SimpleResource initialize
INFO: [ID = 'ResourceInitialized'] The resource at
'ServiceGroupRegistration' has been initialized.
Dec 11, 2006 11:02:05 AM org.apache.muse.core.routing.SimpleResourceRouter
initialize
INFO: [ID = 'RouterIsInitialized'] The resource router has been
initialized.
Dec 11, 2006 11:02:05 AM org.apache.muse.util.LoggingUtils logMessage
FINE: [SERVER TRACE] SOAP envelope contents (incoming):
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
        <wsa:To
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://localhost:8080/RegistryService/services/ServiceGroupRegistration</wsa:To>
        <wsa:Action
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://docs.oasis-open.org/wsrf/rpw-2/GetResourcePropertyDocument/GetResourcePropertyDocumentRequest</wsa:Action>
        <wsa:MessageID
xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:d6a1be20-a40c-54c1-da03-168833534778</wsa:MessageID>
        <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">

<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
        </wsa:From>
    </soap:Header>
    <soap:Body>
        <wsrf-rp:GetResourcePropertyDocument
xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2"/>
    </soap:Body>
</soap:Envelope>
Dec 11, 2006 11:02:05 AM org.apache.muse.util.LoggingUtils logMessage
FINE: [SERVER TRACE] SOAP envelope contents (outgoing):
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
        <wsa:To
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/role/anonymous</wsa:To>
        <wsa:Action
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://docs.oasis-open.org/wsrf/rpw-2/GetResourcePropertyDocument/GetResourcePropertyDocumentResponse</wsa:Action>
        <wsa:MessageID
xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:b61a39a3-8c62-2c51-1e13-7c314bb17c8b</wsa:MessageID>
        <wsa:RelatesTo xmlns:wsa="http://www.w3.org/2005/08/addressing"
RelationshipType="wsa:Reply">uuid:d6a1be20-a40c-54c1-da03-168833534778</wsa:RelatesTo>
        <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">

<wsa:Address>http://localhost:8080/RegistryService/services/ServiceGroupRegistration</wsa:Address>
        </wsa:From>
    </soap:Header>
    <soap:Body>
        <wsrf-rp:GetResourcePropertyDocumentResponse
xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2">
            <wsrf-sg:ServiceGroupRP
xmlns:wsrf-sg="http://docs.oasis-open.org/wsrf/sg-2">

<wsrf-rp:QueryExpressionDialect>http://www.w3.org/TR/1999/REC-xpath-19991116</wsrf-rp:QueryExpressionDialect>
            </wsrf-sg:ServiceGroupRP>
        </wsrf-rp:GetResourcePropertyDocumentResponse>
    </soap:Body>
</soap:Envelope>
Dec 11, 2006 11:02:05 AM org.apache.muse.util.LoggingUtils logMessage
FINE: [SERVER TRACE] SOAP envelope contents (incoming):
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
        <wsa:To
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://localhost:8080/wsrf/services/WsResource</wsa:To>
        <wsa:Action
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://docs.oasis-open.org/wsrf/rpw-2/GetResourceProperty/GetResourcePropertyRequest</wsa:Action>
        <wsa:MessageID
xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:f8f22114-9be5-0ab0-8df6-d26227f80496</wsa:MessageID>
        <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">

<wsa:Address>http://www.w3.org/2005/08/addressing/role/anonymous</wsa:Address>
        </wsa:From>
        <muse-wsa:ResourceId wsa:IsReferenceParameter="true"
            xmlns:muse-wsa="http://ws.apache.org/muse/addressing"
xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:9d52e9da-1172-e9c8-4cb2-1c7390fe19a6</muse-wsa:ResourceId>
    </soap:Header>
    <soap:Body>
        <wsrf-rp:GetResourceProperty
            xmlns:wsrf-rp="http://docs.oasis-open.org/wsrf/rp-2"
xmlns:wsrf-sg="http://docs.oasis-open.org/wsrf/sg-2">wsrf-sg:Content</wsrf-rp:GetResourceProperty>
    </soap:Body>
</soap:Envelope>
Dec 11, 2006 11:02:05 AM org.apache.muse.util.LoggingUtils logCall
FINE: [SERVER TRACE] Mapping SOAP request to Java method
'getResourceProperty'.
Parameter types expected by Java method:
      [javax.xml.namespace.QName]
Parameter types received by the MessageHandler:
      [javax.xml.namespace.QName]
Messages about this call will appear below...
Dec 11, 2006 11:02:05 AM org.apache.muse.util.LoggingUtils logError
INFO: There was an error while processing a request:
[ID = 'PropertyNotInSchema'] There is no property named
'{http://docs.oasis-open.org/wsrf/sg-2}Content' defined in the schema. A
property should not have any operations or metadata applied to it if it is
not in the WS-RP document.

org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.getResourceProperty(SimpleResourcePropertyCollection.java:608)

org.apache.muse.ws.resource.properties.get.impl.SimpleGetCapability.getResourceProperty(SimpleGetCapability.java:88)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:585)
      org.apache.muse.core.SimpleResource.invoke(SimpleResource.java:356)

org.apache.muse.core.routing.SimpleResourceRouter.invoke(SimpleResourceRouter.java:278)

org.apache.muse.core.platform.mini.MiniIsolationLayer.handleRequest(MiniIsolationLayer.java:104)

org.apache.muse.core.platform.mini.MiniServlet.doPost(MiniServlet.java:65)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      11 more...
------------------------------------------
Dec 11, 2006 11:02:05 AM org.apache.muse.util.LoggingUtils logMessage
FINE: [SERVER TRACE] SOAP envelope contents (outgoing):
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
        <wsa:To
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/role/anonymous</wsa:To>
        <wsa:Action
xmlns:wsa="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/fault</wsa:Action>
        <wsa:MessageID
xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:7f9f31a0-8cc9-aaff-13fc-cdb3524eaef2</wsa:MessageID>
        <wsa:RelatesTo xmlns:wsa="http://www.w3.org/2005/08/addressing"
RelationshipType="wsa:Reply">uuid:f8f22114-9be5-0ab0-8df6-d26227f80496</wsa:RelatesTo>
        <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">

<wsa:Address>http://localhost:8080/wsrf/services/WsResource</wsa:Address>
            <wsa:ReferenceParameters>
                <muse-wsa:ResourceId
                    xmlns:muse-wsa="http://ws.apache.org/muse/addressing"
                    wsa:IsReferenceParameter="true"
xmlns:wsa="http://www.w3.org/2005/08/addressing">uuid:9d52e9da-1172-e9c8-4cb2-1c7390fe19a6</muse-wsa:ResourceId>
            </wsa:ReferenceParameters>
        </wsa:From>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <soap:Code>
                <soap:Value>soap:Receiver</soap:Value>
            </soap:Code>
            <soap:Reason>
                <soap:Text>[ID = 'PropertyNotInSchema'] There is no
property named '{http://docs.oasis-open.org/wsrf/sg-2}Content' defined in
the schema. A property should not have any operations or metadata applied
to it if it is not in the WS-RP document.</soap:Text>
            </soap:Reason>
            <soap:Detail>
                <wsrf-rpw:InvalidResourcePropertyQNameFault
xmlns:wsrf-rpw="http://docs.oasis-open.org/wsrf/rpw-2">[ID =
'PropertyNotInSchema'] There is no property named
'{http://docs.oasis-open.org/wsrf/sg-2}Content' defined in the schema. A
property should not have any operations or metadata applied to it if it is
not in the WS-RP document.</wsrf-rpw:InvalidResourcePropertyQNameFault>
            </soap:Detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>



                                                                           
             Daniel Jemiolo                                                
             <danjemiolo@us.ib                                             
             m.com>                                                     To 
                                       muse-user@ws.apache.org             
             16.11.2006 17:51                                           cc 
                                                                           
                                                                   Subject 
             Please respond to         Re: WSN-Producer example with       
             muse-user@ws.apac         wsrf-sg:Content property            
                  he.org                                                   
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




can you send the server-side log (in WEB-INF/services/muse/log), or the
output on the tomcat console?

I think maybe you took wsrf-sg:Content out of the WSRP doc but forgot to
take it out of the RMD doc... or vice versa. Or you're still returning
that name as part of getPropertyNames().

Dan


Christian Ewers <CE...@de.ibm.com> wrote on 11/15/2006 11:45:04 AM:

> Hi Dan,
>
> ok, I think I really was (and still am) heading in the wrong direction.
My
> problem is: When I'm not adding a wsrf-sg:Content property to the
Resource
> to be added I get the following Exception:
>
> java.lang.RuntimeException: [ID = 'PropertyNotInSchema'] There is no
> property named '{http://docs.oasis-open.org/wsrf/sg-2}Content' defined
in
> the schema. A property should not have any operations or metadata
applied
> to it if it is not in the WS-RP document.
>       at org.apache.muse.ws.resource.sg.impl.AddRequest.toXML(
> AddRequest.java:151)
>       at org.apache.muse.ws.resource.sg.impl.AddRequest.toXML(
> AddRequest.java:120)
>       at org.apache.muse.ws.resource.sg.remote.ServiceGroupClient.add(
> ServiceGroupClient.java:81)
>       at
org.apache.muse.test.wsn.WsnTestClient.main(WsnTestClient.java:88)
> Caused by: org.apache.muse.ws.addressing.soap.SoapFault: [ID =
> 'PropertyNotInSchema'] There is no property named
> '{http://docs.oasis-open.org/wsrf/sg-2}Content' defined in the schema. A
> property should not have any operations or metadata applied to it if it
is
> not in the WS-RP document.
>       at org.apache.muse.core.AbstractResourceClient.invoke(
> AbstractResourceClient.java:254)
>       at
> org.apache.muse.ws.resource.remote.WsResourceClient.getResourceProperty(
> WsResourceClient.java:134)
>       at org.apache.muse.ws.resource.sg.impl.AddRequest.toXML(
> AddRequest.java:144)
>       ... 3 more
>
> That's why I thought I have to add the Content property. For testing I
> added the following code to the WsnTestClient to add the
producer-resource
> to my ServiceGroup
>
> //... existing code ...
> producer.subscribe(consumer, null, null);
>
> EndpointReference groupEpr = new EndpointReference(getLocalAddress(
> "/Registry/services/ServiceGroup", 8080));
> ServiceGroupClient sg = new ServiceGroupClient(groupEpr);
> sg.setTrace(true);
> Calendar cal = Calendar.getInstance();
> cal.add(Calendar.HOUR_OF_DAY, 1);
> sg.add(producer.getEndpointReference(),cal.getTime()); // (this is line
88
> from the Exception)
>
> My ServiceGroup works with other Resources that have a wsrf-sg:Content
> property.
>
>
> thx,
> Christian
>
>
>
>
>              Daniel Jemiolo
>              <danjemiolo@us.ib
>              m.com> To
>                                        muse-user@ws.apache.org
>              15.11.2006 13:55 cc
>
> Subject
>              Please respond to         Re: WSN-Producer example with
>              muse-user@ws.apac         wsrf-sg:Content property
>                   he.org
>
>
>
>
>
>
>
>
>
> Hi,
>
> I think you might be misunderstanding how resources are evaluated for
> service group membership. Resource that are potential service group
> members have a list of properties (WSRP doc), and the service group
> resource has a set of membership content rules which are also a list of
> properties. In the latter case, the list signifies which properties a
> resource must have in order to become a service group member. When the
> WSSG Add operation is invoked, if the service group determines that they
> resource has the properties that are in its membership content rules,
then
> it will create a third resource: a service group entry. The service
group
> entry has a property named wsrf-sg:Content, and it contains the actual
> values of the resource properties that are in the MCR list.
>
> Here's an example:
>
> Let's say I want a service group that will only contain WSDM-enabled
> resources. WSDM requires that all manageable resources have a
> muws1:ResourceId property, so my service group will have a membership
> content rule that lists muws1:ResourceId. In the RMD doc for the service
> group resource, I add:
>
>
> <Property>
>   <InitialValues>
>     <wsrf-sg:MembershipContentRule ContentElements="muws1:ResourceId"
> xmlns:muws1="..." xmlns:wsrf-sg="..."/>
>   </InitialValues>
> </Property>
>
>
> After initialization, I try to add a ws-resource that has the
> muws1:ResourceId property in its WSRP doc. When I do this, a service
group
> entry will be created. It will have three properties:
>
> 1. ServiceGroupEPR - The EPR of the service group that this entry
belongs
> to.
>
> 2. MemberEPR - The EPR of the ws-resource we're adding.
>
> 3. Content - The value of the member's muws1:ResourceId property, which
I
> got dynamically via GetResourceProperty().
>
>
> So, you should be most concerned with setting the MCRs (declaratively in
> RMD or programmatically - I recommend declaratively). Is this more
clear?
>
> Dan
>
>
> Christian Ewers <CE...@de.ibm.com> wrote on 11/15/2006 04:27:18 AM:
>
> >
> > Hi,
> > I'm trying to extend the wsn-producer example by adding the
WS-Resource
> to
> > a remote ServiceGroup.
> > For doing so, I added the wsrf-sg:Content property to the existing
> resource
> > properties, extended the MyCapabilityImpl.java class by adding the
> > getContent(), setContent(Element e) methods and I added the
> WssgConstants.
> > CONTENT_QNAMEto the _PROPERTIESarray.
> >
> > Property in the WSDL-File:
> >
> > <xsd:element ref="wsrf-sg:Content" minOccurs="0" maxOccurs="1"/>
> >
> > I added the following test-content to the WsResource.rmd file (also
> added
> > the wsrf-sg namespace)
> >
> > <Property name="wsrf-sg:Content" modifiability="read-write"
mutability=
> > "mutable">
> >  <InitialValues>
> >   <wsrf-sg:Content>
> >    <wsrf-sg:RPDoc>
> >     <myns:ServerName>TestServerName</myns:ServerName>
> >    </wsrf-sg:RPDoc>
> >   </wsrf-sg:Content>
> >  </InitialValues>
> > </Property>
> >
> > Now I'm getting the following exception when initializing the resource
> by
> > using the WsnTestclient. I didn't add any ServiceGroup related code so
> far.
> >
> > java.lang.NullPointerException
> >       at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown
> Source)
> >       at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown
> Source)
> >       at
> >
org.apache.muse.ws.notification.properties.ResourcePropertyChangeEvent.
> > toXML(ResourcePropertyChangeEvent.java:97)
> >       at
> >
org.apache.muse.ws.notification.properties.ResourcePropertyChangeEvent.
> > toXML(ResourcePropertyChangeEvent.java:80)
> >       at
> > org.apache.muse.ws.notification.impl.SimpleNotificationProducer.
> > publish(SimpleNotificationProducer.java:452)
> >       at
> > org.apache.muse.ws.notification.properties.ChangeNotificationListener.
> > propertyChanged(ChangeNotificationListener.java:99)
> >       at
> >
>
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.

>
> > changeCompleted(SimpleResourcePropertyCollection.java:337)
> >       at
> >
>
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.

>
> > insertResourceProperty(SimpleResourcePropertyCollection.java:718)
> >       at
> >
>
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.

>
> > insertResourceProperty(SimpleResourcePropertyCollection.java:681)
> >       at
> >
>
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.

>
> > addInitialValues(SimpleResourcePropertyCollection.java:169)
> >       at
> >
>
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.

>
> > applyMetadata(SimpleResourcePropertyCollection.java:297)
> >       at
> >
>
org.apache.muse.ws.resource.impl.SimpleWsResource.initialize(SimpleWsResource.java:215)

>
> >       at
> > org.apache.muse.core.routing.RouterFilePersistence.
> > reloadResource(RouterFilePersistence.java:139)
> >       at
> > org.apache.muse.core.AbstractFilePersistence.
> > reloadResources(AbstractFilePersistence.java:393)
> >       at
> >
>
org.apache.muse.core.AbstractFilePersistence.reload(AbstractFilePersistence.java:334)

>
> >       at
> > org.apache.muse.core.routing.SimpleResourceRouter.
> > initialize(SimpleResourceRouter.java:248)
> >       at
> > org.apache.muse.core.platform.AbstractIsolationLayer.
> > initialize(AbstractIsolationLayer.java:176)
> >       at
> > org.apache.muse.core.platform.axis2.AxisIsolationLayer.
> > setOperationContext(AxisIsolationLayer.java:138)
> >       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >       at
> >
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

>
> >       at
> >
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

>
> >       at java.lang.reflect.Method.invoke(Method.java:585)
> >       at
> > org.apache.axis2.engine.DependencyManager.
> > configureBusinessLogicProvider(DependencyManager.java:70)
> >       at
> > org.apache.axis2.receivers.RawXMLINOutMessageReceiver.
> > invokeBusinessLogic(RawXMLINOutMessageReceiver.java:79)
> >       at
> > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.
> > receive(AbstractInOutSyncMessageReceiver.java:39)
> >       at
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:504)
> >       at
> > org.apache.axis2.transport.http.HTTPTransportUtils.
> > processHTTPPostRequest(HTTPTransportUtils.java:324)
> >       at
> >
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:234)
> >       at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> >       at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >       at
> > org.apache.catalina.core.ApplicationFilterChain.
> > internalDoFilter(ApplicationFilterChain.java:252)
> >       at
> > org.apache.catalina.core.ApplicationFilterChain.
> > doFilter(ApplicationFilterChain.java:173)
> >       at
> >
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)

>
> >       at
> >
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)

>
> >       at
> >
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)

>
> >       at
> >
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)

>
> >       at
> >
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)

>
> >       at
> >
>
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> >       at
> >
>
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
> >       at
> > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.
> > processConnection(Http11BaseProtocol.java:664)
> >       at
> >
>
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)

>
> >       at
> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.
> > runIt(LeaderFollowerWorkerThread.java:80)
> >       at
> >
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)

>
> >       at java.lang.Thread.run(Thread.java:595)
> >
> > What am I doing wrong?
> >
> > Thx,
> > Christian
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: muse-user-help@ws.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


Re: WSN-Producer example with wsrf-sg:Content property

Posted by Daniel Jemiolo <da...@us.ibm.com>.
can you send the server-side log (in WEB-INF/services/muse/log), or the 
output on the tomcat console?

I think maybe you took wsrf-sg:Content out of the WSRP doc but forgot to 
take it out of the RMD doc... or vice versa. Or you're still returning 
that name as part of getPropertyNames().

Dan


Christian Ewers <CE...@de.ibm.com> wrote on 11/15/2006 11:45:04 AM:

> Hi Dan,
> 
> ok, I think I really was (and still am) heading in the wrong direction. 
My
> problem is: When I'm not adding a wsrf-sg:Content property to the 
Resource
> to be added I get the following Exception:
> 
> java.lang.RuntimeException: [ID = 'PropertyNotInSchema'] There is no
> property named '{http://docs.oasis-open.org/wsrf/sg-2}Content' defined 
in
> the schema. A property should not have any operations or metadata 
applied
> to it if it is not in the WS-RP document.
>       at org.apache.muse.ws.resource.sg.impl.AddRequest.toXML(
> AddRequest.java:151)
>       at org.apache.muse.ws.resource.sg.impl.AddRequest.toXML(
> AddRequest.java:120)
>       at org.apache.muse.ws.resource.sg.remote.ServiceGroupClient.add(
> ServiceGroupClient.java:81)
>       at 
org.apache.muse.test.wsn.WsnTestClient.main(WsnTestClient.java:88)
> Caused by: org.apache.muse.ws.addressing.soap.SoapFault: [ID =
> 'PropertyNotInSchema'] There is no property named
> '{http://docs.oasis-open.org/wsrf/sg-2}Content' defined in the schema. A
> property should not have any operations or metadata applied to it if it 
is
> not in the WS-RP document.
>       at org.apache.muse.core.AbstractResourceClient.invoke(
> AbstractResourceClient.java:254)
>       at
> org.apache.muse.ws.resource.remote.WsResourceClient.getResourceProperty(
> WsResourceClient.java:134)
>       at org.apache.muse.ws.resource.sg.impl.AddRequest.toXML(
> AddRequest.java:144)
>       ... 3 more
> 
> That's why I thought I have to add the Content property. For testing I
> added the following code to the WsnTestClient to add the 
producer-resource
> to my ServiceGroup
> 
> //... existing code ...
> producer.subscribe(consumer, null, null);
> 
> EndpointReference groupEpr = new EndpointReference(getLocalAddress(
> "/Registry/services/ServiceGroup", 8080));
> ServiceGroupClient sg = new ServiceGroupClient(groupEpr);
> sg.setTrace(true);
> Calendar cal = Calendar.getInstance();
> cal.add(Calendar.HOUR_OF_DAY, 1);
> sg.add(producer.getEndpointReference(),cal.getTime()); // (this is line 
88
> from the Exception)
> 
> My ServiceGroup works with other Resources that have a wsrf-sg:Content
> property.
> 
> 
> thx,
> Christian
> 
> 
> 
>  
>              Daniel Jemiolo  
>              <danjemiolo@us.ib  
>              m.com> To 
>                                        muse-user@ws.apache.org  
>              15.11.2006 13:55 cc 
>  
> Subject 
>              Please respond to         Re: WSN-Producer example with  
>              muse-user@ws.apac         wsrf-sg:Content property  
>                   he.org  
>  
>  
>  
>  
>  
> 
> 
> 
> 
> Hi,
> 
> I think you might be misunderstanding how resources are evaluated for
> service group membership. Resource that are potential service group
> members have a list of properties (WSRP doc), and the service group
> resource has a set of membership content rules which are also a list of
> properties. In the latter case, the list signifies which properties a
> resource must have in order to become a service group member. When the
> WSSG Add operation is invoked, if the service group determines that they
> resource has the properties that are in its membership content rules, 
then
> it will create a third resource: a service group entry. The service 
group
> entry has a property named wsrf-sg:Content, and it contains the actual
> values of the resource properties that are in the MCR list.
> 
> Here's an example:
> 
> Let's say I want a service group that will only contain WSDM-enabled
> resources. WSDM requires that all manageable resources have a
> muws1:ResourceId property, so my service group will have a membership
> content rule that lists muws1:ResourceId. In the RMD doc for the service
> group resource, I add:
> 
> 
> <Property>
>   <InitialValues>
>     <wsrf-sg:MembershipContentRule ContentElements="muws1:ResourceId"
> xmlns:muws1="..." xmlns:wsrf-sg="..."/>
>   </InitialValues>
> </Property>
> 
> 
> After initialization, I try to add a ws-resource that has the
> muws1:ResourceId property in its WSRP doc. When I do this, a service 
group
> entry will be created. It will have three properties:
> 
> 1. ServiceGroupEPR - The EPR of the service group that this entry 
belongs
> to.
> 
> 2. MemberEPR - The EPR of the ws-resource we're adding.
> 
> 3. Content - The value of the member's muws1:ResourceId property, which 
I
> got dynamically via GetResourceProperty().
> 
> 
> So, you should be most concerned with setting the MCRs (declaratively in
> RMD or programmatically - I recommend declaratively). Is this more 
clear?
> 
> Dan
> 
> 
> Christian Ewers <CE...@de.ibm.com> wrote on 11/15/2006 04:27:18 AM:
> 
> >
> > Hi,
> > I'm trying to extend the wsn-producer example by adding the 
WS-Resource
> to
> > a remote ServiceGroup.
> > For doing so, I added the wsrf-sg:Content property to the existing
> resource
> > properties, extended the MyCapabilityImpl.java class by adding the
> > getContent(), setContent(Element e) methods and I added the
> WssgConstants.
> > CONTENT_QNAMEto the _PROPERTIESarray.
> >
> > Property in the WSDL-File:
> >
> > <xsd:element ref="wsrf-sg:Content" minOccurs="0" maxOccurs="1"/>
> >
> > I added the following test-content to the WsResource.rmd file (also
> added
> > the wsrf-sg namespace)
> >
> > <Property name="wsrf-sg:Content" modifiability="read-write" 
mutability=
> > "mutable">
> >  <InitialValues>
> >   <wsrf-sg:Content>
> >    <wsrf-sg:RPDoc>
> >     <myns:ServerName>TestServerName</myns:ServerName>
> >    </wsrf-sg:RPDoc>
> >   </wsrf-sg:Content>
> >  </InitialValues>
> > </Property>
> >
> > Now I'm getting the following exception when initializing the resource
> by
> > using the WsnTestclient. I didn't add any ServiceGroup related code so
> far.
> >
> > java.lang.NullPointerException
> >       at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown
> Source)
> >       at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown
> Source)
> >       at
> > 
org.apache.muse.ws.notification.properties.ResourcePropertyChangeEvent.
> > toXML(ResourcePropertyChangeEvent.java:97)
> >       at
> > 
org.apache.muse.ws.notification.properties.ResourcePropertyChangeEvent.
> > toXML(ResourcePropertyChangeEvent.java:80)
> >       at
> > org.apache.muse.ws.notification.impl.SimpleNotificationProducer.
> > publish(SimpleNotificationProducer.java:452)
> >       at
> > org.apache.muse.ws.notification.properties.ChangeNotificationListener.
> > propertyChanged(ChangeNotificationListener.java:99)
> >       at
> >
> 
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.
> 
> > changeCompleted(SimpleResourcePropertyCollection.java:337)
> >       at
> >
> 
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.
> 
> > insertResourceProperty(SimpleResourcePropertyCollection.java:718)
> >       at
> >
> 
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.
> 
> > insertResourceProperty(SimpleResourcePropertyCollection.java:681)
> >       at
> >
> 
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.
> 
> > addInitialValues(SimpleResourcePropertyCollection.java:169)
> >       at
> >
> 
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.
> 
> > applyMetadata(SimpleResourcePropertyCollection.java:297)
> >       at
> >
> 
org.apache.muse.ws.resource.impl.SimpleWsResource.initialize(SimpleWsResource.java:215)
> 
> >       at
> > org.apache.muse.core.routing.RouterFilePersistence.
> > reloadResource(RouterFilePersistence.java:139)
> >       at
> > org.apache.muse.core.AbstractFilePersistence.
> > reloadResources(AbstractFilePersistence.java:393)
> >       at
> >
> 
org.apache.muse.core.AbstractFilePersistence.reload(AbstractFilePersistence.java:334)
> 
> >       at
> > org.apache.muse.core.routing.SimpleResourceRouter.
> > initialize(SimpleResourceRouter.java:248)
> >       at
> > org.apache.muse.core.platform.AbstractIsolationLayer.
> > initialize(AbstractIsolationLayer.java:176)
> >       at
> > org.apache.muse.core.platform.axis2.AxisIsolationLayer.
> > setOperationContext(AxisIsolationLayer.java:138)
> >       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >       at
> >
> 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 
> >       at
> >
> 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 
> >       at java.lang.reflect.Method.invoke(Method.java:585)
> >       at
> > org.apache.axis2.engine.DependencyManager.
> > configureBusinessLogicProvider(DependencyManager.java:70)
> >       at
> > org.apache.axis2.receivers.RawXMLINOutMessageReceiver.
> > invokeBusinessLogic(RawXMLINOutMessageReceiver.java:79)
> >       at
> > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.
> > receive(AbstractInOutSyncMessageReceiver.java:39)
> >       at 
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:504)
> >       at
> > org.apache.axis2.transport.http.HTTPTransportUtils.
> > processHTTPPostRequest(HTTPTransportUtils.java:324)
> >       at
> > 
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:234)
> >       at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> >       at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >       at
> > org.apache.catalina.core.ApplicationFilterChain.
> > internalDoFilter(ApplicationFilterChain.java:252)
> >       at
> > org.apache.catalina.core.ApplicationFilterChain.
> > doFilter(ApplicationFilterChain.java:173)
> >       at
> >
> 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
> 
> >       at
> >
> 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
> 
> >       at
> >
> 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
> 
> >       at
> >
> 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
> 
> >       at
> >
> 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
> 
> >       at
> >
> 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> >       at
> >
> 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
> >       at
> > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.
> > processConnection(Http11BaseProtocol.java:664)
> >       at
> >
> 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
> 
> >       at
> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.
> > runIt(LeaderFollowerWorkerThread.java:80)
> >       at
> >
> 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
> 
> >       at java.lang.Thread.run(Thread.java:595)
> >
> > What am I doing wrong?
> >
> > Thx,
> > Christian
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: muse-user-help@ws.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


Re: WSN-Producer example with wsrf-sg:Content property

Posted by Christian Ewers <CE...@de.ibm.com>.
Hi Dan,

ok, I think I really was (and still am) heading in the wrong direction. My
problem is: When I'm not adding a wsrf-sg:Content property to the Resource
to be added I get the following Exception:

java.lang.RuntimeException: [ID = 'PropertyNotInSchema'] There is no
property named '{http://docs.oasis-open.org/wsrf/sg-2}Content' defined in
the schema. A property should not have any operations or metadata applied
to it if it is not in the WS-RP document.
      at org.apache.muse.ws.resource.sg.impl.AddRequest.toXML(
AddRequest.java:151)
      at org.apache.muse.ws.resource.sg.impl.AddRequest.toXML(
AddRequest.java:120)
      at org.apache.muse.ws.resource.sg.remote.ServiceGroupClient.add(
ServiceGroupClient.java:81)
      at org.apache.muse.test.wsn.WsnTestClient.main(WsnTestClient.java:88)
Caused by: org.apache.muse.ws.addressing.soap.SoapFault: [ID =
'PropertyNotInSchema'] There is no property named
'{http://docs.oasis-open.org/wsrf/sg-2}Content' defined in the schema. A
property should not have any operations or metadata applied to it if it is
not in the WS-RP document.
      at org.apache.muse.core.AbstractResourceClient.invoke(
AbstractResourceClient.java:254)
      at
org.apache.muse.ws.resource.remote.WsResourceClient.getResourceProperty(
WsResourceClient.java:134)
      at org.apache.muse.ws.resource.sg.impl.AddRequest.toXML(
AddRequest.java:144)
      ... 3 more

That's why I thought I have to add the Content property. For testing I
added the following code to the WsnTestClient to add the producer-resource
to my ServiceGroup

//... existing code ...
producer.subscribe(consumer, null, null);

EndpointReference groupEpr = new EndpointReference(getLocalAddress(
"/Registry/services/ServiceGroup", 8080));
ServiceGroupClient sg = new ServiceGroupClient(groupEpr);
sg.setTrace(true);
Calendar cal = Calendar.getInstance();
cal.add(Calendar.HOUR_OF_DAY, 1);
sg.add(producer.getEndpointReference(),cal.getTime()); // (this is line 88
from the Exception)

My ServiceGroup works with other Resources that have a wsrf-sg:Content
property.


thx,
Christian



                                                                           
             Daniel Jemiolo                                                
             <danjemiolo@us.ib                                             
             m.com>                                                     To 
                                       muse-user@ws.apache.org             
             15.11.2006 13:55                                           cc 
                                                                           
                                                                   Subject 
             Please respond to         Re: WSN-Producer example with       
             muse-user@ws.apac         wsrf-sg:Content property            
                  he.org                                                   
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hi,

I think you might be misunderstanding how resources are evaluated for
service group membership. Resource that are potential service group
members have a list of properties (WSRP doc), and the service group
resource has a set of membership content rules which are also a list of
properties. In the latter case, the list signifies which properties a
resource must have in order to become a service group member. When the
WSSG Add operation is invoked, if the service group determines that they
resource has the properties that are in its membership content rules, then
it will create a third resource: a service group entry. The service group
entry has a property named wsrf-sg:Content, and it contains the actual
values of the resource properties that are in the MCR list.

Here's an example:

Let's say I want a service group that will only contain WSDM-enabled
resources. WSDM requires that all manageable resources have a
muws1:ResourceId property, so my service group will have a membership
content rule that lists muws1:ResourceId. In the RMD doc for the service
group resource, I add:


<Property>
  <InitialValues>
    <wsrf-sg:MembershipContentRule ContentElements="muws1:ResourceId"
xmlns:muws1="..." xmlns:wsrf-sg="..."/>
  </InitialValues>
</Property>


After initialization, I try to add a ws-resource that has the
muws1:ResourceId property in its WSRP doc. When I do this, a service group
entry will be created. It will have three properties:

1. ServiceGroupEPR - The EPR of the service group that this entry belongs
to.

2. MemberEPR - The EPR of the ws-resource we're adding.

3. Content - The value of the member's muws1:ResourceId property, which I
got dynamically via GetResourceProperty().


So, you should be most concerned with setting the MCRs (declaratively in
RMD or programmatically - I recommend declaratively). Is this more clear?

Dan


Christian Ewers <CE...@de.ibm.com> wrote on 11/15/2006 04:27:18 AM:

>
> Hi,
> I'm trying to extend the wsn-producer example by adding the WS-Resource
to
> a remote ServiceGroup.
> For doing so, I added the wsrf-sg:Content property to the existing
resource
> properties, extended the MyCapabilityImpl.java class by adding the
> getContent(), setContent(Element e) methods and I added the
WssgConstants.
> CONTENT_QNAMEto the _PROPERTIESarray.
>
> Property in the WSDL-File:
>
> <xsd:element ref="wsrf-sg:Content" minOccurs="0" maxOccurs="1"/>
>
> I added the following test-content to the WsResource.rmd file (also
added
> the wsrf-sg namespace)
>
> <Property name="wsrf-sg:Content" modifiability="read-write" mutability=
> "mutable">
>  <InitialValues>
>   <wsrf-sg:Content>
>    <wsrf-sg:RPDoc>
>     <myns:ServerName>TestServerName</myns:ServerName>
>    </wsrf-sg:RPDoc>
>   </wsrf-sg:Content>
>  </InitialValues>
> </Property>
>
> Now I'm getting the following exception when initializing the resource
by
> using the WsnTestclient. I didn't add any ServiceGroup related code so
far.
>
> java.lang.NullPointerException
>       at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown
Source)
>       at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown
Source)
>       at
> org.apache.muse.ws.notification.properties.ResourcePropertyChangeEvent.
> toXML(ResourcePropertyChangeEvent.java:97)
>       at
> org.apache.muse.ws.notification.properties.ResourcePropertyChangeEvent.
> toXML(ResourcePropertyChangeEvent.java:80)
>       at
> org.apache.muse.ws.notification.impl.SimpleNotificationProducer.
> publish(SimpleNotificationProducer.java:452)
>       at
> org.apache.muse.ws.notification.properties.ChangeNotificationListener.
> propertyChanged(ChangeNotificationListener.java:99)
>       at
>
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.

> changeCompleted(SimpleResourcePropertyCollection.java:337)
>       at
>
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.

> insertResourceProperty(SimpleResourcePropertyCollection.java:718)
>       at
>
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.

> insertResourceProperty(SimpleResourcePropertyCollection.java:681)
>       at
>
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.

> addInitialValues(SimpleResourcePropertyCollection.java:169)
>       at
>
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.

> applyMetadata(SimpleResourcePropertyCollection.java:297)
>       at
>
org.apache.muse.ws.resource.impl.SimpleWsResource.initialize(SimpleWsResource.java:215)

>       at
> org.apache.muse.core.routing.RouterFilePersistence.
> reloadResource(RouterFilePersistence.java:139)
>       at
> org.apache.muse.core.AbstractFilePersistence.
> reloadResources(AbstractFilePersistence.java:393)
>       at
>
org.apache.muse.core.AbstractFilePersistence.reload(AbstractFilePersistence.java:334)

>       at
> org.apache.muse.core.routing.SimpleResourceRouter.
> initialize(SimpleResourceRouter.java:248)
>       at
> org.apache.muse.core.platform.AbstractIsolationLayer.
> initialize(AbstractIsolationLayer.java:176)
>       at
> org.apache.muse.core.platform.axis2.AxisIsolationLayer.
> setOperationContext(AxisIsolationLayer.java:138)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

>       at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

>       at java.lang.reflect.Method.invoke(Method.java:585)
>       at
> org.apache.axis2.engine.DependencyManager.
> configureBusinessLogicProvider(DependencyManager.java:70)
>       at
> org.apache.axis2.receivers.RawXMLINOutMessageReceiver.
> invokeBusinessLogic(RawXMLINOutMessageReceiver.java:79)
>       at
> org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.
> receive(AbstractInOutSyncMessageReceiver.java:39)
>       at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:504)
>       at
> org.apache.axis2.transport.http.HTTPTransportUtils.
> processHTTPPostRequest(HTTPTransportUtils.java:324)
>       at
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:234)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>       at
> org.apache.catalina.core.ApplicationFilterChain.
> internalDoFilter(ApplicationFilterChain.java:252)
>       at
> org.apache.catalina.core.ApplicationFilterChain.
> doFilter(ApplicationFilterChain.java:173)
>       at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)

>       at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)

>       at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)

>       at
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)

>       at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)

>       at
>
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>       at
>
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>       at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.
> processConnection(Http11BaseProtocol.java:664)
>       at
>
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)

>       at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.
> runIt(LeaderFollowerWorkerThread.java:80)
>       at
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)

>       at java.lang.Thread.run(Thread.java:595)
>
> What am I doing wrong?
>
> Thx,
> Christian
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


Re: WSN-Producer example with wsrf-sg:Content property

Posted by Daniel Jemiolo <da...@us.ibm.com>.
Hmmm. I thought we fixed this a long time ago. In fact, here is the code, 
from SimpleResourcePropertyCollection.java, that is causing the fault:


if (!isNillable)
{
    for (int n = 0; n < instances.length; ++n)
    {
        //
        // check for child elements, attributes, and text, all of 
        // which qualify an element as "not null"
        //
        if (!instances[n].hasChildNodes() && 
            !instances[n].hasAttributes() && 
            XmlUtils.extractText(instances[n]) == null)
            throw new SchemaValidationFault(message);
    }
}


As you can see, it includes attributes in the check for 'null' elements 
(note: the error message needs to be updated). Since the MCR elements have 
attributes, this shouldn't be a problem. I will have to look into this 
more. In the meantime, you can hack around the problem by removing the 
'nillable="true"' attribute from the MCR schema defintion.

Dan

Christian Ewers <CE...@de.ibm.com> wrote on 11/15/2006 11:43:59 AM:

> Hi,
> 
> I tried to add the following MCR to the WSServiceGroup.rmd I use.
> 
> <Property name="wsrf-sg:MembershipContentRule" 
modifiability="read-write"
> mutability="mutable">
>   <InitialValues>
>     <wsrf-sg:MembershipContentRule MemberInterfaces="test:WsResource"
> ContentElements="test:MyProperty"
>     xmlns:test="http://ws.apache.org/muse/test/wsrf"/>
>   </InitialValues>
> </Property>
> 
> When initializing the Resource by calling the getPropertyDocument() 
method,
> I get the following exception:
> 
> org.apache.muse.ws.addressing.soap.SoapFault: [ID = 'NotNillable'] The
> property '{http://docs.oasis-open.org/wsrf/sg-2}MembershipContentRule' 
is
> not nillable, but there is an instance of it with no child nodes (a null
> value).
>       at org.apache.muse.core.AbstractResourceClient.invoke(
> AbstractResourceClient.java:254)
>       at
> 
org.apache.muse.ws.resource.remote.WsResourceClient.getResourcePropertyDocument(
> WsResourceClient.java:142)
>       at org.apache.muse.test.wsrf.WsrfTestClient.main(
> WsrfTestClient.java:191)
> 
> Are there any child elements for the MCR-element???
> 
> thx,
> Christian
> 
> 
> 
> 
>  
>              Daniel Jemiolo  
>              <danjemiolo@us.ib  
>              m.com> To 
>                                        muse-user@ws.apache.org  
>              15.11.2006 13:55 cc 
>  
> Subject 
>              Please respond to         Re: WSN-Producer example with  
>              muse-user@ws.apac         wsrf-sg:Content property  
>                   he.org  
>  
>  
>  
>  
>  
> 
> 
> 
> 
> Hi,
> 
> I think you might be misunderstanding how resources are evaluated for
> service group membership. Resource that are potential service group
> members have a list of properties (WSRP doc), and the service group
> resource has a set of membership content rules which are also a list of
> properties. In the latter case, the list signifies which properties a
> resource must have in order to become a service group member. When the
> WSSG Add operation is invoked, if the service group determines that they
> resource has the properties that are in its membership content rules, 
then
> it will create a third resource: a service group entry. The service 
group
> entry has a property named wsrf-sg:Content, and it contains the actual
> values of the resource properties that are in the MCR list.
> 
> Here's an example:
> 
> Let's say I want a service group that will only contain WSDM-enabled
> resources. WSDM requires that all manageable resources have a
> muws1:ResourceId property, so my service group will have a membership
> content rule that lists muws1:ResourceId. In the RMD doc for the service
> group resource, I add:
> 
> 
> <Property>
>   <InitialValues>
>     <wsrf-sg:MembershipContentRule ContentElements="muws1:ResourceId"
> xmlns:muws1="..." xmlns:wsrf-sg="..."/>
>   </InitialValues>
> </Property>
> 
> 
> After initialization, I try to add a ws-resource that has the
> muws1:ResourceId property in its WSRP doc. When I do this, a service 
group
> entry will be created. It will have three properties:
> 
> 1. ServiceGroupEPR - The EPR of the service group that this entry 
belongs
> to.
> 
> 2. MemberEPR - The EPR of the ws-resource we're adding.
> 
> 3. Content - The value of the member's muws1:ResourceId property, which 
I
> got dynamically via GetResourceProperty().
> 
> 
> So, you should be most concerned with setting the MCRs (declaratively in
> RMD or programmatically - I recommend declaratively). Is this more 
clear?
> 
> Dan
> 
> 
> Christian Ewers <CE...@de.ibm.com> wrote on 11/15/2006 04:27:18 AM:
> 
> >
> > Hi,
> > I'm trying to extend the wsn-producer example by adding the 
WS-Resource
> to
> > a remote ServiceGroup.
> > For doing so, I added the wsrf-sg:Content property to the existing
> resource
> > properties, extended the MyCapabilityImpl.java class by adding the
> > getContent(), setContent(Element e) methods and I added the
> WssgConstants.
> > CONTENT_QNAMEto the _PROPERTIESarray.
> >
> > Property in the WSDL-File:
> >
> > <xsd:element ref="wsrf-sg:Content" minOccurs="0" maxOccurs="1"/>
> >
> > I added the following test-content to the WsResource.rmd file (also
> added
> > the wsrf-sg namespace)
> >
> > <Property name="wsrf-sg:Content" modifiability="read-write" 
mutability=
> > "mutable">
> >  <InitialValues>
> >   <wsrf-sg:Content>
> >    <wsrf-sg:RPDoc>
> >     <myns:ServerName>TestServerName</myns:ServerName>
> >    </wsrf-sg:RPDoc>
> >   </wsrf-sg:Content>
> >  </InitialValues>
> > </Property>
> >
> > Now I'm getting the following exception when initializing the resource
> by
> > using the WsnTestclient. I didn't add any ServiceGroup related code so
> far.
> >
> > java.lang.NullPointerException
> >       at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown
> Source)
> >       at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown
> Source)
> >       at
> > 
org.apache.muse.ws.notification.properties.ResourcePropertyChangeEvent.
> > toXML(ResourcePropertyChangeEvent.java:97)
> >       at
> > 
org.apache.muse.ws.notification.properties.ResourcePropertyChangeEvent.
> > toXML(ResourcePropertyChangeEvent.java:80)
> >       at
> > org.apache.muse.ws.notification.impl.SimpleNotificationProducer.
> > publish(SimpleNotificationProducer.java:452)
> >       at
> > org.apache.muse.ws.notification.properties.ChangeNotificationListener.
> > propertyChanged(ChangeNotificationListener.java:99)
> >       at
> >
> 
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.
> 
> > changeCompleted(SimpleResourcePropertyCollection.java:337)
> >       at
> >
> 
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.
> 
> > insertResourceProperty(SimpleResourcePropertyCollection.java:718)
> >       at
> >
> 
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.
> 
> > insertResourceProperty(SimpleResourcePropertyCollection.java:681)
> >       at
> >
> 
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.
> 
> > addInitialValues(SimpleResourcePropertyCollection.java:169)
> >       at
> >
> 
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.
> 
> > applyMetadata(SimpleResourcePropertyCollection.java:297)
> >       at
> >
> 
org.apache.muse.ws.resource.impl.SimpleWsResource.initialize(SimpleWsResource.java:215)
> 
> >       at
> > org.apache.muse.core.routing.RouterFilePersistence.
> > reloadResource(RouterFilePersistence.java:139)
> >       at
> > org.apache.muse.core.AbstractFilePersistence.
> > reloadResources(AbstractFilePersistence.java:393)
> >       at
> >
> 
org.apache.muse.core.AbstractFilePersistence.reload(AbstractFilePersistence.java:334)
> 
> >       at
> > org.apache.muse.core.routing.SimpleResourceRouter.
> > initialize(SimpleResourceRouter.java:248)
> >       at
> > org.apache.muse.core.platform.AbstractIsolationLayer.
> > initialize(AbstractIsolationLayer.java:176)
> >       at
> > org.apache.muse.core.platform.axis2.AxisIsolationLayer.
> > setOperationContext(AxisIsolationLayer.java:138)
> >       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >       at
> >
> 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 
> >       at
> >
> 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 
> >       at java.lang.reflect.Method.invoke(Method.java:585)
> >       at
> > org.apache.axis2.engine.DependencyManager.
> > configureBusinessLogicProvider(DependencyManager.java:70)
> >       at
> > org.apache.axis2.receivers.RawXMLINOutMessageReceiver.
> > invokeBusinessLogic(RawXMLINOutMessageReceiver.java:79)
> >       at
> > org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.
> > receive(AbstractInOutSyncMessageReceiver.java:39)
> >       at 
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:504)
> >       at
> > org.apache.axis2.transport.http.HTTPTransportUtils.
> > processHTTPPostRequest(HTTPTransportUtils.java:324)
> >       at
> > 
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:234)
> >       at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> >       at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> >       at
> > org.apache.catalina.core.ApplicationFilterChain.
> > internalDoFilter(ApplicationFilterChain.java:252)
> >       at
> > org.apache.catalina.core.ApplicationFilterChain.
> > doFilter(ApplicationFilterChain.java:173)
> >       at
> >
> 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
> 
> >       at
> >
> 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
> 
> >       at
> >
> 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
> 
> >       at
> >
> 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
> 
> >       at
> >
> 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
> 
> >       at
> >
> 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> >       at
> >
> 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
> >       at
> > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.
> > processConnection(Http11BaseProtocol.java:664)
> >       at
> >
> 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
> 
> >       at
> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.
> > runIt(LeaderFollowerWorkerThread.java:80)
> >       at
> >
> 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
> 
> >       at java.lang.Thread.run(Thread.java:595)
> >
> > What am I doing wrong?
> >
> > Thx,
> > Christian
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: muse-user-help@ws.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


Re: WSN-Producer example with wsrf-sg:Content property

Posted by Christian Ewers <CE...@de.ibm.com>.
Hi,

I tried to add the following MCR to the WSServiceGroup.rmd I use.

<Property name="wsrf-sg:MembershipContentRule" modifiability="read-write"
mutability="mutable">
  <InitialValues>
    <wsrf-sg:MembershipContentRule MemberInterfaces="test:WsResource"
ContentElements="test:MyProperty"
    xmlns:test="http://ws.apache.org/muse/test/wsrf"/>
  </InitialValues>
</Property>

When initializing the Resource by calling the getPropertyDocument() method,
I get the following exception:

org.apache.muse.ws.addressing.soap.SoapFault: [ID = 'NotNillable'] The
property '{http://docs.oasis-open.org/wsrf/sg-2}MembershipContentRule' is
not nillable, but there is an instance of it with no child nodes (a null
value).
      at org.apache.muse.core.AbstractResourceClient.invoke(
AbstractResourceClient.java:254)
      at
org.apache.muse.ws.resource.remote.WsResourceClient.getResourcePropertyDocument(
WsResourceClient.java:142)
      at org.apache.muse.test.wsrf.WsrfTestClient.main(
WsrfTestClient.java:191)

Are there any child elements for the MCR-element???

thx,
Christian




                                                                           
             Daniel Jemiolo                                                
             <danjemiolo@us.ib                                             
             m.com>                                                     To 
                                       muse-user@ws.apache.org             
             15.11.2006 13:55                                           cc 
                                                                           
                                                                   Subject 
             Please respond to         Re: WSN-Producer example with       
             muse-user@ws.apac         wsrf-sg:Content property            
                  he.org                                                   
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hi,

I think you might be misunderstanding how resources are evaluated for
service group membership. Resource that are potential service group
members have a list of properties (WSRP doc), and the service group
resource has a set of membership content rules which are also a list of
properties. In the latter case, the list signifies which properties a
resource must have in order to become a service group member. When the
WSSG Add operation is invoked, if the service group determines that they
resource has the properties that are in its membership content rules, then
it will create a third resource: a service group entry. The service group
entry has a property named wsrf-sg:Content, and it contains the actual
values of the resource properties that are in the MCR list.

Here's an example:

Let's say I want a service group that will only contain WSDM-enabled
resources. WSDM requires that all manageable resources have a
muws1:ResourceId property, so my service group will have a membership
content rule that lists muws1:ResourceId. In the RMD doc for the service
group resource, I add:


<Property>
  <InitialValues>
    <wsrf-sg:MembershipContentRule ContentElements="muws1:ResourceId"
xmlns:muws1="..." xmlns:wsrf-sg="..."/>
  </InitialValues>
</Property>


After initialization, I try to add a ws-resource that has the
muws1:ResourceId property in its WSRP doc. When I do this, a service group
entry will be created. It will have three properties:

1. ServiceGroupEPR - The EPR of the service group that this entry belongs
to.

2. MemberEPR - The EPR of the ws-resource we're adding.

3. Content - The value of the member's muws1:ResourceId property, which I
got dynamically via GetResourceProperty().


So, you should be most concerned with setting the MCRs (declaratively in
RMD or programmatically - I recommend declaratively). Is this more clear?

Dan


Christian Ewers <CE...@de.ibm.com> wrote on 11/15/2006 04:27:18 AM:

>
> Hi,
> I'm trying to extend the wsn-producer example by adding the WS-Resource
to
> a remote ServiceGroup.
> For doing so, I added the wsrf-sg:Content property to the existing
resource
> properties, extended the MyCapabilityImpl.java class by adding the
> getContent(), setContent(Element e) methods and I added the
WssgConstants.
> CONTENT_QNAMEto the _PROPERTIESarray.
>
> Property in the WSDL-File:
>
> <xsd:element ref="wsrf-sg:Content" minOccurs="0" maxOccurs="1"/>
>
> I added the following test-content to the WsResource.rmd file (also
added
> the wsrf-sg namespace)
>
> <Property name="wsrf-sg:Content" modifiability="read-write" mutability=
> "mutable">
>  <InitialValues>
>   <wsrf-sg:Content>
>    <wsrf-sg:RPDoc>
>     <myns:ServerName>TestServerName</myns:ServerName>
>    </wsrf-sg:RPDoc>
>   </wsrf-sg:Content>
>  </InitialValues>
> </Property>
>
> Now I'm getting the following exception when initializing the resource
by
> using the WsnTestclient. I didn't add any ServiceGroup related code so
far.
>
> java.lang.NullPointerException
>       at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown
Source)
>       at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown
Source)
>       at
> org.apache.muse.ws.notification.properties.ResourcePropertyChangeEvent.
> toXML(ResourcePropertyChangeEvent.java:97)
>       at
> org.apache.muse.ws.notification.properties.ResourcePropertyChangeEvent.
> toXML(ResourcePropertyChangeEvent.java:80)
>       at
> org.apache.muse.ws.notification.impl.SimpleNotificationProducer.
> publish(SimpleNotificationProducer.java:452)
>       at
> org.apache.muse.ws.notification.properties.ChangeNotificationListener.
> propertyChanged(ChangeNotificationListener.java:99)
>       at
>
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.

> changeCompleted(SimpleResourcePropertyCollection.java:337)
>       at
>
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.

> insertResourceProperty(SimpleResourcePropertyCollection.java:718)
>       at
>
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.

> insertResourceProperty(SimpleResourcePropertyCollection.java:681)
>       at
>
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.

> addInitialValues(SimpleResourcePropertyCollection.java:169)
>       at
>
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.

> applyMetadata(SimpleResourcePropertyCollection.java:297)
>       at
>
org.apache.muse.ws.resource.impl.SimpleWsResource.initialize(SimpleWsResource.java:215)

>       at
> org.apache.muse.core.routing.RouterFilePersistence.
> reloadResource(RouterFilePersistence.java:139)
>       at
> org.apache.muse.core.AbstractFilePersistence.
> reloadResources(AbstractFilePersistence.java:393)
>       at
>
org.apache.muse.core.AbstractFilePersistence.reload(AbstractFilePersistence.java:334)

>       at
> org.apache.muse.core.routing.SimpleResourceRouter.
> initialize(SimpleResourceRouter.java:248)
>       at
> org.apache.muse.core.platform.AbstractIsolationLayer.
> initialize(AbstractIsolationLayer.java:176)
>       at
> org.apache.muse.core.platform.axis2.AxisIsolationLayer.
> setOperationContext(AxisIsolationLayer.java:138)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

>       at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

>       at java.lang.reflect.Method.invoke(Method.java:585)
>       at
> org.apache.axis2.engine.DependencyManager.
> configureBusinessLogicProvider(DependencyManager.java:70)
>       at
> org.apache.axis2.receivers.RawXMLINOutMessageReceiver.
> invokeBusinessLogic(RawXMLINOutMessageReceiver.java:79)
>       at
> org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.
> receive(AbstractInOutSyncMessageReceiver.java:39)
>       at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:504)
>       at
> org.apache.axis2.transport.http.HTTPTransportUtils.
> processHTTPPostRequest(HTTPTransportUtils.java:324)
>       at
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:234)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>       at
> org.apache.catalina.core.ApplicationFilterChain.
> internalDoFilter(ApplicationFilterChain.java:252)
>       at
> org.apache.catalina.core.ApplicationFilterChain.
> doFilter(ApplicationFilterChain.java:173)
>       at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)

>       at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)

>       at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)

>       at
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)

>       at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)

>       at
>
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>       at
>
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>       at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.
> processConnection(Http11BaseProtocol.java:664)
>       at
>
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)

>       at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.
> runIt(LeaderFollowerWorkerThread.java:80)
>       at
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)

>       at java.lang.Thread.run(Thread.java:595)
>
> What am I doing wrong?
>
> Thx,
> Christian
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org


Re: WSN-Producer example with wsrf-sg:Content property

Posted by Daniel Jemiolo <da...@us.ibm.com>.
Hi,

I think you might be misunderstanding how resources are evaluated for 
service group membership. Resource that are potential service group 
members have a list of properties (WSRP doc), and the service group 
resource has a set of membership content rules which are also a list of 
properties. In the latter case, the list signifies which properties a 
resource must have in order to become a service group member. When the 
WSSG Add operation is invoked, if the service group determines that they 
resource has the properties that are in its membership content rules, then 
it will create a third resource: a service group entry. The service group 
entry has a property named wsrf-sg:Content, and it contains the actual 
values of the resource properties that are in the MCR list.

Here's an example:

Let's say I want a service group that will only contain WSDM-enabled 
resources. WSDM requires that all manageable resources have a 
muws1:ResourceId property, so my service group will have a membership 
content rule that lists muws1:ResourceId. In the RMD doc for the service 
group resource, I add:


<Property>
  <InitialValues>
    <wsrf-sg:MembershipContentRule ContentElements="muws1:ResourceId" 
xmlns:muws1="..." xmlns:wsrf-sg="..."/>
  </InitialValues>
</Property>


After initialization, I try to add a ws-resource that has the 
muws1:ResourceId property in its WSRP doc. When I do this, a service group 
entry will be created. It will have three properties:

1. ServiceGroupEPR - The EPR of the service group that this entry belongs 
to.

2. MemberEPR - The EPR of the ws-resource we're adding.

3. Content - The value of the member's muws1:ResourceId property, which I 
got dynamically via GetResourceProperty().


So, you should be most concerned with setting the MCRs (declaratively in 
RMD or programmatically - I recommend declaratively). Is this more clear?

Dan


Christian Ewers <CE...@de.ibm.com> wrote on 11/15/2006 04:27:18 AM:

> 
> Hi,
> I'm trying to extend the wsn-producer example by adding the WS-Resource 
to
> a remote ServiceGroup.
> For doing so, I added the wsrf-sg:Content property to the existing 
resource
> properties, extended the MyCapabilityImpl.java class by adding the
> getContent(), setContent(Element e) methods and I added the 
WssgConstants.
> CONTENT_QNAMEto the _PROPERTIESarray.
> 
> Property in the WSDL-File:
> 
> <xsd:element ref="wsrf-sg:Content" minOccurs="0" maxOccurs="1"/>
> 
> I added the following test-content to the WsResource.rmd file (also 
added
> the wsrf-sg namespace)
> 
> <Property name="wsrf-sg:Content" modifiability="read-write" mutability=
> "mutable">
>  <InitialValues>
>   <wsrf-sg:Content>
>    <wsrf-sg:RPDoc>
>     <myns:ServerName>TestServerName</myns:ServerName>
>    </wsrf-sg:RPDoc>
>   </wsrf-sg:Content>
>  </InitialValues>
> </Property>
> 
> Now I'm getting the following exception when initializing the resource 
by
> using the WsnTestclient. I didn't add any ServiceGroup related code so 
far.
> 
> java.lang.NullPointerException
>       at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown 
Source)
>       at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown 
Source)
>       at
> org.apache.muse.ws.notification.properties.ResourcePropertyChangeEvent.
> toXML(ResourcePropertyChangeEvent.java:97)
>       at
> org.apache.muse.ws.notification.properties.ResourcePropertyChangeEvent.
> toXML(ResourcePropertyChangeEvent.java:80)
>       at
> org.apache.muse.ws.notification.impl.SimpleNotificationProducer.
> publish(SimpleNotificationProducer.java:452)
>       at
> org.apache.muse.ws.notification.properties.ChangeNotificationListener.
> propertyChanged(ChangeNotificationListener.java:99)
>       at
> 
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.
> changeCompleted(SimpleResourcePropertyCollection.java:337)
>       at
> 
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.
> insertResourceProperty(SimpleResourcePropertyCollection.java:718)
>       at
> 
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.
> insertResourceProperty(SimpleResourcePropertyCollection.java:681)
>       at
> 
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.
> addInitialValues(SimpleResourcePropertyCollection.java:169)
>       at
> 
org.apache.muse.ws.resource.properties.impl.SimpleResourcePropertyCollection.
> applyMetadata(SimpleResourcePropertyCollection.java:297)
>       at
> 
org.apache.muse.ws.resource.impl.SimpleWsResource.initialize(SimpleWsResource.java:215)
>       at
> org.apache.muse.core.routing.RouterFilePersistence.
> reloadResource(RouterFilePersistence.java:139)
>       at
> org.apache.muse.core.AbstractFilePersistence.
> reloadResources(AbstractFilePersistence.java:393)
>       at
> 
org.apache.muse.core.AbstractFilePersistence.reload(AbstractFilePersistence.java:334)
>       at
> org.apache.muse.core.routing.SimpleResourceRouter.
> initialize(SimpleResourceRouter.java:248)
>       at
> org.apache.muse.core.platform.AbstractIsolationLayer.
> initialize(AbstractIsolationLayer.java:176)
>       at
> org.apache.muse.core.platform.axis2.AxisIsolationLayer.
> setOperationContext(AxisIsolationLayer.java:138)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at
> 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at
> 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:585)
>       at
> org.apache.axis2.engine.DependencyManager.
> configureBusinessLogicProvider(DependencyManager.java:70)
>       at
> org.apache.axis2.receivers.RawXMLINOutMessageReceiver.
> invokeBusinessLogic(RawXMLINOutMessageReceiver.java:79)
>       at
> org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.
> receive(AbstractInOutSyncMessageReceiver.java:39)
>       at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:504)
>       at
> org.apache.axis2.transport.http.HTTPTransportUtils.
> processHTTPPostRequest(HTTPTransportUtils.java:324)
>       at
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:234)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>       at
> org.apache.catalina.core.ApplicationFilterChain.
> internalDoFilter(ApplicationFilterChain.java:252)
>       at
> org.apache.catalina.core.ApplicationFilterChain.
> doFilter(ApplicationFilterChain.java:173)
>       at
> 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>       at
> 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
>       at
> 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
>       at
> 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
>       at
> 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>       at
> 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>       at
> 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>       at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.
> processConnection(Http11BaseProtocol.java:664)
>       at
> 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>       at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.
> runIt(LeaderFollowerWorkerThread.java:80)
>       at
> 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
>       at java.lang.Thread.run(Thread.java:595)
> 
> What am I doing wrong?
> 
> Thx,
> Christian
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: muse-user-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: muse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-user-help@ws.apache.org