Invalid lambda deserialization
Asked Answered
Q

2

2

The Eclipse JDT compiler appears to have a problem whereby, under certain circumstances, Java 8 lamdas are not deserializing correctly and instead throw an IllegalArgumentException. I'm using the most recently distributed maintenance build, as follows:

Eclipse SDK

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

There are existing bugs / SO entries that report similar issues that have been (at least partially) resolved in Luna SR2 (4.4.2) M20141210-0900. I have personally verified that the following issues have been resolved.

Java 8 lambdas that access instance fields and methods can't be deserialized

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

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

To give some context to my problem, I'm using Apache Wicket which calls for the use of anonymous inner classes quite frequently. Since upgrading to Java 8, I've started re-factoring the anonymous inner classes into lamda expressions, which really helps reduce boiler plate code.

Apache Wicket uses serialization to cache web pages that the user has visited, deserializing the pages when the uses navigates back to a previous page. Whilst my code is serializing quite happily, it will not deserialize. The posts linked above led me to focus my investigation; it transpires that compiling under javac resolves the issue. This demonstrates that this is another JDT compiler bug. It isn't however fixed alongside the other lamda deserialization bugs in the latest maintenance release.

There are several areas from which I could benefit from a response:

Is there anything obvious that I could be doing wrong that would lead to a successful serialization but unsuccessful deserialization?

Is there an outstanding JDT compiler bug for this that I've missed?

I'm finding debugging this one really tricky. Because the classes I'm having to debug aren't compiled for debug, all I can inspect is the stack, which I find very limiting. Without being able to reproduce the problem outside of some fairly lengthy Wicket code, I can't really raise a helpful bug. Does anyone have any tips for debugging core libraries?

Has anyone had any success using different serialization libraries with Wicket? At a glance it appears that Kryo Serializer isn't battle tested.

Ideally this is a known bug, or with some assistance I can get to the bottom of what's causing this and reproduce the problem in the form of a small example and raise a meaningful bug. However, if there are any workarounds that spring to mind, I'd be keen to hear those too. Thanks in advance.

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
Quatre answered 15/12, 2014 at 16:27 Comment(2)
My first idea would be to download the Wicket source code and put a breakpoint in JavaSerializer. That will at least help you pinpoint which lambda is failing, so you can submit a useful bug report.Subkingdom
Thanks @biziclop, I have several lamdas in there and all of them fail deserialisation when triggered individually. My problem is that the objects are so deep and that the exception is thrown from the core java libraries, which are tricky to debug. I've tried to recreate the problem using non wicket to no avail. There's something in the Wicket code that's highlighting the bug. I'll try and whittle it down tomorrow and perhaps provide a minimal example to see if others can get to the root and trigger the bug in core java code, with an end towards a good Eclipse bug report.Quatre
Q
2

It's caused by this bug with the JDT compiler's handling of anonymous inner classes inside lamda expressions:

"The problem here is that during generation of the deserialize lambda helper method the 'name' of the inner class containing the implementation lambda method is seen as $Local$ when we ought to be using TestClass$1."

It's not been backported to Version: Luna SR2 (4.4.2) build M20141210-0900 but is verified for for 4.5 M4 I20141208-0800. I can personally confirm that this bug is fixed in:

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

Update: Fixed in Luna SR2 (4.4.2)

Quatre answered 16/12, 2014 at 10:27 Comment(0)
P
0

Looks like this Eclipse JDT bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=439889

Pickel answered 15/12, 2014 at 20:24 Comment(1)
No, I tried this one too. It's fixed now also. I meant to add this to the list of bugs I'd validated as fixed. I've updated the question. Good call though, thanks for the input.Quatre

© 2022 - 2024 — McMap. All rights reserved.