在 Tomcat 上安装 Sonar 和 Jenkins
我有一个 tomcat 服务器,我想在上面安装 Jenkins 和 Sonar。我使用的是 debian 发行版,因此我通过 apt-get 获得了 tomcat6 和 Jenkins。当我将 jenkins.war 复制到 tomcat6/webapps 目录时,一切运行正常。但是,当我将 sonar.war 复制到 tomcat6/webapps 时,sonar 工作正常,但 jenkins 抛出错误 500:
javax.servlet.ServletException: org.apache.commons.jelly.JellyTagException: jar:file:/var/lib/tomcat6/webapps/jenkins/WEB-INF/lib/jenkins-core-1.435.jar!/hudson/model/View/index.jelly:39:43: <st:include> PermGen space
org.kohsuke.stapler.jelly.JellyClassTearOff.serveIndexJelly(JellyClassTearOff.java:112)
org.kohsuke.stapler.jelly.JellyFacet.handleIndexRequest(JellyFacet.java:124)
org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:550)
org.kohsuke.stapler.Stapler.invoke(Stapler.java:646)
org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:612)
org.kohsuke.stapler.Stapler.invoke(Stapler.java:646)
org.kohsuke.stapler.Stapler.invoke(Stapler.java:477)
org.kohsuke.stapler.Stapler.service(Stapler.java:159)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)
hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)
hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
我还安装了管理器(tomcat6-admin),并且当我添加 sonar.war 时,管理器也失败了。
我通过从 codehaus 下载声纳、设置数据库配置并构建战争来安装声纳。
有谁知道为什么会发生这种情况并且可能有解决方案?
I have a tomcat server and I wish to install Jenkins and Sonar on it. I am on a debian distibution, therefore I got tomcat6 and Jenkins via apt-get. When I copy the jenkins.war to my tomcat6/webapps directory, everything runs fine. However when I copy the sonar.war to tomcat6/webapps, sonar works fine, but jenkins throws an error 500:
javax.servlet.ServletException: org.apache.commons.jelly.JellyTagException: jar:file:/var/lib/tomcat6/webapps/jenkins/WEB-INF/lib/jenkins-core-1.435.jar!/hudson/model/View/index.jelly:39:43: <st:include> PermGen space
org.kohsuke.stapler.jelly.JellyClassTearOff.serveIndexJelly(JellyClassTearOff.java:112)
org.kohsuke.stapler.jelly.JellyFacet.handleIndexRequest(JellyFacet.java:124)
org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:550)
org.kohsuke.stapler.Stapler.invoke(Stapler.java:646)
org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:612)
org.kohsuke.stapler.Stapler.invoke(Stapler.java:646)
org.kohsuke.stapler.Stapler.invoke(Stapler.java:477)
org.kohsuke.stapler.Stapler.service(Stapler.java:159)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)
hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)
hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
I've also install the manager (tomcat6-admin) and the manager is failing too when i add the sonar.war.
I've installed sonar by downloading it from codehaus, setting the database configuration and building the war.
Does anyone know why this is happening and might have a solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在您的异常中,它出现:
永久生成存在问题:
要修复该错误,您需要将
-XX:MaxPermSize=m
(其中;
是您想要的内存)在CATALINA_OPTS环境变量中。你如何实现这一目标?按照这篇文章(例如):
如何增加应用程序服务器中的内存?
In your exception, it appears :
There's a problem with the permgen :
To fix the error, you need to put the
-XX:MaxPermSize=<Y>m
(where<Y>
is the memory you want) in the CATALINA_OPTS environment variable.How do you achieve this ? Follow this article (for example) :
How can I increase memory in my application server ?
我在具有 8Gb RAM 的 RHEL 服务器上进行了配置。我发现我需要(在
catalina.sh
或运行 tomcat 的非交互式 shell 中)-Xms1024m -Xmx2048m -XX:PermSize=256m -XX:MaxPermSize=512m
的 VM 选项>我还需要重置 Executor
maxThreads
和minSpareThreads
conf/server.xml 文件(分别为 400 和 50),否则服务器会爬行。顺便说一句,如果您使用虚拟服务器,您可以尝试已配置的虚拟机,SecureCI,它设置了一个完整的 Maven/Jenkins/Sonar CI 环境,开箱即用。如果您的构建依赖于 Maven,则无需配置。
I had this configured on a RHEL server with 8Gb RAM. I found I needed (in
catalina.sh
or the non-interactive shell running tomcat) VM options of-Xms1024m -Xmx2048m -XX:PermSize=256m -XX:MaxPermSize=512m
I also needed to reset the Executor
maxThreads
, andminSpareThreads
in the conf/server.xml file (400, and 50 respectively), otherwise the server crawled.By the way, if you're using Virtual Servers, you could try an already configured VM, SecureCI, which sets up a complete Maven/Jenkins/Sonar CI environment out of the box. There's no configuration if your build relies on Maven.