eugenp / tutorials

Getting Started with Spring Boot 3:
https://bit.ly/github-ls
MIT License
36.7k stars 54.47k forks source link

cas sso #7520

Closed winnerawan closed 4 years ago

winnerawan commented 5 years ago

i get this exception when using command : ./mwnw tomcat:run

INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
Aug 06, 2019 8:21:51 AM org.apache.catalina.core.StandardContext resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base /Users/winnerawan/Works/learns/baeldung/tutorials/cas/cas-server/src/main/webapp does not exist or is not a readable directory
    at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:142)
    at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4249)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4418)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
    at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
    at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMojo.java:558)
    at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java:255)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:194)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.apache.maven.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:41)
    at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:150)
    at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:48)

Aug 06, 2019 8:21:51 AM org.apache.catalina.core.StandardContext start
SEVERE: Error in resourceStart()
Aug 06, 2019 8:21:51 AM org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
Aug 06, 2019 8:21:51 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/cas-server] startup failed due to previous errors
Aug 06, 2019 8:21:51 AM org.apache.catalina.core.StandardContext stop
INFO: Container org.apache.catalina.core.ContainerBase.[localEngine].[localhost].[/cas-server] has not been started
Aug 06, 2019 8:21:52 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Aug 06, 2019 8:21:52 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080

and this exception when using command ./build.sh run

08:27:08.854 [main] DEBUG org.reflections.Reflections - expanded subtype org.springframework.boot.actuate.health.HealthIndicator -> org.springframework.boot.actuate.health.AbstractHealthIndicator
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
    at org.springframework.boot.loader.WarLauncher.main(WarLauncher.java:59)
Caused by: java.lang.NoSuchMethodError: org.apache.logging.log4j.ThreadContext.getThreadContextMap()Lorg/apache/logging/log4j/spi/ThreadContextMap;
    at org.apache.logging.log4j.ThreadContextAccess.getThreadContextMap(ThreadContextAccess.java:45)
    at org.apache.logging.log4j.core.impl.ContextDataInjectorFactory.createDefaultInjector(ContextDataInjectorFactory.java:83)
    at org.apache.logging.log4j.core.impl.ContextDataInjectorFactory.createInjector(ContextDataInjectorFactory.java:67)
    at org.apache.logging.log4j.core.lookup.ContextMapLookup.<init>(ContextMapLookup.java:34)
    at org.apache.logging.log4j.core.lookup.Interpolator.<init>(Interpolator.java:116)
    at org.apache.logging.log4j.core.config.AbstractConfiguration.<init>(AbstractConfiguration.java:120)
    at org.apache.logging.log4j.core.config.NullConfiguration.<init>(NullConfiguration.java:32)
    at org.apache.logging.log4j.core.LoggerContext.<clinit>(LoggerContext.java:72)
    at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.createContext(ClassLoaderContextSelector.java:171)
    at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.locateContext(ClassLoaderContextSelector.java:145)
    at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:70)
    at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:57)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:147)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
    at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
    at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:121)
    at org.apache.logging.log4j.jcl.LogAdapter.getContext(LogAdapter.java:39)
    at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:46)
    at org.apache.logging.log4j.jcl.LogFactoryImpl.getInstance(LogFactoryImpl.java:40)
    at org.apache.logging.log4j.jcl.LogFactoryImpl.getInstance(LogFactoryImpl.java:55)
    at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)
    at org.springframework.boot.SpringApplication.<clinit>(SpringApplication.java:179)
    at org.springframework.boot.builder.SpringApplicationBuilder.createSpringApplication(SpringApplicationBuilder.java:99)
    at org.springframework.boot.builder.SpringApplicationBuilder.<init>(SpringApplicationBuilder.java:87)
    at org.apereo.cas.web.CasWebApplication.main(CasWebApplication.java:65)
    ... 8 more
maibin commented 5 years ago

@winnerawan could you please let us know to which article you're referring to? Thanks!

winnerawan commented 5 years ago

@maibin thanks for fast reply, here https://www.baeldung.com/spring-security-cas-sso i use code from repo,

the principal in the database that the server uses must be the same as that of the client applications. i would like to know about the note , is that mean client and server must be 1 database ? how about client have their own db?

maibin commented 5 years ago

@winnerawan we logged an internal ticket to investigate the issue. Most likely, the dependencies are out of date. We'll follow up here with updates.

lor6 commented 4 years ago

the dependencies and article have been updated