Skip to Content.
Sympa Menu

mace-opensaml-users - Re: Problems initializing XML tooling in servlet (TOMCAT) environment

Subject: OpenSAML user discussion

List archive

Re: Problems initializing XML tooling in servlet (TOMCAT) environment


Chronological Thread 
  • From: "Prasanna Krishna" <>
  • To:
  • Subject: Re: Problems initializing XML tooling in servlet (TOMCAT) environment
  • Date: Fri, 13 Jul 2007 21:29:54 +0000

Hello -

To answer the question of Paul, yes I to start with having java.endorsed.dirs as shown below:

---
-verbose -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -Dcom.ebay.jni.JniDirectory=C:\apache-tomcat-5.5.17\shared\lib -Djava.library.path=C:\apache-tomcat-5.5.17\shared\lib -Djava.endorsed.dirs="C:\apache-tomcat-5.5.17\common\endorsed" -classpath "C:\apache-tomcat-5.5.17\shared\lib\classes12-v10g.zip;C:\apache-tomcat-5.5.17\bin\bootstrap.jar" -Dcatalina.base="C:\apache-tomcat-5.5.17" -Dcatalina.home="C:\apache-tomcat-5.5.17"
---

I also tried having endorsed folder under jre/lib.

From: Chad La Joie
<>
Date: Fri, 13 Jul 2007 16:32:38 -0400

The verbose output of the class loader has nothing to do with whether classes are endorsed. It just means that the class loader has loaded those particular classes. Sun's classes are probably used internally by some of Sun's code.


Fine. The reason I said the xerces/xalan were endorsed because when I removed these 2 from apache/common/endorsed and web-inf/lib, it complained as I mentioned earlier. When I have these in respective folders, it wouldn't complain which means openSAML is able to find xerces/xalan from common/endorsed.

Putting libraries in the WEB-INF/lib directory also doesn't endorse them (in fact it can mess up and endorsement).


I tried both the ways. The place where it is blowing off is the same.

I further closely monitored the path and it looks like it is blowing at

TransformerFactoryImpl.newTransformer() - Line 821
at ValidatorImpl.process(DOMSource, DOMResult) - no source
at ValidatorImpl.validate(Source,Result) - no source
at ValidatorImpl(Validator).validate(Source) - no source

What documentation, for your servlet container are you following to do the endorsement?

http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html - Section (Class Loader Definitions)

Regards
Prasanna Krishna

Prasanna Krishna wrote:
Hello -

Further to what I stated in my mail, I tried the following:

I removed xercesImpl.jar (size:1196 KB) from apache/common/endorsed and also apache/..web-inf/lib to check if SUN's xerces is being picked up and whats the behavior.

I got the fatal message from openSAML as

---

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

---

This looks to me that xerces is being properly endorsed when I place the same in endorsed folder. So my question is why then I am finding com.sun.org.apache..... entries in my verbose output.

The place where it blows of is
at ValidatorImpl.process(DOMSource, DOMResult)
at ValidatorImpl.validate(Source,Result)
at ValidatorImpl(Validator).validate(Source)

Am I not adding any other required jar files to apache/web-inf/lib or am missing something in the process.

Any input is greatly appreciated.

Regards
Prasanna Krishna

From: "Prasanna Krishna"
<>
Date: Fri, 13 Jul 2007 04:13:18 +0000

Hi Chad -

Probably I was not clear.

When I said

DefaultBootStrap.bootstrap but this time it wouldn't throw the exception reported in this mail.

I meant a similar thread where Perez found the exception
https://mail.internet2.edu/wws/arc/mace-opensaml-users/2007-06/msg00019.html


I was getting this exception but once I picked up the latest xalan & xerces from apache site this exception no longer occurs but when I 'step in' in eclipse at bootstrap() method, it drills down till a point where validation of XML is being done. Surprisingly though I have put an exception block & printing stack trace nothing is reported (which earlier was being reported when using older versions of xerces/xalan).

I thought probably any of the libraries required may be missing but I wouldn't find NoClassFound too in the console.

When I said it doesn't do anything I meant, it skips all the statements after bootstrap() statement in my method and comes out of the program without reporting anything.

The examples I pasted in my mail is to just provide an info that xerces & xalan of apache endoresed folder are indeed being picked up.

My assumption is, at few places classes from apache xerces being picked up but at few other places classes from sun is picked up.

Hope I could provide better info.

Regards
Prasanna Krishna

From: Chad La Joie
<>
Date: Thu, 12 Jul 2007 23:07:57 -0400

JAXP is an interface, Xerces + Xalan happen to provide one implementation (the only one which we know works). Sun happens to ship a pre-alpha release of a really old version of Xerces which is the com.sun.org.apache.... classes. These are horribly broken and fail on anything but the simplest of XML parsing use cases.

If you see com.sun.org.apache... classes being used then Apache released and maintained versions of Xerces and Xalan are not being used.

At the moment you seem to be providing contradictory information. You said that it "just doesn't do anything" and then "looks like it fails while validating". Is there some error you are seeing that you didn't include? The loading of classes that you included is not a problem in and of itself, the JVM will load thousands of classes as it runs.


wrote:
Hello -

While working with openSAML I still have some problem at DefaultBootStrap.bootstrap but this time it wouldn't throw the exception reported in this mail. It just doesn't do anything after reaching a specific point in the stack. But looks like it still fails while validating the XML.

Also I switched on the verbose and this is what I find:
First few lines:

[Opened C:\apache-tomcat-5.5.17\common\endorsed\xalan.jar]
[Opened C:\apache-tomcat-5.5.17\common\endorsed\xercesImpl.jar]
[Opened C:\Program Files\Java\jre1.5.0_07\lib\rt.jar]
.....

I find many classes loaded from xerces - An exmaple
[Loaded org.apache.xerces.jaxp.SAXParserFactoryImpl from C:\apache-tomcat-5.5.17\common\endorsed\xercesImpl.jar]

I also find many classes loaded from xalan - An example
[Loaded org.apache.xalan.processor.TransformerFactoryImpl from C:\apache-tomcat-5.5.17\common\endorsed\xalan.jar]

I also find many classes loaded from rt.jar that are related to xml validation
Ex:
[Loaded com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl from C:\Program Files\Java\jre1.5.0_07\lib\rt.jar]
[Loaded com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl$1 from C:\Program Files\Java\jre1.5.0_07\lib\rt.jar]
[Loaded com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl$2 from C:\Program Files\Java\jre1.5.0_07\lib\rt.jar]


Is this behavior correct?
I read http://www.ibm.com/developerworks/xml/library/x-javaxmlvalidapi.html that jaxp is bundled with xerces.

Am I missing something which needs to be resolved?

I appreciate any help.

_________________________________________________________________
Spice up your IM conversations. New, colorful and animated emoticons. Get chatting! http://server1.msn.co.in/SP05/emoticons/

--
Chad La Joie 2052-C Harris Bldg
OIS-Middleware 202.687.0124

_________________________________________________________________
Real Estate classifieds on MSN - for free.www.yello.in http://www.yello.in/home.php?utm_source=hotmailtag&utm_medium=email&utm_content=in&utm_campaign=jun




Archive powered by MHonArc 2.6.16.

Top of Page