24 May 2012 09:13
Domain configuration file "cayenne.xml" is not found.
Kanwar Manish <kanwarmanish <at> gmail.com>
2012-05-24 07:13:27 GMT
2012-05-24 07:13:27 GMT
Sorry guys, I am posting this bugger again.
But it has turned out to be a bummer for me.
I am using NetBeans 7.1.1
JDK 1.7
cayenne files are in the folder - "/WEB-INF/config/cayenne-files". Total
three files cayenne.xml, map and node files.
Error:
"[v.3.0.2 Jun 11 2011 09:26:09] Error during Configuration initialization.
[v.3.0.2 Jun 11 2011 09:26:09]
[org.apache.cayenne.conf.DefaultConfiguration] : Domain configuration file
"cayenne.xml" is not found."
My XML File section for cayenne:
"
<filter>
<filter-name>CayenneFilter</filter-name>
<filter-class>org.apache.cayenne.conf.WebApplicationContextFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CayenneFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<context-param>
<param-name>cayenne.configuration.path</param-name>
<param-value>/WEB-INF/config/cayenne-files</param-value>
(Continue reading)
]
Here is what I did - 1st approach
1. Moved to conf files to the default package.
2. Stepped through lot of errors for dependencies like Commons-Collections,
Ashwood and JDBC driver not found.
3. Used code below - and it worked.
"
DefaultConfiguration conf = new DefaultConfiguration();
conf.addClassPath("mypackage");
Configuration.initializeSharedConfiguration(conf);
DataContext context = DataContext.createDataContext();
return context;
"
2nd Approach
To test out Michael's suggestion of keeping the '<context-param> section
before <filter> and <filter-mapping>', I moved back the config files to the
RSS Feed