You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by masjab <mj...@jastech-solutions.com> on 2010/07/25 16:03:28 UTC

cayenne.xml not found

Hey all, 

I am trying to complete the "getting started" tutorial but I can´t. 
Everything was easy but when I run the Main.java I get the following error:

Exception in thread "main" org.apache.cayenne.ConfigurationException:
[v.3.0RC2 Feb 03 2010 13:38:54] Error during Configuration initialization.
[v.3.0RC2 Feb 03 2010 13:38:54]
[org.apache.cayenne.conf.DefaultConfiguration] : Domain configuration file
"cayenne.xml" is not found.
	at
org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:168)
	at
org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:141)
	at
org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:121)
	at
org.apache.cayenne.conf.Configuration.getSharedConfiguration(Configuration.java:91)
	at
org.apache.cayenne.access.DataContext.createDataContext(DataContext.java:143)
	at org.example.cayenne.Main.main(Main.java:12)
Caused by: org.apache.cayenne.ConfigurationException: [v.3.0RC2 Feb 03 2010
13:38:54] [org.apache.cayenne.conf.DefaultConfiguration] : Domain
configuration file "cayenne.xml" is not found.
	at
org.apache.cayenne.conf.DefaultConfiguration.initialize(DefaultConfiguration.java:141)
	at
org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:159)
	... 5 more


I did search and I saw that I am not the only one...
But after readying still don´t know what to do.


In Eclipse the cayenne.xml is in src/main/resources
My pom.xml looks like this:

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.example.cayenne</groupId>
  <artifactId>tutorial</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  
  <dependencies>
		<dependency>
			<groupId>org.apache.cayenne</groupId>
			<artifactId>cayenne-server</artifactId>
   <!-- Here specify the version of Cayenne you are actually using -->
			<version>3.0RC2</version>
		</dependency>
		
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>5.1.13</version>
		</dependency>
	</dependencies>
</project>


The tables are created in my database, no prob...

THX 2 ALL Your HELP



-- 
View this message in context: http://cayenne.195.n3.nabble.com/cayenne-xml-not-found-tp993821p993821.html
Sent from the Cayenne - User mailing list archive at Nabble.com.

Re: cayenne.xml not found

Posted by Michael Gentry <mg...@masslight.net>.
I think, in addition to what Evgeny said, that you have to add
src/main/resources to your Eclipse source path.  I don't have my
Eclipse setup handy at the moment, but I've had to do this in the past
(manually add it).  Also, make sure you have Eclipse set up to
auto-refresh the Workspace.

mrg


On Sun, Jul 25, 2010 at 10:03 AM, masjab <mj...@jastech-solutions.com> wrote:
>
> Hey all,
>
> I am trying to complete the "getting started" tutorial but I can´t.
> Everything was easy but when I run the Main.java I get the following error:
>
> Exception in thread "main" org.apache.cayenne.ConfigurationException:
> [v.3.0RC2 Feb 03 2010 13:38:54] Error during Configuration initialization.
> [v.3.0RC2 Feb 03 2010 13:38:54]
> [org.apache.cayenne.conf.DefaultConfiguration] : Domain configuration file
> "cayenne.xml" is not found.
>        at
> org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:168)
>        at
> org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:141)
>        at
> org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:121)
>        at
> org.apache.cayenne.conf.Configuration.getSharedConfiguration(Configuration.java:91)
>        at
> org.apache.cayenne.access.DataContext.createDataContext(DataContext.java:143)
>        at org.example.cayenne.Main.main(Main.java:12)
> Caused by: org.apache.cayenne.ConfigurationException: [v.3.0RC2 Feb 03 2010
> 13:38:54] [org.apache.cayenne.conf.DefaultConfiguration] : Domain
> configuration file "cayenne.xml" is not found.
>        at
> org.apache.cayenne.conf.DefaultConfiguration.initialize(DefaultConfiguration.java:141)
>        at
> org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:159)
>        ... 5 more
>
>
> I did search and I saw that I am not the only one...
> But after readying still don´t know what to do.
>
>
> In Eclipse the cayenne.xml is in src/main/resources
> My pom.xml looks like this:
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>  <modelVersion>4.0.0</modelVersion>
>  <groupId>org.example.cayenne</groupId>
>  <artifactId>tutorial</artifactId>
>  <version>0.0.1-SNAPSHOT</version>
>
>  <dependencies>
>                <dependency>
>                        <groupId>org.apache.cayenne</groupId>
>                        <artifactId>cayenne-server</artifactId>
>   <!-- Here specify the version of Cayenne you are actually using -->
>                        <version>3.0RC2</version>
>                </dependency>
>
>                <dependency>
>                        <groupId>mysql</groupId>
>                        <artifactId>mysql-connector-java</artifactId>
>                        <version>5.1.13</version>
>                </dependency>
>        </dependencies>
> </project>
>
>
> The tables are created in my database, no prob...
>
> THX 2 ALL Your HELP
>
>
>
> --
> View this message in context: http://cayenne.195.n3.nabble.com/cayenne-xml-not-found-tp993821p993821.html
> Sent from the Cayenne - User mailing list archive at Nabble.com.
>

Re: cayenne.xml not found

Posted by Evgeny Ryabitskiy <ev...@gmail.com>.
Hello!

First of all I would recommended you using official release 3.0
instead of release candidate.

Exception tells that your cayenne.xml still not in classpath. Mostly
it's Eclipse/Maven problem.

Have you install Maven 2 Eclipse integration plug-in? Have you run
"mvn install" before Main?

Hints:
Check your target if it contains cayenne.xml.
Check your Eclipse project settings that build output is configured on
target/...


Evgeny.


2010/7/25 masjab <mj...@jastech-solutions.com>:
>
> Hey all,
>
> I am trying to complete the "getting started" tutorial but I can´t.
> Everything was easy but when I run the Main.java I get the following error:
>
> Exception in thread "main" org.apache.cayenne.ConfigurationException:
> [v.3.0RC2 Feb 03 2010 13:38:54] Error during Configuration initialization.
> [v.3.0RC2 Feb 03 2010 13:38:54]
> [org.apache.cayenne.conf.DefaultConfiguration] : Domain configuration file
> "cayenne.xml" is not found.
>        at
> org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:168)
>        at
> org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:141)
>        at
> org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:121)
>        at
> org.apache.cayenne.conf.Configuration.getSharedConfiguration(Configuration.java:91)
>        at
> org.apache.cayenne.access.DataContext.createDataContext(DataContext.java:143)
>        at org.example.cayenne.Main.main(Main.java:12)
> Caused by: org.apache.cayenne.ConfigurationException: [v.3.0RC2 Feb 03 2010
> 13:38:54] [org.apache.cayenne.conf.DefaultConfiguration] : Domain
> configuration file "cayenne.xml" is not found.
>        at
> org.apache.cayenne.conf.DefaultConfiguration.initialize(DefaultConfiguration.java:141)
>        at
> org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(Configuration.java:159)
>        ... 5 more
>
>
> I did search and I saw that I am not the only one...
> But after readying still don´t know what to do.
>
>
> In Eclipse the cayenne.xml is in src/main/resources
> My pom.xml looks like this:
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
>  <modelVersion>4.0.0</modelVersion>
>  <groupId>org.example.cayenne</groupId>
>  <artifactId>tutorial</artifactId>
>  <version>0.0.1-SNAPSHOT</version>
>
>  <dependencies>
>                <dependency>
>                        <groupId>org.apache.cayenne</groupId>
>                        <artifactId>cayenne-server</artifactId>
>   <!-- Here specify the version of Cayenne you are actually using -->
>                        <version>3.0RC2</version>
>                </dependency>
>
>                <dependency>
>                        <groupId>mysql</groupId>
>                        <artifactId>mysql-connector-java</artifactId>
>                        <version>5.1.13</version>
>                </dependency>
>        </dependencies>
> </project>
>
>
> The tables are created in my database, no prob...
>
> THX 2 ALL Your HELP
>
>
>
> --
> View this message in context: http://cayenne.195.n3.nabble.com/cayenne-xml-not-found-tp993821p993821.html
> Sent from the Cayenne - User mailing list archive at Nabble.com.
>

Re: cayenne.xml not found

Posted by Hans Pikkemaat <h....@tsi-solutions.nl>.
  Hi,

I've seen this issue before with Eclipse.
Sometimes it happens that resource files disappear from the classes directory.

A clean project usually helps as this rebuilds the whole project (if autobuilding is on).

tx

HPI

On 7/26/10 12:25 PM, masjab wrote:
> Ok,
>
> it´s working.
> The problem was the source path but strange... When I checked the source
> path, src/java/res...was added already.
>
> I finally deleted it and added it again, everything looked the same, but now
> it´s working.
>
> Many THX!
>
> Now I can go on...


Re: cayenne.xml not found

Posted by masjab <mj...@jastech-solutions.com>.
Ok, 

it´s working.
The problem was the source path but strange... When I checked the source
path, src/java/res...was added already. 

I finally deleted it and added it again, everything looked the same, but now
it´s working.

Many THX!

Now I can go on...
-- 
View this message in context: http://cayenne.195.n3.nabble.com/cayenne-xml-not-found-tp993821p995826.html
Sent from the Cayenne - User mailing list archive at Nabble.com.

Re: cayenne.xml not found

Posted by Andrus Adamchik <an...@objectstyle.org>.
I think you need to follow Michael's advice. "src/main/resources" must  
be setup as a *source* folder in Eclipse. E.g.:

http://cayenne.apache.org/doc30/tutorial-starting-project.data/eclipse-xmlfiles.png

To do that, right-click on the project, select "Properties > Java  
Build Path > Source > Add Folder" and add src/main/resources.

Andrus

On Jul 26, 2010, at 12:34 AM, masjab wrote:

>
> Hey,
> thx for your help, but still: No chance...
>
> I downloaded the lastest stable release and still same problem..
> Yes, I did install the maven plugin into eclipse.
>
> When I open eclipse, I make a new project, choose maven projekt, and  
> follow
> the instructions in the tutorial...
>
> Now, after building the modeler it doesnt even copy any cayenne.xml  
> into my
> project=(
>
> In my sources there are cayenne-UntitledDomain.xml and  
> UntitledDomainMap.xml
> ..but nothing else
>
> -- 
> View this message in context: http://cayenne.195.n3.nabble.com/cayenne-xml-not-found-tp993821p994693.html
> Sent from the Cayenne - User mailing list archive at Nabble.com.
>


Re: cayenne.xml not found

Posted by Jeffrey Black <jb...@yahoo.com>.
For what it's worth -- I am in the process of upgrading a project which 
presently uses DBUtils to Cayenne.  


After adding the Cayenne Jars to the project I placed the cayenne.xml along with 
the supporting XML files into the default package and it worked as beautifully.

Of course I plan to refactor. :)


jb





________________________________
From: masjab <mj...@jastech-solutions.com>
To: user@cayenne.apache.org
Sent: Sun, July 25, 2010 4:34:09 PM
Subject: Re: cayenne.xml not found


Hey, 
thx for your help, but still: No chance...

I downloaded the lastest stable release and still same problem..
Yes, I did install the maven plugin into eclipse.

When I open eclipse, I make a new project, choose maven projekt, and follow
the instructions in the tutorial...

Now, after building the modeler it doesnt even copy any cayenne.xml into my
project=(

In my sources there are cayenne-UntitledDomain.xml and UntitledDomainMap.xml
..but nothing else

-- 
View this message in context: 
http://cayenne.195.n3.nabble.com/cayenne-xml-not-found-tp993821p994693.html
Sent from the Cayenne - User mailing list archive at Nabble.com.

Re: cayenne.xml not found

Posted by masjab <mj...@jastech-solutions.com>.
Hey, 
thx for your help, but still: No chance...

I downloaded the lastest stable release and still same problem..
Yes, I did install the maven plugin into eclipse.

When I open eclipse, I make a new project, choose maven projekt, and follow
the instructions in the tutorial...

Now, after building the modeler it doesnt even copy any cayenne.xml into my
project=(

In my sources there are cayenne-UntitledDomain.xml and UntitledDomainMap.xml
..but nothing else

-- 
View this message in context: http://cayenne.195.n3.nabble.com/cayenne-xml-not-found-tp993821p994693.html
Sent from the Cayenne - User mailing list archive at Nabble.com.