[OpenSAML] OpenSAML requires an xml parser that supports JAXP 1.3 and DOM3.

1,783 views
Skip to first unread message

vepanje...@gmail.com

unread,
Aug 24, 2009, 4:35:24 AM8/24/09
to mace-open...@internet2.edu
Hi,

I am running glassfish webserver and using opensaml for parsing SAML 2.0. I am getting the below mentioned error.

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

I have endorsed the jars xml-apis-2.9.1,xercesImpl-2.9.1,xalan-2.7.1, serializer-2.9.1 and resolver-2.9.1 placing the following locations.

C:\glassfish\lib\endorsed
C:\Program Files\Java\jdk1.5.0_14\lib\endorsed

Please help me how to resolve this issue.

Regards,
Govind.

Chad La Joie

unread,
Aug 24, 2009, 4:40:55 AM8/24/09
to mace-open...@internet2.edu
No you did not endorse those libraries or else you wouldn't be getting
that error. Check your container's docs to see if they have a special
endorsement mechanism.

--
SWITCH
Serving Swiss Universities
--------------------------
Chad La Joie, Software Engineer, Net Services
Werdstrasse 2, P.O. Box, 8021 Zürich, Switzerland
phone +41 44 268 15 75, fax +41 44 268 15 68
chad....@switch.ch, http://www.switch.ch

Govinda Reddy

unread,
Aug 24, 2009, 4:50:34 AM8/24/09
to mace-open...@internet2.edu
Hi,

I am using opensaml-2.2.3.jar in our application. when I restart the
glassfish webserver, i will get the below mention error while parsing
the xml. To fix this issue I have to re-deploy my ear. I have placed
all required endorsed jars into glassfish\lib\endorsed folder. then
also I am getting the same error after restart of my web server .
Please help me how to over come this issue.


Regards,
Govind.

Chad La Joie

unread,
Aug 24, 2009, 6:12:54 AM8/24/09
to mace-open...@internet2.edu
It doesn't matter how many times you say you endorsed, you didn't or
else you wouldn't be getting the error. If you believe that Glassfish
is the thing controlling the endorsement, which is quite likely, then
you need to contact them and ask how to properly endorse libraries for
that container.

--

Joakim Recht

unread,
Aug 27, 2009, 5:51:37 AM8/27/09
to mace-open...@internet2.edu
Chad La Joie wrote:
> It doesn't matter how many times you say you endorsed, you didn't or
> else you wouldn't be getting the error. If you believe that Glassfish
> is the thing controlling the endorsement, which is quite likely, then
> you need to contact them and ask how to properly endorse libraries for
> that container.

Hi

Glassfish is nice enough to explicitely define which xml parser to use
by setting the system property javax.xml.parsers.DocumentBuilderFactory,
so any endorsement you make will not have any effect.

To fix this, add a similar property to the domain.xml file:

<jvm-options>-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</jvm-options>

It's worth noting that this behavior also overrides the normal
META-INF/services method where you do not have to endorse anything.

Regards,
--
Joakim Recht

Trifork A/S, Margrethepladsen 4, 8000 Aarhus C, Denmark
Phone: +45 8732 8787 / Mobile: +45 2021 6257
http://www.trifork.com - E-mail: j...@trifork.com

Govinda Reddy

unread,
Aug 27, 2009, 6:23:29 AM8/27/09
to mace-open...@internet2.edu
Thank you so much... finally this issue has been resolved.

Chad La Joie

unread,
Aug 27, 2009, 6:29:24 AM8/27/09
to mace-open...@internet2.edu
Yeah, every container does something different.

Joakim, does Glassfish document this mechanism (which honestly at first
glance I think I'd prefer over the standard endorse mechanism) somewhere?

Joakim Recht wrote:
> Chad La Joie wrote:
>> It doesn't matter how many times you say you endorsed, you didn't or
>> else you wouldn't be getting the error. If you believe that Glassfish
>> is the thing controlling the endorsement, which is quite likely, then
>> you need to contact them and ask how to properly endorse libraries for
>> that container.
>
> Hi
>
> Glassfish is nice enough to explicitely define which xml parser to use
> by setting the system property javax.xml.parsers.DocumentBuilderFactory,
> so any endorsement you make will not have any effect.
>
> To fix this, add a similar property to the domain.xml file:
>
> <jvm-options>-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</jvm-options>
>
>
> It's worth noting that this behavior also overrides the normal
> META-INF/services method where you do not have to endorse anything.
>
> Regards,

--

Joakim Recht

unread,
Aug 27, 2009, 6:34:35 AM8/27/09
to mace-open...@internet2.edu
Chad La Joie wrote:
> Yeah, every container does something different.
>
> Joakim, does Glassfish document this mechanism (which honestly at first
> glance I think I'd prefer over the standard endorse mechanism) somewhere?

The thing about editing domain.xml? I haven't seen anything which
explicitly refers to the xml parser.

However, the other mechanisms for choosing parsers are documented in the
java api:
http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/parsers/DocumentBuilderFactory.html#newInstance()

Just be aware that in order to use the services api properly, you must
use 1.5.0_14+, if I remember correctly. Earlier versions had some kind
of bug which prevented it from finding the services file.

Chad La Joie

unread,
Aug 27, 2009, 6:40:11 AM8/27/09
to mace-open...@internet2.edu
No, I knew about what Java supported (and there is a maddening
combinations of bugs from Sun's JDK and Xerces/Xalan that makes this not
work except for in the latest and greatest releases of everything). I
just wondered if Glassfish documented the whole process for setting the
various factory implementations.

Joakim Recht wrote:
> Chad La Joie wrote:
>> Yeah, every container does something different.
>>
>> Joakim, does Glassfish document this mechanism (which honestly at
>> first glance I think I'd prefer over the standard endorse mechanism)
>> somewhere?
>
> The thing about editing domain.xml? I haven't seen anything which
> explicitly refers to the xml parser.
>
> However, the other mechanisms for choosing parsers are documented in the
> java api:
> http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/parsers/DocumentBuilderFactory.html#newInstance()
>
>
> Just be aware that in order to use the services api properly, you must
> use 1.5.0_14+, if I remember correctly. Earlier versions had some kind
> of bug which prevented it from finding the services file.
>
> Regards,

--

Reply all
Reply to author
Forward
0 new messages