ThomasJaspers/java-junit-sample

CustomerServiceTest.java:[9,30] package com.sun.jndi.cosnaming does not exist

Opened this issue · 0 comments

java -version

openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.18.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.18.04, mixed mode, sharing)

mvn -v

Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 11.0.11, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-19041-microsoft", arch: "amd64", family: "unix"

mvn clean compile

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------< de.codecentric.sample:junitsample >------------------
[INFO] Building junitsample 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ junitsample ---
[INFO] Deleting /home/apatsev/github/java-junit-sample/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ junitsample ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/apatsev/github/java-junit-sample/src/main/resources
[INFO] skip non existing resourceDirectory /home/apatsev/github/java-junit-sample/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ junitsample ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 11 source files to /home/apatsev/github/java-junit-sample/target/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.692 s
[INFO] Finished at: 2021-11-17T14:39:39+06:00

mvn clean test

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------< de.codecentric.sample:junitsample >------------------
[INFO] Building junitsample 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ junitsample ---
[INFO] Deleting /home/apatsev/github/java-junit-sample/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ junitsample ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/apatsev/github/java-junit-sample/src/main/resources
[INFO] skip non existing resourceDirectory /home/apatsev/github/java-junit-sample/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ junitsample ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 11 source files to /home/apatsev/github/java-junit-sample/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ junitsample ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/apatsev/github/java-junit-sample/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ junitsample ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to /home/apatsev/github/java-junit-sample/target/test-classes
[INFO] -------------------------------------------------------------
[WARNING] COMPILATION WARNING : 
[INFO] -------------------------------------------------------------
[WARNING] /home/apatsev/github/java-junit-sample/src/test/java/com/codecentric/sample/store/service/ItemServiceTest.java: /home/apatsev/github/java-junit-sample/src/test/java/com/codecentric/sample/store/service/ItemServiceTest.java uses unchecked or unsafe operations.
[WARNING] /home/apatsev/github/java-junit-sample/src/test/java/com/codecentric/sample/store/service/ItemServiceTest.java: Recompile with -Xlint:unchecked for details.
[INFO] 2 warnings 
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/apatsev/github/java-junit-sample/src/test/java/com/codecentric/sample/store/service/CustomerServiceTest.java:[9,30] package com.sun.jndi.cosnaming does not exist
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.916 s
[INFO] Finished at: 2021-11-17T14:40:43+06:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project junitsample: Compilation failure
[ERROR] /home/apatsev/github/java-junit-sample/src/test/java/com/codecentric/sample/store/service/CustomerServiceTest.java:[9,30] package com.sun.jndi.cosnaming does not exist
[ERROR] 
[ERROR] -> [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