프로젝트/Pinpoint, Scouter 구축(APM)

[Scouter paper] Web API, UI 적용 불가 해결( javax.servlet.ServletException: org.glassfish.jersey.servlet.ServletContainer-6a2d68f6@28a35f7d==org.glassfish.jersey.servlet.ServletContainer,jsp=null,order=1,inst=false)

블랑v 2024. 1. 25. 13:02

 

오류 로그

 

20240124 19:26:10 Scouter Server Version 2.20.0 2023-05-29 05:14 GMT
20240124 19:26:10 [PID]3306
  ____                  _            
 / ___|  ___ ___  _   _| |_ ___ _ __ 
 \___ \ / __/   \| | | | __/ _ \ '__|
  ___) | (_| (+) | |_| | ||  __/ |   
 |____/ \___\___/ \__,_|\__\___|_|                                      
 Open Source S/W Performance Monitoring  
 Scouter version 2.20.0
 
20240124 19:26:14 Scouter Server Version 2.20.0 2023-05-29 05:14 GMT
20240124 19:26:14 [PID]3338
  ____                  _            
 / ___|  ___ ___  _   _| |_ ___ _ __ 
 \___ \ / __/   \| | | | __/ _ \ '__|
  ___) | (_| (+) | |_| | ||  __/ |   
 |____/ \___\___/ \__,_|\__\___|_|                                      
 Open Source S/W Performance Monitoring  
 Scouter version 2.20.0
 
20240124 19:26:14 Load Account Group File
20240124 19:26:14 Load Account File
20240124 19:26:14 udp listen 0.0.0.0:6100
20240124 19:26:14 	udp_host=0.0.0.0
20240124 19:26:14 	udp_port=6100
20240124 19:26:14 	udp_buffer=65535
20240124 19:26:14 	udp_so_rcvbuf=4194304
20240124 19:26:14 Load Account Group File
20240124 19:26:14 Load Account File
20240124 19:26:14 	tcp_port=6100
20240124 19:26:14 	cp_agent_so_timeout=60000
20240124 19:26:14 	cp_client_so_timeout=8000
20240124 19:26:15 [HTTP] Failed to start http server
javax.servlet.ServletException: org.glassfish.jersey.servlet.ServletContainer-6a2d68f6@28a35f7d==org.glassfish.jersey.servlet.ServletContainer,jsp=null,order=1,inst=false
	org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:658)
	org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:421)
	org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:760)
	org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:348)
	org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:785)
	org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261)
	org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
	org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
	org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
	org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:272)
	org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
	org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)
	org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
	org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
	org.eclipse.jetty.server.Server.start(Server.java:452)
	org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
	org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
	org.eclipse.jetty.server.Server.doStart(Server.java:419)
	org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	scouter.server.http.HttpServer.run(HttpServer.java:125)
20240124 19:26:16 [S104] New OBJECT  objType=tomcat objHash=x68kpe8 objName=/localhost.localdomain/scouterAgentJava addr=10.0.2.4 2.20.0 2023-05-29 05:14 GMT_ENV_java8plus alive 2024-01-24 19:26:15.991 {detected=tomcat,ADC=false}
20240124 19:26:16 [S104] New OBJECT  objType=linux objHash=zt87fst objName=/localhost.localdomain addr=10.0.2.4 2.20.0 2023-05-29 05:14 GMT alive 2024-01-24 19:26:16.161 {detected=linux,podName=,kubeSeq=-1,useKubeSeq=false,hostName=localhost.localdomain}
20240124 19:26:19 [A1601] error on toClass with javassist. try to fallback for java8 below. err:Class not in same package as lookup class: scouter.server.plugin.impl.Neighbor has no permission to define the class
20240124 19:26:19 [S215] Alert rule detected : ErrorRate.alert
20240124 19:26:19 [S212] [source error] ) is missing
20240124 19:26:19 [A1601] error on toClass with javassist. try to fallback for java8 below. err:Class not in same package as lookup class: scouter.server.plugin.impl.Neighbor has no permission to define the class
20240124 19:26:19 [S215] Alert rule detected : Elapsed90%.alert
20240124 19:26:19 PLUG-IN : scouter.server.plugin.IAlert loaded #x1q3h3u
20240124 19:26:19 PLUG-IN : scouter.server.plugin.ICounter loaded #xa8q3uf
20240124 19:26:19 PLUG-IN : scouter.server.plugin.IObject loaded #x1k0ocoi
20240124 19:26:19 PLUG-IN : scouter.server.plugin.IXLog loaded #x4h8e7l
20240124 19:26:19 PLUG-IN : scouter.server.plugin.IXLog loaded #xurkn5n
20240124 19:26:19 PLUG-IN : scouter.server.plugin.IXLogProfile loaded #x1dpp2ak
20240124 19:26:19 PLUG-IN : scouter.server.plugin.ISummary loaded #x120iatf
20240124 19:26:26 [S145] GeoIP db file is not readable : /opt/scouter/server/conf/GeoLiteCity.dat

 

 19:26:14.816 [scouter.server.http.HttpServer]  INFO  org.eclipse.jetty.util.log[192] - Logging initialized @1084ms to org.eclipse.jetty.util.log.Slf4jLog
 19:26:14.838 [scouter.server.http.HttpServer]  INFO  scouterx.webapp.main.WebAppMain[270] - scouter webapp starting! Run-Mode:Embedded
 19:26:14.850 [scouter.server.http.HttpServer]  INFO  s.w.framework.client.net.TcpProxy[58] - TcpProxy created : pool-size:0, scouterx.webapp.framework.client.net.TcpProxy@427f02c2
 19:26:14.852 [scouter.server.http.HttpServer]  INFO  s.w.framework.client.net.ClientTCP[62] - Connected scouterx.webapp.framework.client.net.ClientTCP@43ef7424 to 127.0.0.1:6100
 19:26:14.863 [scouter.server.http.HttpServer]  INFO  s.w.framework.client.net.TcpProxy[110] - TcpProxy closed : pool-size:0, scouterx.webapp.framework.client.net.TcpProxy@427f02c2, stack:
 19:26:14.863 [scouter.server.http.HttpServer]  INFO  s.w.framework.client.net.TcpProxy[58] - TcpProxy created : pool-size:0, scouterx.webapp.framework.client.net.TcpProxy@387b20c4
 19:26:14.864 [scouter.server.http.HttpServer]  INFO  s.w.framework.client.net.TcpProxy[58] - TcpProxy created : pool-size:1, scouterx.webapp.framework.client.net.TcpProxy@6044488b
 19:26:14.864 [scouter.server.http.HttpServer]  INFO  s.w.framework.client.net.TcpProxy[58] - TcpProxy created : pool-size:2, scouterx.webapp.framework.client.net.TcpProxy@64c896b
 19:26:14.864 [scouter.server.http.HttpServer]  INFO  s.w.framework.client.net.TcpProxy[58] - TcpProxy created : pool-size:3, scouterx.webapp.framework.client.net.TcpProxy@6808362a
 19:26:14.864 [scouter.server.http.HttpServer]  INFO  s.w.framework.client.net.TcpProxy[58] - TcpProxy created : pool-size:4, scouterx.webapp.framework.client.net.TcpProxy@91456ef
 19:26:14.864 [scouter.server.http.HttpServer]  INFO  s.w.framework.client.net.TcpProxy[58] - TcpProxy created : pool-size:5, scouterx.webapp.framework.client.net.TcpProxy@4bd65756
 19:26:14.865 [scouter.server.http.HttpServer]  INFO  s.w.framework.client.net.ClientTCP[62] - Connected scouterx.webapp.framework.client.net.ClientTCP@67fc9414 to 127.0.0.1:6100
 19:26:14.872 [scouter.server.http.HttpServer]  INFO  scouterx.webapp.main.WebAppMain[223] - Successfully log in to 127.0.0.1:6100
 19:26:14.875 [scouterx.webapp.framework.client.model.AgentModelThread]  INFO  s.w.framework.client.net.ClientTCP[62] - Connected scouterx.webapp.framework.client.net.ClientTCP@5584eaf0 to 127.0.0.1:6100
 19:26:14.902 [scouterx.webapp.framework.client.model.AgentModelThread]  INFO  s.w.framework.client.net.ClientTCP[62] - Connected scouterx.webapp.framework.client.net.ClientTCP@5f7c8180 to 127.0.0.1:6100
 19:26:14.958 [scouter.server.http.HttpServer]  INFO  org.eclipse.jetty.server.Server[372] - jetty-9.4.6.v20170531
 19:26:14.965 [scouter.server.http.HttpServer]  INFO  o.e.j.server.AbstractNCSARequestLog[230] - Opened /opt/scouter/server/logs/http-request-2024_01_24.log
 19:26:14.969 [scouter.server.http.HttpServer]  INFO  org.eclipse.jetty.server.session[364] - DefaultSessionIdManager workerName=node0
 19:26:14.969 [scouter.server.http.HttpServer]  INFO  org.eclipse.jetty.server.session[369] - No SessionScavenger set, using defaults
 19:26:14.970 [scouter.server.http.HttpServer]  INFO  org.eclipse.jetty.server.session[149] - Scavenging every 600000ms
 19:26:15.613 [scouter.server.http.HttpServer]  WARN  o.e.j.s.handler.ContextHandler.ROOT[2231] - unavailable
org.glassfish.hk2.api.MultiException: A MultiException has 2 exceptions.  They are:
1. java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/util/JacksonFeature
2. java.lang.IllegalStateException: Unable to perform operation: create on scouterx.webapp.framework.mapper.JerseyMapperProvider

	at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:392)
	at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:487)
	at org.jvnet.hk2.internal.SingletonContext$1.compute(SingletonContext.java:83)
	at org.jvnet.hk2.internal.SingletonContext$1.compute(SingletonContext.java:71)
	at org.glassfish.hk2.utilities.cache.Cache$OriginThreadAwareFuture$1.call(Cache.java:97)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.glassfish.hk2.utilities.cache.Cache$OriginThreadAwareFuture.run(Cache.java:154)
	at org.glassfish.hk2.utilities.cache.Cache.compute(Cache.java:199)
	at org.jvnet.hk2.internal.SingletonContext.findOrCreate(SingletonContext.java:122)
	at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2126)
	at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetAllServiceHandles(ServiceLocatorImpl.java:1491)
	at org.jvnet.hk2.internal.ServiceLocatorImpl.getAllServices(ServiceLocatorImpl.java:818)
	at org.glassfish.jersey.inject.hk2.AbstractHk2InjectionManager.getAllInstances(AbstractHk2InjectionManager.java:194)
	at org.glassfish.jersey.inject.hk2.ImmediateHk2InjectionManager.getAllInstances(ImmediateHk2InjectionManager.java:54)
	at org.glassfish.jersey.internal.ContextResolverFactory$ContextResolversConfigurator.postInit(ContextResolverFactory.java:93)
	at org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$2(ApplicationHandler.java:372)
	at java.base/java.util.Arrays$ArrayList.forEach(Arrays.java:4390)
	at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:372)
	at org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$1(ApplicationHandler.java:316)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
	at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:256)
	at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:315)
	at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:282)
	at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:335)
	at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:178)
	at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:370)
	at javax.servlet.GenericServlet.init(GenericServlet.java:244)
	at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:637)
	at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:421)
	at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:760)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:348)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:785)
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
	at org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:272)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
	at org.eclipse.jetty.server.Server.start(Server.java:452)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
	at org.eclipse.jetty.server.Server.doStart(Server.java:419)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
	at scouter.server.http.HttpServer.run(HttpServer.java:125)
Caused by: java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/util/JacksonFeature
	at com.fasterxml.jackson.databind.ObjectMapper.<init>(ObjectMapper.java:655)
	at com.fasterxml.jackson.databind.ObjectMapper.<init>(ObjectMapper.java:558)
	at scouterx.webapp.framework.mapper.JerseyMapperProvider.<clinit>(JerseyMapperProvider.java:32)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at org.glassfish.hk2.utilities.reflection.ReflectionHelper.makeMe(ReflectionHelper.java:1375)
	at org.jvnet.hk2.internal.ClazzCreator.createMe(ClazzCreator.java:272)
	at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:366)
	... 50 common frames omitted
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.core.util.JacksonFeature
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:476)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:594)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:527)
	... 60 common frames omitted
 19:26:15.622 [scouter.server.http.HttpServer]  INFO  o.e.jetty.server.AbstractConnector[280] - Started ServerConnector@33d957c1{HTTP/1.1,[http/1.1]}{0.0.0.0:6180}
 19:26:15.913 [XLogThread-127.0.0.1:6100-0]  INFO  s.w.framework.client.net.ClientTCP[62] - Connected scouterx.webapp.framework.client.net.ClientTCP@19e378a0 to 127.0.0.1:6100
 19:26:16.847 [scouterx.webapp.framework.client.server.ServerManager]  INFO  s.w.framework.client.net.ClientTCP[62] - Connected scouterx.webapp.framework.client.net.ClientTCP@4403a082 to 127.0.0.1:6100
 19:26:16.922 [XLogThread-127.0.0.1:6100-0]  INFO  s.w.framework.client.net.ClientTCP[62] - Connected scouterx.webapp.framework.client.net.ClientTCP@6dbe4fd6 to 127.0.0.1:6100

 

 

jackson 의존성 다운 후 적용

 

- Jackson Core : https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core

- Jackson Databind : https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind

- Jackson Annotations : https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations

 

jackson-*-2.12.3.jar 기준으로 설치함

 

시작 파일에 의존성 추가 - 스크립트 수정

 

webapp/ 하위 paper boot -> paper용 StandAlone 서버

#!/usr/bin/env bash
#export JDK_JAVA_OPTIONS="--add-modules java.xml.bind"

JACKSON_CORE="/opt/scouter/jackson_scouter/jackson-core-2.12.3.jar"
JACKSON_DATABIND="/opt/scouter/jackson_scouter/jackson-databind-2.12.3.jar"
JACKSON_ANNOTATIONS="/opt/scouter/jackson_scouter/jackson-annotations-2.12.3.jar"

nohup java -cp ${JACKSON_CORE}:${JACKSON_DATABIND}:${JACKSON_ANNOTATIONS}:./scouter.webapp.jar:./lib/*:. scouterx.webapp.main.WebAppMain > nohup.out &
#nohup java -cp ./scouter.webapp.jar:./lib/*:.  scouterx.webapp.main.WebAppMain > nohup.out &

sleep 1
tail -100 nohup.out

 

 

server boot -> main server

#!/usr/bin/env bash

JACKSON_CORE="/opt/scouter/jackson_scouter/jackson-core-2.12.3.jar"
JACKSON_DATABIND="/opt/scouter/jackson_scouter/jackson-databind-2.12.3.jar"
JACKSON_ANNOTATIONS="/opt/scouter/jackson_scouter/jackson-annotations-2.12.3.jar"

echo $JAVA_HOME
echo ${JACKSON_CORE}
echo ${JACKSON_DATABIND}
echo ${JACKSON_ANNOTATIONS}

nohup java -Xmx1024m -classpath ./scouter-server-boot.jar:${JACKSON_CORE}:${JACKSON_DATABIND}:${JACKSON_ANNOTATIONS} scouter.boot.Boot ./lib > nohup.out &
#nohup java -Xmx1024m -classpath ./scouter-server-boot.jar scouter.boot.Boot ./lib > nohup.out &

sleep 1
tail -100 nohup.out

 

 

오류 해결

 

curl 확인

문제 없이 받아지는 모습.