Skip to content

SPARK-1877: ClassNotFoundException when loading RDD with serialized obje... - #821

Closed
ghidi wants to merge 2 commits into
apache:masterfrom
ghidi:master
Closed

ghidi wants to merge 2 commits into
apache:masterfrom
ghidi:master

Conversation

@ghidi

@ghidi ghidi commented May 19, 2014

Copy link
Copy Markdown

When I load a RDD that has custom serialized objects, Spark throws ClassNotFoundException. This happens only when Spark is deployed as a standalone cluster, it works fine when Spark is local.

I debugged the issue and I noticed that ObjectInputStream.resolveClass does not use ExecutorURLClassLoader set by SparkSubmit. You have to explicitly set the classloader in SparkContext.objectFile for ObjectInputStream when deserializing objects.

@AmplabJenkins

Copy link
Copy Markdown

Can one of the admins verify this patch?

@mateiz

mateiz commented May 19, 2014

Copy link
Copy Markdown
Contributor

Jenkins, this is ok to test

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished.

@AmplabJenkins

Copy link
Copy Markdown

Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/15086/

@tdas

tdas commented May 19, 2014

Copy link
Copy Markdown
Contributor

Is it possible to give a unit test that highlights this problem? Since it works locally, you can try using "local-cluster" mode (see DistributedSuite if you dont know what it is) to reproduce and test it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you change this to Utils.getContextOrSparkClassLoader? It's not always the case that the context classloader is set, and the utility function deals with that correctly.

@pwendell

Copy link
Copy Markdown
Contributor

LGTM - I pending a small change (we have a utility function to get the classloader).

asfgit pushed a commit that referenced this pull request May 20, 2014
…objects

Updated version of #821

Author: Tathagata Das <tathagata.das1565@gmail.com>
Author: Ghidireac <bogdang@u448a5b0a73d45358d94a.ant.amazon.com>

Closes #835 from tdas/SPARK-1877 and squashes the following commits:

f346f71 [Tathagata Das] Addressed Patrick's comments.
fee0c5d [Ghidireac] SPARK-1877: ClassNotFoundException when loading RDD with serialized objects

(cherry picked from commit 52eb54d)
Signed-off-by: Tathagata Das <tathagata.das1565@gmail.com>
asfgit pushed a commit that referenced this pull request May 20, 2014
…objects

Updated version of #821

Author: Tathagata Das <tathagata.das1565@gmail.com>
Author: Ghidireac <bogdang@u448a5b0a73d45358d94a.ant.amazon.com>

Closes #835 from tdas/SPARK-1877 and squashes the following commits:

f346f71 [Tathagata Das] Addressed Patrick's comments.
fee0c5d [Ghidireac] SPARK-1877: ClassNotFoundException when loading RDD with serialized objects
@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@ghidi

ghidi commented May 20, 2014

Copy link
Copy Markdown
Author

I changed Thread.getContextClassLoader with Utils.getContextOrSparkClassLoader.

@tdas

tdas commented May 20, 2014

Copy link
Copy Markdown
Contributor

Hey @ghidi

Sorry I should have mentioned. In order to speed up the process (so that I can cut another RC for Spark 1.0), I cloned your branch and made the fix myself and merged it. This was the PR #835, it has your commit.

If you dont mind, can you close this PR.

@ghidi ghidi closed this May 20, 2014
@AmplabJenkins

Copy link
Copy Markdown

Merged build finished. All automated tests passed.

@AmplabJenkins

Copy link
Copy Markdown

All automated tests passed.
Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/15105/

pdeyhim pushed a commit to pdeyhim/spark-1 that referenced this pull request Jun 25, 2014
…objects

Updated version of apache#821

Author: Tathagata Das <tathagata.das1565@gmail.com>
Author: Ghidireac <bogdang@u448a5b0a73d45358d94a.ant.amazon.com>

Closes apache#835 from tdas/SPARK-1877 and squashes the following commits:

f346f71 [Tathagata Das] Addressed Patrick's comments.
fee0c5d [Ghidireac] SPARK-1877: ClassNotFoundException when loading RDD with serialized objects
dongjoon-hyun added a commit that referenced this pull request Nov 2, 2026
### What changes were proposed in this pull request?

This PR aims to upgrade FasterXML Jackson to 2.22.4.

### Why are the changes needed?

Jackson 2.22.4 is the latest patch release on the 2.22 line.

- https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.22.4 (2026-10-17)
  - Streaming
    - [#1683](FasterXML/jackson-core#1683) `ReaderBasedJsonParser` accepts lone surrogates in `\uXXXX` escapes in field names
    - [#1744](FasterXML/jackson-core#1744) `UTF8DataInputJsonParser` fails on JSON-escaped surrogate pairs in property names
    - [#1750](FasterXML/jackson-core#1750) `ALLOW_UNESCAPED_CONTROL_CHARS` is ignored for single-quoted string values in UTF-8 byte parsers
    - [#1742](FasterXML/jackson-core#1742), [#1746](FasterXML/jackson-core#1746), [#1756](FasterXML/jackson-core#1756) Non-blocking parser fixes for escaped surrogate pairs, leading decimal point numbers, and multi-byte UTF-8 characters after a backslash escape
    - [#1730](FasterXML/jackson-core#1730) `FilteringGeneratorDelegate` handles embedded objects, typed arrays, and raw/binary values consistently
  - Databind
    - CVE-2026-110879 [#6287](FasterXML/jackson-databind#6287) Validate type parameters and array element types of type ids
    - [#6206](FasterXML/jackson-databind#6206) Report a cycle through a `JsonValue` accessor as a `DatabindException`
    - [#6227](FasterXML/jackson-databind#6227) `BeanDescription.findProperties()` is not thread-safe on a shared, cached instance
    - [#6249](FasterXML/jackson-databind#6249) Avoid an NPE when the parser reports `VALUE_STRING` with null text
  - CBOR
    - CVE-2026-106554 [#821](FasterXML/jackson-dataformats-binary#821) Grow the `CBORParser.TagList` backing array geometrically

`jackson-annotations` stays at 2.22 as referenced by `jackson-bom` 2.22.4.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

Pass the CIs.

### Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Sonnet 5.5

Closes #60004 from dongjoon-hyun/SPARK-60799.

Authored-by: Dongjoon Hyun <dongjoon@apache.org>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants