You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by nath1 <vi...@yahoo.co.in> on 2009/12/21 12:45:56 UTC

com.ibatis.sqlmap.client.SqlMapException: There was an error while building the SqlMap instance

Hi
Am very new to iBATIS. Am facing com.ibatis.sqlmap.client.SqlMapException:
There was an error while building the SqlMap instance Exception. 

below is the SQLMapConfig.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMapConfig
  PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
  "http://ibatis.apache.org/dtd/sql-map-config-2.dtd">

<sqlMapConfig>

  <settings useStatementNamespaces="true"/>
  
  <transactionManager type="JDBC" commitRequired="false">
    <dataSource type="SIMPLE">
      <property name="JDBC.Driver" value="com.mysql.jdbc.Driver"/>
      <property name="JDBC.ConnectionURL"
        value="jdbc:mysql://localhost:3306/junk"/>
      <property name="JDBC.Username" value="root"/>
      <property name="JDBC.Password" value=""/>
    </dataSource>
  </transactionManager>

  <sqlMap resource="Contact.xml"/>
 
</sqlMapConfig>


Contact.xml file:

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

<sqlMap namespace="Contact">

	<!--- Inserting data in table -->

	<insert id="insert" parameterClass="Contact">
		insert into contact (firstName,lastName,email)
		values (#firstName#, #lastName#, #email#)
		<selectKey resultClass="int" keyProperty="id">
				select last_insert_id() as id
		</selectKey>
     </insert>

	<!--- Showing all data of table -->

	<select id="getAll" resultClass="Contact">
		select * from contact
	</select>

</sqlMap>


I used jar files:

ibatis-common-2.jar      
ibatis-dao-2.jar         
ibatis-sqlmap-2.jar      
sqljdbc.jar              
commons-logging-1.0.4.jar

Please help to rectify the error....

Exception in Detail:



:com.ibatis.sqlmap.client.SqlMapException: There was an error while building
the SqlMap instance.
--- The error occurred in the SQL Map Configuration file.
--- Cause: com.ibatis.sqlmap.client.SqlMapException: XML Parser Error. 
Cause: java.net.ConnectExcep
tion: Connection timed out: connect
Caused by: java.net.ConnectException: Connection timed out: connect
Caused by: com.ibatis.sqlmap.client.SqlMapException: XML Parser Error. 
Cause: java.net.ConnectExcep
tion: Connection timed out: connect
Caused by: java.net.ConnectException: Connection timed out: connect

-- 
View this message in context: http://old.nabble.com/com.ibatis.sqlmap.client.SqlMapException%3A-There-was-an-error-while-building-the-SqlMap-instance-tp26872916p26872916.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


RE: com.ibatis.sqlmap.client.SqlMapException: There was an error while building the SqlMap instance

Posted by meindert <me...@eduflex.com>.
I can be wrong but isn't sqljdbc.jar for MS sql server? You are using the
mysql for the driver class


-----Original Message-----
From: nath1 [mailto:vishwanath.manchala@yahoo.co.in] 
Sent: 21 December 2009 01:46 PM
To: user-java@ibatis.apache.org
Subject: com.ibatis.sqlmap.client.SqlMapException: There was an error while
building the SqlMap instance


Hi
Am very new to iBATIS. Am facing com.ibatis.sqlmap.client.SqlMapException:
There was an error while building the SqlMap instance Exception. 

below is the SQLMapConfig.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMapConfig
  PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
  "http://ibatis.apache.org/dtd/sql-map-config-2.dtd">

<sqlMapConfig>

  <settings useStatementNamespaces="true"/>
  
  <transactionManager type="JDBC" commitRequired="false">
    <dataSource type="SIMPLE">
      <property name="JDBC.Driver" value="com.mysql.jdbc.Driver"/>
      <property name="JDBC.ConnectionURL"
        value="jdbc:mysql://localhost:3306/junk"/>
      <property name="JDBC.Username" value="root"/>
      <property name="JDBC.Password" value=""/>
    </dataSource>
  </transactionManager>

  <sqlMap resource="Contact.xml"/>
 
</sqlMapConfig>


Contact.xml file:

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

<sqlMap namespace="Contact">

	<!--- Inserting data in table -->

	<insert id="insert" parameterClass="Contact">
		insert into contact (firstName,lastName,email)
		values (#firstName#, #lastName#, #email#)
		<selectKey resultClass="int" keyProperty="id">
				select last_insert_id() as id
		</selectKey>
     </insert>

	<!--- Showing all data of table -->

	<select id="getAll" resultClass="Contact">
		select * from contact
	</select>

</sqlMap>


I used jar files:

ibatis-common-2.jar      
ibatis-dao-2.jar         
ibatis-sqlmap-2.jar      
sqljdbc.jar              
commons-logging-1.0.4.jar

Please help to rectify the error....

Exception in Detail:



:com.ibatis.sqlmap.client.SqlMapException: There was an error while building
the SqlMap instance.
--- The error occurred in the SQL Map Configuration file.
--- Cause: com.ibatis.sqlmap.client.SqlMapException: XML Parser Error. 
Cause: java.net.ConnectExcep
tion: Connection timed out: connect
Caused by: java.net.ConnectException: Connection timed out: connect
Caused by: com.ibatis.sqlmap.client.SqlMapException: XML Parser Error. 
Cause: java.net.ConnectExcep
tion: Connection timed out: connect
Caused by: java.net.ConnectException: Connection timed out: connect

-- 
View this message in context:
http://old.nabble.com/com.ibatis.sqlmap.client.SqlMapException%3A-There-was-
an-error-while-building-the-SqlMap-instance-tp26872916p26872916.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 9.0.717 / Virus Database: 270.14.116/2578 - Release Date: 12/20/09
21:35:00


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Re: com.ibatis.sqlmap.client.SqlMapException: There was an error while building the SqlMap instance

Posted by nath1 <vi...@yahoo.co.in>.
meindert-3, 
Thanks for the reply. Am also using MySql drivers but not mentioned in the
jar files listing..




nath1 wrote:
> 
> Hi
> Am very new to iBATIS. Am facing com.ibatis.sqlmap.client.SqlMapException:
> There was an error while building the SqlMap instance Exception. 
> 
> below is the SQLMapConfig.xml file:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE sqlMapConfig
>   PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
>   "http://ibatis.apache.org/dtd/sql-map-config-2.dtd">
> 
> <sqlMapConfig>
> 
>   <settings useStatementNamespaces="true"/>
>   
>   <transactionManager type="JDBC" commitRequired="false">
>     <dataSource type="SIMPLE">
>       <property name="JDBC.Driver" value="com.mysql.jdbc.Driver"/>
>       <property name="JDBC.ConnectionURL"
>         value="jdbc:mysql://localhost:3306/junk"/>
>       <property name="JDBC.Username" value="root"/>
>       <property name="JDBC.Password" value=""/>
>     </dataSource>
>   </transactionManager>
> 
>   <sqlMap resource="Contact.xml"/>
>  
> </sqlMapConfig>
> 
> 
> Contact.xml file:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE sqlMap
>   PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
>   "http://ibatis.apache.org/dtd/sql-map-2.dtd">
> 
> <sqlMap namespace="Contact">
> 
> 	<!--- Inserting data in table -->
> 
> 	<insert id="insert" parameterClass="Contact">
> 		insert into contact (firstName,lastName,email)
> 		values (#firstName#, #lastName#, #email#)
> 		<selectKey resultClass="int" keyProperty="id">
> 				select last_insert_id() as id
> 		</selectKey>
>      </insert>
> 
> 	<!--- Showing all data of table -->
> 
> 	<select id="getAll" resultClass="Contact">
> 		select * from contact
> 	</select>
> 
> </sqlMap>
> 
> 
> I used jar files:
> 
> ibatis-common-2.jar      
> ibatis-dao-2.jar         
> ibatis-sqlmap-2.jar      
> sqljdbc.jar              
> commons-logging-1.0.4.jar
> 
> Please help to rectify the error....
> 
> Exception in Detail:
> 
> 
> 
> :com.ibatis.sqlmap.client.SqlMapException: There was an error while
> building the SqlMap instance.
> --- The error occurred in the SQL Map Configuration file.
> --- Cause: com.ibatis.sqlmap.client.SqlMapException: XML Parser Error. 
> Cause: java.net.ConnectExcep
> tion: Connection timed out: connect
> Caused by: java.net.ConnectException: Connection timed out: connect
> Caused by: com.ibatis.sqlmap.client.SqlMapException: XML Parser Error. 
> Cause: java.net.ConnectExcep
> tion: Connection timed out: connect
> Caused by: java.net.ConnectException: Connection timed out: connect
> 
> 

-- 
View this message in context: http://old.nabble.com/com.ibatis.sqlmap.client.SqlMapException%3A-There-was-an-error-while-building-the-SqlMap-instance-tp26872916p26873788.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org