Re: Cayenne configuration with Maven

From: Andrey Razumovsky (razumovsky.andre..mail.com)
Date: Mon Sep 22 2008 - 02:24:19 EDT

  • Next message: Stephen Winnall: "Re: Cayenne configuration with Maven"

    Seems that you created your Xw project with Cayenne 3.0
    (since org.apache.cayenne.conf.DriverDataSourceFactory is set in Driver.xml)
    and trying to open it with Cayenne 1.2.4 modeler. I don't think this is a
    good idea, you'd better choose just one version (or at least change to 2.0.4
    - there are more chances that DriverDataSourceFactory class will be found).

    2008/9/22, Stephen Winnall <stev..innall.ch>:
    >
    > I'm trying to set up a new project using Maven. I'm new to Cayenne and
    > Maven. I use NetBeans 6.1 and I've managed to get everything compiled.
    > However, when I try to run it, it falls at the first hurdle. This is my
    > program:
    >
    > public static void main(String[] args) {
    > DataContext context = DataContext.createDataContext();
    > }
    >
    > It fails with the following messages:
    >
    > Exception in thread "main" org.objectstyle.cayenne.ConfigurationException:
    > [v.1.2.4 October 8 2007] Error during Configuration initialization. [v.1.2.4
    > October 8 2007] Load failures. Main configuration class:
    > org.objectstyle.cayenne.conf.DefaultConfiguration, details:
    > domain.node.name=XwRepositoryNode,
    > domain.node.datasource=XwRepositoryNode.driver.xml, reason: DataSource load
    > failed - org.apache.cayenne.conf.DriverDataSourceFactory
    > at
    > org.objectstyle.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:321)
    > at
    > org.objectstyle.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:294)
    > at
    > org.objectstyle.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:275)
    > at
    > org.objectstyle.cayenne.conf.Configuration.getSharedConfiguration(Configuration.java:212)
    > at
    > org.objectstyle.cayenne.access.DataContext.createDataContext(DataContext.java:242)
    > at org.vimia.xw.PopulateNst.main(PopulateNst.java:23)
    >
    > I've got org.apache.cayenne.conf.DriverDataSourceFactory in my classpath by
    > using
    > org.apache.cayenne.unpublished:cayenne-jdk1.5-unpublished:3.0-SNAPSHOT.
    >
    > I downloaded Cayenne 3.0-SNAPSHOT and built and installed it in my local
    > repository.
    >
    > I've tried changing cayenne-log.properties to switch on debugging, but I
    > don't think it is being found. I get the impression that the file
    > XwRepositoryNode.driver.xml is not being found either. I have copied them
    > both manually to the same place as cayenne.xml. I know cayenne.xml is being
    > found because I got a different error complaining about that before I did
    > the manual copy.
    >
    > Where do these files go? How do I tell Maven about these files so it copies
    > them to the right place for run-time?
    >
    > Steve
    >



    This archive was generated by hypermail 2.0.0 : Mon Sep 22 2008 - 02:25:11 EDT