Hi,

I am trying to use a custom location for the cayenne configuration files and 
I'm getting the exception below on the following code on the line that executes 
ServerRuntime.builder() and I don't know what is missing.
I'm using version 4.0.B1.
I am also not sure how to replace the deprecated bindMap call with the proper 
replacement method.

Any help and insight would be greatly appreciated,

Andrew

        if (!serverRuntimeList.containsKey(pathToCayenneXMLFile)) {
            Module myModule = (Binder binder) -> {
                binder.bind(ResourceLocator.class).toInstance(new 
FilesystemResourceLocator(pathForCayenne));
                
binder.bindMap(Constants.PROPERTIES_MAP).put(Constants.SERVER_CONTEXTS_SYNC_PROPERTY, 
"false");
                //binder.bind(QueryCache.class).to(EhCacheQueryCache.class);
            };
            runtime = ServerRuntime.builder().addConfig(cayenneXMLFileName)
                    .addModule(myModule)
                    .build();
            if (runtime != null) {
                serverRuntimeList.put(pathToCayenneXMLFile, runtime);
            } else {
                throw new RuntimeException("ORMCayenne Error");
            }
        }


javax.servlet.ServletException: com.vaadin.server.ServiceException: 
java.lang.NoSuchMethodError: 
org.apache.cayenne.di.spi.ModuleLoader.load(Ljava/lang/Class;)Ljava/util/List;
        com.vaadin.server.VaadinServlet.service(VaadinServlet.java:383)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        
org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)

*root cause*

com.vaadin.server.ServiceException: java.lang.NoSuchMethodError: 
org.apache.cayenne.di.spi.ModuleLoader.load(Ljava/lang/Class;)Ljava/util/List;
        
com.vaadin.server.VaadinService.handleExceptionDuringRequest(VaadinService.java:1620)
        com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1580)
        com.vaadin.server.VaadinServlet.service(VaadinServlet.java:381)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        
org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)

*root cause*

java.lang.NoSuchMethodError: 
org.apache.cayenne.di.spi.ModuleLoader.load(Ljava/lang/Class;)Ljava/util/List;
        
org.apache.cayenne.configuration.server.ServerRuntimeBuilder.autoLoadedModules(ServerRuntimeBuilder.java:238)
        
org.apache.cayenne.configuration.server.ServerRuntimeBuilder.build(ServerRuntimeBuilder.java:226)
        
com.callistacti.clientbase.ClientBaseAdmin.getServerRuntime(ClientBaseAdmin.java:304)
        
com.callistacti.clientbase.ClientBaseAdmin.initClientBaseAdmin(ClientBaseAdmin.java:91)
        com.callistacti.clientbase.UI_ClientBase.<clinit>(UI_ClientBase.java:62)
        java.lang.Class.forName0(Native Method)
        java.lang.Class.forName(Class.java:348)
        
com.vaadin.server.DefaultUIProvider.getUIClass(DefaultUIProvider.java:33)
        
com.vaadin.server.BootstrapHandler.synchronizedHandleRequest(BootstrapHandler.java:400)
        
com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
        com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1568)
        com.vaadin.server.VaadinServlet.service(VaadinServlet.java:381)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        
org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71)

Reply via email to