Skip to Content.
Sympa Menu

mace-opensaml-users - The endorsing problem revisited

Subject: OpenSAML user discussion

List archive

The endorsing problem revisited


Chronological Thread 
  • From: "Massimiliano Masi" <>
  • To:
  • Subject: The endorsing problem revisited
  • Date: Wed, 22 Aug 2007 19:19:35 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=QxF6p4IQZ2abVdfK99I51eRnAC3TEDU8g+KmCQeCYeitN3BchqoqqalOdPK7ucuarjk/3DxrMFRjpR/TgbOZoXgiVab+MnF45RRVeUK6IV3IBrhb1WOynidiobbQoy5zgqTRpYufBkmj8t3WAuphzMm39sSGJ21uqFxC3Jq1G98=

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

--
Massimiliano Masi

http://www.comunidelchianti.it/~max



Archive powered by MHonArc 2.6.16.

Top of Page