Return-Path: X-Original-To: apmail-ws-dev-archive@www.apache.org Delivered-To: apmail-ws-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D1DAD6393 for ; Mon, 4 Jul 2011 13:29:26 +0000 (UTC) Received: (qmail 99624 invoked by uid 500); 4 Jul 2011 13:29:26 -0000 Delivered-To: apmail-ws-dev-archive@ws.apache.org Received: (qmail 99143 invoked by uid 500); 4 Jul 2011 13:29:24 -0000 Mailing-List: contact dev-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ws.apache.org Delivered-To: mailing list dev@ws.apache.org Delivered-To: moderator for dev@ws.apache.org Received: (qmail 58349 invoked by uid 99); 4 Jul 2011 12:59:47 -0000 X-ASF-Spam-Status: No, hits=2.9 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.in; s=s1024; t=1309784355; bh=3p7K27zupMKc+JtdmQPlF6RZ75h2xdOUpJ6DywT3WBM=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:MIME-Version:Content-Type; b=0zd5cikOr5UfgQkvGPT/Zr/x6Q+VeBNYuCyGN/UB8QUBowH7ZU74podSa6aHZMJ5N/Naab96TMaJG5yGNBJ41/j7SBNGYDYSyhOu4T0ny3AQmxLluYmFhE9w+BD9U/DWPAMsAalnFzOKNbrb6G0WorAT5+4j0qQj0xx2k9kTyJ0= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:MIME-Version:Content-Type; b=FOGWlH3N/QJBQ5azNcaB4guD5amXVRJEmaAS8aegfL4ALnE7s+roQnmpI7TYUUJkd+AEn4tMWkuqjbYL9+WzxmhGgz9VqgqpX+Xc4naI1Adey7DWAh97WGVq670uU+WsujbXvUf25Hxdat1xuFm1lwWKS96G0y3+aDS6iBz9LIk=; X-YMail-OSG: BLX0VcsVM1lkLqix0K0kZeL7Y1jhoYXyu75hS8o3vkrQLU1 XDNO3hx40BgR6UPadRkSVQnQZjL9BgaHTueiXEiUYgMTm1us6t1QI4Hza.Oj 72ARCA6Dd70F8O6OhkhiD8K7__xaZoPIPNeLWXzWS2Mkb1hFu3UrXbvyl1Cd 1Bmkrci9MsZXZnEK9RUBqiJhYFNGS9yl_Jwey.AYtCl7d4tN.DdO87yEimvP HTyg7MhFI3qTsdTJZiCanrj6zIaWswjz3u.H.uFgkjQlmWUJuyYbXd39lYrW IlybVv0Z8u1UgmnhA3gd4UtCObeVXf.sEXy2u9lVaTilmlX23mSkELsdj_OH eEPrNZwDz0WjO26qlaPDrlDHHA6V.EcyKbZZvlv0P9MbDYvqywhCmDhnmKcn AoEBhT8HYrbgMtUNy2TDM5_4IitkVk07IEf87c4GBnL1lBN41ANcyulZWOnO E2nQO7xau86zN._K1YJnhnTXmGlkvkjZlV4ZmeYlAW7nGQZ.Dut9W7pVePwL rjmesW.Dq8YC_0Sb1jHh_y46MeVUMw.yR7r2bl.0IilxqzBQCDqB3vQ9Vw3. XIW0QIG46alo.7UDqcAIuPA05BDyJ99RmUam_RmadUFzir6GfKsIbcloWv0F iHKHM1B071CIVMWytdOPQlNv9Np.WGxs- X-Mailer: YahooMailClassic/14.0.3 YahooMailWebService/0.8.112.307740 Message-ID: <1309784355.51081.YahooMailClassic@web94610.mail.in2.yahoo.com> Date: Mon, 4 Jul 2011 18:29:15 +0530 (IST) From: JAYA KARTHIK Subject: Policy reference can not be resolved To: dev@ws.apache.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1353816890-1309784355=:51081" --0-1353816890-1309784355=:51081 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi, Am a new Apache Neethi user.I downloaded the latest Apache Neethi 3.0.0 bin= aries. On using I get the following exception when it tries t= o resolve the corresponding policy. Exception in thread "main" java.lang.RuntimeException: #PolicyID can't be r= esolved =A0=A0=A0=A0=A0=A0=A0 at org.apache.neethi.AbstractPolicyOperator.normalize= Operator(AbstractPolicyOperator.java:130) =A0=A0=A0=A0=A0=A0=A0 at org.apache.neethi.AbstractPolicyOperator.normalize= Operator(AbstractPolicyOperator.java:143) =A0=A0=A0=A0=A0=A0=A0 at org.apache.neethi.AbstractPolicyOperator.normalize= Operator(AbstractPolicyOperator.java:140) =A0=A0=A0=A0=A0=A0=A0 at org.apache.neethi.AbstractPolicyOperator.normalize= (AbstractPolicyOperator.java:87) =A0=A0=A0=A0=A0=A0=A0 at org.apache.neethi.Policy.normalize(Policy.java:95) =A0=A0=A0=A0=A0=A0=A0 at org.apache.neethi.Policy$PolicyIterator.(Pol= icy.java:245) =A0=A0=A0=A0=A0=A0=A0 at org.apache.neethi.Policy.getAlternatives(Policy.ja= va:235) =A0=A0=A0=A0=A0=A0=A0 at TestNeethi.test(TestNeethi.java:26) =A0=A0=A0=A0=A0=A0=A0 at TestNeethi.main(TestNeethi.java:18) Following is the test source code: public class TestNeethi{ =A0=A0=A0 public static void main(String args[])throws Exception{=A0=A0=A0= =20 =A0=A0=A0 =A0=A0=A0 new TestNeethi().test(args[0]);=A0=A0=A0=20 =A0=A0=A0 } =A0=A0=A0 public void test(String file) throws Exception{ =A0=A0=A0 =A0=A0=A0 Assertion ast=3Dnull; =A0=A0=A0 =A0=A0=A0 PolicyBuilder builder =3D new PolicyBuilder(); =A0=A0=A0 =A0=A0=A0 builder.setPolicyRegistry(new PolicyRegistryImpl()); =A0=A0=A0 =A0=A0=A0 Policy policy=3Dbuilder.getPolicy(getResourceAsDOM(file= )); =A0=A0=A0 =A0=A0=A0 Iterator it =3D policy.getAlternatives(); =A0=A0=A0 =A0=A0=A0 while(it.hasNext()){ =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 List k =3D(ArrayList)it.next(); =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 for(int g=3D0;g =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =20 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0 Not sure if am missing something.Could you please help me in resolving this= ? Thanks&Regards J.JayaKarthik. --0-1353816890-1309784355=:51081 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable <= /table> --0-1353816890-1309784355=:51081--
Hi,

Am a new Apache Neethi user.I down= loaded the latest Apache Neethi 3.0.0 binaries.
On using <PolicyRefer= ence ..> I get the following exception when it tries to resolve the corr= esponding policy.

Exception in thread "main" java.lang.RuntimeExcept= ion: #PolicyID can't be resolved
      &nb= sp; at org.apache.neethi.AbstractPolicyOperator.normalizeOperator(AbstractP= olicyOperator.java:130)
        at or= g.apache.neethi.AbstractPolicyOperator.normalizeOperator(AbstractPolicyOper= ator.java:143)
        at org.apache.= neethi.AbstractPolicyOperator.normalizeOperator(AbstractPolicyOperator.java= :140)
        at org.apache.neethi.AbstractPolicyOperator.normalize(AbstractPolicyOperator.= java:87)
        at org.apache.neethi= .Policy.normalize(Policy.java:95)
      &n= bsp; at org.apache.neethi.Policy$PolicyIterator.<init>(Policy.java:24= 5)
        at org.apache.neethi.Polic= y.getAlternatives(Policy.java:235)
      &= nbsp; at TestNeethi.test(TestNeethi.java:26)
    &nb= sp;   at TestNeethi.main(TestNeethi.java:18)

Following is = the test source code:

public class TestNeethi{
   = public static void main(String args[])throws Exception{    =
        new TestNeethi().test(args[0]);&n= bsp;  
    }
    public void= test(String file) throws Exception{
        Assertion ast=3Dnull;
      = ;  PolicyBuilder builder =3D new PolicyBuilder();
   = ;     builder.setPolicyRegistry(new PolicyRegistryImpl());        Policy policy=3Dbuilder.getPolicy(g= etResourceAsDOM(file));
        Iterator i= t =3D policy.getAlternatives();
        wh= ile(it.hasNext()){
          &nb= sp; List k =3D(ArrayList)it.next();
       = ;     for(int g=3D0;g<k.size();g++){
   = ;             ast =3D (org.apa= che.neethi.Assertion)k.get(g);
        &nb= sp;       System.out.println(ast.toString()); = ;                          
  &= nbsp;         }      = ;         
     =    }           
=     }   
    public Elemen= t getResourceAsDOM(String name)
      &nb= sp; throws ParserConfigurationException, SAXException, IOException {
&nb= sp;       InputStream in =3D new FileInputStr= eam(name);
        DocumentBuilderFac= tory dbf =3D DocumentBuilderFactory.newInstance();
   &nb= sp;    dbf.setValidating(false);
    =     dbf.setIgnoringComments(false);
   &nb= sp;    dbf.setIgnoringElementContentWhitespace(true);
    =     dbf.setNamespaceAware(true);
    =     DocumentBuilder db =3D null;
    =     db =3D dbf.newDocumentBuilder();
   &n= bsp;    return db.parse(in).getDocumentElement();
 &= nbsp;  }   
}

Policy file used:

<P= olicies xmlns:wsp=3D"http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:ws= u=3D"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-uti= lity-1.0.xsd" xmlns:wsaws=3D"http://www.w3.org/2005/08/addressing">
&= nbsp;   <wsp:Policy Name=3D"OuterPolicy" >
  &= nbsp;     <wsp:All>
      =       <wsp:PolicyReference URI=3D"#PolicyID"/>        </wsp:All>
  &nbs= p; </wsp:Policy>
    <wsp:Policy Name=3D"TestPoli= cy" wsu:Id=3D"PolicyID" >
         = ;<wsp:All>
           = ; <wsaws:UsingAddressing xmlns:wsaws=3D"http://www.w3.org/2006/05/addres= sing/wsdl"/>
          &= lt;/wsp:All>
    </wsp:Policy>
</Policies&= gt;

Not sure if am missing something.Could you please help me in res= olving this?

Thanks&Regards
J.JayaKarthik.