From users-return-2360-apmail-ws-users-archive=ws.apache.org@ws.apache.org Mon Jul 14 11:45:53 2014 Return-Path: X-Original-To: apmail-ws-users-archive@www.apache.org Delivered-To: apmail-ws-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6E3AC11FD2 for ; Mon, 14 Jul 2014 11:45:53 +0000 (UTC) Received: (qmail 50969 invoked by uid 500); 14 Jul 2014 11:45:53 -0000 Delivered-To: apmail-ws-users-archive@ws.apache.org Received: (qmail 50917 invoked by uid 500); 14 Jul 2014 11:45:53 -0000 Mailing-List: contact users-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@ws.apache.org Delivered-To: mailing list users@ws.apache.org Received: (qmail 50902 invoked by uid 99); 14 Jul 2014 11:45:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jul 2014 11:45:52 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [91.221.169.45] (HELO smtp.demon.co.uk) (91.221.169.45) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Jul 2014 11:45:49 +0000 Received: from mdfmta004.tch.inty.net (unknown [127.0.0.1]) by mdfmta004.tch.inty.net (Postfix) with ESMTP id E86B5AC40A2; Mon, 14 Jul 2014 12:45:38 +0100 (BST) Received: from mdfmta004.tch.inty.net (unknown [127.0.0.1]) by mdfmta004.tch.inty.net (Postfix) with ESMTP id 802FAAC40A6; Mon, 14 Jul 2014 12:45:37 +0100 (BST) Received: from octavo (unknown [83.105.71.76]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mdfmta004.tch.inty.net (Postfix) with ESMTP; Mon, 14 Jul 2014 12:45:37 +0100 (BST) From: "Adrian Williamson" To: Cc: References: <005901cf9f3e$a3f69a30$ebe3ce90$@demon.co.uk> <006d01cf9f4d$21e57de0$65b079a0$@demon.co.uk> <007f01cf9f53$966e59b0$c34b0d10$@demon.co.uk> <009601cf9f57$090976a0$1b1c63e0$@demon.co.uk> <009e01cf9f57$874486e0$95cd94a0$@demon.co.uk> In-Reply-To: Subject: RE: FW: CryptoFactory.getInstance("wss40.properties"); - in Wss4J 2.0.2 Date: Mon, 14 Jul 2014 12:45:20 +0100 Message-ID: <00a901cf9f59$17bc5d00$47351700$@demon.co.uk> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00AA_01CF9F61.7980C500" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac+fWFps9MGaHsMOTGyGxkzvsU5/SQAAJ1ig Content-Language: en-gb X-MDF-HostID: 17 X-Virus-Checked: Checked by ClamAV on apache.org This is a multipart message in MIME format. ------=_NextPart_000_00AA_01CF9F61.7980C500 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable No, that=E2=80=99s what I=E2=80=99m looking for now. =20 From: Colm O hEigeartaigh [mailto:coheigea@apache.org]=20 Sent: 14 July 2014 12:40 To: Adrian Williamson Cc: users@ws.apache.org Subject: Re: FW: CryptoFactory.getInstance("wss40.properties"); - in = Wss4J 2.0.2 =20 =20 Do you have the XML Security jar on the classpath? Colm. =20 On Mon, Jul 14, 2014 at 12:34 PM, Adrian Williamson = wrote: Sorry, I just noticed the first error complaining about = XMLSecurityException =E2=80=93 I think there is some Maven voodoo going = on to make things work that may take some time for me to tease out. =20 From: Adrian Williamson [mailto:aw@octavo2.demon.co.uk]=20 Sent: 14 July 2014 12:31 To: coheigea@apache.org Cc: users@ws.apache.org Subject: RE: FW: CryptoFactory.getInstance("wss40.properties"); - in = Wss4J 2.0.2 =20 Ouch. =20 I took the liberty of trying this from the command prompt: =20 set CLASSPATH=3Dc:\wss4jtrunc\jars\* =20 C:\Users\ingres\Documents\NetBeansProjects\ExceptionTest\src\exceptiontes= t>javac ExceptionTest.java ExceptionTest.java:11: error: cannot access XMLSecurityException crypto =3D = CryptoFactory.getInstance("wss40.properties");//compilation error here ^ class file for org.apache.xml.security.exceptions.XMLSecurityException = not found ExceptionTest.java:20: error: unreported exception WSSecurityException; = must be caught or declared to be thrown localCrypto =3D = CryptoFactory.getInstance("wss40.properties");//compilation error here ^ 2 errors =20 Where ExceptionTest.java is this source: =20 package exceptiontest; =20 import org.apache.wss4j.common.crypto.Crypto; import org.apache.wss4j.common.crypto.CryptoFactory; =20 public class ExceptionTest{ =20 private Crypto crypto =3D null; =20 public ExceptionTest() throws Exception { crypto =3D = CryptoFactory.getInstance("wss40.properties");//compilation error here } =20 public static void main (String[]args) { =20 Crypto localCrypto =3D null; =20 try { localCrypto =3D = CryptoFactory.getInstance("wss40.properties");//compilation error here } catch (Exception e)=20 { System.out.println("Caught Exception" + e.getMessage()); } } } =20 =20 =20 =20 From: Colm O hEigeartaigh [mailto:coheigea@apache.org]=20 Sent: 14 July 2014 12:13 To: Adrian Williamson Cc: users@ws.apache.org Subject: Re: FW: CryptoFactory.getInstance("wss40.properties"); - in = Wss4J 2.0.2 =20 =20 Sorry, but I'm only willing to look at test-code if I can compile + run = it via ant/maven/etc, I don't use netbeans... Colm. =20 On Mon, Jul 14, 2014 at 12:05 PM, Adrian Williamson = wrote: Hi, =20 This is the project taken from NetBeans 8.0 =20 All I did was create a new Java Application using the IDE wizard, then I = added the wss4j jar files to the project using the Project Properties = Libraries section. =20 I then pasted in the source below and it complains about = CryptoFactory.getInstance. =20 Are you getting that? =20 Thanks =20 Adrian =20 From: Colm O hEigeartaigh [mailto:coheigea@apache.org]=20 Sent: 14 July 2014 11:53 To: users@ws.apache.org Subject: Re: FW: CryptoFactory.getInstance("wss40.properties"); - in = Wss4J 2.0.2 =20 Can you create a test-case that I could unzip + compile? Colm. =20 On Mon, Jul 14, 2014 at 11:19 AM, Adrian Williamson = wrote: Hi=20 =20 I isolated this against the 2.0.2 jars I built: =20 package exceptiontest; =20 import org.apache.wss4j.common.crypto.Crypto; import org.apache.wss4j.common.crypto.CryptoFactory; =20 public class ExceptionTest{ =20 private Crypto crypto =3D null; =20 public ExceptionTest() throws Exception { crypto =3D = CryptoFactory.getInstance("wss40.properties");//compilation error here } =20 public static void main (String[]args) { =20 Crypto localCrypto =3D null; =20 try { localCrypto =3D = CryptoFactory.getInstance("wss40.properties");//compilation error here } catch (Exception e)=20 { System.out.println("Caught Exception" + e.getMessage()); } } =20 } =20 I can see this used in the test classes in the Wss4J project, so I fully = expect it to be something stupid I=E2=80=99m not doing. =20 Thanks =20 Adrian =20 From: Colm O hEigeartaigh [mailto:coheigea@apache.org]=20 Sent: 14 July 2014 11:06 To: users@ws.apache.org Subject: Re: FW: CryptoFactory.getInstance("wss40.properties"); - in = Wss4J 2.0.2 =20 =20 What does your code snippet look like? Colm. =20 On Mon, Jul 14, 2014 at 9:35 AM, Adrian Williamson = wrote: Can anyone shed some light on this? Thanks Adrian -----Original Message----- From: Adrian Williamson [mailto:aw@octavo2.demon.co.uk] Sent: 11 July 2014 16:06 To: users@ws.apache.org Subject: CryptoFactory.getInstance("wss40.properties"); - in Wss4J 2.0.2 Hi, NetBeans/JDK1.7 is telling me that I need to handle "unreported = exception WSSecurityException; must be caught or declared to be thrown" for this invocation of CryptoFactory.getInstance. However I can't make it go away by blindly wrapping it in a try-catch or = by throwing the exception as in the examples: 81 public EncryptionTest() throws Exception { 82 crypto =3D = CryptoFactory.getInstance("wss40.properties"); 83 } If I try to reference WSSecurityException in the catch block it = maintains that it cannot be converted to throwable due to incompatible types. java.lang.Object java.lang.Throwable java.lang.Exception org.apache.xml.security.exceptions.XMLSecurityException org.apache.wss4j.common.ext.WSSecurityException Forgive me for what might seem like a very basic java question but why = is it complaining? Thanks Adrian =20 --=20 Colm O hEigeartaigh Talend Community Coder http://coders.talend.com --=20 Colm O hEigeartaigh Talend Community Coder http://coders.talend.com --=20 Colm O hEigeartaigh Talend Community Coder http://coders.talend.com --=20 Colm O hEigeartaigh Talend Community Coder http://coders.talend.com ------=_NextPart_000_00AA_01CF9F61.7980C500 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

No, that=E2=80=99s what I=E2=80=99m looking for = now.

 

From:= Colm O = hEigeartaigh [mailto:coheigea@apache.org]
Sent: 14 July 2014 12:40
To: Adrian Williamson
Cc: users@ws.apache.org
Subject: Re: FW: CryptoFactory.getInstance("wss40.properties"); - in Wss4J = 2.0.2

 

 

Do you have the XML Security jar on the = classpath?

Colm.

 

On Mon, Jul 14, 2014 at 12:34 PM, Adrian Williamson = <aw@octavo2.demon.co.uk> wrote:

Sorry, I just noticed the first error complaining about XMLSecurityException = =E2=80=93 I think there is some Maven voodoo going on to make things work that may take = some time for me to tease out.

 

From:= Adrian = Williamson [mailto:aw@octavo2.demon.co.uk]
Sent: 14 July 2014 12:31
To: coheigea@apache.org
Cc: users@ws.apache.org
Subject: RE: FW: CryptoFactory.getInstance("wss40.properties"); - in Wss4J = 2.0.2

 <= /o:p>

Ouch.

 

I took the liberty of trying this from the command = prompt:

 

set CLASSPATH=3Dc:\wss4jtrunc\jars\*

 

C:\Users\ingres\Documents\NetBeansProjects\ExceptionTest\src\exception= test>javac ExceptionTest.java

ExceptionTest.java:11: error: cannot access XMLSecurityException

     crypto =3D = CryptoFactory.getInstance("wss40.properties");//compilation error here

                 &= nbsp;           &n= bsp;         ^

  class file for org.apache.xml.security.exceptions.XMLSecurityException = not found

ExceptionTest.java:20: error: unreported exception WSSecurityException; must be caught or = declared to be thrown

    localCrypto =3D CryptoFactory.getInstance("wss40.properties");//compilation = error here

           &nbs= p;            = ;            =        ^

2 errors

 

Where ExceptionTest.java is this source:

 

package exceptiontest;

 

import org.apache.wss4j.common.crypto.Crypto;

import org.apache.wss4j.common.crypto.CryptoFactory;

  

public class ExceptionTest{

   

    private Crypto crypto =3D null;

   

    public ExceptionTest() throws Exception = {

     crypto =3D CryptoFactory.getInstance("wss40.properties");//compilation = error here

     }

   

public static void main (String[]args)

{

 

    Crypto localCrypto =3D null;

   

try {

    localCrypto =3D = CryptoFactory.getInstance("wss40.properties");//compilation error here

    }

catch (Exception e)

    {

    System.out.println("Caught Exception" + e.getMessage());

    }

}

}

 

 

 

 

From:= Colm O = hEigeartaigh [mailto:coheigea@apache.org]
Sent: 14 July 2014 12:13
To: Adrian Williamson
Cc: users@ws.apache.org
Subject: Re: FW: CryptoFactory.getInstance("wss40.properties"); - in Wss4J = 2.0.2

 <= /o:p>

 <= /o:p>

Sorry, but I'm only willing to look at test-code if I can compile + run it via ant/maven/etc, I don't use netbeans...

Colm.

 <= /p>

On Mon, Jul 14, 2014 at 12:05 PM, Adrian Williamson <aw@octavo2.demon.co.uk> wrote:

Hi,

 

This is the project taken from NetBeans 8.0

 

All I did was create a new Java Application using the IDE wizard, then I added = the wss4j jar files to the project using the Project Properties Libraries = section.

 

I then pasted in the source below and it complains  about CryptoFactory.getInstance.

 

Are you getting that?

 

Thanks

 

Adrian

 

From:= Colm O = hEigeartaigh [mailto:coheigea@apache.org]
Sent: 14 July 2014 11:53
To: users@ws.apache.org
Subject: Re: FW: CryptoFactory.getInstance("wss40.properties"); - in Wss4J = 2.0.2

 <= /o:p>

Can you create a test-case that I could unzip + compile?

Colm.

 <= /p>

On Mon, Jul 14, 2014 at 11:19 AM, Adrian Williamson <aw@octavo2.demon.co.uk> wrote:

Hi

 

I isolated this against the 2.0.2 jars I built:

 

package exceptiontest;

 

import org.apache.wss4j.common.crypto.Crypto;

import org.apache.wss4j.common.crypto.CryptoFactory;

  

public class ExceptionTest{

   

    private Crypto crypto =3D null;

   

    public ExceptionTest() throws Exception {

     crypto =3D = CryptoFactory.getInstance("wss40.properties");//compilation error here

     }

   

public static void main (String[]args)

{

 

    Crypto localCrypto =3D null;

   

try {

    localCrypto =3D CryptoFactory.getInstance("wss40.properties");//compilation = error here

    }

catch (Exception e)

    {

    System.out.println("Caught Exception" + = e.getMessage());

    }

}

 

}

 

I can see this used in the test classes in the Wss4J project, so I fully = expect it to be something stupid I=E2=80=99m not doing.

 

Thanks

 

Adrian

 

From:= Colm O = hEigeartaigh [mailto:coheigea@apache.org]
Sent: 14 July 2014 11:06
To: users@ws.apache.org
Subject: Re: FW: CryptoFactory.getInstance("wss40.properties"); - in Wss4J = 2.0.2

 <= /o:p>

 <= /o:p>

What does your code snippet look like?

Colm.

 <= /p>

On Mon, Jul 14, 2014 at 9:35 AM, Adrian Williamson <aw@octavo2.demon.co.uk> wrote:

Can anyone shed some light on this?

Thanks

Adrian


-----Original Message-----
From: Adrian Williamson [mailto:aw@octavo2.demon.co.uk]
Sent: 11 July 2014 16:06
To: users@ws.apache.org
Subject: CryptoFactory.getInstance("wss40.properties"); - in = Wss4J 2.0.2

Hi,

NetBeans/JDK1.7 is telling me that I need to handle "unreported = exception
WSSecurityException; must be caught or declared to be thrown" for = this
invocation of CryptoFactory.getInstance.

However I can't make it go away by blindly wrapping it in a try-catch or = by
throwing the exception as in the examples:

81      public EncryptionTest() throws Exception {
82              crypto =3D CryptoFactory.getInstance("wss40.properties");
83      }

If I try to reference WSSecurityException in the catch block it = maintains
that it cannot be converted to throwable due to incompatible types.

java.lang.Object
  java.lang.Throwable
    java.lang.Exception
      = org.apache.xml.security.exceptions.XMLSecurityException
        = org.apache.wss4j.common.ext.WSSecurityException

Forgive me for what might seem like a very basic java question but why = is it
complaining?

Thanks

Adrian

 



--
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com




--
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com




--
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com




--
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com

------=_NextPart_000_00AA_01CF9F61.7980C500--