<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Problem seems to be with your yp community. Comments embedded below<br>
Christian Bernardt wrote:
<blockquote
 cite="mid:e65d710e0806261509i6e90ced1h7c927896d0902739@mail.gmail.com"
 type="cite">Hi Noelle,<br>
  <br>
I have gone through your list and found out about the following facts:<br>
  <br>
  <b><font size="4">0.)</font></b><br>
  <div style="margin-left: 40px;">My ServiceProfileURL looks like this:<br>
<a class="moz-txt-link-freetext" href="file:/N:/arbeit/cougaar/programming/CougaarControl/src/data/serviceprofiles/">file:/N:/arbeit/cougaar/programming/CougaarControl/src/data/serviceprofiles/</a><br>
  <br>
Does this look right to you?<br>
  </div>
</blockquote>
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?<br>
<blockquote
 cite="mid:e65d710e0806261509i6e90ced1h7c927896d0902739@mail.gmail.com"
 type="cite"><br>
  <font size="4"><b>1.)</b></font><br>
  <div style="margin-left: 40px;">The
SimpleSDRegistrationPlugin.isProvider() -&gt; returns with true<br>
  <br>
I don't understand this code in the SimpleSDRegistrationPlugin:<br>
  <br>
  </div>
  <div style="margin-left: 80px;"><font size="1">protected void
initYPInfo() {<br>
&nbsp;&nbsp;&nbsp; Collection params = getParameters();<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; if (params.isEmpty()) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IllegalArgumentException iae = new IllegalArgumentException();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; log.error("SDRegistrationPlugin: no YP agent parameter" +<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; " - unable to register.", iae);<br>
&nbsp;&nbsp;&nbsp; } else {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ypInfo = new YPInfo((String) params.iterator().next(),<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; <u style="background-color: rgb(255, 255, 0);"><b>null</b></u>,
false, false);<br>
&nbsp;&nbsp;&nbsp; }</font><br>
  </div>
  <div style="margin-left: 40px;"><br>
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 <br>
  <br>
  </div>
  <div style="margin-left: 80px;"><i>DEBUG - SDRegistrationPlugin -
MTA: : ypInfo =
org.cougaar.servicediscovery.plugin.SimpleSDRegistrationPlugin$YPInfo@138b0d5</i><br>
  </div>
  <div style="margin-left: 40px;"><br>
In the SimpleSDR..Plugin the code for the community doesn't set the
community:<br>
  <br>
  </div>
  <div style="margin-left: 80px;"><font size="1">protected void
findYPCommunity() {</font><br>
  <font size="1">&nbsp;&nbsp;&nbsp; Community ypCommunity = </font><br>
  <font size="1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
communityService.getCommunity(getYPCommunityName(ypInfo.getAgentName()),</font><br>
  <font size="1">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; new
YPCommunityResponseListener(ypInfo));</font><br>
  <font size="1">&nbsp;&nbsp;&nbsp; </font><br>
  <font size="1">&nbsp;&nbsp;&nbsp; if (ypCommunity != null) {</font><br>
  <font size="1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ypInfo.setCommunity(ypCommunity);</font><br>
  <font size="1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (log.isDebugEnabled()) {</font><br>
  <font size="1">&nbsp;&nbsp;&nbsp; log.debug("Registering: " + getAgentIdentifier() +
" with " +</font><br>
  <font size="1">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; ypInfo.getCommunity().getName());</font><br>
  <font size="1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</font><br>
  <font size="1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; initialRegister();</font><br>
  <font size="1">&nbsp;&nbsp;&nbsp; }<span
 style="background-color: rgb(255, 255, 102);"> else if
(log.isDebugEnabled()) {</span></font><br
 style="background-color: rgb(255, 255, 102);">
  <font style="background-color: rgb(255, 255, 102);" size="1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
log.debug("waiting on community info " +</font><br
 style="background-color: rgb(255, 255, 102);">
  <font style="background-color: rgb(255, 255, 102);" size="1">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
getYPCommunityName(ypInfo.getAgentName()));</font><br
 style="background-color: rgb(255, 255, 102);">
  <font style="background-color: rgb(255, 255, 102);" size="1">&nbsp;&nbsp;&nbsp; }</font><br>
  </div>
  <div style="margin-left: 40px;"><br>
it instead runs the else branch (yellow part) of the code and issues:<br>
  <br>
  </div>
  <div style="margin-left: 80px;"><i>DEBUG - SDRegistrationPlugin -
MTA: waiting on community info TrySimFactoryYPA-YPCOMMUNITY</i><br>
  </div>
  <div style="margin-left: 40px;"><br>
  <font size="2">So I assume it did not find the community. Then the
initialRegister() doesn't get called, because readyToRegister() return
false:</font><br>
  <br>
  </div>
  <div style="margin-left: 80px;"><font size="2">&nbsp;<font size="1">if
(ypInfo.readyToRegister()) {</font></font><br>
  <font size="2"><font size="1">&nbsp;&nbsp;&nbsp; if (log.isDebugEnabled()) {</font></font><br>
  <font size="2"><font size="1">&nbsp;&nbsp;&nbsp; &nbsp; log.debug("Registering: " +
getAgentIdentifier() + " with " +</font></font><br>
  <font size="2"><font size="1">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
ypInfo.getCommunity().getName());</font></font><br>
  <font size="2"><font size="1">&nbsp;&nbsp;&nbsp; }</font></font><br>
  <font size="2"><font size="1">&nbsp;&nbsp;&nbsp; initialRegister();</font></font><br>
  <font size="2"><font size="1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</font></font><br>
  <font size="2"><font size="1">&nbsp;&nbsp;&nbsp; }<br>
  </font></font></div>
  <div style="margin-left: 40px;"><br>
To sum up, the community does not get found, the registration is
therefore not completed.<br>
  </div>
</blockquote>
Short answer - SimpleSDRegistrationPlugin calls&nbsp; 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.<br>
<br>
<blockquote
 cite="mid:e65d710e0806261509i6e90ced1h7c927896d0902739@mail.gmail.com"
 type="cite">
  <div class="gmail_quote"><br>
  <font size="4"><b>2.)</b></font><br>
  <div style="margin-left: 40px;">I have attached my Constants.java to
let you see, whether the roles are defined correctly.<br>
  </div>
  </div>
</blockquote>
Looks fine to me.<br>
<blockquote
 cite="mid:e65d710e0806261509i6e90ced1h7c927896d0902739@mail.gmail.com"
 type="cite">
  <div class="gmail_quote"><font size="4"><b>3.)</b></font><br>
  <div style="margin-left: 40px;">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:<br>
  <br>
protected String getServiceSchemeForRoles() {<br>
&nbsp;&nbsp;&nbsp; return Constants.UDDIConstants.COMMERCIAL_SERVICE_SCHEME;<br>
&nbsp; }<br>
  <br>
in it.<br>
  <br>
  </div>
  </div>
</blockquote>
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(). <br>
<blockquote
 cite="mid:e65d710e0806261509i6e90ced1h7c927896d0902739@mail.gmail.com"
 type="cite">
  <div class="gmail_quote">I hope you don't find this mail too
confusing and the formatting gets transmitted right.<br>
  <br>
Looking forward to hear from you. I really appreciate your help.<br>
  <br>
Thank you very much. Yours, Christian<br>
  <br>
  <div style="margin-left: 40px;"> </div>
  </div>
</blockquote>
<br>
</body>
</html>