1. Jetty 9.0.3 启动时的错误:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
[root@kvm-guest jetty-9.0.3]# java -jar start.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/eclipse/jetty/start/Main : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: org.eclipse.jetty.start.Main. Program will exit.
|
原因:Jetty 9 需要 JVM 1.7 的支持(我原来的JVM是1.6)
解决方案:使用Java 1.7即可。
2. 将jenkns.war复制到webapp目录后,启动Jetty,但jenkins访问出错,HTTP ERROR 503。
启动和关闭Jetty的命令为:
1
2
3
|
[root@kvm-guest jetty-9.0.3]# java -jar start.jar -DSTOP.PORT=8881 -DSTOP.KEY=magic --daemon &
[root@kvm-guest jetty-9.0.3]# java -jar start.jar -DSTOP.PORT=8881 -DSTOP.KEY=magic --stop
|
在浏览器中访问时,遇到的错误信息如下:
1
2
3
4
5
|
HTTP ERROR: 503
Problem accessing /jenkins/. Reason:
Service Unavailable
------------
Powered by Jetty
|
查看Jetty的log中,可以看到如下的错误信息:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
2013-05-21 14:33:31.265:WARN:oejuc.AbstractLifeCycle:main: FAILED org.eclipse.jetty.security.ConstraintSecurityHandler@70188b41: java.lang.IllegalStateException: No LoginService for org.eclipse.jetty.security.authentication.FormAuthenticator@790bb6f4 in org.eclipse.jetty.security.ConstraintSecurityHandler@70188b41
java.lang.IllegalStateException: No LoginService for org.eclipse.jetty.security.authentication.FormAuthenticator@790bb6f4 in org.eclipse.jetty.security.ConstraintSecurityHandler@70188b41
at org.eclipse.jetty.security.authentication.LoginAuthenticator.setConfiguration(LoginAuthenticator.java:67)
at org.eclipse.jetty.security.authentication.FormAuthenticator.setConfiguration(FormAuthenticator.java:131)
at org.eclipse.jetty.security.SecurityHandler.doStart(SecurityHandler.java:375)
at org.eclipse.jetty.security.ConstraintSecurityHandler.doStart(ConstraintSecurityHandler.java:457)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
...................
2013-05-21 14:33:31.267:WARN:oejuc.AbstractLifeCycle:main: FAILED org.eclipse.jetty.server.session.SessionHandler@5b5e91e5: java.lang.IllegalStateException: No LoginService for org.eclipse.jetty.security.authentication.FormAuthenticator@790bb6f4 in org.eclipse.jetty.security.ConstraintSecurityHandler@70188b41
java.lang.IllegalStateException: No LoginService for org.eclipse.jetty.security.authentication.FormAuthenticator@790bb6f4 in org.eclipse.jetty.security.ConstraintSecurityHandler@70188b41
at org.eclipse.jetty.security.authentication.LoginAuthenticator.setConfiguration(LoginAuthenticator.java:67)
at org.eclipse.jetty.security.authentication.FormAuthenticator.setConfiguration(FormAuthenticator.java:131)
...................
2013-05-21 14:33:31.268:WARN:oejw.WebAppContext:main: Failed startup of context o.e.j.w.WebAppContext@729b9707{/jenkins,file:/tmp/jetty-0.0.0.0-8080-jenkins.war-_jenkins-any-/webapp/,STARTING}{/root/jetty-9.0.3/webapps.demo/jenkins.war}
java.lang.IllegalStateException: No LoginService for org.eclipse.jetty.security.authentication.FormAuthenticator@790bb6f4 in org.eclipse.jetty.security.ConstraintSecurityHandler@70188b41
at org.eclipse.jetty.security.authentication.LoginAuthenticator.setConfiguration(LoginAuthenticator.java:67)
at org.eclipse.jetty.security.authentication.FormAuthenticator.setConfiguration(FormAuthenticator.java:131)
at org.eclipse.jetty.security.SecurityHandler.doStart(SecurityHandler.java:375)
at org.eclipse.jetty.security.ConstraintSecurityHandler.doStart(ConstraintSecurityHandler.java:457)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:108)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:90)
|
原因:Jetty 8.1.0之后对安全性有了一些要求,需要显示注明安全域(security realm)。
解决方法:编辑(或新建) webapps/jenkins.xml 文件,添加如下配置。
1
2
3
4
5
6
7
8
9
10
11
12
13
|
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/jenkins</Set>
<Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/jenkins.war</Set>
<Get name="securityHandler">
<Set name="loginService">
<New class="org.eclipse.jetty.security.HashLoginService">
<Set name="name">Jenkins Realm</Set>
<Set name="config"><SystemProperty name="jetty.home" default="."/>/etc/realm.properties</Set>
</New>
</Set>
</Get>
</Configure>
|
另外,Jetty 自带的示例:webapps.demo/test.xml 中也有security realm相关的配置。
解决了这两个问题后,Jenkins示例URL:http://192.168.52.11:8080/jenkins/ 就可以正常访问了。
参考资料:
http://www.eclipse.org/jetty/documentation/current/what-jetty-version.html
http://stackoverflow.com/questions/9111759/http-error-503-accessing-jenkins-reason-service-unavailable
https://wiki.jenkins-ci.org/display/JENKINS/Jetty
- 在centos中部署jenkins
在centos中部署jenkins,需要的环境:安装jdk,Apache-tomcat 这两步我前面文章里已写,再次忽略 到官网下载最新的jenkins 我这里的是 jenkins.war 把该文件 ...
- linux 在jetty中部署web工程
背景:公司中原有的项目需要在jetty中进行部署,所以要掌握相关知识. 1 部署步骤 首先要保证jdk环境变量配置正常,然后去官网下载对应版本号的jetty,解压缩即可. 将需要部署的web应用,wa ...
- linux中部署jenkins(war包)及jenkins忘记登录账号密码
未登录状态 登录状态 一:部署jenkins(war包) 1.直接下载war包jenkins.war,下载地址https://jenkins.io/download 2.将下载的war包放到服务器上t ...
- Ubuntu中安装jenkins+docker,实现项目部署
本人对于linux系统是个小白,恰逢公司新框架需要docker+jenkins部署项目,所以通过同事口述+一顿乱查,终于实现在虚拟机上搭建的ubuntu系统中 实现jenkins +docker 自动 ...
- docker部署Jenkins,以及在Jenkins中使用宿主机的docker/docker-compose命令
使用最新的官方镜像jenkins/jenkins 第一次使用的docker部署jenkins的时候,出现了两个问题: 1.因为用户权限问题挂载/home/jenkins/data到/var/jenki ...
- [系统集成] 基于Kubernetes 部署 jenkins 并动态分配资源
基于kubernetes 部署 jenkins master 比较简单,难点是为 jenkins 动态分配资源.基于kubernetes 为 jenkins 动态分配资源需要实现下述功能: 资源分配: ...
- Maven构建web项目在Eclipse中部署的几种方法
目录: 方法一:运用Maven的plugin:jetty来部署web 方法二:运用Eclipse 的Jetty插件直接部署 方法三:运用Run on Server(tomcat)部署 [方法一].运用 ...
- 在AWS中部署OpenShift平台
OpenShift是RedHat出品的PAAS平台.OpenShift做为PAAS平台最大的特点是它是完全容器化的PAAS平台,底层封装了Docker和Kubernetes,上层暴露了对开发者友好的接 ...
- linux上部署jenkins步骤小记
一.部署jdk环境 1.下载jdk包,解压,放在选定的位置,我本次jdk包放置在“/usr/local/java/jdk” 目录下 2.配置环境变量 1)打开/etc/profile文件,在命令框中输 ...
随机推荐
- NOIP2015 D1 解题报告
T1 神奇的幻方 题目描述 幻方是一种很神奇的N*N矩阵:它由数字1,2,3,……,N*N构成,且每行.每列及两条对角线上的数字之和都相同. 当N为奇数时,我们可以通过以下方法构建一个幻方: 首先将1 ...
- Xilinx ISE的时序约束
使用Synplify Pro加时序约束.综合完毕后,可以在ISE中进行布局.布线.需要用.ucf文件指定布局布线的时钟约束.前者可以比后者小. 早期的ISE,两个约束可以继承.现在用的高版本,反而需要 ...
- [golang]golang如何覆盖输出console,实现进度条;golang一个骚气的进度提示库
[golang]golang如何覆盖输出console,实现进度条 package main import( "fmt" "os" "time&quo ...
- Mybatis 代码生成器(集成通用Mapper)
0.确保通用Mapper被正确配置 1.pom.xml追加 <properties> <targetJavaProject>${basedir}/src/main/java&l ...
- php单点登录SSO(Single Sign On)的解决思路
一.什么是单点登录 解释:登录一个系统后,其它系统无需再次登录,即可进入. 二.举个例子: 你登录了淘宝,然后你进入天猫,发现你不用登录了.这时你要注意到,淘宝跟天猫可是完全不一样的域名. 你登录淘宝 ...
- 蚂蚁金服财富技术部,诚招Java研发工程师。校招内推!!!
蚂蚁金服财富技术部,诚招Java研发工程师. 团队是蚂蚁金服财富技术部核心团队,支持亿级互联网交易清算,在这里不仅能学习到先进的互联网技术,也能了解许多终身受益的金融知识. 内推对象 2020届毕业生 ...
- 2019软工实践_Alpha(3/6)
队名:955 组长博客:https://www.cnblogs.com/cclong/p/11872693.html 作业博客:https://edu.cnblogs.com/campus/fzu/S ...
- HTML5中的article和section的区别
HTML5中的article和section的区别 一.总结 一句话总结: article和section都相当于语义化后的div,article强调独立性,section强调分段或者分块 1.art ...
- 动化安装SQL Server+SP就那么简单
随着业务.企业规模的日益壮大,DB的数量也在不断增多,配置一台新增DB,从服务器的参数配置,磁盘阵列规划,DB安装部署,DB参数调优等等一列步骤下来,手工操作的效率变得越来越低,因为我负责的数据库近些 ...
- python gtk 环境
为Python添加GTK+库:pygtk(windows下安装pygtk) 一.下载需要的文件 昨天晚上就是所需的文件没有找全,我还以为只需要一个pygtk就够了. 1.下载pygtk需要的文件 到p ...