ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Turkenkopf" <dturk...@gmail.com>
Subject Re: ibator build error
Date Mon, 19 Jan 2009 14:59:29 GMT
Hi Shao,

It looks like you've run into a bug in the current release of Ibator where
the DAO generator is required.  It's been fixed in Subversion, so you can
either build from source or add the daoGenerator element to your config.

Here's an example:

    <daoGenerator type="SPRING" targetPackage="test.dao"
targetProject="src">
      <property name="enableSubPackages" value="true" />
    </daoGenerator>

Hope this helps,

Dan Turkenkopf

On Mon, Jan 19, 2009 at 12:35 AM, schin <fafy_99@yahoo.com> wrote:

>
> Hi,
> I'm a brand new member here, and a brand new ibator user. I
> tried my first Ant build in eclipse using ibator plugin to generate code
> and
> spent all night to no avail, so I'm
> hoping I could get some help here.
> I created a Build.xml and a ibatorConfig.xml, and they are located in my
> project directory "C:\projects\AFI\InputService".  When I tried to build it
> in Ant, I keep getting the NullPointeException.
>
> This is my simple Build.xml file:
>
> <project default="genfiles" basedir="c:\projects\AFI\InputService\">
>     <property name="generated.source.dir" value="${basedir}" />
>     <target name="genfiles" description="Generate the files">
>           <taskdef name="ibator"
>                    classname="org.apache.ibatis.ibator.ant.IbatorAntTask"
>                    classpath="c:\Program
> Files\eclipse\plugins\org.apache.ibatis.ibator.core_1.2.1\ibator.jar" />
>           <ibator overwrite="true"
> configfile="c:\projects\AFI\InputService\ibatorConfig.xml" verbose="true" >
>                         <propertyset>
>                               <propertyref name="generated.source.dir"/>
>                         </propertyset>
>            </ibator>
>     </target>
> </project>
>
>
> This is my ibatorConfig.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE ibatorConfiguration
>  PUBLIC "-//Apache Software Foundation//DTD Apache iBATIS Ibator
> Configuration 1.0//EN"
>  "http://ibatis.apache.org/dtd/ibator-config_1_0.dtd">
>
> <ibatorConfiguration>
>  <classPathEntry location="c:\Program
> Files\java\mysql-connector-java-5.1.7\mysql-connector-java-5.1.7-bin.jar"
> />
>
>  <ibatorContext id="MySQLTables" targetRuntime="Ibatis2Java2">
>    <jdbcConnection driverClass="com.mysql.jdbc.Driver"
>        connectionURL="jdbc:mysql://localhost:3306/afi"
>        userId="root"
>        password="123456">
>    </jdbcConnection>
>
>    <javaModelGenerator targetPackage="InputService"
> targetProject="InputService\src">
>      <property name="enableSubPackages" value="false" />
>      <property name="trimStrings" value="true" />
>    </javaModelGenerator>
>
>    <sqlMapGenerator targetPackage="InputService"
> targetProject="InputService\src">
>      <property name="enableSubPackages" value="false" />
>    </sqlMapGenerator>
>
>    <table tableName="client_table_properties"
> domainObjectName="ClientTableProperties" >
>      <property name="useActualColumnNames" value="false"/>
>      <columnOverride column="account_number" javaType="java.lang.Object"
> jdbcType="LONG" />
>    </table>
>
>  </ibatorContext>
> </ibatorConfiguration>
>
>
> This is the error I got:
>
> Buildfile: C:\projects\AFI\InputService\build.xml
> genfiles:
>   [ibator] java.lang.NullPointerException
>   [ibator]  at
>
> org.apache.ibatis.ibator.api.IntrospectedTable.calculateDAOImplementationPackage(IntrospectedTable.java:508)
>   [ibator]  at
>
> org.apache.ibatis.ibator.api.IntrospectedTable.initialize(IntrospectedTable.java:479)
>   [ibator]  at
>
> org.apache.ibatis.ibator.config.IbatorContext.generateFiles(IbatorContext.java:493)
>   [ibator]  at
> org.apache.ibatis.ibator.api.Ibator.generate(Ibator.java:219)
>   [ibator]  at
> org.apache.ibatis.ibator.ant.IbatorAntTask.execute(IbatorAntTask.java:145)
>   [ibator]  at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
>   [ibator]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   [ibator]  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>   [ibator]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
>   [ibator]  at java.lang.reflect.Method.invoke(Unknown Source)
>   [ibator]  at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
>   [ibator]  at org.apache.tools.ant.Task.perform(Task.java:348)
>   [ibator]  at org.apache.tools.ant.Target.execute(Target.java:357)
>   [ibator]  at org.apache.tools.ant.Target.performTasks(Target.java:385)
>   [ibator]  at
> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
>   [ibator]  at
> org.apache.tools.ant.Project.executeTarget(Project.java:1298)
>   [ibator]  at
>
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
>   [ibator]  at
>
> org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
>   [ibator]  at
> org.apache.tools.ant.Project.executeTargets(Project.java:1181)
>   [ibator]  at
>
> org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
>   [ibator]  at
>
> org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
>
> BUILD FAILED
> C:\projects\AFI\InputService\build.xml:8: null
>
> Can anyone point out what I'm missing here? I ran the project in Debug mode
> but I can't step into the ibatorConfig file, only inside the Build.xml
> file.
> Is this a bug in ibator?
>
> Thank you very much for your help!
> Shao Chin,
> Tempe, AZ
>
> --
> View this message in context:
> http://www.nabble.com/ibator-build-error-tp21537217p21537217.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

Mime
View raw message