Hi John,

First, a note re: Java 1.5: Eddie Shin has recently been testing compiling and running the server in 1.5.  After renaming a few things that are now reserved keywords, and upgrading a few libraries (axis.jar, saaj.jar, jaxrpc.jar from the Axis 1.2 dist), he mentioned that things basically seemed to work, but he saw a few warnings from the server, so rolled back.  So I must preface this message with: We have NOT been testing with Java 1.5, so your mileage may vary.

Regarding the AElfred problem:  It's not good enough to just put the right parser in the classpath: you'll need to set some system properties to get it to use the correct parser.  In our code, this is all done in the .bat/.sh scripts that invoke java:

-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl

Just make sure you pass these to java when you invoke your program (or set them in your program before it does anything else) and it should work.

- Chris

-----Original Message-----
From: fedora-users-bounces@comm.nsdl.org on behalf of Elly Cramer
Sent: Thu 5/19/2005 11:23 AM
To: John Toews; fedora-users@comm.nsdl.org
Subject: RE: [Fedora-users] custom utility - SAXException with AElfred(SAX2XMLReader)

Hi John,

I don't remember the reason why (Chris Wilper can tell you), but we got the
same (AElfred) error using the API-M when we deployed to the included Fedora
Tomcat container (a config, not version problem), once we used a stand-alone
Tomcat for our java app, the error dissappeared.

-elly

~~~~~~~~~~~~~~~~
Ellen J. Cramer
Research Staff
NSDL, CIS
Cornell University
301 College Ave.
Ithaca, NY 14850


-----Original Message-----
From: fedora-users-bounces@comm.nsdl.org
[mailto:fedora-users-bounces@comm.nsdl.org] On Behalf Of John Toews
Sent: Thursday, May 19, 2005 10:41 AM
To: fedora-users@comm.nsdl.org
Subject: [Fedora-users] custom utility - SAXException with AElfred
(SAX2XMLReader)

I'm trying to build a simple utility to create an object, using some of the
fedora admin client code as a base/example (at first I was using
AutoIngestor, now I'm directly accessing the APIM). I'm running into the same
error no matter what I do regarding AElfred being a SAX2 XMLReader.
I'm in a Java 1.5 environment, and I'm thinking my Axis is somehow a later
version ("upgraded" to SAX2)? I have the client/lib/axis.jar in my class
path. Attached is an example of the FOXML (objXML below) I am attempting to
submit with the following lines of code:

String objXML=xml.toString();
ByteArrayInputStream in = new
ByteArrayInputStream(objXML.getBytes("UTF-8"));

ByteArrayOutputStream out = new ByteArrayOutputStream();
StreamUtility.pipeStream(in, out, 4096);

FedoraAPIM m_apim = APIMStubFactory.getStub("localhost", 8081, "fedoraAdmin",
"password"); m_apim.ingest(out.toByteArray(), "foxml1.0", "created with
jtoews code");

The object does seem to be created.

Any thoughts?
Thanks!
John




May 19, 2005 9:18:34 AM org.apache.axis.utils.XMLUtils getSAXParser
SEVERE: SAXException:
org.xml.sax.SAXException: The AElfred parser is a SAX2 XMLReader
        at
com.icl.saxon.aelfred.SAXParserImpl.getParser(SAXParserImpl.java:15)
        at org.apache.axis.utils.XMLUtils.getSAXParser(XMLUtils.java:253)
        at
org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationCont
extImpl.java:239)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
        at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
        at org.apache.axis.client.Call.invoke(Call.java:2553)
        at org.apache.axis.client.Call.invoke(Call.java:2248)
        at org.apache.axis.client.Call.invoke(Call.java:2171)
        at org.apache.axis.client.Call.invoke(Call.java:1691)
        at
fedora.server.management.FedoraAPIMBindingSOAPHTTPStub.ingest(FedoraAPIMBindi
ngSOAPHTTPStub.java:513)
        at simpleSubmit.main(simpleSubmit.java:179)


_______________________________________________
Fedora-users mailing list
Fedora-users@comm.nsdl.org
http://comm.nsdl.org/mailman/listinfo/fedora-users