cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kanwar Manish <kanwarman...@gmail.com>
Subject Re: Domain configuration file "cayenne.xml" is not found.
Date Fri, 25 May 2012 06:37:40 GMT
Worked - Possible Bug? [Not Solved - because I don't understand how it
worked. Two approaches below]

Question is - if the postgres jdbc jar is missing - why should the error be
- "....cayenne.xml not found...". Please read for details.

Thanks Guys for all the help. Please remember that I am a .NET specialist
and a Java newbie [phew - talk about being deadly ;-)]

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
locations as per the original post below [basically moved back to the same
state in which I had raised the query]

Bummer - it works without a problem.

Curious about how this is possible - I just removed the postgres jdbc jar
out of curiosity - and the error is back. And I can replicate this without
any problems.

Hint - To save from banging head again and again make sure that Ashwood,
commons collection, jdbc and any required dependencies are in place and
well referred. Error is cryptic. There are references of using cayenne.jar
that has all the dependencies - I couldn't find it though.

Thanks for all the help.
KM

On Thu, May 24, 2012 at 9:03 PM, Mike Kienenberger <mkienenb@gmail.com>wrote:

> Yes, dependent on your servlet version, context-param definitely has
> to be the first section in the file.
>
> Also, make sure that you're including the files in your war/ear.
> Obvious, but sometimes still the cause :)
>
> On Thu, May 24, 2012 at 8:54 AM, Michael Gentry <mgentry@masslight.net>
> wrote:
> > Hi there,
> >
> > I'm not a servlet guru (I know enough to get by and have my Tapestry
> > apps run), but I always put my <context-param> section before <filter>
> > and <filter-mapping>.  May not make a difference, but worth trying.  I
> > haven't looked through the source extensively, but you seem to be on
> > the right path from what the JavaDocs say.
> >
> > mrg
> >
> >
> > On Thu, May 24, 2012 at 3:13 AM, Kanwar Manish <kanwarmanish@gmail.com>
> wrote:
> >> 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>
> >>    </context-param>
> >> "
> >>
> >> Thanks in Advance
> >>
> >> I have searched this where I can - but not able to find a solution.
> >>
> >> Thanks
> >> KM
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message