Я пытаюсь развернуть приложение Grails с использованием Tomcat 6.0. Когда я использую БД в комплекте с Grails, он работает нормально. Однако, когда я использую PostgreSQL, я получаю ошибку статуса 404.
Журнал дает мне следующее:
Nov 12, 2011 7:44:40 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Lenovo\Bluetooth Software\;C:\Program Files\Lenovo\Bluetooth Software\syswow64;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\TortoiseSVN\bin;;.
Nov 12, 2011 7:44:41 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Nov 12, 2011 7:44:41 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2901 ms
Nov 12, 2011 7:44:42 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Nov 12, 2011 7:44:42 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.33
Nov 12, 2011 7:44:42 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor manager.xml
Nov 12, 2011 7:44:42 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive HighPoint-0.1.war
Nov 12, 2011 7:44:43 AM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Nov 12, 2011 7:44:43 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/HighPoint-0.1] startup failed due to previous errors
Nov 12, 2011 7:44:43 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive Test-0.1.war
Nov 12, 2011 7:45:00 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive Test2-0.1.war
Nov 12, 2011 7:45:20 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
Nov 12, 2011 7:45:20 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
Nov 12, 2011 7:45:21 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Nov 12, 2011 7:45:21 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Nov 12, 2011 7:45:21 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/63 config=null
Nov 12, 2011 7:45:21 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 39476 ms
Любой совет будет принят с благодарностью.
В соответствии с запросом, вот файл данных datasource.config:
dataSource {
pooled = true
driverClassName = "org.postgresql.Driver"
}
hibernate {
cache.use_second_level_cache=true
cache.use_query_cache=true
cache.provider_class = 'net.sf.ehcache.hibernate.EhCacheProvider'
}
environments {
development {
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop','update'
url = "jdbc:postgresql:Test"
username = "postgres"
password = "highpoint"
}
}
test {
dataSource {
dbCreate = "update"
url = "jdbc:postgresql:Test"
username = "postgres"
password = "highpoint"
}
}
production {
dataSource {
dbCreate = "create-drop"
url = "jdbc:postgresql:Test"
username = "postgres"
password = "highpoint"
}
}
}
Вот файл buildconfig:
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
//grails.project.war.file = "target/${appName}-${appVersion}.war"
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// uncomment to disable ehcache
// excludes 'ehcache'
}
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
repositories {
grailsPlugins()
grailsHome()
grailsCentral()
// uncomment the below to enable remote dependency resolution
// from public Maven repositories
//mavenLocal()
//mavenCentral()
//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 eg.
// runtime 'mysql:mysql-connector-java:5.1.13'
}
}
После внесения изменений в источник данных и файлы конфигурации, как было предложено Оливером, я получаю следующий результат:
Я больше не получаю ошибку 404, но Tomcat теперь зависает и не отображает веб-сайт. Журнал ошибок дает мне следующую ошибку:
Nov 18, 2011 1:03:01 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
Nov 18, 2011 1:03:02 PM org.apache.tomcat.util.digester.Digester endElement
SEVERE: End event threw error
java.lang.OutOfMemoryError: PermGen space
Nov 18, 2011 1:03:02 PM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory docs
java.lang.OutOfMemoryError: PermGen space'