当前位置: 首页 > 面试题库 >

无效的反序列化

郑俊彦
2023-03-14
问题内容

Eclipse JDT编译器似乎存在一个问题,在某些情况下,Java 8
lamda不能正确反序列化,而是抛出IllegalArgumentException。我正在使用最新发布的维护版本,如下所示:

Eclipse SDK

Version: Luna SR2 (4.4.2)
Build id: M20141210-0900

现有的Bug / SO条目报告了已(至少部分地)已解决的类似问题Luna SR2 (4.4.2) M20141210-0900。我已经亲自验证以下问题已解决。

访问实例字段和方法的Java 8Lambda不能反序列化

https://bugs.eclipse.org/bugs/show_bug.cgi?id=449453

https://bugs.eclipse.org/bugs/show_bug.cgi?id=439889

为了给我的问题提供一些背景信息,我使用了Apache Wicket,它非常频繁地要求使用匿名内部类。自从升级到Java 8之后,我就开始将匿名内部类重构为lamda表达式,这确实有助于减少样板代码。

Apache Wicket使用序列化来缓存用户访问过的网页,并在用户导航回到上一页时反序列化这些页面。虽然我的代码非常愉快地进行了序列化,但不会反序列化。上面链接的帖子使我专注于调查;它javac可以解决该问题。这表明这是另一个JDT编译器错误。但是,它并未与最新维护版本中的其他lamda反序列化错误一起修复。

我可以从以下几个方面受益:

有什么明显的错误提示会导致成功的序列化但不会成功进行反序列化吗?

我是否错过了一个出色的JDT编译器错误?

我发现调试这一程序 确实很
棘手。因为我要调试的类不是为调试而编译的,所以我只能检查堆栈,我发现这是非常有限的。如果无法在一些相当冗长的Wicket代码之外重现该问题,我将无法真正提出有用的错误。有没有人有调试核心库的提示?

有人使用Wicket使用不同的序列化库有成功吗?乍一看,似乎Kryo
Serializer没有经过战斗测试。

理想情况下,这是一个已知的错误,或者在一些帮助下,我可以深入了解导致此错误的原因,并以一个小示例的形式重现该问题,并提出一个有意义的错误。但是,如果想到任何解决方法,我也很想听听。提前致谢。

2014-12-15 14:30:55,239 WARN  - RequestCycleExtra - ********************************
2014-12-15 14:30:55,246 WARN  - RequestCycleExtra - Handling the following exception
java.lang.RuntimeException: Could not deserialize object from byte[]
    at org.apache.wicket.serialize.java.JavaSerializer.deserialize(JavaSerializer.java:143) ~[wicket-core-7.0.0-M3.jar:7.0.0-M3]
    at org.apache.wicket.pageStore.AbstractPageStore.deserializePage(AbstractPageStore.java:152) ~[wicket-core-7.0.0-M3.jar:7.0.0-M3]
    at org.apache.wicket.pageStore.AbstractCachingPageStore.getPage(AbstractCachingPageStore.java:67) ~[wicket-core-7.0.0-M3.jar:7.0.0-M3]
    at org.apache.wicket.page.PageStoreManager$SessionEntry.getPage(PageStoreManager.java:203) ~[wicket-core-7.0.0-M3.jar:7.0.0-M3]
    at org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.getPage(PageStoreManager.java:357) ~[wicket-core-7.0.0-M3.jar:7.0.0-M3]
    at org.apache.wicket.page.AbstractPageManager.getPage(AbstractPageManager.java:82) ~[wicket-core-7.0.0-M3.jar:7.0.0-M3]
    at org.apache.wicket.page.PageManagerDecorator.getPage(PageManagerDecorator.java:50) ~[wicket-core-7.0.0-M3.jar:7.0.0-M3]
    at org.apache.wicket.page.PageAccessSynchronizer$2.getPage(PageAccessSynchronizer.java:234) ~[wicket-core-7.0.0-M3.jar:7.0.0-M3]
    at org.apache.wicket.DefaultMapperContext.getPageInstance(DefaultMapperContext.java:148) ~[wicket-core-7.0.0-M3.jar:7.0.0-M3]
    at org.apache.wicket.core.request.handler.PageProvider.getStoredPage(PageProvider.java:296) ~[wicket-core-7.0.0-M3.jar:7.0.0-M3]
    at org.apache.wicket.core.request.handler.PageProvider.isNewPageInstance(PageProvider.java:208) ~[wicket-core-7.0.0-M3.jar:7.0.0-M3]
    at org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper.processHybrid(AbstractBookmarkableMapper.java:261) ~[wicket-core-7.0.0-M3.jar:7.0.0-M3]
    at org.apache.wicket.core.request.mapper.AbstractBookmarkableMapper.mapRequest(AbstractBookmarkableMapper.java:360) ~[wicket-core-7.0.0-M3.jar:7.0.0-M3]
    at org.apache.wicket.request.mapper.CompoundRequestMapper.mapRequest(CompoundRequestMapper.java:152) ~[wicket-request-7.0.0-M3.jar:7.0.0-M3]
    at org.apache.wicket.request.cycle.RequestCycle.resolveRequestHandler(RequestCycle.java:189) [wicket-core-7.0.0-M3.jar:7.0.0-M3]
    at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:219) [wicket-core-7.0.0-M3.jar:7.0.0-M3]
    at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:293) [wicket-core-7.0.0-M3.jar:7.0.0-M3]
    at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:261) [wicket-core-7.0.0-M3.jar:7.0.0-M3]
    at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:203) [wicket-core-7.0.0-M3.jar:7.0.0-M3]
    at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:284) [wicket-core-7.0.0-M3.jar:7.0.0-M3]
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650) [jetty-servlet-9.2.3.v20140905.jar:9.2.3.v20140905]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) [spring-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260) [spring-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650) [jetty-servlet-9.2.3.v20140905.jar:9.2.3.v20140905]
    at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:177) [spring-orm-4.0.7.RELEASE.jar:4.0.7.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650) [jetty-servlet-9.2.3.v20140905.jar:9.2.3.v20140905]
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583) [jetty-servlet-9.2.3.v20140905.jar:9.2.3.v20140905]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [jetty-server-9.2.3.v20140905.jar:9.2.3.v20140905]
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577) [jetty-security-9.2.3.v20140905.jar:9.2.3.v20140905]
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223) [jetty-server-9.2.3.v20140905.jar:9.2.3.v20140905]
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125) [jetty-server-9.2.3.v20140905.jar:9.2.3.v20140905]
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) [jetty-servlet-9.2.3.v20140905.jar:9.2.3.v20140905]
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [jetty-server-9.2.3.v20140905.jar:9.2.3.v20140905]
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059) [jetty-server-9.2.3.v20140905.jar:9.2.3.v20140905]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.2.3.v20140905.jar:9.2.3.v20140905]
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) [jetty-server-9.2.3.v20140905.jar:9.2.3.v20140905]
    at org.eclipse.jetty.server.Server.handle(Server.java:497) [jetty-server-9.2.3.v20140905.jar:9.2.3.v20140905]
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311) [jetty-server-9.2.3.v20140905.jar:9.2.3.v20140905]
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248) [jetty-server-9.2.3.v20140905.jar:9.2.3.v20140905]
    at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540) [jetty-io-9.2.3.v20140905.jar:9.2.3.v20140905]
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610) [jetty-util-9.2.3.v20140905.jar:9.2.3.v20140905]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539) [jetty-util-9.2.3.v20140905.jar:9.2.3.v20140905]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_11]
Caused by: java.io.IOException: unexpected exception type
    at java.io.ObjectStreamClass.throwMiscException(ObjectStreamClass.java:1538) ~[na:1.8.0_11]
    at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1110) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1810) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1707) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1345) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1707) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1345) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1707) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1345) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1707) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1345) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1707) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1345) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1707) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1345) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1707) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1345) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1707) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1345) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) ~[na:1.8.0_11]
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371) ~[na:1.8.0_11]
    at org.apache.wicket.serialize.java.JavaSerializer.deserialize(JavaSerializer.java:122) ~[wicket-core-7.0.0-M3.jar:7.0.0-M3]
    ... 66 common frames omitted
Caused by: java.lang.reflect.InvocationTargetException: null
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_11]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_11]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_11]
    at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_11]
    at java.lang.invoke.SerializedLambda.readResolve(SerializedLambda.java:230) ~[na:1.8.0_11]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_11]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_11]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_11]
    at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_11]
    at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1104) ~[na:1.8.0_11]
    ... 146 common frames omitted
Caused by: java.lang.IllegalArgumentException: Invalid lambda deserialization
    at com.nucleusfinancial.nuclear.portfolioperformance.ui.TimeWeightedPortfolioAnalysisPanel$2.$deserializeLambda$(TimeWeightedPortfolioAnalysisPanel.java:1) ~[classes/:na]
    ... 156 common frames omitted
2014-12-15 14:30:55,248 WARN  - RequestCycleExtra - ********************************
2014-12-15 14:30:55,251 ERROR - DefaultExceptionMapper - Unexpected error occurred

问题答案:

这是由JDT编译器处理lamda表达式中的匿名内部类的错误引起的:

“这里的问题是,在反序列化lambda辅助方法的生成过程中,当我们应该使用TestClass $ 1时,包含实现lambda方法的内部类的’名称’被视为$
Local $。”

它不被移植到Version: Luna SR2 (4.4.2)建设M20141210-0900,但被证实为4.5 M4 I20141208-0800。我可以亲自确认此错误已修复:

Eclipse SDK
Version: Mars (4.5)
Build id: I20141210-2000

更新:
固定在LunaSR2 (4.4.2)



 类似资料:
  • Eclipse JDT编译器似乎有一个问题,在某些情况下,Java8个lamda没有正确反序列化,而是抛出一个。我正在使用最近的分布式维护版本,如下所示: 现有的bug/SO条目报告了在中已经(至少部分)解决的类似问题。我亲自验证了以下问题已经得到解决。 无法反序列化访问实例字段和方法的Java 8 lambda https://bugs.eclipse.org/bugs/show_bug.cgi

  • 问题内容: 关于如何解决此错误的任何想法?我在Hibernate中使用Spring JPA。下面的必要详细信息。 实体类别1: 用户的实体类: 和stacktrace: stacktrace非常大。我将下面的整个stacktrace粘贴以供参考,并在此处粘贴快速TL; DR: 完整的堆栈跟踪如下: 更新: 我将Ways实体类更新为以下内容,但仍然出现错误: 问题答案: 当无法反序列化某些内容时,就

  • 我正在玩弄一个基本的无限泛集群,我遇到了一个令人费解的错误。 我基本上实现了一个共享映射,只包含一个整数 这是我的服务代码 缓存是通过以下方式生成的: 当集群中至少有两台服务器时,computeIfAbsen会失败 这可以归结为: 最后是: 如果我把我非常好的时髦代码重写成丑陋的代码,它就会起作用。 我怎么能使用漂亮的电脑现在没有做事的方式? Eclipse 2018-12、WildFly 14、

  • 问题内容: 我的json文件主要是一个包含对象的数组,但是列表不完整,所以我不能使用最后一个条目。我想反序列化文件的其余部分,同时丢弃最后一个无效的条目 请告诉我是否有使用Newtonsoft.Json库的方法,还是我需要一些预处理。 谢谢! 问题答案: 您可以使用JsonReader类,并尝试尽可能地解析。类似于下面的代码,它将解析尽可能多的属性,然后引发异常。如果您想反序列化为一个具体的类,那

  • 问题内容: 我试图序列化和反序列化内部对象的数组列表: HairList对象也是一个可序列化的对象。 此代码执行返回以下错误: 排队 我不知道我在做什么错。你能给个小费吗? 更新: 解决: 仅使用HairBirt的本机数组而不是ArrayList即可工作: 代替 感谢大家的帮助。 问题答案: 不要使用-而是使用二进制数据并对它进行base64编码,以将其转换为字符串而不会丢失信息。 我强烈怀疑这是

  • 问题内容: 作为一个小项目,我一直在尝试做一个小事,它可以读取序列化的lambda(从本地或从FTP)并调用它们的运行函数作为测试的一部分,以测试Windows中的文件关联(即打开某些文件类型)使用特定程序打开它们),但不管如何,无论如何,它似乎从未正确地反序列化。 lambda被这样声明 并使用由ObjectOutputStream包装的[n可选] BufferedOutputStream包装的