[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology] Re: Error in eclipse Ant Build using ibator

I suspect that Eclipse is not the source of the problem. You can test this for yourself by trying a simpler build.xml and confirming that Eclipse can execute it as expected.

ibator is not part of any Eclipse project, so it's relatively unlikely that you'll find any help for it here.

The org.apache.ibatis.ibator.api.IntrospectedTable type seems to be the source of the error. This is part of the Apache ibatis project code. I recommend that you seek answers on a forum from that project.

Good luck,

Wayne


shao wrote:
Hi,
I'm a brand new member here, and a brand new eclipse/ant/ibator user. I
tried my first Ant build in eclipse 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 eclipse, 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

Please point out what I'm missing here. Thank you very much for your help!
Shao Chin,
Tempe, AZ