2016-01-01 37 views
0

的Debian 8.2 的Java 7 + JRE 的Grails 2.2.4 甲骨文12C 的Tomcat 7如何使用Oracle 12c工作Grails 2.2.4?

遇到問題時嘗試啓動安裝目錄甲骨文12C之後的Grails。 在Debian 8.2 + Oracle 10XE上一切正常。 THX求助

app.log:

 2016-01-01 20:57:43,245 [localhost-startStop-1] ERROR resource.ResourceMeta - While processing /bundle-bundle_applications_head.css, /styles/dist/gui/core/main.css, /styles/dist/gui/core/top-panel.css, /styles/dist/gui/core/footer.css, /styles/dist/gui/core/general/modal-window.css, /styles/dist/gui/core/general/metro-tiles.css, /styles/dist/gui/core/general/buttons.css, /styles/src/libs/jquery.mCustomScrollbar.css, a resource was required but not found: /styles/src/libs/mCSB_buttons.png 
    2016-01-01 20:57:46,005 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error initializing the application: groovy.lang.MissingMethodException: No signature of method: cz.test.dto.system.Client.findAll() is applicable for argument types:() values: [] 
    Possible solutions: findAll(), findAll(), findAll(groovy.lang.Closure), findAll(java.lang.Object), findAll(java.lang.String), findAll(groovy.lang.Closure) 
    org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: cz.test.dto.system.Client.findAll() is applicable for argument types:() values: [] 
    Possible solutions: findAll(), findAll(), findAll(groovy.lang.Closure), findAll(java.lang.Object), findAll(java.lang.String), findAll(groovy.lang.Closure) 
     at grails.util.Environment.evaluateEnvironmentSpecificBlock(Environment.java:308) 
     at grails.util.Environment.executeForEnvironment(Environment.java:301) 
     at grails.util.Environment.executeForCurrentEnvironment(Environment.java:277) 
     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
     at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
     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) 
    Caused by: groovy.lang.MissingMethodException: No signature of method: cz.test.dto.system.Client.findAll() is applicable for argument types:() values: [] 
    Possible solutions: findAll(), findAll(), findAll(groovy.lang.Closure), findAll(java.lang.Object), findAll(java.lang.String), findAll(groovy.lang.Closure) 
     at cz.test.libs.core.privileges.PrivilegeApiService.generateAccessRules(PrivilegeApiService.groovy:45) 
     at BootStrap$_closure1.doCall(BootStrap.groovy:259) 
     ... 8 more 
    2016-01-01 20:57:46,012 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error initializing Grails: groovy.lang.MissingMethodException: No signature of method: cz.test.dto.system.Client.findAll() is applicable for argument types:() values: [] 
    Possible solutions: findAll(), findAll(), findAll(groovy.lang.Closure), findAll(java.lang.Object), findAll(java.lang.String), findAll(groovy.lang.Closure) 
    org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: cz.test.dto.system.Client.findAll() is applicable for argument types:() values: [] 
    Possible solutions: findAll(), findAll(), findAll(groovy.lang.Closure), findAll(java.lang.Object), findAll(java.lang.String), findAll(groovy.lang.Closure) 
     at grails.util.Environment.evaluateEnvironmentSpecificBlock(Environment.java:308) 
     at grails.util.Environment.executeForEnvironment(Environment.java:301) 
     at grails.util.Environment.executeForCurrentEnvironment(Environment.java:277) 
     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
     at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
     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) 
    Caused by: groovy.lang.MissingMethodException: No signature of method: cz.test.dto.system.Client.findAll() is applicable for argument types:() values: [] 
    Possible solutions: findAll(), findAll(), findAll(groovy.lang.Closure), findAll(java.lang.Object), findAll(java.lang.String), findAll(groovy.lang.Closure) 
     at cz.test.libs.core.privileges.PrivilegeApiService.generateAccessRules(PrivilegeApiService.groovy:45) 
     at BootStrap$_closure1.doCall(BootStrap.groovy:259) 
     ... 8 more 

DataSource.groovy的:

dataSource { 
    pooled = true 
    driverClassName = "org.h2.Driver" 
    username = "sa" 
    password = "" 
} 

hibernate { 
    cache.use_second_level_cache = true 
    cache.use_query_cache = false 
    cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' 
} 


// environment specific settings 
environments { 
    development { 
     dataSource_system { 
      dbCreate = "update" 
      pooled = true 
      url = "jdbc:oracle:thin:@localhost:1521:xe" 
      driverClassName = 'oracle.jdbc.OracleDriver' 
      username = "user" 
      password = "pass" 
     } 

     dataSource_usersettings { 
      dbCreate = "update" 
      pooled = true 
      url = "jdbc:oracle:thin:@localhost:1521:xe" 
      driverClassName = 'oracle.jdbc.OracleDriver' 
      username = "user" 
      password = "pass" 
     } 
    } 

    production { 
     dataSource_system { 
      dbCreate = "update" 
      pooled = true 
      url = "jdbc:oracle:thin:@localhost:1521:xe" 
      driverClassName = 'oracle.jdbc.OracleDriver' 
      username = "user" 
      password = "pass" 
     } 

     dataSource_usersettings { 
      dbCreate = "update" 
      pooled = true 
      url = "jdbc:oracle:thin:@localhost:1521:xe" 
      driverClassName = 'oracle.jdbc.OracleDriver' 
      username = "user" 
      password = "pass" 
     } 
    } 
} 

Build.Config.groovy

grails.servlet.version = "2.5" // 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.target.level = 1.6 
grails.project.source.level = 1.6 
//grails.project.war.file = "target/${appName}-${appVersion}.war" 

// uncomment (and adjust settings) to fork the JVM to isolate classpaths 
//grails.project.fork = [ 
// run: [maxMemory:1024, minMemory:64, debug:false, maxPerm:256] 
//] 

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() 
     grailsCentral() 

     mavenLocal() 
     mavenCentral() 

     // uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories 
     //mavenRepo "http://snapshots.repository.codehaus.org" 
     //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.22' 
    } 

    plugins { 
     runtime ":hibernate:$grailsVersion" 
     runtime ":jquery:1.8.3" 
     runtime ":resources:1.2" 

     // Uncomment these (or add new ones) to enable additional resources capabilities 
     //runtime ":zipped-resources:1.0" 
     //runtime ":cached-resources:1.0" 
     //runtime ":yui-minify-resources:0.1.5" 

     build ":tomcat:$grailsVersion" 

     runtime ":database-migration:1.3.2" 

     compile ':cache:1.0.1' 
    } 
} 
+0

可能是一個休眠問題。 AFAIK,hibernate尚未使用12c進行測試。你能發佈更多的細節 - 你的datasource.groovy? – rdmueller

+0

編輯後的第一篇文章,如果需要更多的東西,請告訴。) – higi

+0

我看不到你連接到一個只有oracle的h2 ...你正在使用哪個hibernate版本(buildconfig.groovy)? – rdmueller

回答

0

反正有這個固定的連接不知何故JAVA_HOME導出JAVA_HOME = did not工作,所以我用/tomcat/bin/patchclas.sh/env.sh並做了一些expor t JAVA_HOME = 並最終得到這個工作:)