Skip to content
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

Issues with some JDK version #3

Open
sfc-gh-mrojas opened this issue Mar 30, 2023 · 3 comments
Open

Issues with some JDK version #3

sfc-gh-mrojas opened this issue Mar 30, 2023 · 3 comments
Assignees

Comments

@sfc-gh-mrojas
Copy link
Collaborator

When testing with some JDK version I encountered an issue getting:

Exception in thread "main" java.lang.IllegalAccessError: class com.snowflake.snowpark.internal.UDFClassPath$ (in unnamed module @0x4bd4bcd4) cannot access class [sun.net](http://sun.net/).www.ParseUtil (in module java.base) because module java.base does not export sun.net.www to unnamed module @0x4bd4bcd4

This issues has been detected before:
https://community.snowflake.com/s/article/JDBC-Driver-Compatibility-Issue-With-JDK-16-and-Later

@sfc-gh-jfreeberg
Copy link
Collaborator

Following up on our conversation....

  • Which JDK vendor and version was this?
  • Was this thrown at build time or run time?

Maybe we can set up a fork of this template with the offending JDK and engineering can use that as the repro?

@sfc-gh-jfreeberg sfc-gh-jfreeberg self-assigned this Apr 3, 2023
@sfc-gh-mrojas
Copy link
Collaborator Author

sfc-gh-mrojas commented Apr 4, 2023

@sfc-gh-jfreeberg This is the configuration I have:

/workspaces/snowpark-scala-template (main) $ mvn -version
Apache Maven 3.9.0 (9b58d2bad23a66be161c4664ef21ce219c2c8584)
Maven home: /usr/local/sdkman/candidates/maven/current
Java version: 11.0.18, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-1105-azure", arch: "amd64", family: "unix"
/workspaces/snowpark-scala-template (main) $ uname -a
Linux codespaces-bda58f 5.4.0-1105-azure #111~18.04.1-Ubuntu SMP Fri Mar 3 22:47:43 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
/workspaces/snowpark-scala-template (main) $ mvn clean compile package
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------< org.example:template-scala >---------------------
[INFO] Building Scala project template for Snowflake 1
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- clean:3.2.0:clean (default-clean) @ template-scala ---
[INFO] Deleting /workspaces/snowpark-scala-template/target
[INFO] 
[INFO] --- resources:3.3.0:resources (default-resources) @ template-scala ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /workspaces/snowpark-scala-template/src/main/resources
[INFO] 
[INFO] --- compiler:3.10.1:compile (default-compile) @ template-scala ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- scala:3.3.2:compile (default) @ template-scala ---
[INFO] /workspaces/snowpark-scala-template/src/main/scala:-1: info: compiling
[INFO] /workspaces/snowpark-scala-template/target/generated-sources/annotations:-1: info: compiling
[INFO] Compiling 3 source files to /workspaces/snowpark-scala-template/target/classes at 1680617605340
[INFO] prepare-compile in 0 s
[INFO] compile in 5 s
[INFO] 
[INFO] --- resources:3.3.0:resources (default-resources) @ template-scala ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /workspaces/snowpark-scala-template/src/main/resources
[INFO] 
[INFO] --- compiler:3.10.1:compile (default-compile) @ template-scala ---
[INFO] Changes detected - recompiling the module!
[INFO] 
[INFO] --- scala:3.3.2:compile (default) @ template-scala ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- resources:3.3.0:testResources (default-testResources) @ template-scala ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /workspaces/snowpark-scala-template/src/test/resources
[INFO] 
[INFO] --- compiler:3.10.1:testCompile (default-testCompile) @ template-scala ---
[INFO] Changes detected - recompiling the module!
[INFO] 
[INFO] --- scala:3.3.2:testCompile (default) @ template-scala ---
[INFO] /workspaces/snowpark-scala-template/src/test/scala:-1: info: compiling
[INFO] /workspaces/snowpark-scala-template/target/generated-test-sources/test-annotations:-1: info: compiling
[INFO] Compiling 2 source files to /workspaces/snowpark-scala-template/target/test-classes at 1680617610607
[INFO] prepare-compile in 0 s
[INFO] compile in 4 s
[INFO] 
[INFO] --- surefire:3.0.0-M8:test (default-test) @ template-scala ---
[INFO] Using auto detected provider org.apache.maven.surefire.junit.JUnit3Provider
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.example.function.ExampleFunctionTest
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.177 s - in org.example.function.ExampleFunctionTest
[INFO] Running org.example.procedure.AppTest
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in org.example.procedure.AppTest
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- scalatest:2.0.0:test (test) @ template-scala ---
Discovery starting.
[ScalaTest-main] INFO com.snowflake.snowpark.Session - Closing stderr and redirecting to stdout
[ScalaTest-main] INFO com.snowflake.snowpark.Session - Done closing stderr and redirecting to stdout
[ScalaTest-main] INFO com.snowflake.snowpark.internal.ParameterUtils - set JDBC client memory limit to 10240
Discovery completed in 3 seconds, 168 milliseconds.
Run starting. Expected test count is: 1
ExampleFunctionTest:
ExampleFunction
- should return the concatenated string
AppTest:
org.example.procedure.AppTest *** ABORTED ***
  java.lang.RuntimeException: Unable to load a Suite class org.example.procedure.AppTest that was discovered in the runpath: class com.snowflake.snowpark.internal.UDFClassPath$ (in unnamed module @0x37ea6c0f) cannot access class sun.net.www.ParseUtil (in module java.base) because module java.base does not export sun.net.www to unnamed module @0x37ea6c0f
  at org.scalatest.tools.DiscoverySuite$.getSuiteInstance(DiscoverySuite.scala:80)
  at org.scalatest.tools.DiscoverySuite.$anonfun$nestedSuites$1(DiscoverySuite.scala:38)
  at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286)
  at scala.collection.Iterator.foreach(Iterator.scala:943)
  at scala.collection.Iterator.foreach$(Iterator.scala:943)
  at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
  at scala.collection.IterableLike.foreach(IterableLike.scala:74)
  at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
  at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
  at scala.collection.TraversableLike.map(TraversableLike.scala:286)
  ...
  Cause: java.lang.IllegalAccessError: class com.snowflake.snowpark.internal.UDFClassPath$ (in unnamed module @0x37ea6c0f) cannot access class sun.net.www.ParseUtil (in module java.base) because module java.base does not export sun.net.www to unnamed module @0x37ea6c0f
  at com.snowflake.snowpark.internal.UDFClassPath$.$anonfun$getPathUsingClassLoader$1(UDFClassPath.scala:101)
  at scala.Option.map(Option.scala:230)
  at com.snowflake.snowpark.internal.UDFClassPath$.getPathUsingClassLoader(UDFClassPath.scala:89)
  at com.snowflake.snowpark.internal.UDFClassPath$.getPathForClass(UDFClassPath.scala:72)
  at com.snowflake.snowpark.internal.UDFClassPath$.<init>(UDFClassPath.scala:23)
  at com.snowflake.snowpark.internal.UDFClassPath$.<clinit>(UDFClassPath.scala)
  at com.snowflake.snowpark.Session.sessionInfo$lzycompute(Session.scala:86)
  at com.snowflake.snowpark.Session.sessionInfo(Session.scala:76)
  at com.snowflake.snowpark.Session$.com$snowflake$snowpark$Session$$setActiveSession(Session.scala:1195)
  at com.snowflake.snowpark.Session$SessionBuilder.createInternal(Session.scala:1327)
  ...
*** RUN ABORTED ***
  java.lang.IllegalAccessError: class com.snowflake.snowpark.internal.UDFClassPath$ (in unnamed module @0x37ea6c0f) cannot access class sun.net.www.ParseUtil (in module java.base) because module java.base does not export sun.net.www to unnamed module @0x37ea6c0f
  at com.snowflake.snowpark.internal.UDFClassPath$.$anonfun$getPathUsingClassLoader$1(UDFClassPath.scala:101)
  at scala.Option.map(Option.scala:230)
  at com.snowflake.snowpark.internal.UDFClassPath$.getPathUsingClassLoader(UDFClassPath.scala:89)
  at com.snowflake.snowpark.internal.UDFClassPath$.getPathForClass(UDFClassPath.scala:72)
  at com.snowflake.snowpark.internal.UDFClassPath$.<init>(UDFClassPath.scala:23)
  at com.snowflake.snowpark.internal.UDFClassPath$.<clinit>(UDFClassPath.scala)
  at com.snowflake.snowpark.Session.sessionInfo$lzycompute(Session.scala:86)
  at com.snowflake.snowpark.Session.sessionInfo(Session.scala:76)
  at com.snowflake.snowpark.Session$.com$snowflake$snowpark$Session$$setActiveSession(Session.scala:1195)
  at com.snowflake.snowpark.Session$SessionBuilder.createInternal(Session.scala:1327)
  ...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  17.675 s
[INFO] Finished at: 2023-04-04T14:13:41Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.scalatest:scalatest-maven-plugin:2.0.0:test (test) on project template-scala: There are test failures -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

@sfc-gh-mrojas
Copy link
Collaborator Author

sfc-gh-mrojas commented Apr 4, 2023

I just tried out with a devcontainers config. and it works.

// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/java
{
	"name": "Java",
	// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
	"image": "mcr.microsoft.com/devcontainers/java:0-11",
	"features": {
		"ghcr.io/devcontainers/features/java:1": {
			"version": "none",
			"installMaven": "true",
			"installGradle": "false"
		}
	}
}

So it seems like when JDK 17 is also installed there might be some issues.

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

No branches or pull requests

2 participants