[ 
https://issues.apache.org/jira/browse/GEODE-9980?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kirk Lund updated GEODE-9980:
-----------------------------
    Description: 
The following error conditions need better handling and should cause the 
startup of a Locator or Server to fail. Without the changes for this ticket, 
Geode will handle errors inconsistently and in most cases will log a statement 
that it could not set the serialization filter and then simply continue running.

1) The user is trying to secure the JVM very thoroughly and accidentally 
specifies both {{-Djdk.serialFilter}} and {{-Dgeode.enableGlobalSerialFilter}}. 

2) The user runs some non-Geode code in the same JVM that invokes 
{{ObjectInputFilter.Config.setFilter(...)}} directly.

3) The user is using a version of Java 8 prior to 8u121 (the release that first 
added {{sun.misc.ObjectInputFilter}}) and specifies 
{{-Dgeode.enableGlobalSerialFilter=true}}. Also, the same behavior occurs if 
they do NOT specify enabling that property.



  was:
The following error conditions need better handling and should cause the 
startup of a Locator or Server to fail. Without the changes for this ticket, 
Geode will handle errors inconsistently and in most cases will log a statement 
that it could not set the serialization filter and then simply continue running.

1) The user is trying to secure the JVM very thoroughly and accidentally 
specifies both {{-Djdk.serialFilter}} and {{-Dgeode.enableGlobalSerialFilter}}. 

2) The user runs some non-Geode code in the same JVM that invokes 
{{ObjectInputFilter.Config.setFilter(...)}} directly.

3) The user is using a version of Java 8 prior to 8u121 (the release that first 
added {{sun.misc.ObjectInputFilter}}) and specifies 
{{-Dgeode.enableGlobalSerialFilter=true}}. Also, the same behavior occurs if 
they do NOT specify enabling that property.

This should not be thrown unless the system property 
{{geode.enableGlobalSerialFilter=true}} is set.

pre-8u121 JRE throws java.lang.UnsupportedOperationException even when 
geode.enableGlobalSerialFilter is false

{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}



> Startup of Locator or Server should fail fast if 
> geode.enableGlobalSerialFilter is enabled but fails due to configuration error
> -------------------------------------------------------------------------------------------------------------------------------
>
>                 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, pull-request-available
>
> The following error conditions need better handling and should cause the 
> startup of a Locator or Server to fail. Without the changes for this ticket, 
> Geode will handle errors inconsistently and in most cases will log a 
> statement that it could not set the serialization filter and then simply 
> continue running.
> 1) The user is trying to secure the JVM very thoroughly and accidentally 
> specifies both {{-Djdk.serialFilter}} and 
> {{-Dgeode.enableGlobalSerialFilter}}. 
> 2) The user runs some non-Geode code in the same JVM that invokes 
> {{ObjectInputFilter.Config.setFilter(...)}} directly.
> 3) The user is using a version of Java 8 prior to 8u121 (the release that 
> first added {{sun.misc.ObjectInputFilter}}) and specifies 
> {{-Dgeode.enableGlobalSerialFilter=true}}. Also, the same behavior occurs if 
> they do NOT specify enabling that property.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to