Hi,
I've double checked that driver loading and that seem to be fine for me. The driver jar is in classpath and I've tried adding classpathref to the task as well but that didn't help.
With classpathref the ant code looked like this. I've cayenne tools and cayenne server jars in the classpath.
Regards,
Parth
<cdbgen map="${src.dir}/CoffeshopMap.map.xml"
adapter="org.apache.cayenne.dba.sqlserver.SQLServerAdapter"
driver="om.microsoft.jdbc.sqlserver.SQLServerDriver"
url="jdbc:sqlserver://localhost:1433;databaseName=coffeshop;SelectMethod=cursor"
username="coffeshop"
password="password"
classpathref="${cayenne.build.classpath}"/>
-----Original Message-----
From: Kevin Menard [mailto:nirvdru..mail.com]
Sent: Tuesday, 2 March 2010 3:03 PM
To: use..ayenne.apache.org
Subject: Re: cdbgen problem for SQLServer on RC2
I'm seeing the same thing now. In my case it looks like the JDBC
driver isn't being loaded off the classpath. But I haven't had the
time to dig into it more to see why that may be or at what point it
broke.
-- KevinOn Mon, Mar 1, 2010 at 10:59 PM, Parth Pandya <ppandy..voka.com> wrote: > Hi Guys, > I'm trying to use cdbgen task in my Ant script and I'm getting NPE. > Here is the ant code and the exception. Can anyone please help?? > Thanks in advance. > Cheers, > Parth > > From Ant build: > <target name="create-db" description="build the Coffeshop database"> > <cdbgen map="${src.dir}/CoffeshopMap.map.xml" > adapter="org.apache.cayenne.dba.sqlserver.SQLServerAdapter" > driver="om.microsoft.jdbc.sqlserver.SQLServerDriver" > url="jdbc:sqlserver://localhost:1433;databaseName=coffeshop;SelectMethod=cursor" > username="coffeshop" > password="password"/> > </target> > > Exception > generator options - [dropTables: false, dropPK: false, createTables: true, createPK: true, createFK: true] > [cdbgen] Error generating database > > BUILD FAILED > C:\dev\myEclipseTelstraWorkspace\telstra.all4biz.portal\edge-build.xml:293: Error generating database > at org.apache.cayenne.tools.DbGeneratorTask.execute(DbGeneratorTask.java:94) > at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105) > at org.apache.tools.ant.Task.perform(Task.java:348) > at org.apache.tools.ant.Target.execute(Target.java:357) > at org.apache.tools.ant.Target.performTasks(Target.java:385) > at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329) > at org.apache.tools.ant.Project.executeTarget(Project.java:1298) > at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) > at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32) > at org.apache.tools.ant.Project.executeTargets(Project.java:1181) > at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423) > at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137) > Caused by: java.lang.NullPointerException > at org.apache.cayenne.map.AshwoodEntitySorter.fillInMetadata(AshwoodEntitySorter.java:264) > at org.apache.cayenne.map.AshwoodEntitySorter._indexSorter(AshwoodEntitySorter.java:97) > at org.apache.cayenne.map.AshwoodEntitySorter.sortDbEntities(AshwoodEntitySorter.java:136) > at org.apache.cayenne.access.DbGenerator.prepareDbEntities(DbGenerator.java:582) > at org.apache.cayenne.access.DbGenerator.<init>(DbGenerator.java:132) > at org.apache.cayenne.access.DbGenerator.<init>(DbGenerator.java:105) > at org.apache.cayenne.access.DbGenerator.<init>(DbGenerator.java:93) > at org.apache.cayenne.tools.DbGeneratorTask.execute(DbGeneratorTask.java:71) > ... 16 more > --- Nested Exception --- > java.lang.NullPointerException > at org.apache.cayenne.map.AshwoodEntitySorter.fillInMetadata(AshwoodEntitySorter.java:264) > at org.apache.cayenne.map.AshwoodEntitySorter._indexSorter(AshwoodEntitySorter.java:97) > at org.apache.cayenne.map.AshwoodEntitySorter.sortDbEntities(AshwoodEntitySorter.java:136) > at org.apache.cayenne.access.DbGenerator.prepareDbEntities(DbGenerator.java:582) > at org.apache.cayenne.access.DbGenerator.<init>(DbGenerator.java:132) > at org.apache.cayenne.access.DbGenerator.<init>(DbGenerator.java:105) > at org.apache.cayenne.access.DbGenerator.<init>(DbGenerator.java:93) > at org.apache.cayenne.tools.DbGeneratorTask.execute(DbGeneratorTask.java:71) > at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105) > at org.apache.tools.ant.Task.perform(Task.java:348) > at org.apache.tools.ant.Target.execute(Target.java:357) > at org.apache.tools.ant.Target.performTasks(Target.java:385) > at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329) > at org.apache.tools.ant.Project.executeTarget(Project.java:1298) > at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) > at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32) > at org.apache.tools.ant.Project.executeTargets(Project.java:1181) > at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423) > at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137) > > > >
> >
This archive was generated by hypermail 2.0.0 : Mon Mar 01 2010 - 23:10:40 EST