You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Reda <ma...@libero.it> on 2008/10/14 09:40:47 UTC

iBatis with xmlResultName fails

Hi

I have the file MyRouteBuilder.java like

	from("timer://pollTheDatabase?delay=1000&period=300000").
   		to("ibatis:selectAllUsers").splitter(body()).to("jms:topic:xxx");

It works if User.xml is like

<select id="selectAllUsers" resultClass="xml">
    select
    	id,firstname,
        lastname,
      	email
    from mdl_user
  </select>

It fails if User.xml is like

<select id="selectAllUsers" resultClass="xml" xmlResultName=”user”>
    select
    	id,firstname,
        lastname,
      	email
    from mdl_user
  </select>

with the error
SEVERE: Failed delivery for exchangeId:
ID-nowar.redaelli.org/56357-1223923215058/0-0. On delivery attempt: 3
caught: java.lang.RuntimeException: Error occurred.  Cause:
com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause:
java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. 
Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause:
org.xml.sax.SAXParseException: Open quote is expected for attribute
"xmlResultName" associated with an  element type  "select".

What's wrong? Is there an other way to convert User.class to/from a xml
file? Using Jaxb and marshal/unmarshal? 

-- 
View this message in context: http://www.nabble.com/iBatis-with-xmlResultName-fails-tp19968530s22882p19968530.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: iBatis with xmlResultName fails

Posted by Reda <ma...@libero.it>.
Yes, now it works. that was the problem (I did a copy/paste from the document
iBATIS-SqlMaps-2_en.pdf ;-)

Thanks
Matteo


Hi 

Please check that you are using correct quotes around user in the XML.

This looks wrong:
xmlResultName="user"

Should be using " quotes. Please retype.


-- 
View this message in context: http://www.nabble.com/iBatis-with-xmlResultName-fails-tp19968530s22882p19971253.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: iBatis with xmlResultName fails

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi 

Please check that you are using correct quotes around user in the XML.

This looks wrong:
xmlResultName="user"

Should be using " quotes. Please retype.


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: Reda [mailto:matteo.redaelli@libero.it] 
Sent: 14. oktober 2008 09:41
To: camel-user@activemq.apache.org
Subject: iBatis with xmlResultName fails


Hi

I have the file MyRouteBuilder.java like

	from("timer://pollTheDatabase?delay=1000&period=300000").
   		to("ibatis:selectAllUsers").splitter(body()).to("jms:topic:xxx");

It works if User.xml is like

<select id="selectAllUsers" resultClass="xml">
    select
    	id,firstname,
        lastname,
      	email
    from mdl_user
  </select>

It fails if User.xml is like

<select id="selectAllUsers" resultClass="xml" xmlResultName="user">
    select
    	id,firstname,
        lastname,
      	email
    from mdl_user
  </select>

with the error
SEVERE: Failed delivery for exchangeId:
ID-nowar.redaelli.org/56357-1223923215058/0-0. On delivery attempt: 3
caught: java.lang.RuntimeException: Error occurred.  Cause:
com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause:
java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. 
Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause:
org.xml.sax.SAXParseException: Open quote is expected for attribute
"xmlResultName" associated with an  element type  "select".

What's wrong? Is there an other way to convert User.class to/from a xml
file? Using Jaxb and marshal/unmarshal? 

-- 
View this message in context: http://www.nabble.com/iBatis-with-xmlResultName-fails-tp19968530s22882p19968530.html
Sent from the Camel - Users mailing list archive at Nabble.com.