Re: Easily Import/Export tables

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Sep 08 2009 - 10:33:21 EDT

  • Next message: Reinout van Schouwen: "Re: DataContext cache WICKET"

    Looks like this bug to me:

    https://issues.apache.org/jira/browse/CAY-1170

    It is fixed in 3.0M6. Which version of Cayenne do you have?

    Andrus

    On Sep 8, 2009, at 10:27 AM, open.pumpkin wrote:

    > The trace :
    > /.../build.xml:20: Error porting data: null
    > at
    > org.apache.cayenne.tools.DataPortTask.execute(DataPortTask.java:108)
    > 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:
    > 106)
    > 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:
    > 1337)
    > at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
    > at
    > org
    > .apache
    > .tools
    > .ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    > at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
    > at org.apache.tools.ant.Main.runBuild(Main.java:758)
    > at org.apache.tools.ant.Main.startAnt(Main.java:217)
    > at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
    > at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
    > Caused by: java.lang.NullPointerException
    > at org.apache.cayenne.dba.TypesHandler.<init>(TypesHandler.java:74)
    > at
    > org.apache.cayenne.dba.TypesHandler.getHandler(TypesHandler.java:58)
    > at org.apache.cayenne.dba.JdbcAdapter.<init>(JdbcAdapter.java:100)
    > at
    > org.apache.cayenne.dba.mysql.MySQLAdapter.<init>(MySQLAdapter.java:75)
    > at
    > org
    > .apache
    > .cayenne.dba.mysql.MySQLSniffer.createAdapter(MySQLSniffer.java:71)
    > at
    > org
    > .apache
    > .cayenne
    > .dba.DbAdapterFactoryChain.createAdapter(DbAdapterFactoryChain.java:
    > 58)
    > at
    > org.apache.cayenne.dba.AutoAdapter.loadAdapter(AutoAdapter.java:173)
    > at org.apache.cayenne.dba.AutoAdapter.getAdapter(AutoAdapter.java:
    > 155)
    > at
    > org.apache.cayenne.dba.AutoAdapter.getExtendedTypes(AutoAdapter.java:
    > 263)
    > at
    > org.apache.cayenne.access.DataNode.performQueries(DataNode.java:243)
    > at org.apache.cayenne.access.DataPort.processDelete(DataPort.java:
    > 151)
    > at org.apache.cayenne.access.DataPort.execute(DataPort.java:110)
    > at
    > org.apache.cayenne.tools.DataPortTask.execute(DataPortTask.java:104)
    > ... 17 more
    > --- Nested Exception ---
    > java.lang.NullPointerException
    > at org.apache.cayenne.dba.TypesHandler.<init>(TypesHandler.java:74)
    > at
    > org.apache.cayenne.dba.TypesHandler.getHandler(TypesHandler.java:58)
    > at org.apache.cayenne.dba.JdbcAdapter.<init>(JdbcAdapter.java:100)
    > at
    > org.apache.cayenne.dba.mysql.MySQLAdapter.<init>(MySQLAdapter.java:75)
    > at
    > org
    > .apache
    > .cayenne.dba.mysql.MySQLSniffer.createAdapter(MySQLSniffer.java:71)
    > at
    > org
    > .apache
    > .cayenne
    > .dba.DbAdapterFactoryChain.createAdapter(DbAdapterFactoryChain.java:
    > 58)
    > at
    > org.apache.cayenne.dba.AutoAdapter.loadAdapter(AutoAdapter.java:173)
    > at org.apache.cayenne.dba.AutoAdapter.getAdapter(AutoAdapter.java:
    > 155)
    > at
    > org.apache.cayenne.dba.AutoAdapter.getExtendedTypes(AutoAdapter.java:
    > 263)
    > at
    > org.apache.cayenne.access.DataNode.performQueries(DataNode.java:243)
    > at org.apache.cayenne.access.DataPort.processDelete(DataPort.java:
    > 151)
    > at org.apache.cayenne.access.DataPort.execute(DataPort.java:110)
    > at
    > org.apache.cayenne.tools.DataPortTask.execute(DataPortTask.java:104)
    > 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:
    > 106)
    > 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:
    > 1337)
    > at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
    > at
    > org
    > .apache
    > .tools
    > .ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    > at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
    > at org.apache.tools.ant.Main.runBuild(Main.java:758)
    > at org.apache.tools.ant.Main.startAnt(Main.java:217)
    > at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
    > at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
    >
    >
    > 2009/9/8 Andrus Adamchik <andru..bjectstyle.org>
    >
    >>
    >> On Sep 8, 2009, at 3:24 AM, open.pumpkin wrote:
    >>
    >> Line #20 is : srcNode="Dev_WKN_Node" destNode="Local_WKN_Node" />
    >>> Connections to databases are correct (if I stop one DB, I receive a
    >>> Connection refused exception). Node names are correct. But I'm not
    >>> familiar
    >>> with ant.
    >>> Can you enlighten me?
    >>>
    >>
    >> Try running ant with -v flag: "ant -v". It should print the stack
    >> trace.
    >>
    >>
    >> Now some general questions :
    >>> When using the ant method to export DB data, ID's are kept
    >>> identical in
    >>> different DB's ? Or, if they change, the foreign keys are
    >>> automatically
    >>> mapped with new ID's ? If not, then this method does not interest
    >>> me.
    >>>
    >>
    >> The ids are preserved.
    >>
    >> Andrus
    >>
    >>



    This archive was generated by hypermail 2.0.0 : Tue Sep 08 2009 - 10:33:59 EDT