ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cesar Villar <cesarvillar...@yahoo.es>
Subject Re: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'
Date Fri, 26 Aug 2005 09:13:59 GMT
When I write the content of the file that fails into
another file the problem disappears.
The stack exception is:
- AbstractUnafeDAO static block:
com.ibatis.common.exception.NestedRuntimeException:
Error occurred.  Cause:
com.ibatis.common.xml.NodeletException: Error parsing
XML.  Cause:
com.ibatis.common.exception.NestedRuntimeException:
Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause:
com.ibatis.common.xml.NodeletException: Error parsing
XML.  Cause: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by: com.ibatis.common.xml.NodeletException:
Error parsing XML.  Cause:
org.xml.sax.SAXParseException: Falta elemento de raíz
de documento.
Caused by: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by:
com.ibatis.common.exception.NestedRuntimeException:
Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause:
com.ibatis.common.xml.NodeletException: Error parsing
XML.  Cause: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by: com.ibatis.common.xml.NodeletException:
Error parsing XML.  Cause:
org.xml.sax.SAXParseException: Falta elemento de raíz
de documento.
Caused by: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by: com.ibatis.common.xml.NodeletException:
Error parsing XML.  Cause:
com.ibatis.common.exception.NestedRuntimeException:
Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause:
com.ibatis.common.xml.NodeletException: Error parsing
XML.  Cause: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by: com.ibatis.common.xml.NodeletException:
Error parsing XML.  Cause:
org.xml.sax.SAXParseException: Falta elemento de raíz
de documento.
Caused by: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by:
com.ibatis.common.exception.NestedRuntimeException:
Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause:
com.ibatis.common.xml.NodeletException: Error parsing
XML.  Cause: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by: com.ibatis.common.xml.NodeletException:
Error parsing XML.  Cause:
org.xml.sax.SAXParseException: Falta elemento de raíz
de documento.
Caused by: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
java.lang.ExceptionInInitializerError
	at
com.unafe.dao.DAOFactory.getCursoDAO(DAOFactory.java:74)
	at
com.unafe.dao.pruebas.PruebaCursos.obtenerCursos(PruebaCursos.java:47)
	at
com.unafe.dao.pruebas.PruebaCursos.main(PruebaCursos.java:39)
Caused by: java.lang.RuntimeException: Error
Initializing AbstractUnafeDAO
:com.ibatis.common.exception.NestedRuntimeException:
Error occurred.  Cause:
com.ibatis.common.xml.NodeletException: Error parsing
XML.  Cause:
com.ibatis.common.exception.NestedRuntimeException:
Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause:
com.ibatis.common.xml.NodeletException: Error parsing
XML.  Cause: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by: com.ibatis.common.xml.NodeletException:
Error parsing XML.  Cause:
org.xml.sax.SAXParseException: Falta elemento de raíz
de documento.
Caused by: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by:
com.ibatis.common.exception.NestedRuntimeException:
Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause:
com.ibatis.common.xml.NodeletException: Error parsing
XML.  Cause: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by: com.ibatis.common.xml.NodeletException:
Error parsing XML.  Cause:
org.xml.sax.SAXParseException: Falta elemento de raíz
de documento.
Caused by: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by: com.ibatis.common.xml.NodeletException:
Error parsing XML.  Cause:
com.ibatis.common.exception.NestedRuntimeException:
Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause:
com.ibatis.common.xml.NodeletException: Error parsing
XML.  Cause: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by: com.ibatis.common.xml.NodeletException:
Error parsing XML.  Cause:
org.xml.sax.SAXParseException: Falta elemento de raíz
de documento.
Caused by: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by:
com.ibatis.common.exception.NestedRuntimeException:
Error parsing XPath '/sqlMapConfig/sqlMap'.  Cause:
com.ibatis.common.xml.NodeletException: Error parsing
XML.  Cause: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
Caused by: com.ibatis.common.xml.NodeletException:
Error parsing XML.  Cause:
org.xml.sax.SAXParseException: Falta elemento de raíz
de documento.
Caused by: org.xml.sax.SAXParseException: Falta
elemento de raíz de documento.
	at
com.unafe.dao.AbstractUnafeDAO.<clinit>(AbstractUnafeDAO.java:43)
	... 3 more
Exception in thread "main" 

And the content of the file is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map
2.0//EN" 
	"http://www.ibatis.com/dtd/sql-map-2.dtd">

<sqlMap namespace="CursoSQL">
 
   <!-- 
   
==============================================================
   
    ======================== CACHES
==============================
   
==============================================================
   
    -->
    
    <cacheModel id="curso_cache" type="MEMORY" >
        <flushInterval   hours="24"/>
        <flushOnExecute statement= "insertCurso" />
        <flushOnExecute statement= "updateCurso" /> 
        <flushOnExecute statement= "deleteCurso" /> 
        <property name="reference-type" value="WEAK"
/>
    </cacheModel>

    <!-- 
   
=============================================================
   
    ======================== ALIAS
==============================
   
=============================================================
   
    -->

   	<typeAlias alias="CursoDTO"
type="com.unafe.dto.cursos.CursoDTO"/>

    <!-- 
   
=================================================================
    ======================== PARAMETERMAPS
==========================
   
=================================================================
    -->

  	<parameterMap id="tipoSanitario" class="CursoDTO">
  		<parameter property="sanitario"/>
  	</parameterMap>
  	
 	<parameterMap id="cursoId" class="CursoDTO">
  		<parameter property="id"/>
  	</parameterMap> 
  	
  	<parameterMap id="datosAlumnoSanitario"
class="AlumnoDTO">
  		<parameter property="id"/>
  		<parameter property="id"/>  		
  		<parameter property="sanitario"/>  		
  	</parameterMap> 	

    <!-- 
   
=================================================================
    ======================== RESULTMAP
==============================
   
=================================================================
    -->

	<resultMap id="curso_resultado"  class="CursoDTO">
		<result property="id"			column="CUR_ID" />
		<result property="nombre"		column="CUR_NOMBRE" /> 
		<result property="temario"		column="CUR_TEMARIO" /> 
		<result property="creditos"		column="CUR_CREDITOS"
/>
		<result property="horas"		column="CUR_NUMHORAS" />
		<result property="sanitario"	column="CUR_SANITARIO"
/>
		<result property="precio"		column="CUR_PRECIO" />
		<result property="codigo"		column="CUR_CODIGO" />		
    </resultMap>
    
	<resultMap id="curso_resultado_para_lista" 
class="CursoDTO">
		<result property="id"			column="CUR_ID" />
		<result property="nombre"		column="CUR_NOMBRE" /> 
		<result property="codigo"		column="CUR_CODIGO" />		
		<result property="sanitario"	column="CUR_SANITARIO"
/>
    </resultMap>

   <!-- 
   
=================================================================
    ======================== CONSULTAS
==============================
   
=================================================================
    -->
     <select  id="getCursos" resultClass="CursoDTO"
cacheModel="curso_cache">    
        SELECT CUR_ID AS id, 
			CUR_NOMBRE AS nombre, 
			CUR_TEMARIO AS temario, 
			CUR_CREDITOS AS creditos, 
			CUR_SANITARIO AS sanitario, 
			CUR_NUMHORAS AS horas, 
			CUR_PRECIO AS precio,
			CUR_CODIGO AS codigo
		FROM CURSO  	
    </select>

    <select id="getCursosPorTipo"
parameterMap="tipoSanitario"
resultMap="curso_resultado">
    	SELECT CUR_ID, 
			CUR_NOMBRE, 
			CUR_TEMARIO, 
			CUR_CREDITOS, 
			CUR_SANITARIO, 
			CUR_NUMHORAS, 
			CUR_PRECIO,
			CUR_CODIGO
		FROM CURSO  
        <dynamic prepend="where"> 
            <isNotNull prepend="AND"
property="sanitario"> 
		        CUR_SANITARIO = #sanitario#
            </isNotNull> 
        </dynamic> 
    </select>   
    
    <select id="getTipoDeCurso" parameterClass="int"
resultClass="java.lang.String">
    	SELECT CUR_SANITARIO
		FROM CURSO  
	    WHERE CUR_ID = #value#
    </select>       
    
	<select id="getCursoPorID" parameterClass="int"
resultMap="curso_resultado">
    	SELECT CUR_ID, 
			CUR_NOMBRE, 
			CUR_TEMARIO, 
			CUR_CREDITOS, 
			CUR_SANITARIO, 
			CUR_NUMHORAS, 
			CUR_PRECIO,
			CUR_CODIGO
		FROM CURSO  
	    WHERE CUR_ID = #value#
    </select> 
   
   
    <select
id="selectCursosNoSeleccionadosEnUnPeriodo"
parameterClass="int"
resultMap="curso_resultado_para_lista">
    	SELECT CUR_ID, 
	    	CUR_CODIGO,
			CUR_NOMBRE,
			CUR_SANITARIO
		FROM CURSO
	    WHERE CUR_ID NOT IN (SELECT CURPER_CURSO 
	    					 FROM CURSO_PERIODOLECTIVO 
	    					 WHERE CURPER_PERIODO = #value#)
	    ORDER BY CUR_SANITARIO,CUR_NOMBRE
    </select>

    <select id="selectCursosNoCompradosPorAlumno"
parameterMap="datosAlumnoSanitario"
resultMap="curso_resultado">
    	SELECT CUR_ID, 
			CUR_NOMBRE, 
			CUR_TEMARIO, 
			CUR_CREDITOS, 
			CUR_SANITARIO, 
			CUR_NUMHORAS, 
			CUR_PRECIO,
			CUR_CODIGO
		FROM CURSO, V_CURSOSPERIODOACTUAL
		WHERE CUR_ID NOT IN(
			<!--  CURSOS QUE NO ESTEN YA COMPRADOS EN EL
PERIODO LECTIVO ACTUAL -->
				SELECT CCPL_CURSO
				FROM COMPRA, COMPRA_CURSO_PERIODOLECTIVO
				WHERE COM_ALUMNO = ?
				AND COM_ESTADO IN ('A','E')
				AND CCPL_COMPRA = COM_ID
				AND CCPL_PERIODO = (SELECT PER_ID 
									FROM PERIODOLECTIVO 
									WHERE PER_FEC_INICIO <![CDATA[<=]]> SYSDATE 
									AND PER_FEC_FIN>=SYSDATE
									)
			)
		AND CUR_ID NOT IN (
			<!--  CURSOS APROBADOS ANTERIORMENTE -->
			SELECT CUR_ID
			FROM CURSO, EXAMEN, PRUEBAEXAMEN,
CURSO_PERIODOLECTIVO
			WHERE CUR_ID=EXA_CURSO
			AND EXA_ID=PEXA_EXAMEN
			AND PEXA_ESTADO= 'AP'
			AND PEXA_ALUMNO = ?
			AND CURPER_CURSO=CUR_ID
			AND CURPER_PERIODO IN (SELECT PER_ID 
									FROM PERIODOLECTIVO 
									WHERE PER_FEC_INICIO <![CDATA[<]]> SYSDATE 
									AND PER_FEC_FIN<![CDATA[<]]>SYSDATE)
		)		
		AND CUR_SANITARIO=? 
		AND CPA_CURSO = CUR_ID  
    </select>
    <!-- 
   
==============================================================
    ======================== INSERT
==============================
   
==============================================================
    -->
    
    <insert id="insertCurso"
parameterClass="CursoDTO">
    	<selectKey resultClass="int" keyProperty="id">
			SELECT CURSO_SEQ.NEXTVAL AS ID
			FROM DUAL    	
    	</selectKey>
        INSERT INTO CURSO ( CUR_ID, CUR_NOMBRE,
CUR_TEMARIO, CUR_CREDITOS, 
        					CUR_NUMHORAS, CUR_SANITARIO, CUR_PRECIO,
CUR_CODIGO)
        VALUES  ( #id#, #nombre#, #temario:VARCHAR#,
#creditos#, #horas#, #sanitario#, 
        		#precio#, #codigo# )
    </insert>
    
    <!-- 
   
===============================================================
      
    ======================== UPDATES
==============================
   
===============================================================
      
    -->

    <statement   id="updateCurso"
parameterClass="CursoDTO">
        UPDATE CURSO 
        SET CUR_NOMBRE= #nombre#, CUR_TEMARIO=
#temario:VARCHAR#, 
        	CUR_CREDITOS= #creditos#, CUR_NUMHORAS=
#horas#, CUR_SANITARIO= #sanitario#,
        	CUR_PRECIO= #precio#, CUR_CODIGO= #codigo#
        WHERE CUR_ID = #id# 
    </statement>
    
    <!-- 
   
===============================================================
      
    ======================== DELETES
==============================
   
===============================================================
  
    -->
    <delete id="deleteCursoPorID"
parameterClass="CursoDTO">
    	DELETE FROM CURSO WHERE CUR_ID = #id#
    </delete>   
</sqlMap>

I can attach all others xml files and a class to prove
the files.
Thanks a lot.



		
______________________________________________ 
Renovamos el Correo Yahoo! 
Nuevos servicios, más seguridad 
http://correo.yahoo.es

Mime
View raw message