Debian 8.2Java 7+jre圣杯2.2.4Oracle 12cTomcat 7
安装Oracle12c后启动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.Govy:
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'
}
}
无论如何都通过链接JAVA_HOME修复了这个问题,但导出JAVA_HOME=不起作用,所以我使用了/tomcat/bin/patchclass.sh/env.sh并导出了一些JAVA_HOME=并最终使其工作:)
对于任何试图让一个旧的grails应用程序与Oracle12c一起运行的人来说,我必须在DataSource.groovy文件中明确指定方言:
dataSource_system {
dbCreate = "update"
pooled = true
url = "jdbc:oracle:thin:@localhost:1521:xe"
driverClassName = 'oracle.jdbc.OracleDriver'
username = "user"
password = "pass"
dialect = SequencePerTableOracleDialect
}