cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Dahbura <>
Subject Re: Having problems with cayenne.xml in web application
Date Tue, 17 May 2011 14:32:00 GMT
I found the problem I think....It appears my calling the DataContext dataContext = DataContext.createDataContext();
at application startup was causing problems?  

I am not sure why I cannot initialize the context at startup unless the WebApplicationContextFilter
has not finished initializing by then.  When I took the call out of the startup listener class
it was find.  Not sure how to get the WebApplicationContextFilter to startup ahead of this....


----- Original Message -----
From: "Tony Dahbura" <>
Sent: Tuesday, May 17, 2011 10:04:19 AM
Subject: Having problems with cayenne.xml in web application

I have placed the cayenne.xml file in WEB-INF directory, also in classes directory under WEB-INF
and even added a parameter to my web.xml file to : 



I cannot get Cayenne the web application to startup without throwing a cayenne.xml not found....

SEVERE: Exception sending context initialized event to listener instance of class com.tasc.aops.eurest.Context.DatabaseStartup

org.apache.cayenne.ConfigurationException: [v.3.0.1 Aug 25 2010 19:42:04] Error during Configuration
initialization. [v.3.0.1 Aug 25 2010 19:42:04] [org.apache.cayenne.conf.DefaultConfiguration]
: Domain configuration file "cayenne.xml" is not found. 
at org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(

at org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(

at org.apache.cayenne.conf.Configuration.initializeSharedConfiguration(

at org.apache.cayenne.conf.Configuration.getSharedConfiguration( 
at org.apache.cayenne.access.DataContext.createDataContext( 
at com.tasc.aops.eurest.Context.DatabaseAccess.<init>( 
at com.tasc.aops.eurest.Context.DatabaseAccess.getInstance( 
at com.tasc.aops.eurest.Context.DatabaseStartup.contextInitialized(

at org.apache.catalina.core.StandardContext.listenerStart( 
at org.apache.catalina.core.StandardContext.start( 
at org.apache.catalina.core.ContainerBase.start( 
at org.apache.catalina.core.StandardHost.start( 
at org.apache.catalina.core.ContainerBase.start( 
at org.apache.catalina.core.StandardEngine.start( 
at org.apache.catalina.core.StandardService.start( 
at org.apache.catalina.core.StandardServer.start( 
at org.apache.catalina.startup.Catalina.start( 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke( 
at sun.reflect.DelegatingMethodAccessorImpl.invoke( 
at java.lang.reflect.Method.invoke( 
at org.apache.catalina.startup.Bootstrap.start( 
at org.apache.catalina.startup.Bootstrap.main( 

I When my application starts up it tries to do a DataContext dataContext = DataContext.createDataContext();
which is causing the error.... 

I am using version 3.0.1.... with the WebApplicationContextFilter.... 


View raw message