db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Army <qoz...@sbcglobal.net>
Subject Re: XMLPARSE usage?
Date Tue, 14 Feb 2006 19:57:33 GMT
Rajesh Kartha wrote:
> The 10.2 build you have is an old one. Try in the latest codeline and it
> should work.
> 
> On 2/14/06, Susan Cline <home4slc@pacbell.net> wrote:
>>
>>However, when I try the following I get errors:
>>
>>ij> create table xmltab (id integer, xml_col xml);
>>
>>ij> insert into xmltab values (1, xmlparse(document '<simp> doc
>></simp>'preserve whitespace));
>>ERROR XJ001: Java exception: ': java.lang.NullPointerException'.

The syntax is still as documented, so your statement is correct.

It looks like the problem is with the jar files--when I tried your statement 
against the classes directory with various JVMs, I got the expected results (see 
  "PS" below).  But when I tried to do it against the jars (10.2.0.0 alpha - 
(377424), I see the same NPE that you do:

java.lang.NullPointerException
	at 
org.apache.derby.impl.sql.compile.TypeCompilerFactoryImpl.getAnInstance(TypeCompilerFactoryImpl.java:318)
	at 
org.apache.derby.impl.sql.compile.TypeCompilerFactoryImpl.staticGetTypeCompiler(TypeCompilerFactoryImpl.java:263)
	at 
org.apache.derby.impl.sql.compile.TypeCompilerFactoryImpl.getTypeCompiler(TypeCompilerFactoryImpl.java:81)
	at 
org.apache.derby.impl.sql.compile.QueryTreeNode.getTypeCompiler(QueryTreeNode.java:726)
	at org.apache.derby.impl.sql.compile.ValueNode.getTypeCompiler(ValueNode.java:221)
	at 
org.apache.derby.impl.sql.compile.ResultColumn.checkStorableExpression(ResultColumn.java:837)
	at 
org.apache.derby.impl.sql.compile.ResultColumnList.checkStorableExpressions(ResultColumnList.java:812)
	at org.apache.derby.impl.sql.compile.InsertNode.bind(InsertNode.java:440)

I'll try to find time to look at this.  Note that as part of my 
in-progress-but-currently-back-burnered work for the 10.2 release I will be 
enabling XML tests to run as part of derbyall, so this type of problem (where it 
only occurs against the jar files) will be caught in the regression tests.

But in the meantime, thanks for bringing this to my attention.  If anyone out 
there knows what might be causing this NPE with the jars but not with classes, 
I'd appreciate any pointers...

Army

P.S. In case you're interested, I see the following results when using the 
"classes" directory.  Note that the changes I hope to make for the 10.2 release 
will catch the "class not found" type of exceptions and print something more 
friendly.  In the meantime, though:

Sun 1.3 (expected failure because XML interfaces aren't part of 1.3):

ERROR 38000: The exception 'java.lang.NoClassDefFoundError: 
org/xml/sax/ErrorHandler' was thrown while evaluating an expression.
ERROR XJ001: Java exception: 'org/xml/sax/ErrorHandler: 
java.lang.NoClassDefFoundError'.

IBM 1.3 (expected failure because XML interfaces aren't part of 1.3):

ERROR 38000: The exception 'java.lang.NoClassDefFoundError: 
javax/xml/transform/Result' was thrown while evaluating an expression.
ERROR XJ001: Java exception: 'javax/xml/transform/Result: 
java.lang.NoClassDefFoundError'.

Sun 1.4.2, 1.5:

ERROR 2200L: XMLPARSE operand is not an XML document; see next exception for 
details.
ERROR XJ001: Java exception: 'SAX2 driver class 
org.apache.xerces.parsers.SAXParser not found: org.xml.sax.SAXException'.

This is an expected error if I don't have Xerces in my classpath; if I put 
Xerces in my classpath (i.e. just include xercesImpl.jar), then the insert 
statement succeeds.

IBM 1.4.2:

Statement succeeds (because Xerces is part of the IBM 1.4.2 jvm).


Mime
View raw message