|
Bugzilla – Bug 171 |
trakem2 xml error |
Last modified: 2010-08-21 13:36:26 CDT |
| ⚠ |
NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug. The Fiji project now uses GitHub Issues for issue tracking. Please file all new issues there. |
|
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
|||||||
can't reopen all the trakem2 projects, which i created during the last 1-2 weeks. gives following error: ================== MAX_MEMORY: 16755515392 project file path 2: /projects/kevan/DAISY/cat_0507/cat_0507_LH/reconstructions/EM reconstructions/distal cluster/EM/bt2/untitled.xml Loader.openFSProject: path is /projects/kevan/DAISY/cat_0507/cat_0507_LH/reconstructions/EM reconstructions/distal cluster/EM/bt2/untitled.xml Fatal error: column=21 line=4 ================== ERROR: org.xml.sax.SAXParseException: A '(' character or an element type is required in the declaration of element type "project". at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at javax.xml.parsers.SAXParser.parse(SAXParser.java:395) at ini.trakem2.persistence.FSLoader.openFSProject(FSLoader.java:270) at ini.trakem2.Project.openFSProject(Project.java:524) at ini.trakem2.Project.openFSProject(Project.java:515) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at HandleExtraFileTypes.tryOpen(HandleExtraFileTypes.java:192) at HandleExtraFileTypes.openImage(HandleExtraFileTypes.java:292) at HandleExtraFileTypes.run(HandleExtraFileTypes.java:38) at ij.IJ.runUserPlugIn(IJ.java:189) at ij.IJ.runPlugIn(IJ.java:155) at ij.IJ.runPlugIn(IJ.java:144) at ij.io.Opener.openWithHandleExtraFileTypes(Opener.java:412) at ij.io.Opener.openImage(Opener.java:289) at ij.io.Opener.openImage(Opener.java:308) at ij.io.Opener.open(Opener.java:142) at ij.io.Opener.open(Opener.java:70) at ij.plugin.Commands.run(Commands.java:23) at ij.IJ.runPlugIn(IJ.java:161) at ij.Executer.runCommand(Executer.java:147) at ij.Executer.run(Executer.java:78) at java.lang.Thread.run(Thread.java:619) ================== Information about your version of Java - this information is useful for the Fiji developers: os.arch => amd64 os.name => Linux os.version => 2.6.31.12-0.2-default java.version => 1.6.0_16 java.vendor => Sun Microsystems Inc. java.runtime.name => Java(TM) SE Runtime Environment java.runtime.version => 1.6.0_16-b01 java.vm.name => Java HotSpot(TM) 64-Bit Server VM java.vm.version => 14.2-b01 java.vm.vendor => Sun Microsystems Inc. java.vm.info => mixed mode java.awt.graphicsenv => sun.awt.X11GraphicsEnvironment java.specification.name => Java Platform API Specification java.specification.version => 1.6 sun.cpu.endian => little sun.desktop => null file.separator => /Created attachment 15 xml exampleCreated attachment 16 xml exampleIt seems that the problem here is that it's possible in TrakEM2 to create a node whose name begins with a digit ("0507" in one of these case) which isn't a valid XML element name. Changing the "0507" to "a0507" wherever it occurs in the file allows it to load. Since the rules for checking these names are non-trivial, it might be best to check by trying to create an element when a name is suggested, e.g. as in the example in JRuby below. (I can't see an obvious static method for checking names.) >>> include_class 'javax.xml.parsers.DocumentBuilderFactory' javax.xml.parsers.DocumentBuilderFactory >>> factory = DocumentBuilderFactory.newInstance com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl@5e5c15 >>> builder = factory.newDocumentBuilder com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl@2e879 >>> implementation = builder.getDOMImplementation com.sun.org.apache.xerces.internal.dom.DOMImplementationImpl@8b60a >>> document = implementation.createDocument(nil,nil,nil) [#document: null] >>> good_element = document.createElement("a0507") [a0507: null] >>> bad_element = document.createElement("0507") com/sun/org/apache/xerces/internal/dom/CoreDocumentImpl.java:608:in `createElement': org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified. (NativeException) from sun/reflect/NativeMethodAccessorImpl.java:-2:in `invoke0' from sun/reflect/NativeMethodAccessorImpl.java:39:in `invoke' from sun/reflect/DelegatingMethodAccessorImpl.java:25:in `invoke' from java/lang/reflect/Method.java:597:in `invoke' from org/jruby/javasupport/JavaMethod.java:251:in `invokeWithExceptionHandling' from org/jruby/javasupport/JavaMethod.java:223:in `invoke' from org/jruby/javasupport/JavaClass.java:411:in `execute' from org/jruby/internal/runtime/methods/SimpleCallbackMethod.java:67:in `call' ... 11 levels... from JRuby/JRuby_Interpreter.java:18:in `eval' from common/AbstractInterpreter.java:659:in `execute' from common/AbstractInterpreter.java:559:in `run' Complete Java stackTrace org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified. at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createElement(CoreDocumentImpl.java:608) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jruby.javasupport.JavaMethod.invokeWithExceptionHandling(JavaMethod.java:251) at org.jruby.javasupport.JavaMethod.invoke(JavaMethod.java:223) at org.jruby.javasupport.JavaClass$InstanceMethodInvoker.execute(JavaClass.java:411) at org.jruby.internal.runtime.methods.SimpleCallbackMethod.call(SimpleCallbackMethod.java:67) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:66) at org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:102) at org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:243) at org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:657) at org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:308) at org.jruby.evaluator.ASTInterpreter.localAsgnNode(ASTInterpreter.java:1256) at org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:387) at org.jruby.evaluator.ASTInterpreter.rootNode(ASTInterpreter.java:1615) at org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:458) at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168) at org.jruby.Ruby.evalScriptlet(Ruby.java:221) at JRuby.JRuby_Interpreter.eval(JRuby_Interpreter.java:18) at common.AbstractInterpreter.execute(AbstractInterpreter.java:659) at common.AbstractInterpreter$ExecuteCode.run(AbstractInterpreter.java:559) ...internal jruby stack elided...