You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Ali Baharev <al...@gmail.com> on 2022/07/21 21:03:50 UTC

Using Cayenne without Maven

Hi,

I am trying to integrate Cayenne into a project that must not use
Maven. The application – not too surprisingly – crashes on this line:

        ServerRuntime cayenneRuntime = ServerRuntime.builder()
                .addConfig("cayenne-project.xml")
                .build();

Exception in thread "main"
org.apache.cayenne.configuration.server.DataDomainLoadException:
[v.4.1.1 Dec 20 2021 16:33:19] Configuration resource
"cayenne-project.xml" is not found.

It looks like Cayenne is assuming the Maven project folder structure,
which of course is not there, since I am not using Maven.

I tried the full absolute path, but that did not work either, I get
the same Exception.

Where exactly is Cayenne looking for the configuration file?

How can I specify the location of the configuration file?

Are there more stumbling blocks if I must not use Maven?

Thank you in advance!

Ali

Re: Using Cayenne without Maven

Posted by Ali Baharev <al...@gmail.com>.
Dear Michael,

Thank you for the prompt reply!

> Like if you are using a barebones java command, try adding a -cp entry, etc.

Yes, putting the configuration files on the class path seems to have
solved the problem, thank you!

> What tooling are you using?

I need a solution that is independent of any tooling. I am giving a
Java course for beginners, and I must not interfere with the tools
that the students are using.

Again, thank you very much for your help!

Best wishes,

Ali

Re: Using Cayenne without Maven

Posted by Michael Gentry <bl...@gmail.com>.
Hi Ali,

What tooling are you using?

Cayenne should be looking for that file at the root/top of one of the
classpaths. Maven will package src/main/resource up and make it available
at the root, but you can specify other classpath values yourself. Like if
you are using a barebones java command, try adding a -cp entry, etc.


On Thu, Jul 21, 2022 at 5:04 PM Ali Baharev <al...@gmail.com> wrote:

> Hi,
>
> I am trying to integrate Cayenne into a project that must not use
> Maven. The application – not too surprisingly – crashes on this line:
>
>         ServerRuntime cayenneRuntime = ServerRuntime.builder()
>                 .addConfig("cayenne-project.xml")
>                 .build();
>
> Exception in thread "main"
> org.apache.cayenne.configuration.server.DataDomainLoadException:
> [v.4.1.1 Dec 20 2021 16:33:19] Configuration resource
> "cayenne-project.xml" is not found.
>
> It looks like Cayenne is assuming the Maven project folder structure,
> which of course is not there, since I am not using Maven.
>
> I tried the full absolute path, but that did not work either, I get
> the same Exception.
>
> Where exactly is Cayenne looking for the configuration file?
>
> How can I specify the location of the configuration file?
>
> Are there more stumbling blocks if I must not use Maven?
>
> Thank you in advance!
>
> Ali
>