W3C home > Mailing lists > Public > www-jigsaw@w3.org > July to August 2003

RE: Problem with root.xml on AIX - Solved

From: Yves Lafon <ylafon@w3.org>
Date: Fri, 11 Jul 2003 16:22:55 +0200 (MEST)
To: Wayne Johnson <wjohnson@mqsoftware.com>
cc: www-jigsaw@w3.org
Message-ID: <Pine.GSO.4.56.0307111617260.28359@tarantula.inria.fr>

On Thu, 19 Jun 2003, Wayne Johnson wrote:

>
> Turns out our problem is that we were using the CvsDAV stuff and our
> CLASSPATH had a typo in the path to jigedit.jar.  Seems Windows isn't
> concerned with things like case... :{s>
>
> This was further complicated by the fact that the code in
> org.w3c.tools.resources.serialization.xml.XMLReader.startElement() was
> placing an UnknownResource onto resourceStack, which was then being
> added to a resourcearray Vector in resourceSetStack, and then in
> endElement(), an attempt to do a CopyInto of the Vector containing the
> UnknownResource into the ResourceFrame array caused an
> ArrayStorageException.  Gee, that's a mouthful.
>
> Maybe some annotated code fragements...
>
>     public void startElement(String name, AttributeList attributes)
> 	throws SAXException
>     {
> 	String iname = name.intern();
> 	if (iname == iRESOURCE_TAG) {
> 	    String resourceclass = attributes.getValue(CLASS_ATTR);
> 	    try {
> 		Class c = Class.forName(resourceclass);
> 		resourceStack.push(c.newInstance());
> 	    } catch (Exception ex) {       // Generates ClassNotFoundException
> 		UnknownResource unknown = new UnknownResource();
> 		resourceStack.push(unknown); // Here the UnknownResource gets created
> 	    }
>
> Then in:
>     public void endElement(String name)
> 	throws SAXException
>     {
> ...
> 	    Vector vframes = (Vector) resourceSetStack.pop();
> 	    ResourceFrame frames[] = new ResourceFrame[vframes.size()];
> 	    vframes.copyInto(frames); // attempt to copy UnknownResource into ResourceFrame array.  Boom.
>
> Why you can't copy the UnknownResource into the frames array, I don't
> quite understand, just that Java doesn't like it.
>
> I don't have a proper fix for this, but I'm pretty sure there is a
> better way to handle the exception.

Also I want to modify the behaviour of a bad attribute definition in the
serialized format.
Now, if I decide to change Content-Length from Integer (2G limit) to a
Long, I have a serialization issue, as IntegerAttribute and LongAttribute
won't match. In that particular case, ignoring the attribute value and
have it recomputed by the application is ok as it has the
Attribute.COMPUTED value.
In the case of an unknown resource, a deletion may be too much, as it can
ruin a configuration during an upgrade of the startup script that have a
wrong CLASSPATH. Loading the UnknownResource is an option but in this case
I would disable the auto-save of this store.
I'll think more and come up with something (of course if other have
ideas/code... ;) ).
Thanks,

>
>
> > -----Original Message-----
> > From: Wayne Johnson
> > Sent: Thursday, June 19, 2003 9:29 AM
> > To: www-jigsaw@w3.org
> > Subject: Problem with root.xml on AIX
> >
> >
> >
> > We've tried to run Jigsaw 2.2.2 on AIX but we're getting a
> > problem in (I think) processing the file root.xml.
> >
> > At first we were just getting the error:
> > Unknown error while starting http-server: null
> > *** FATAL Error:
> > No servers launched !
> > I tracked down this rather cryptic message and added a
> > printStackTrace() to it and we're seeing:
> > Unknown error while starting http-server: null
> > java.lang.ArrayStoreException
> >         at java.lang.System.arraycopy(Native Method)
> >         at java.util.Vector.copyInto(Vector.java:167)
> >         at
> > org.w3c.tools.resources.serialization.xml.XMLReader.endElement
> > (XMLReader.java:119)
> >         at com.jclark.xml.sax.Driver.endElement(Driver.java)
> >         at
> > com.jclark.xml.parse.EntityParser.parseContent(EntityParser.java)
> >         at
> > com.jclark.xml.parse.EntityParser.parseDocumentEntity(EntityPa
> > rser.java)
> >         at
> > com.jclark.xml.parse.DocumentParser.parse(DocumentParser.java)
> >         at
> > com.jclark.xml.parse.base.ParserImpl.parseDocument(ParserImpl.java)
> >         at com.jclark.xml.sax.Driver.parse(Driver.java)
> >         at
> > org.w3c.tools.resources.serialization.xml.XMLReader.parse(XMLR
> > eader.java:200)
> >         at
> > org.w3c.tools.resources.serialization.xml.XMLReader.readResour
> > ces(XMLReader.java:214)
> >         at
> > org.w3c.tools.resources.serialization.xml.XMLSerializer.readRe
> > sources(XMLSerializer.java:142)
> >         at
> > org.w3c.tools.resources.store.ResourceStoreImpl.loadResources(
> > ResourceStoreImpl.java:475)
> >         at
> > org.w3c.tools.resources.store.ResourceStoreImpl.lookupResource
> > (ResourceStoreImpl.java:212)
> >         at
> > org.w3c.tools.resources.store.NewReference.lock(NewStoreEntry.java:75)
> >         at
> > org.w3c.tools.resources.store.NewStoreEntry.loadResource(NewSt
> > oreEntry.java:284)
> >         at
> > org.w3c.tools.resources.store.ResourceStoreManager.loadRootRes
> > ource(ResourceStoreManager.java:992)
> >         at org.w3c.jigsaw.http.httpd.loadRoot(httpd.java:852)
> >         at org.w3c.jigsaw.http.httpd.changeRoot(httpd.java:859)
> >         at
> > org.w3c.jigsaw.http.httpd.initializeRootResource(httpd.java:888)
> >         at org.w3c.jigsaw.http.httpd.start(httpd.java:2032)
> >         at
> > org.w3c.jigsaw.daemon.ServerHandlerManager.<init>(ServerHandle
> > rManager.java(Compiled Code))
> >         at
> > org.w3c.jigsaw.daemon.ServerHandlerManager.main(ServerHandlerM
> > anager.java:501)
> >         at org.w3c.jigsaw.Main.main(Main.java:15)
> > *** FATAL Error:
> > No servers launched !
> > This same jigsaw implementation is working on Windows.  I
> > checked the root.xml file, and it appears normal, and is in
> > UNIX format (should it still be DOS format?). Except for the
> > UNIX translation, root.xml is copied from the Windows version.
> >
> > Anyone seen this before?  Any suggestions?
> >
> > TIA,
> >
> >
> >
> >
>

-- 
Yves Lafon - W3C
"Baroula que barouleras, au tiéu toujou t'entourneras."
Received on Friday, 11 July 2003 10:23:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:36 GMT