vaadin grails plugin hibernate conflict

时间:2016-04-17 02:49:11

标签: grails neo4j vaadin7 hibernate-4.x

我是java / grails项目的新手..我总是用python编程所以请耐心等待..

我试图使用以下

在eclipse中创建一个项目
  1. Grails v2.5.4(Groovy v2.4)
  2. Grails vaadin插件v7.6.1
  3. Neo4j grails plugin v5.0.3.RELEASE(GORM)
  4. hibernate4 v4.3.5.5(这是与vaadin插件兼容的hibernate插件)
  5. 基本上我遇到的问题是, Neo4j grails v5.0.3.RELEASE插件与hibernate4 v4.3.5.5配合不好 如果我从构建中删除hibernate4 v4.3.5.5,Grails vaadin v7.6.1会抛出异常

    2016-04-17 07:28:30,501 [http-bio-8080-exec-4] ERROR StackTrace  - Full Stack Trace:
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'hibernateDatastore' is defined
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1168)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:281)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:272)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:960)
        at org.springframework.beans.factory.BeanFactory$getBean$3.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
        at com.vaadin.grails.server.DefaultServlet.withNewSession(DefaultServlet.groovy:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
        at com.vaadin.grails.server.DefaultServlet.service(DefaultServlet.groovy:46)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.processFilterChain(UrlMappingsFilter.java:440)
        at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInternal(UrlMappingsFilter.java:241)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:69)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.codehaus.groovy.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
    2016-04-17 07:28:30,503 [http-bio-8080-exec-4] ERROR StackTrace  - Full Stack Trace:
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'hibernateDatastore' is defined
        at com.vaadin.grails.server.DefaultServlet.withNewSession(DefaultServlet.groovy:34)
        at com.vaadin.grails.server.DefaultServlet.service(DefaultServlet.groovy:46)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
    

    这个BuildConfig.groovy我正在使用......

    grails.servlet.version = "3.0" // Change depending on target container compliance (2.5 or 3.0)
    grails.project.class.dir = "target/classes"
    grails.project.test.class.dir = "target/test-classes"
    grails.project.test.reports.dir = "target/test-reports"
    grails.project.work.dir = "target/work"
    grails.project.target.level = 1.6
    grails.project.source.level = 1.6
    //grails.project.war.file = "target/${appName}-${appVersion}.war"
    
    grails.project.fork = [
        // configure settings for compilation JVM, note that if you alter the Groovy version forked compilation is required
        //  compile: [maxMemory: 256, minMemory: 64, debug: false, maxPerm: 256, daemon:true],
    
        // configure settings for the test-app JVM, uses the daemon by default
        test: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, daemon:true],
        // configure settings for the run-app JVM
        run: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
        // configure settings for the run-war JVM
        war: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
        // configure settings for the Console UI JVM
        console: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256]
    ]
    
    grails.project.dependency.resolver = "maven" // or ivy
    grails.project.dependency.resolution = {
        // inherit Grails' default dependencies
        inherits("global") {
            // specify dependency exclusions here; for example, uncomment this to disable ehcache:
            // excludes 'ehcache'
        }
        log "error" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
        checksums true // Whether to verify checksums on resolve
        legacyResolve false // whether to do a secondary resolve on plugin installation, not advised and here for backwards compatibility
    
        repositories {
            inherits true // Whether to inherit repository definitions from plugins
    
            grailsPlugins()
            grailsHome()
            mavenLocal()
            grailsCentral()
            mavenCentral()
            // uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories
            //mavenRepo "http://repository.codehaus.org"
            //mavenRepo "http://download.java.net/maven/2/"
            //mavenRepo "http://repository.jboss.com/maven2/"
        }
    
        dependencies {
            // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
            // runtime 'mysql:mysql-connector-java:5.1.29'
            // runtime 'org.postgresql:postgresql:9.3-1101-jdbc41'
            test "org.grails:grails-datastore-test-support:1.0.2-grails-2.4"
            compile 'org.neo4j:neo4j:2.3.2'
    
        }
    
        plugins {
            // plugins for the build system only
            build ":tomcat:7.0.55.3" // or ":tomcat:8.0.22"
    
            // plugins for the compile step
            compile ":neo4j:5.0.3.RELEASE"
    
            compile "org.grails.plugins:vaadin:7.6.1"
            //compile ":hibernate4:4.3.5.5"
            compile ":scaffolding:2.1.2"
            compile ':cache:1.1.8'
            // asset-pipeline 2.0+ requires Java 7, use version 1.9.x with Java 6
            compile ":asset-pipeline:2.5.7"
    
            // plugins needed at runtime but not for compilation
            runtime ":database-migration:1.4.0"
            runtime ":jquery:1.11.1"
    
            // Uncomment these to enable additional asset-pipeline capabilities
            //compile ":sass-asset-pipeline:1.9.0"
            //compile ":less-asset-pipeline:1.10.0"
            //compile ":coffee-asset-pipeline:1.8.0"
            //compile ":handlebars-asset-pipeline:1.3.0.3"
        }
    }
    

    另外,在我的eclipse工作区中,我看到了这个..

    Archive for required library: '/home/blah/.m2/repository/org/neo4j/neo4j/2.3.2/neo4j-2.3.2.pom' in project 'demo1' cannot be read or is not a valid ZIP file    demo1       Build path  Build Path Problem
    

    我尝试多次清理.grails和.m2 repo,但上面的buildPath问题仍然存在,它尝试将pom放在classpath中,即使jar在同一个dir中。

    如何解决这个问题?

    如果您需要任何日志,配置等,请告诉我

0 个答案:

没有答案