mace-opensaml-users - Re: The endorsing problem revisited
Subject: OpenSAML user discussion
List archive
- From: Chad La Joie <>
- To:
- Subject: Re: The endorsing problem revisited
- Date: Wed, 22 Aug 2007 13:31:58 -0400
- Openpgp: id=A260F52E; url=http://pgpkeys.pca.dfn.de/pks/lookup?op=get&search=0x3F5E9E87A260F52E
- Organization: Georgetown University
I don't think the first error you list is an error from the OpenSAML
code. I just looks like the log message that indicates which parser is
being used. The null pointer exception is in your code.
Massimiliano Masi wrote:
> Hi all,
>
> I'm trying to start coding with OpenSAML2. Using the following code
> (taken from an
> email from this list of some months ago):
>
>
>
>
>
> package com.prova;
>
> import java.io.PrintWriter;
> import java.io.StringWriter;
>
> import org.apache.log4j.Logger;
> import org.opensaml.Configuration;
> import org.opensaml.saml2.core.AuthnStatement;
> import org.opensaml.saml2.core.impl.AuthnStatementBuilder;
> import org.opensaml.saml2.core.validator.AuthnStatementSchemaValidator;
> import org.opensaml.xml.XMLObjectBuilderFactory;
> import org.opensaml.xml.validation.ValidationException;
>
>
> public class Prova {
> public static void main(String args[])
> {
> Logger logger = Logger.getLogger (Prova.class);
>
> try
> {
> XMLObjectBuilderFactory builderFactory =
> Configuration.getBuilderFactory ();
> AuthnStatementBuilder authnStatementBuilder =
> (AuthnStatementBuilder)builderFactory.getBuilder(AuthnStatement.DEFAULT_ELEMENT_NAME);
>
> AuthnStatement authnStatement =
> authnStatementBuilder.buildObject ();
>
> logger.debug ("Calling
> authnStatement.validate(false)");
> authnStatement.validate (false);
>
> logger.debug ("Calling AuthnStatementSchemaValidator
> ().validate");
> try
> {
> new AuthnStatementSchemaValidator ().validate
> (authnStatement);
> }
> catch (ValidationException e)
> {
> logger.debug (e);
> }
>
> logger.debug ("Calling
> authnStatement.validate(true)");
> authnStatement.validate (true);
> logger.debug ("finished");
> }
> catch (NullPointerException e)
> {
> StringWriter sw = new StringWriter ();
> e.printStackTrace (new PrintWriter (sw));
> logger.debug (sw.toString ());
>
>
>
>
> }
> catch(ValidationException e)
> {
> e.printStackTrace();
> }
> catch(Throwable T)
> {
> T.printStackTrace();
> }
> }
> }
>
>
> I got the JAXP parser error:
> VM using JAXP parser org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
> org.opensaml.xml.Configuration
> VM using JAXP parser org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
> org.opensaml.xml.Configuration
> java.lang.NullPointerException
> at com.prova.Prova.main(Prova.java:25)
> com.prova.Prova
>
> I have -Djava.endorsed.dirs=/opt/java5/lib/endorsed in eclipse's vm args.
>
> The endorsed lib is:
> max@fourier
> /afs/mascanc.net/users/m/max/Desktop $ ls /opt/java5/lib/endorsed/
> total 6.6M
> -rw-r--r-- 1 root root 83K Aug 22 19:03 resolver.jar
> -rw-r--r-- 1 root root 272K Aug 22 19:03 serializer.jar
> -rw-r--r-- 1 root root 3.0M Aug 22 19:08 xalan.jar
> -rw-r--r-- 1 root root 1.2M Aug 22 19:03 xercesImpl.jar
> -rw-r--r-- 1 root root 162K Aug 22 19:03 xercesSamples.jar
> -rw-r--r-- 1 root root 190K Aug 22 19:03 xml-apis.jar
> -rw-r--r-- 1 root root 1.8M Aug 22 19:08 xsltc.jar
>
>
> (latest download of xerces and xalan)
>
> If the endorsed directory is wrong the error message become:
>
>
> VM using JAXP parser
> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
> org.opensaml.xml.Configuration
> VM using JAXP parser
> com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
> org.opensaml.xml.Configuration
>
>
>
> OpenSAML requires an xml parser that supports JAXP 1.3 and DOM3.
> The JVM is currently configured to use the Sun XML parser, which is known
> to be buggy and can not be used with OpenSAML. Please endorse a functional
> JAXP library(ies) such as Xerces and Xalan. For instructions on how to
> endorse
> a new parser see
> http://java.sun.com/j2se/1.5.0/docs/guide/standards/index.html
>
>
> org.opensaml.xml.Configuration
>
>
>
>
> I don't have the Configuration.init() since is not in the
> opensaml-2.0-alpha1-jdk1.5.jar.
>
>
>
>
> Do you have any hints?
>
>
> Thanks,
>
>
> Massimiliano
>
>
>
>
> PS: Sorry if you receive multiple message. My university mailserver
> doesn't work properly
>
--
Chad La Joie 2052-C Harris Bldg
OIS-Middleware 202.687.0124
- The endorsing problem revisited, Massimiliano Masi, 08/22/2007
- Re: The endorsing problem revisited, Chad La Joie, 08/22/2007
- Re: The endorsing problem revisited, Massimiliano Masi, 08/22/2007
- Re: The endorsing problem revisited, Chad La Joie, 08/22/2007
- Re: The endorsing problem revisited, Brent Putman, 08/22/2007
- Re: The endorsing problem revisited, Massimiliano Masi, 08/23/2007
- Re: The endorsing problem revisited, Massimiliano Masi, 08/23/2007
- Profile question, Janardhanan, Srilakshmi, 08/28/2007
- Re: Profile question, Chad La Joie, 08/28/2007
- RE: Profile question, Janardhanan, Srilakshmi, 08/29/2007
- RE: Profile question, Scott Cantor, 08/29/2007
- RE: Profile question, Janardhanan, Srilakshmi, 08/29/2007
- Re: Profile question, Chad La Joie, 08/28/2007
- Re: The endorsing problem revisited, Massimiliano Masi, 08/23/2007
- Re: The endorsing problem revisited, Massimiliano Masi, 08/22/2007
- Re: The endorsing problem revisited, Chad La Joie, 08/22/2007
Archive powered by MHonArc 2.6.16.