[
https://issues.apache.org/jira/browse/GEODE-9980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17483902#comment-17483902
]
Kirk Lund commented on GEODE-9980:
----------------------------------
Yesterday I realized that it would be best if a launched Geode process failed
to start up if configuration of serialization filtering fails when
{{geode.enableGlobalSerialFilter}} is set.
The current behavior will log a message and then continue running. Unless the
User is closely monitoring the logs, they could miss the fact that setting
{{geode.enableGlobalSerialFilter}} had no effect.
I think it would be best to update the error handling to cause a newly launched
Geode process (Locator or Server) with {{geode.enableGlobalSerialFilter}} set
to fail to start if any of these conditions occur:
* if {{jdk.serialFilter}} AND {{geode.enableGlobalSerialFilter}} are both set
* if the JRE is too old and {{ObjectInputFilter}} does not exist
* if Java's {{ObjectInputFilter}} throws for any reason, such as:
** a non-null filter already exists
** {{ObjectInputerFilter}} class is not accessible from the current
{{ClassLoader}} or Geode module
I have the above recommended product changes with unit and integration tests
coded up in a local branch. I need to update the acceptance tests and then this
ticket should be complete.
> pre-8u121 JRE throws java.lang.UnsupportedOperationException even when
> geode.enableGlobalSerialFilter is false
> --------------------------------------------------------------------------------------------------------------
>
> Key: GEODE-9980
> URL: https://issues.apache.org/jira/browse/GEODE-9980
> Project: Geode
> Issue Type: Bug
> Components: serialization
> Affects Versions: 1.15.0
> Reporter: Kirk Lund
> Assignee: Kirk Lund
> Priority: Major
> Labels: GeodeOperationAPI, blocks-1.15.0, pull-request-available
>
> {{sun.misc.ObjectInputFilter}} was not added to Java 8 until 8u121. Using
> Geode on an older Java release throws {{java.lang.ClassNotFoundException:
> sun.misc.ObjectInputFilter}} wrapped in an {{UnsupportedOperationException}}.
> This should not be thrown unless the system property
> {{geode.enableGlobalSerialFilter=true}} is set.
> {code:java}
> java.lang.UnsupportedOperationException: ObjectInputFilter is not available.
> at
> org.apache.geode.internal.serialization.filter.ObjectInputFilterUtils.throwUnsupportedOperationException(ObjectInputFilterUtils.java:41)
> at
> org.apache.geode.internal.serialization.filter.ReflectiveObjectInputFilterApiFactory.createObjectInputFilterApi(ReflectiveObjectInputFilterApiFactory.java:40)
> at
> org.apache.geode.internal.serialization.filter.ReflectiveFacadeObjectInputFilterFactory.<init>(ReflectiveFacadeObjectInputFilterFactory.java:35)
> at
> org.apache.geode.internal.InternalDataSerializer.initializeSerializationFilter(InternalDataSerializer.java:435)
> at
> org.apache.geode.internal.InternalDataSerializer.initializeSerializationFilter(InternalDataSerializer.java:420)
> at
> org.apache.geode.distributed.internal.InternalDistributedSystem.initialize(InternalDistributedSystem.java:717)
> at
> org.apache.geode.distributed.internal.InternalDistributedSystem.access$200(InternalDistributedSystem.java:133)
> at
> org.apache.geode.distributed.internal.InternalDistributedSystem$Builder.build(InternalDistributedSystem.java:3018)
> at
> org.apache.geode.distributed.internal.InternalDistributedSystem.connectInternal(InternalDistributedSystem.java:283)
> at
> org.apache.geode.distributed.internal.InternalDistributedSystem.connectInternal(InternalDistributedSystem.java:209)
> at
> org.apache.geode.distributed.DistributedSystem.connect(DistributedSystem.java:159)
> [snip]
> Caused by: java.lang.ClassNotFoundException: sun.misc.ObjectInputFilter
> at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:264)
> at
> org.apache.geode.internal.serialization.filter.ReflectiveObjectInputFilterApi.ObjectInputFilter(ReflectiveObjectInputFilterApi.java:207)
> at
> org.apache.geode.internal.serialization.filter.ReflectiveObjectInputFilterApi.<init>(ReflectiveObjectInputFilterApi.java:65)
> at
> org.apache.geode.internal.serialization.filter.ReflectiveObjectInputFilterApiFactory.createObjectInputFilterApi(ReflectiveObjectInputFilterApiFactory.java:37)
> ... 12 more
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)