ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "McCarrier, Alex" <amccarr...@pointserve.com>
Subject RE: Problems upgrading from 1.2.x to 2.0.8
Date Fri, 03 Dec 2004 23:07:08 GMT
Okay, so after may problems using the compat libraries, I've begun the
attempt to upgrade.  However, I am getting problems using the ant task
saying it can't find the SqlMap.xsl file.  The jar is on the class path
(it is finding the SqlMapXmlConverter file just fine).

Here's my build.xml:

<project name="convert" default="main" basedir=".">
	<path id="classpath">
		<fileset dir="lib/ibatis">
			<include name="**/*.jar"/>
		</fileset>
	</path>

	<taskdef name="convertSqlMaps" 
              classname="com.ibatis.db.sqlmap.upgrade.ConvertTask" 
              classpathref="classpath"/>


      	<target name="main">
      		<convertSqlMaps todir="c:/convertSqlMaps/"
overwrite="true">
			<fileset dir="config/ibatis">
				<include name="**/*.xml"/>
             		</fileset>
         	</convertSqlMaps>
	</target>
</project>

Here's the output:

Buildfile: convert.xml

main:
[convertSqlMaps] Copying 33 files to C:\convertSqlMaps

BUILD FAILED
com.ibatis.common.exception.NestedRuntimeException: Error.  Cause:
java.io.IOExc
eption: Could not find resource com/ibatis/db/sqlmap/upgrade/SqlMap.xsl
Caused by: java.io.IOException: Could not find resource
com/ibatis/db/sqlmap/upg
rade/SqlMap.xsl
        at
com.ibatis.db.sqlmap.upgrade.SqlMapXmlConverter.convertXml(SqlMapXmlC
onverter.java:50)
        at
com.ibatis.db.sqlmap.upgrade.SqlMapXmlConverter.convertFile(SqlMapXml
Converter.java:71)
        at
com.ibatis.db.sqlmap.upgrade.ConvertTask.doFileOperations(ConvertTask
.java:75)
        at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:369)
        at org.apache.tools.ant.Task.perform(Task.java:341)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
        at
org.apache.tools.ant.Project.executeTargets(Project.java:1255)
        at org.apache.tools.ant.Main.runBuild(Main.java:609)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)
Caused by: java.io.IOException: Could not find resource
com/ibatis/db/sqlmap/upg
rade/SqlMap.xsl
        at
com.ibatis.common.resources.Resources.getResourceAsStream(Resources.j
ava:101)
        at
com.ibatis.common.resources.Resources.getResourceAsStream(Resources.j
ava:86)
        at
com.ibatis.common.resources.Resources.getResourceAsReader(Resources.j
ava:150)
        at
com.ibatis.db.sqlmap.upgrade.SqlMapXmlConverter.convertXml(SqlMapXmlC
onverter.java:43)
        ... 11 more

Caused by:
java.io.IOException: Could not find resource
com/ibatis/db/sqlmap/upgrade/SqlMap
.xsl
        at
com.ibatis.common.resources.Resources.getResourceAsStream(Resources.j
ava:101)
        at
com.ibatis.common.resources.Resources.getResourceAsStream(Resources.j
ava:86)
        at
com.ibatis.common.resources.Resources.getResourceAsReader(Resources.j
ava:150)
        at
com.ibatis.db.sqlmap.upgrade.SqlMapXmlConverter.convertXml(SqlMapXmlC
onverter.java:43)
        at
com.ibatis.db.sqlmap.upgrade.SqlMapXmlConverter.convertFile(SqlMapXml
Converter.java:71)
        at
com.ibatis.db.sqlmap.upgrade.ConvertTask.doFileOperations(ConvertTask
.java:75)
        at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:369)
        at org.apache.tools.ant.Task.perform(Task.java:341)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
        at
org.apache.tools.ant.Project.executeTargets(Project.java:1255)
        at org.apache.tools.ant.Main.runBuild(Main.java:609)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)

Total time: 0 seconds
com.ibatis.common.exception.NestedRuntimeException: Error.  Cause:
java.io.IOExc
eption: Could not find resource com/ibatis/db/sqlmap/upgrade/SqlMap.xsl
Caused by: java.io.IOException: Could not find resource
com/ibatis/db/sqlmap/upg
rade/SqlMap.xsl
        at
com.ibatis.db.sqlmap.upgrade.SqlMapXmlConverter.convertXml(SqlMapXmlC
onverter.java:50)
        at
com.ibatis.db.sqlmap.upgrade.SqlMapXmlConverter.convertFile(SqlMapXml
Converter.java:71)
        at
com.ibatis.db.sqlmap.upgrade.ConvertTask.doFileOperations(ConvertTask
.java:75)
        at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:369)
        at org.apache.tools.ant.Task.perform(Task.java:341)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
        at
org.apache.tools.ant.Project.executeTargets(Project.java:1255)
        at org.apache.tools.ant.Main.runBuild(Main.java:609)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)
Caused by: java.io.IOException: Could not find resource
com/ibatis/db/sqlmap/upg
rade/SqlMap.xsl
        at
com.ibatis.common.resources.Resources.getResourceAsStream(Resources.j
ava:101)
        at
com.ibatis.common.resources.Resources.getResourceAsStream(Resources.j
ava:86)
        at
com.ibatis.common.resources.Resources.getResourceAsReader(Resources.j
ava:150)
        at
com.ibatis.db.sqlmap.upgrade.SqlMapXmlConverter.convertXml(SqlMapXmlC
onverter.java:43)
        ... 11 more

Caused by:
java.io.IOException: Could not find resource
com/ibatis/db/sqlmap/upgrade/SqlMap
.xsl
        at
com.ibatis.common.resources.Resources.getResourceAsStream(Resources.j
ava:101)
        at
com.ibatis.common.resources.Resources.getResourceAsStream(Resources.j
ava:86)
        at
com.ibatis.common.resources.Resources.getResourceAsReader(Resources.j
ava:150)
        at
com.ibatis.db.sqlmap.upgrade.SqlMapXmlConverter.convertXml(SqlMapXmlC
onverter.java:43)
        at
com.ibatis.db.sqlmap.upgrade.SqlMapXmlConverter.convertFile(SqlMapXml
Converter.java:71)
        at
com.ibatis.db.sqlmap.upgrade.ConvertTask.doFileOperations(ConvertTask
.java:75)
        at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:369)
        at org.apache.tools.ant.Task.perform(Task.java:341)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
        at
org.apache.tools.ant.Project.executeTargets(Project.java:1255)
        at org.apache.tools.ant.Main.runBuild(Main.java:609)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)

Caused by:
java.io.IOException: Could not find resource
com/ibatis/db/sqlmap/upgrade/SqlMap
.xsl
        at
com.ibatis.common.resources.Resources.getResourceAsStream(Resources.j
ava:101)
        at
com.ibatis.common.resources.Resources.getResourceAsStream(Resources.j
ava:86)
        at
com.ibatis.common.resources.Resources.getResourceAsReader(Resources.j
ava:150)
        at
com.ibatis.db.sqlmap.upgrade.SqlMapXmlConverter.convertXml(SqlMapXmlC
onverter.java:43)
        at
com.ibatis.db.sqlmap.upgrade.SqlMapXmlConverter.convertFile(SqlMapXml
Converter.java:71)
        at
com.ibatis.db.sqlmap.upgrade.ConvertTask.doFileOperations(ConvertTask
.java:75)
        at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:369)
        at org.apache.tools.ant.Task.perform(Task.java:341)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
        at
org.apache.tools.ant.Project.executeTargets(Project.java:1255)
        at org.apache.tools.ant.Main.runBuild(Main.java:609)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)
Error.  Cause: java.io.IOException: Could not find resource
com/ibatis/db/sqlmap
/upgrade/SqlMap.xsl

-----Original Message-----
From: Clinton Begin [mailto:clinton.begin@gmail.com] 
Sent: Friday, December 03, 2004 9:04 AM
To: McCarrier, Alex
Cc: ibatis-user-java@incubator.apache.org
Subject: Re: Problems upgrading from 1.2.x to 2.0.8


I'd really recommend converting your SQL Maps (just the XML) to the 2.0
syntax.  You can continue to safely use the 1.x java API, but the 2.0
XML is much cleaner and will avoid these conversion issues for complex
configurations.

Cheers,
Clinton


On Thu, 2 Dec 2004 17:06:29 -0600, McCarrier, Alex
<amccarrier@pointserve.com> wrote:
> FYI I found the cause of this:
> 
> There is an XSL transform in the ibatis-sqlmap-1-x.jar upgrade that 
> does an on the fly conversion when using the old format config files.

> When it encounters useGlobalTransactions in the settings it assumes 
> the user is using User Managed Transactions and tries to get the JNDI 
> names from the settings as well.  However, when useGlobalTransactions 
> is set in the old it does not necessarily mean they are using user 
> managed transactions, by default it means they are using external 
> transactions. The XSL incorrectly translates the file to JTA with JNDI

> name "".  It should translate to transaction type EXTERNAL.
> 
> 
> 
> -----Original Message-----
> From: McCarrier, Alex [mailto:amccarrier@pointserve.com]
> Sent: Thursday, December 02, 2004 3:12 PM
> To: ibatis-user-java@incubator.apache.org
> Subject: Problems upgrading from 1.2.x to 2.0.8
> 
> I'm getting ClassCastExceptions on TransactionManager when trying to 
> load our old ibatis config file using the new iBatis libraries.
> 
> Apparently what it is trying to do is an on the fly conversion from 
> the old format to the new format (found by tracing through iBatis 
> source code).  However, we don't have anything transaction related in 
> our config file other than a settings option to specify using global 
> transactions.  We let the EJB container handle the demarcation of our 
> transactions.  When iBatis does the conversion, it seems to default to

> using JTA transactions, tries to lookup the UserTransaction with JNDI 
> name "" and then throws the ClassCastException.  Any ideas on how to 
> fix this without having to do a manual conversion of the file 
> (although I will do that if that's the only way, but someone might 
> want to add this to the upgrade guide).
> 
> Here's the part of our config file that is causing problems:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> 
> <!DOCTYPE sql-map-config
>    PUBLIC "-//iBATIS.com//DTD SQL Map Config 1.0//EN"
>    "http://www.ibatis.com/dtd/sql-map-config.dtd">
> 
> <sql-map-config>
> 
>    <settings useGlobalTransactions="true"
>              cacheModelsEnabled="true" />
>    <!--settings useBeansMetaClasses="true"/ Investigate, suppose to be

> big performance improvement-->
> 
>    <datasource name="snmDataSource"
> 
> factory-class="com.ibatis.db.sqlmap.datasource.JndiDataSourceFactory"
>                  default="true" >
>        <property name="DBFullJndiContext" value="java:/dsname" />
>    </datasource>
> 
>        .. Rest of stuff here ...
> 
> </sql-map-config>
>

Mime
View raw message