新浪SAE部署java war出现JAVA_SAE_Fatal_error

艾焱
2023-12-01


今天把一个war项目扔到Sina的SAE上,然后访问之,一直提示:

HTTP ERROR: 503

Problem accessing /. Reason:

    Service Unavailable
Powered by Jetty://

查看JVM日志如下:

[24/Jun/2014:15:03:57 +0800] 
JAVA_SAE_Fatal_error: Failed startup of context c.s.s.w.SaeWebAppContext{/1/awoke,file:/data1/jetty_work/966/awoke/jetty-0.0.0.0-11867-awoke.war-_1_awoke-any-/webapp/},/data1/www/htdocs/966/awoke/1/awoke.warjava.lang.reflect.InvocationTargetException	
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)	
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)	
at java.lang.reflect.Method.invoke(Method.java:624)	
at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.visit(IterativeDescriptorProcessor.java:80)	
at org.eclipse.jetty.webapp.IterativeDescriptorProcessor.process(IterativeDescriptorProcessor.java:67)	
at com.sina.sae.webapp.SaeStandardDescriptorProcessor.process(SaeStandardDescriptorProcessor.java:27)	
at org.eclipse.jetty.webapp.MetaData.resolve(MetaData.java:320)	
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1206)	
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:586)	
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:449)	
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:58)	
at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:36)	
at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:180)	
at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:482)	
at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:135)	
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileChanged(ScanningAppProvider.java:154)	
at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileChanged(ScanningAppProvider.java:55)	
at org.eclipse.jetty.util.Scanner.reportChange(Scanner.java:655)	
at org.eclipse.jetty.util.Scanner.reportDiffere yq36.javaruntime 

结合官方wiki,http://sae.sina.com.cn/doc/java/tutorial.html#id3

  • 为了避免jar包冲突,请在上传War包至SAE环境前删除servlet-api和xml-api相关的jar包

感觉应该是jar冲突了,发现我的war包中多了dom4j.jar,删除之,reload,服务正常启动。

另外:注意sae的jre是1.6x的,如果本地是1.7或者1.8,编译的时候注意调整下。官网原话:SAE Java 环境以 OpenJDK 1.6 和 Jetty 7.4 为基础构建而成,平台运行在CentOS-6.x 64位Linux环境下。


PS:一定要注意jar冲突问题。



 类似资料: