Search code examples
javapostgresqlapache-cayenne

Apache Cayenne "DI container has no binding for key ObjectContextFactory" error


I'm using Apache 4.0 BETA and I'm getting the following runtime error:

org.apache.cayenne.di.DIRuntimeException: DI container has no binding for key <BindingKey: org.apache.cayenne.configuration.ObjectContextFactory>
at org.apache.cayenne.di.spi.DefaultInjector.getProvider(DefaultInjector.java:158)
at org.apache.cayenne.di.spi.DefaultInjector.getProvider(DefaultInjector.java:144)
at org.apache.cayenne.di.spi.DefaultInjector.getInstance(DefaultInjector.java:134)
at org.apache.cayenne.configuration.CayenneRuntime.newContext(CayenneRuntime.java:124)

As Cayenne is modular, I've included only these dependencies (see pic).enter image description here

What library needs to be included?

Thanks!

(The backend db is postgres but I don't this this is relavant to this error.)


Solution

  • I resolved this problem myself. Turns out that I need to build the artifact with "copy to output directory and link via manifest" (using IntelliJ IDEA) and upload the entire generated _jar directory to the server.