启动服务器时出现异常

时间:2014-10-22 13:38:47

标签: servlets jersey websphere slf4j

部署应用程序时遇到以下异常。 Slf4j错误和找不到的类有什么关联吗?

[10/22/14 17:33:05:792 GST] 00000082 SystemErr     R SLF4J: Class path contains multiple SLF4J bindings.
[10/22/14 17:33:05:792 GST] 00000082 SystemErr     R SLF4J: Found binding in [bundleresource://242.fwk10101291:1/org/slf4j/impl/StaticLoggerBinder.class]
[10/22/14 17:33:05:792 GST] 00000082 SystemErr     R SLF4J: Found binding in [wsjar:file:/D:/Program%20Files%20(x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/App1/Appl1.ear/WebApp1.war/WEB-INF/lib/slf4j-log4j12-1.6.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
[10/22/14 17:33:05:792 GST] 00000082 SystemErr     R SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
[10/22/14 17:33:05:792 GST] 00000082 SystemErr     R SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
[10/22/14 17:33:23:669 GST] 00000090 SystemErr     R java.lang.ClassNotFoundException: com.sun.jersey.core.spi.factory.ResponseImpl
[10/22/14 17:33:23:669 GST] 00000090 SystemErr     R    at java.net.URLClassLoader.findClass(URLClassLoader.java:599)
[10/22/14 17:33:23:669 GST] 00000090 SystemErr     R    at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:204)
[10/22/14 17:33:23:669 GST] 00000090 SystemErr     R    at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:743)
[10/22/14 17:33:23:669 GST] 00000090 SystemErr     R    at java.lang.ClassLoader.loadClass(ClassLoader.java:720)
[10/22/14 17:33:23:669 GST] 00000090 SystemErr     R    at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:119)
[10/22/14 17:33:23:669 GST] 00000090 SystemErr     R    at java.lang.ClassLoader.loadClass(ClassLoader.java:690)
[10/22/14 17:33:23:669 GST] 00000090 SystemErr     R    at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:62)
[10/22/14 17:33:23:669 GST] 00000090 SystemErr     R    at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:58)
[10/22/14 17:33:23:716 GST] 00000090 SystemErr     R    at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:584)
[10/22/14 17:33:23:716 GST] 00000090 SystemErr     R    at java.lang.ClassLoader.loadClass(ClassLoader.java:690)
[10/22/14 17:33:23:716 GST] 00000090 SystemErr     R    at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:584)
[10/22/14 17:33:23:716 GST] 00000090 SystemErr     R    at java.lang.ClassLoader.loadClass(ClassLoader.java:690)
[10/22/14 17:33:23:716 GST] 00000090 SystemErr     R    at java.lang.J9VMInternals.verifyImpl(Native Method)
[10/22/14 17:33:23:716 GST] 00000090 SystemErr     R    at java.lang.J9VMInternals.verify(J9VMInternals.java:93)
[10/22/14 17:33:23:716 GST] 00000090 SystemErr     R    at java.lang.J9VMInternals.initialize(J9VMInternals.java:170)
[10/22/14 17:33:23:716 GST] 00000090 SystemErr     R    at com.sun.jersey.core.spi.factory.AbstractRuntimeDelegate.createResponseBuilder(AbstractRuntimeDelegate.java:99)
[10/22/14 17:33:23:716 GST] 00000090 SystemErr     R    at javax.ws.rs.core.Response$ResponseBuilder.newInstance(Response.java:60)
[10/22/14 17:33:23:716 GST] 00000090 SystemErr     R    at javax.ws.rs.core.Response.status(Response.java:256)
[10/22/14 17:33:23:716 GST] 00000090 SystemErr     R    at javax.ws.rs.core.Response.ok(Response.java:215)

2 个答案:

答案 0 :(得分:1)

看起来您的应用程序正在使用第三方JAX-RS提供程序。由于WebSphere拥有它自己存在冲突。检查this post如何使用自定义JAX-RS提供程序。

答案 1 :(得分:0)

从Java 7升级到Java 8看起来在类路径中引入了一些版本的JAX-RS。

WAS有自己的JDK实现。本地系统中还有另一个Java安装。该安装已升级到版本8.

我删除了JAVA_HOME环境变量并重新启动了系统。应用程序正在启动。猜猜这是问题,虽然我也清除了一些临时文件夹等。也可能是SLF4J冲突。

相关问题