JDK-8343124 : Tests fails with java.lang.IllegalAccessException: class com.sun.javatest.regtest.agent.MainWrapper$MainTask cannot access
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 8,23,24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2024-10-28
  • Updated: 2025-04-21
  • Resolved: 2024-11-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 17 JDK 21 JDK 24 JDK 8
11.0.28-oracleFixed 17.0.16-oracleFixed 21.0.8-oracleFixed 24 b23Fixed 8u461Fixed
Related Reports
Duplicate :  
Relates :  
Description
Following two test fails with 
open/test/jdk/java/awt/print/Dialog/PrintDlgPageable.java
open/test/jdk/javax/print/StreamPrintingOrientation.java
test/jdk/javax/print/URLGIFPrinting.java


----------System.err:(11/874)----------
java.lang.IllegalAccessException: class com.sun.javatest.regtest.agent.MainWrapper$MainTask cannot access a member of class PrintDlgPageable with modifiers "public static"
	at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:401)
	at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:692)
	at java.base/java.lang.reflect.Method.invoke(Method.java:563)
	at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
	at java.base/java.lang.Thread.run(Thread.java:1491)


This two tests is not a public class & when I added public the test passes
Comments
Fix request [21u,17u] I backport this for parity with 21.0.8-oracle,17.0.16-oracle. No risk, only a test change. Clean backport. Tests pass. SAP nightly testing passed.
17-04-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk17u-dev/pull/3504 Date: 2025-04-16 13:40:04 +0000
16-04-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk21u-dev/pull/1666 Date: 2025-04-16 13:39:49 +0000
16-04-2025

The problem with the javax/print/URLGIFPrinting.java test is resolved by JDK-8346837.
20-01-2025

Changeset: dafa2e55 Branch: master Author: Prasanta Sadhukhan <psadhukhan@openjdk.org> Date: 2024-11-05 06:27:42 +0000 URL: https://git.openjdk.org/jdk/commit/dafa2e55adb6b054c342d5e723e51087d771e6d6
05-11-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/21780 Date: 2024-10-30 02:50:08 +0000
30-10-2024

Possibly older versions of jtreg simply made it accessible. We should make the classes public. Also these should have @key printer. FWIW I think the StreamPrinting test could be automated ( I have not looked at the other two) Generate the stream twice - once in landscape, once in portrait, and they should differ. For extra credit you should verify the difference. Here you can see that the tx is rotated. diff stream_portrait.ps stream_landscape.ps 78c78 < [4.1666665 0.0 0.0 4.1666665 300.0 300.0] concat --- > [0.0 -4.1666665 4.1666665 0.0 300.0 3000.0] concat this part below is setting the clip 81,83c81,83 < 468.0 0.0 L < 468.0 648.0 L < 0.0 648.0 L --- > 648.0 0.0 L > 648.0 468.0 L > 0.0 468.0 L
29-10-2024