Christian Bernardt - LogFiles, SD

Noelle Givler ngivler at bbn.com
Mon Jun 30 17:38:29 EDT 2008


Problem seems to be with your yp community. Comments embedded below
Christian Bernardt wrote:
> Hi Noelle,
>
> I have gone through your list and found out about the following facts:
>
> *0.)*
> My ServiceProfileURL looks like this:
> file:/N:/arbeit/cougaar/programming/CougaarControl/src/data/serviceprofiles/
>
> Does this look right to you?
It's fine so long as that's the correct path to your service profiles. 
Are you writing your own method to generate it or using the method 
provided by org.cougaar.servicediscovery.Constants?
>
> *1.)*
> The SimpleSDRegistrationPlugin.isProvider() -> returns with true
>
> I don't understand this code in the SimpleSDRegistrationPlugin:
>
> protected void initYPInfo() {
>     Collection params = getParameters();
>    
>     if (params.isEmpty()) {
>       IllegalArgumentException iae = new IllegalArgumentException();
>       log.error("SDRegistrationPlugin: no YP agent parameter" +
>         " - unable to register.", iae);
>     } else {
>       ypInfo = new YPInfo((String) params.iterator().next(),
>               _*null*_, false, false);
>     }
>
> It puts null to the new YPInfo, where there should be inserted a 
> YPCommunity, so I guess this is inserted at another point in the code, 
> but where. The SimpleSDReg..Plugin prints out
>
> /DEBUG - SDRegistrationPlugin - MTA: : ypInfo = 
> org.cougaar.servicediscovery.plugin.SimpleSDRegistrationPlugin$YPInfo at 138b0d5/
>
> In the SimpleSDR..Plugin the code for the community doesn't set the 
> community:
>
> protected void findYPCommunity() {
>     Community ypCommunity =
>       
> communityService.getCommunity(getYPCommunityName(ypInfo.getAgentName()),
>                     new YPCommunityResponseListener(ypInfo));
>    
>     if (ypCommunity != null) {
>       ypInfo.setCommunity(ypCommunity);
>       if (log.isDebugEnabled()) {
>     log.debug("Registering: " + getAgentIdentifier() + " with " +
>           ypInfo.getCommunity().getName());
>       }
>       initialRegister();
>     } else if (log.isDebugEnabled()) {
>       log.debug("waiting on community info " +
>         getYPCommunityName(ypInfo.getAgentName()));
>     }
>
> it instead runs the else branch (yellow part) of the code and issues:
>
> /DEBUG - SDRegistrationPlugin - MTA: waiting on community info 
> TrySimFactoryYPA-YPCOMMUNITY/
>
> So I assume it did not find the community. Then the initialRegister() 
> doesn't get called, because readyToRegister() return false:
>
>  if (ypInfo.readyToRegister()) {
>     if (log.isDebugEnabled()) {
>       log.debug("Registering: " + getAgentIdentifier() + " with " +
>             ypInfo.getCommunity().getName());
>     }
>     initialRegister();
>       }
>     }
>
> To sum up, the community does not get found, the registration is 
> therefore not completed.
Short answer - SimpleSDRegistrationPlugin calls  findYPCommunity() to 
find the YP community for the specified agent. (That's the point of the 
initial null value in the ypInfo structure.) So it looks like there's 
something wrong in the way you've set up the community support via 
Communities.xml. The CommunityViewerServlet should show you the yp 
communities in the running society so you can see how the Cougaar is 
interpreting your Communities.xml Section 3.2.10 of the Cougaar 
Developer's Guide also addresses Cougaar community support.

>
> *2.)*
> I have attached my Constants.java to let you see, whether the roles 
> are defined correctly.
Looks fine to me.
> *3.)*
> About the MilitaryServiceScheme, this is what bothered me most as 
> well, because I thought, when using the pizza example as my 
> foundation, I would automatically use the COMMERCIAL_SERVICE_SCHEME, 
> when I look into the servlet, I also see, that the MMQuery refers to 
> the MilitaryServiceScheme. What can I do about it? I have not 
> overwritten the getServiceScheme. However I have copied the 
> MatchMakerPlugin to my Plugins for debugging reasons, but it still has:
>
> protected String getServiceSchemeForRoles() {
>     return Constants.UDDIConstants.COMMERCIAL_SERVICE_SCHEME;
>   }
>
> in it.
>
Is it possible that your plugin somehow extends 
org.cougaar.servicediscovery.plugin.MatchmakerStubPlugin instead of 
SimpleMatchmakerPlugin? MatchmakerStubPlugin does reference the 
MilitaryServiceScheme when generating ServiceClassifications based on 
MMQueryRequests - see MatchmakerStubPlugin.addRQ().
> I hope you don't find this mail too confusing and the formatting gets 
> transmitted right.
>
> Looking forward to hear from you. I really appreciate your help.
>
> Thank you very much. Yours, Christian
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cougaar.org/pipermail/cougaar-developers/attachments/20080630/8863ec6b/attachment.html


More information about the Cougaar-developers mailing list