Re: Deploy to Resin throws config error

From: Steve Wells (
Date: Sat Sep 25 2004 - 00:12:11 EDT

  • Next message: Jason Dwyer: "RE: postgres PK serial column insert error"

    The namespace issue seems to be spot on. I did as suggested and the
    Attributes atts[0]._namespace value is null, if I set it to "" it gets
    through. I also tryed setting namespaces in the cayenne.xml such as:
    <domain xmlns="myns" myns:name="xxx"> xmlns sets the namespaceURI =
    "myns" and myns: sets the atts[0]._prefix = "myns"
    also tryed xmlns="" and <dom:domain
    xmlns:dom="" dom:name="my_dom">

    Anyway, back to reality, I dont think we should have to do this.

    So I found a workaround for the moment, following the directions at
    add to your web.xml
    <system-property javax.xml.parsers.DocumentBuilderFactory=
    <system-property javax.xml.parsers.SAXParserFactory=
    <system-property javax.xml.transform.TransformerFactory=

    and add to your WEB-INf/lib xercesImpl.jar xmlParserAPIs.jar (I copied
    mine from Tomcat 4.1.29)

    I couldn't see anything wrong with how the SAX parser is setup from the
    Cayenne side.

    I guess a workaround in code could be done but to write a kludge in this
    case seems wrong.

    Also found this at caucho:
    Resin XML parser doesn't conform with SAX2:

    ----- Original message -----
    From: "Andrus Adamchik" <>
    Date: Fri, 24 Sep 2004 20:11:26 -0400
    Subject: Re: Deploy to Resin throws config error

    As I prefer to know about XML just the bare minimum that gets me by, so
    I can't point to the exact problem... Still looking at the loader code,
    this might be some XML namespace issue. Cayenne extracts element
    attributes using code like this:

    public void startElement(
                 String namespaceURI,
                 String localName,
                 String qName,
                 Attributes atts)
                 throws SAXException {

    String domainName = attrs.getValue("", "name");

    ignoring all other stuff... I wonder if resin's parser doesn't like it.
    It would be nice to be able to pick at the XML parts passed to
    "startElement". The ideal way to do that is to run resin in debugger,
    and insert a breakpoint at ConfigLoader, line 190. Alternatively you
    can get Cayenne from CVS and recompile it with debug statements.

    Another random idea is to check for another cayenne.xml file floating
    around your environment...


    > Normally I do my web dev using Tomcat, today I tryed deploying to Resin
    > and as soon as I get the data context it throws:
    > (ok so it uses a different XML parser and personally I'd point the
    > finger at the caucho lib, but thought I'd ask here. I checked the
    > cayenne.xml and the domain tag has a valid looking name="my_domain")
    > Error during Configuration initialization. [v.1.1B3 September 20 2004]
    > Domain 'name' attribute must be not null.
    > Stack Trace:
    > org.objectstyle.cayenne.conf.RuntimeLoadDelegate.shouldLoadDataDomain(R
    > org.objectstyle.cayenne.conf.ConfigLoader$DomainHandler.init(ConfigLoad
    > org.objectstyle.cayenne.conf.ConfigLoader$DomainsHandler.startElement(C
    > com.caucho.xml.XmlParser.addElement(
    > com.caucho.xml.XmlParser.parseElement(
    > com.caucho.xml.XmlParser.parseNode(
    > com.caucho.xml.XmlParser.parseInt(
    > com.caucho.xml.AbstractParser.parse(
    > org.objectstyle.cayenne.conf.ConfigLoader.loadDomains(
    > :114)
    > org.objectstyle.cayenne.conf.DefaultConfiguration.initialize(DefaultCon
    > org.objectstyle.cayenne.conf.Configuration.initializeSharedConfiguratio
    > n(
    > org.objectstyle.cayenne.conf.Configuration.initializeSharedConfiguratio
    > n(
    > org.objectstyle.cayenne.conf.Configuration.initializeSharedConfiguratio
    > n(
    > org.objectstyle.cayenne.conf.Configuration.getSharedConfiguration(Confi
    > org.objectstyle.cayenne.access.DataContext.createDataContext(DataContex

    This archive was generated by hypermail 2.0.0 : Sat Sep 25 2004 - 00:12:46 EDT