You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@santuario.apache.org by Bryan Field-Elliot <br...@netmeme.org> on 2003/03/13 22:19:28 UTC

JDK 1.4.1/Xalan issue

Hi,

I realize this is your #1 most-frequently-asked question, but I can't
seem to find a satisfactory answer...

I still get intermittent (and that's what's maddening, it's
intermittent) exceptions thrown from XMLSec, regarding "reading the
installation notes" and checking the endorsed directory.

I'm using RedHat Linux 7.3, Sun JDK 1.4.1_01, and XML Security 1.0.5D2.

Xalan is version 2.4.1, and I have xalan.jar in
/$JAVA_HOME/jre/lib/endorsed, as well as /$JAVA_HOME/lib/endorsed, as
well as my own application classpath. 

NullPointerException occurs in:

org.apache.xml.security.utils.XMLUtils.getOwnerDocument(XMLUtils.java:996)

The original method I called was XMLSignature.sign().

Am I missing something?

Again, what makes me nuts about this, is that the problem is
intermittent... It's a Servlet application. I can click "back", and
"submit" again (in my browser), and everything goes through just fine.

Thank you,

Bryan

Re: JDK 1.4.1/Xalan issue

Posted by Evaristo Camarero <ev...@ece.ericsson.se>.
I have a similar problem with a servlet application. Have you solved
this problem?

Thank you,

Evaristo

On Thu, 2003-03-13 at 22:19, Bryan Field-Elliot wrote:
> Hi, 
> 
> I realize this is your #1 most-frequently-asked question, but I can't
> seem to find a satisfactory answer... 
> 
> I still get intermittent (and that's what's maddening, it's
> intermittent) exceptions thrown from XMLSec, regarding "reading the
> installation notes" and checking the endorsed directory. 
> 
> I'm using RedHat Linux 7.3, Sun JDK 1.4.1_01, and XML Security
> 1.0.5D2. 
> 
> Xalan is version 2.4.1, and I have xalan.jar in
> /$JAVA_HOME/jre/lib/endorsed, as well as /$JAVA_HOME/lib/endorsed, as
> well as my own application classpath. 
> 
> NullPointerException occurs in: 
> 
> org.apache.xml.security.utils.XMLUtils.getOwnerDocument(XMLUtils.java:996) 
> 
> The original method I called was XMLSignature.sign(). 
> 
> Am I missing something? 
> 
> Again, what makes me nuts about this, is that the problem is
> intermittent... It's a Servlet application. I can click "back", and
> "submit" again (in my browser), and everything goes through just fine.
> 
> Thank you, 
> 
> Bryan


RE: JDK 1.4.1/Xalan issue

Posted by Bryan Field-Elliot <br...@netmeme.org>.
Glad I could help, though I'm still a little dizzy over this. It took a
long time to zero in on, since it's intermittent (and low frequency) its
been low priority too, but still bothersome. I think I have it solved,
but more testing needed.

XMLSec installation instructions say to put "xalan.jar" in
JAVA_HOME/lib/endorsed. But Tomcat, by default, will blow this away, by
launching java with "-Djava.endorsed.dirs=" (a blank value).

Solution (which passes a quick test but more testing needed) is to make
sure the environment variable JAVA_ENDORSED_DIRS is set to
"$JAVA_HOME/lib/endorsed" before running Tomcat. The RPM lets you do
this in "/var/tomcat4/tomcat4.conf", but the Binary install of Tomcat
doesn't seem to have or use this file. So many variables!

I consider this a bug in Tomcat (4.1.18), it shouldn't be issuing a
"-Djava.endorsed.dirs=" (empty) if the user didn't supply a custom value
there in the first place... It should just leave out the environment
property completely. Or maybe I'm missing something else (again, so many
variables).

Sorry if this is a little OT from XMLSec (not really an XMLSec issue,
the installation notes are correct), but I suspect there are a lot of
people here using XMLSec in Tomcat.

I still can hardly believe my eyes that this problem is so
intermittent.. I don't think I've ever encountered a similarly
intermittent problem (with the same inputs each time) in Java. Last time
was in the C++ days of pointer arithmetic errors and double free()'s.

Bryan

On Thu, 2003-03-13 at 14:54, Scott Cantor wrote:

    Thank you. Now I know *why* it's doing that, which is more than I
    knew before!
    
    -- Scott
    

RE: JDK 1.4.1/Xalan issue

Posted by Scott Cantor <ca...@osu.edu>.
Thank you. Now I know *why* it's doing that, which is more than I knew before!

-- Scott


RE: JDK 1.4.1/Xalan issue

Posted by Bryan Field-Elliot <br...@netmeme.org>.
Thanks.. I think I almost caught up to you just as you posted... ;)
Noticing that Tomcat's "startup.sh" is overriding the java.endorsed.dirs
environment property.  And JAVA_HOME/lib/endorsed is not looked at if
the java.endorsed.dirs environment property is present (even if the
property value is empty).

Thanks again,

Bryan


On Thu, 2003-03-13 at 14:43, Scott Cantor wrote:

    I think you may find that you need to address this by using Tomcat's
    own endorsed folder. I found that to be the case with the newest
    Tomcat engine.
     
    -- Scott
     
    

RE: JDK 1.4.1/Xalan issue

Posted by Scott Cantor <ca...@osu.edu>.
I think you may find that you need to address this by using Tomcat's own endorsed folder. I found that to be the case with the
newest Tomcat engine.
 
-- Scott