Ubuntu 12.10下安装icescrum需要首先安装tomcat7还有jdk,直接在ubuntu下面安装
apt-get install tomcat7
然后需要配置一下tomcat里面的环境变量,指定icescrum的配置文件路径,在文件/usr/share/tomcat7/bin/catalina.sh中开头添加一个设置:
JAVA_OPTS=”-Djava.awt.headless=true -XX:MaxPermSize=1024m -Xmx1024m -Dicescrum_config_location=/opt/config.groovy”
最后的一个参数就是设置icescrum的配置文件路径。
当然该文件权限要设置一下,允许icescrum访问。
下载R5#5.1 版本的war包,复制到/var/lib/tomcat7/webapps目录后,tomcat7会自动解开war包。然后观察日志/var/lib/tomcat7/logs/icescrum.log文件:
2013-01-09 13:02:09,698 [localhost-startStop-1] ERROR org.springframework.web.context.ContextLoader – Context initialization failed
org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is org.codehaus.groovy.runtime.InvokerInvocationException: java.io.IOE\
xception: No such file or directory
at org.codehaus.groovy.grails.web.context.GrailsContextLoader.createWebApplicationContext(GrailsContextLoader.java:87)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:963)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1600)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: java.io.IOException: No such file or directory
at grails.spring.BeanBuilder.invokeBeanDefiningClosure(BeanBuilder.java:723)
at grails.spring.BeanBuilder.beans(BeanBuilder.java:573)
at grails.spring.BeanBuilder.invokeMethod(BeanBuilder.java:519)
… 6 more
Caused by: java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:947)
at java_io_File$createNewFile.call(Unknown Source)
at org.icescrum.core.support.ApplicationSupport$__clinit__closure10.doCall(ApplicationSupport.groovy:119)
解决方法是到/usr/share/tomcat7目录下创建icescrum目录,然后设置权限:
chown tomcat7:tomcat7 -R ./icescrum/
再次重新启动tomcat7,观察日志,错误变成了:
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
到这里下载mysql jdbc driver,见鬼,IceScrum产品也也太牛了,难道不能将依赖自动带进来么?
将jar包复制到/usr/share/tomcat7/lib目录下。
删除不需要的hsqldb 的jar包。
root@scrum:/var/lib/tomcat7/webapps/icescrum/WEB-INF/lib# rm hsqldb-1.8.0.10.jar
现在看一下关键的/opt/config.groovy文件内容:
// Data Source
dataSource.driverClassName = “com.mysql.jdbc.Driver”
dataSource.dialect = “org.hibernate.dialect.MySQL5InnoDBDialect”
dataSource.url = “jdbc:mysql://10.112.18.182:3306/icescrum?useUnicode=true&characterEncoding=utf8&autoReconnect=true”
dataSource.username = “scrum”
dataSource.password = “youpwd”
// Use pool connection
dataSource.pooled=true
dataSource.properties.maxActive=50
dataSource.properties.maxIdle=25
dataSource.properties.minIdle=1
dataSource.properties.initialSize=1
dataSource.properties.minEvictableIdleTimeMillis=1800000
dataSource.properties.timeBetweenEvictionRunsMillis=1800000
dataSource.properties.numTestsPerEvictionRun=3
dataSource.properties.maxWait=10000
dataSource.properties.testOnBorrow=true
dataSource.properties.testWhileIdle=true
dataSource.properties.testOnReturn=false
dataSource.properties.validationQuery=”SELECT 1″
icescrum部署的确比较麻烦,建议不要依赖什么tomcat,自己做一个standalone server的解决方案。
顺便说一下tomcat7的几个目录:
/usr/share/tomcat7/下面是tomcat7的程序,一些环境变量配置也在这个目录下。
/var/lib/tomcat7目录是tomcat7的用户目录,应用程序和日志都在这个下面。