Skip to content

[Test] Better exception message from SparkSubmitSuite #3212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

andrewor14
Copy link
Contributor

Before:

Exception in thread "main" java.lang.Exception: Could not load user defined classes inside of executors
    at org.apache.spark.deploy.JarCreationTest$.main(SparkSubmitSuite.scala:471)
    at org.apache.spark.deploy.JarCreationTest.main(SparkSubmitSuite.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

After:

Exception in thread "main" java.lang.Exception: Could not load user class from jar:
java.lang.UnsupportedClassVersionError: SparkSubmitClassA : Unsupported major.minor version 51.0
    java.lang.ClassLoader.defineClass1(Native Method)
    java.lang.ClassLoader.defineClass(ClassLoader.java:643)
    ...
    at org.apache.spark.deploy.JarCreationTest$.main(SparkSubmitSuite.scala:472)
    at org.apache.spark.deploy.JarCreationTest.main(SparkSubmitSuite.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

@SparkQA
Copy link

SparkQA commented Nov 11, 2014

Test build #23224 has started for PR 3212 at commit 7779248.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Nov 11, 2014

Test build #23224 has finished for PR 3212 at commit 7779248.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • throw new Exception("Could not load user class from jar: " + result(0))

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/23224/
Test PASSed.

if (result.contains(false)) {
throw new Exception("Could not load user defined classes inside of executors")
if (result.nonEmpty) {
throw new Exception("Could not load user class from jar:\n" + result(0))
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @andrewor14 , only show one class not found? Is it better to show all classes not found when there are more than one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The exception is likely the same anyway. It'll be very verbose if we include all of them.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, the two classes are the same, I missed that :(

@andrewor14
Copy link
Contributor Author

Merging into master and 1.2

@asfgit asfgit closed this in 6e3c5a2 Nov 12, 2014
asfgit pushed a commit that referenced this pull request Nov 12, 2014
Before:
```
Exception in thread "main" java.lang.Exception: Could not load user defined classes inside of executors
	at org.apache.spark.deploy.JarCreationTest$.main(SparkSubmitSuite.scala:471)
	at org.apache.spark.deploy.JarCreationTest.main(SparkSubmitSuite.scala)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
```
After:
```
Exception in thread "main" java.lang.Exception: Could not load user class from jar:
java.lang.UnsupportedClassVersionError: SparkSubmitClassA : Unsupported major.minor version 51.0
	java.lang.ClassLoader.defineClass1(Native Method)
	java.lang.ClassLoader.defineClass(ClassLoader.java:643)
	...
	at org.apache.spark.deploy.JarCreationTest$.main(SparkSubmitSuite.scala:472)
	at org.apache.spark.deploy.JarCreationTest.main(SparkSubmitSuite.scala)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
```

Author: Andrew Or <andrew@databricks.com>

Closes #3212 from andrewor14/submit-suite-message and squashes the following commits:

7779248 [Andrew Or] Format exception
8fe6719 [Andrew Or] Better exception message from failed test

(cherry picked from commit 6e3c5a2)
Signed-off-by: Andrew Or <andrew@databricks.com>
@andrewor14 andrewor14 deleted the submit-suite-message branch November 13, 2014 01:25
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.

4 participants