Project

General

Profile

Actions

Bug #1384

closed

Annotace needs Tomcat restart after redeploy

Added by Lama Saeeda about 4 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
2021-IPR - TermIt - 2.9.0
Start date:
10.09.2020
Due date:
% Done:

0%

Estimated time:

Description

  • Reproduce: Redeploy Annotace in Jenkins.
  • The service is down due to exception "java.lang.NoClassDefFoundError: Could not initialize class cz.cuni.mff.ufal.morphodita.morphodita_javaJNI". The full log is in the attachment. The problem is most probably happening because of using JNI under Tomcat. “The important thing to know about using JNI under Tomcat is that one cannot place the native libraries OR their JNI interfaces under the WEB-INF/lib or WEB-INF/classes directories of a web application and expect to be able to reload the webapp without restarting the server.” see this wiki provided by Martin https://cwiki.apache.org/confluence/display/tomcat/HowTo#HowTo-I'mencounteringclassloaderproblemswhenusingJNIunderTomcat.
  • The current solution is to restart Tomcat with every Jenkins redeploy of Annotace. This is not a very nice solution as other services running on Tomcat will be affected.
    - Sol1: Move the problematic files to the $CATALINA_HOME/shared/lib directory.
    - Sol2: Deploy Annotace in a separate instance of Tomcat.

Files

AnnotaceLog (8.14 KB) AnnotaceLog Lama Saeeda, 10.09.2020 16:27
Actions #1

Updated by Lama Saeeda about 4 years ago

Actions #2

Updated by Martin Ledvinka about 4 years ago

I definitely vote for solution 1.

Actions #3

Updated by Petr Křemen almost 4 years ago

  • Status changed from New to Feedback

Cannot reproduce, seeing there however:
2020-10-01 06:31:46 [http-nio-18189-exec-2] DEBUG c.c.k.t.service.OntologyService - Analyzing ontology model to get all labels
2020-10-01 06:31:46 [http-nio-18189-exec-2] DEBUG c.c.k.t.service.OntologyService - number of retrieved lables is: 92
2020-10-01 06:31:46 [http-nio-18189-exec-2] DEBUG c.c.k.t.service.OntologyService - Morphological anlysis for ontology labels has started:
2020-10-01 06:31:46 [http-nio-18189-exec-2] INFO c.c.k.t.s.m.MorphoDitaServiceJNI - Finding czech-morfflex-pdt-161115.tagger ...
2020-10-01 06:31:46 [http-nio-18189-exec-2] INFO c.c.k.t.s.m.MorphoDitaServiceJNI - Found at /opt/kbss.felk.cvut.cz/opt/external/apache-tomcat-9.0.12-2/webapps/czech-text-analysis/WEB-INF/classes/czech-morfflex-pdt-161115.tagger
2020-10-01 06:31:46 [http-nio-18189-exec-2] INFO c.c.k.t.s.m.MorphoDitaServiceJNI - Loading tagger ... (looks up MorphoDita native library at /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib)
2020-10-01 06:31:46 [http-nio-18189-exec-2] ERROR o.s.boot.web.support.ErrorPageFilter - Forwarding to error page from request [/annotate] due to exception [Native Library /lib64/libmorphodita_java.so already loaded in another classloader]
java.lang.UnsatisfiedLinkError: Native Library /lib64/libmorphodita_java.so already loaded in another classloader
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1907)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at cz.cuni.mff.ufal.morphodita.morphodita_javaJNI.<clinit>(morphodita_javaJNI.java:189)
at cz.cuni.mff.ufal.morphodita.Tagger.load(Tagger.java:39)
at cz.cvut.kbss.textanalysis.service.morphodita.MorphoDitaServiceJNI.init(MorphoDitaServiceJNI.java:47)
at cz.cvut.kbss.textanalysis.service.morphodita.MorphoDitaServiceJNI.getMorphoDiteResultProcessed(MorphoDitaServiceJNI.java:65)
at cz.cvut.kbss.textanalysis.service.OntologyService.analyzeModel(OntologyService.java:109)
at cz.cvut.kbss.textanalysis.service.OntologyService.analyzeModel(OntologyService.java:57)
at cz.cvut.kbss.textanalysis.service.HtmlAnnotationService.annotate(HtmlAnnotationService.java:39)
at cz.cvut.kbss.textanalysis.rest.AnnotateController.annotate(AnnotateController.java:55)
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.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.boot.web.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:115)
at org.springframework.boot.web.support.ErrorPageFilter.access$000(ErrorPageFilter.java:59)
at org.springframework.boot.web.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:90)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.boot.web.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:108)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:770)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)

Actions #4

Updated by Petr Křemen almost 4 years ago

  • Target version changed from 2.1.0 to 2.2.0
Actions #5

Updated by Petr Křemen almost 4 years ago

  • Target version changed from 2.2.0 to user-tasks-to-replenished
Actions #6

Updated by Petr Křemen almost 3 years ago

  • Target version changed from user-tasks-to-replenished to TermIt - 2.9.0
Actions #7

Updated by Petr Křemen almost 3 years ago

  • Assignee set to Petr Křemen
  • Status changed from Feedback to Resolved

Resolved by dockerization of Annotace in termit branch.

Actions #8

Updated by Petr Křemen almost 3 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF