geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (Jira)" <j...@apache.org>
Subject [jira] [Commented] (GEODE-7334) dev rest api failed to start when a JodaModel jar exists in the classpath
Date Tue, 29 Oct 2019 20:06:01 GMT

    [ https://issues.apache.org/jira/browse/GEODE-7334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16962378#comment-16962378
] 

ASF subversion and git services commented on GEODE-7334:
--------------------------------------------------------

Commit 8081dad37e3569cfa969872c533a03fc8c5b609f in geode's branch refs/heads/feature/GEODE-7341
from Jinmei Liao
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=8081dad ]

GEODE-7334: do not Jackson libraries from outside of the war file except Jackson annotations
(#4225)

* remove jackson-annotation.jar from war
* limit all other jackson classes to be loaded by the web apps classloader.

> dev rest api failed to start when a JodaModel jar exists in the classpath
> -------------------------------------------------------------------------
>
>                 Key: GEODE-7334
>                 URL: https://issues.apache.org/jira/browse/GEODE-7334
>             Project: Geode
>          Issue Type: Bug
>          Components: rest (dev)
>            Reporter: Jinmei Liao
>            Priority: Major
>         Attachments: jackson-datatype-joda-2.9.8.jar, joda-time-2.1.jar
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Steps to reproduce
> 1. Add jackson-datatype-joda-2.9.8.jar	and joda-time-2.1.jar in the server classpath
> 2. start the server with rest api started
> 3. examine the server log shows the following exception:
> [error 2019/09/13 05:43:21.681 BST rd1-server <main> tid=0x1] Context initialization
failed
> org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter': Instantiation
of bean failed; nested exception is org.springframework.beans.BeanInstantiationException:
Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]:
Constructor threw exception; nested exception is java.lang.ClassCastException: com.fasterxml.jackson.datatype.joda.JodaModule
cannot be cast to com.fasterxml.jackson.databind.Module
>     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1163)
>     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1107)
>     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
>     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
>     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
>     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
>     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
>     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
>     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
>     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
>     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
>     at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:668)
>     at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:634)
>     at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:682)
>     at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:553)
>     at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:494)
>     at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:171)
>     at javax.servlet.GenericServlet.init(GenericServlet.java:244)
>     at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:670)
>     at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:427)
>     at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:760)
>     at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:374)
>     at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
>     at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
>     at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:847)
>     at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:287)
>     at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
>     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>     at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
>     at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
>     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:138)
>     at org.eclipse.jetty.server.Server.start(Server.java:416)
>     at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108)
>     at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
>     at org.eclipse.jetty.server.Server.doStart(Server.java:383)
>     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
>     at org.apache.geode.management.internal.JettyHelper.startJetty(JettyHelper.java:165)
>     at org.apache.geode.management.internal.ManagementAgent.startHttpService(ManagementAgent.java:297)
>     at org.apache.geode.management.internal.ManagementAgent.startAgent(ManagementAgent.java:150)
>     at org.apache.geode.management.internal.SystemManagementService.startManager(SystemManagementService.java:429)
>     at org.apache.geode.management.internal.beans.ManagementAdapter.handleCacheCreation(ManagementAdapter.java:173)
>     at org.apache.geode.management.internal.beans.ManagementListener.handleEvent(ManagementListener.java:115)
>     at org.apache.geode.distributed.internal.InternalDistributedSystem.notifyResourceEventListeners(InternalDistributedSystem.java:2185)
>     at org.apache.geode.distributed.internal.InternalDistributedSystem.handleResourceEvent(InternalDistributedSystem.java:596)
>     at org.apache.geode.internal.cache.GemFireCacheImpl.initialize(GemFireCacheImpl.java:1211)
>     at org.apache.geode.internal.cache.GemFireCacheImpl.basicCreate(GemFireCacheImpl.java:797)
>     at org.apache.geode.internal.cache.GemFireCacheImpl.create(GemFireCacheImpl.java:783)
>     at org.apache.geode.cache.CacheFactory.create(CacheFactory.java:176)
>     at org.apache.geode.cache.CacheFactory.create(CacheFactory.java:223)
>     at org.apache.geode.distributed.internal.DefaultServerLauncherCacheProvider.createCache(DefaultServerLauncherCacheProvider.java:52)
>     at org.apache.geode.distributed.ServerLauncher.createCache(ServerLauncher.java:860)
>     at org.apache.geode.distributed.ServerLauncher.start(ServerLauncher.java:777)
>     at org.apache.geode.distributed.ServerLauncher.run(ServerLauncher.java:707)
>     at org.apache.geode.distributed.ServerLauncher.main(ServerLauncher.java:227)
> Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Constructor
threw exception; nested exception is java.lang.ClassCastException: com.fasterxml.jackson.datatype.joda.JodaModule
cannot be cast to com.fasterxml.jackson.databind.Module
>     at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:154)
>     at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89)
>     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1155)
>     ... 55 more
> Caused by: java.lang.ClassCastException: com.fasterxml.jackson.datatype.joda.JodaModule
cannot be cast to com.fasterxml.jackson.databind.Module
>     at org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.registerWellKnownModulesIfAvailable(Jackson2ObjectMapperBuilder.java:764)
>     at org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.configure(Jackson2ObjectMapperBuilder.java:607)
>     at org.springframework.http.converter.json.Jackson2ObjectMapperBuilder.build(Jackson2ObjectMapperBuilder.java:590)
>     at org.springframework.http.converter.json.MappingJackson2HttpMessageConverter.<init>(MappingJackson2HttpMessageConverter.java:57)
>     at org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter.<init>(AllEncompassingFormHttpMessageConverter.java:66)
>     at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.<init>(RequestMappingHandlerAdapter.java:182)
>     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>     at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
>     at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142)
>     ... 57 more



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message