在 tomcat 8 中设置 sso/ssl 失败
Fail to set up sso/ssl in tomcat 8
我正在尝试在 tomcat 8 中设置 ssl,我遵循了我公司为 tomcat 7 编写的文档。该文档适用于 tomcat 7,但是当我在 tomcat 8 中尝试了同样的事情,我在 catalina.out 日志文件中收到以下错误。你能告诉我是什么原因导致这个错误吗?
顺便说一句,日志文件中的 sso 指的是我创建的一个简单的 hello world war 应用程序,用于测试 sso/ssl.
SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sso]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:917)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1701)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:812)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [Pipeline[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sso]]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5065)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [com.sap.ldi.tomcat.extensions.SSLAuthenticatorWithFormFallback[/sso]]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
at org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:170)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 12 more
Caused by: java.lang.NoClassDefFoundError: org/apache/catalina/deploy/LoginConfig
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2693)
at java.lang.Class.privateGetPublicMethods(Class.java:2894)
at java.lang.Class.getMethods(Class.java:1607)
at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsIntrospectionSource.createManagedBean(MbeansDescriptorsIntrospectionSource.java:297)
at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsIntrospectionSource.execute(MbeansDescriptorsIntrospectionSource.java:77)
at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsIntrospectionSource.loadDescriptors(MbeansDescriptorsIntrospectionSource.java:70)
at org.apache.tomcat.util.modeler.Registry.load(Registry.java:582)
at org.apache.tomcat.util.modeler.Registry.findManagedBean(Registry.java:485)
at org.apache.tomcat.util.modeler.Registry.registerComponent(Registry.java:614)
at org.apache.catalina.util.LifecycleMBeanBase.register(LifecycleMBeanBase.java:161)
at org.apache.catalina.util.LifecycleMBeanBase.initInternal(LifecycleMBeanBase.java:61)
at org.apache.catalina.valves.ValveBase.initInternal(ValveBase.java:208)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
... 15 more
Caused by: java.lang.ClassNotFoundException: org.apache.catalina.deploy.LoginConfig
at java.net.URLClassLoader.run(URLClassLoader.java:435)
at java.net.URLClassLoader.run(URLClassLoader.java:424)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:493)
at java.lang.ClassLoader.loadClass(ClassLoader.java:426)
... 29 more
class org.apache.catalina.authenticator.AuthenticatorBase 在 Tomcat 8 中发生了变化。最重要的变化是方法
public boolean authenticate(Request request, HttpServletResponse response) throws IOException
您不再在参数中获取 LoginConfig。现在很容易得到它:
LoginConfig config = context.getLoginConfig();
LoginConfig 已移动到另一个包:org.apache.tomcat.util.descriptor.web.LoginConfig。
我正在尝试在 tomcat 8 中设置 ssl,我遵循了我公司为 tomcat 7 编写的文档。该文档适用于 tomcat 7,但是当我在 tomcat 8 中尝试了同样的事情,我在 catalina.out 日志文件中收到以下错误。你能告诉我是什么原因导致这个错误吗? 顺便说一句,日志文件中的 sso 指的是我创建的一个简单的 hello world war 应用程序,用于测试 sso/ssl.
SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sso]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:917)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1701)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:812)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [Pipeline[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sso]]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5065)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [com.sap.ldi.tomcat.extensions.SSLAuthenticatorWithFormFallback[/sso]]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
at org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:170)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 12 more
Caused by: java.lang.NoClassDefFoundError: org/apache/catalina/deploy/LoginConfig
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2693)
at java.lang.Class.privateGetPublicMethods(Class.java:2894)
at java.lang.Class.getMethods(Class.java:1607)
at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsIntrospectionSource.createManagedBean(MbeansDescriptorsIntrospectionSource.java:297)
at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsIntrospectionSource.execute(MbeansDescriptorsIntrospectionSource.java:77)
at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsIntrospectionSource.loadDescriptors(MbeansDescriptorsIntrospectionSource.java:70)
at org.apache.tomcat.util.modeler.Registry.load(Registry.java:582)
at org.apache.tomcat.util.modeler.Registry.findManagedBean(Registry.java:485)
at org.apache.tomcat.util.modeler.Registry.registerComponent(Registry.java:614)
at org.apache.catalina.util.LifecycleMBeanBase.register(LifecycleMBeanBase.java:161)
at org.apache.catalina.util.LifecycleMBeanBase.initInternal(LifecycleMBeanBase.java:61)
at org.apache.catalina.valves.ValveBase.initInternal(ValveBase.java:208)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
... 15 more
Caused by: java.lang.ClassNotFoundException: org.apache.catalina.deploy.LoginConfig
at java.net.URLClassLoader.run(URLClassLoader.java:435)
at java.net.URLClassLoader.run(URLClassLoader.java:424)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:493)
at java.lang.ClassLoader.loadClass(ClassLoader.java:426)
... 29 more
class org.apache.catalina.authenticator.AuthenticatorBase 在 Tomcat 8 中发生了变化。最重要的变化是方法
public boolean authenticate(Request request, HttpServletResponse response) throws IOException
您不再在参数中获取 LoginConfig。现在很容易得到它:
LoginConfig config = context.getLoginConfig();
LoginConfig 已移动到另一个包:org.apache.tomcat.util.descriptor.web.LoginConfig。