XML do banco dando pau - hibernate

2 respostas
Norivan

Pessoal,

Alguém tem alguma dica do que pode estar provocando este erro

14:15:24,234 INFO Environment:543 - Hibernate 3.3.1.GA
14:15:24,234 INFO Environment:561 - loaded properties from resource hibernate.properties: {=, =, , -->=, "-//Hibernate/Hibernate=Configuration DTD 3.0//EN", and=let Hibernate bind the session automatically to the thread, =, org.hibernate.context.ThreadLocalSessionContext=, , hibernate.bytecode.use_reflection_optimizer=false, =, , "http=//hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">, true}
14:15:24,250 INFO Environment:709 - Bytecode provider name : javassist
14:15:24,250 INFO Environment:627 - using JDK 1.4 java.sql.Timestamp handling
14:15:24,328 INFO Configuration:618 - Reading mappings from resource: socket/Servidor.hbm.xml
14:15:24,328 INFO Configuration:563 - Reading mappings from resource: socket/Servidor.hbm.xml
--> 14:15:24,390 ERROR XMLHelper:81 - Error parsing XML: XML InputStream(1) The processing instruction target matching "[xX][mM][lL]" is not allowed.

Arquivo XML
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd" >

   <hibernate-mapping>  
      <class name="Servidor" table="script">  
           
		   <id name="id_script" column="id_script" type="int" not-null="true"/>  
              <generator class="assigned"/>  
           </id>     
           <property name="identificador" type="string"/>            
           <property name="cd_fonte" column="cd_fonte" type="string"/>  
           
       </class>  
  </hibernate-mapping>

2 Respostas

fnandos

O problema parece estar no seu hibernate.cfg.xml, ou talvez a versão de seu mapeamento não seja a mesma do hibernate, da uma olhada nisso.

Norivan

Bom a versão do hibernate é a 3 e declarei no cabeçalho do xml a 3 também...

Fiz alguns testes aqui e o erro só muda quando eu modifico algo no arquivo xml que postei acima, quando eu mudo no hibernate.cfg.xml o erro permanece o mesmo... não estou conseguindo identificar o erro

Ele está dizendo que: O processamento instrução alvo de correspondência "[XX] [mm] [ll]" não é permitido.

Isso no arquivo Servidor.hbm.xml

O que seria "[XX] [mm] [ll]"?

esse seria o hibernate.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>

	<property name="connection.url">jdbc:mysql://localhost/itmanager</property>
	<property name="connection.username">root</property>
	<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
	<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
	<property name="connection.password"></property>
 <property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
 
	<mapping resource="com/itmanager/socket/Servidor.hbm.xml" />

</session-factory>
</hibernate-configuration>
Criado 15 de setembro de 2008
Ultima resposta 15 de set. de 2008
Respostas 2
Participantes 2