Java3D: Illegal reflective access

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Java3D: Illegal reflective access

Andrew2563
I've been getting the familiar warning:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by javax.media.j3d.JoglPipeline
(file:/D:/jogl/j3dcore.jar) to method sun.awt.AppContext.getAppContext()

I'm running Windows 10 on an Intel Core i5 9300H, with Intel UHD
graphics 630.

OpenGL version: 4.5.0 - Build 25.20.100.6617

 > java --version
java 15.0.1 2020-10-20
Java(TM) SE Runtime Environment (build 15.0.1+9-18)
Java HotSpot(TM) 64-Bit Server VM (build 15.0.1+9-18, mixed mode, sharing)

I'm using the latest  JOGL  (2.4) and Java 3D (1.7).

My Java3D program runs, but there's an additional problem -- the 3D view
is clipped, so that part of the scene is not displayed. This problem
disappears when I switch back to Java 1.6, although I still get the
reflective access warning.

I've tried running JOGL 2.4. on its own with the JOGLQuad.java example,
and it compiles and runs without any problems or warnings.

Any suggestions on fixes?
Reply | Threaded
Open this post in threaded view
|

Re: Java3D: Illegal reflective access

gouessej
Administrator
Hello

Please provide a SSCCE so that we have a chance to reproduce your bug.

As far as I remember, Java3D itself still uses some methods in sun.awt.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Java3D: Illegal reflective access

Jerome
In reply to this post by Andrew2563
Hello Andrew2563 (and everybody)

I have exactly the same problem with the following versions:

  • AdoptOpenJDK 11.0.9+11
  • Java3D-1.7.0
  • JogAmp-2.4.0

    WARNING: An illegal reflective access operation has occurred
    WARNING: Illegal reflective access by org.jogamp.java3d.JoglPipeline (file:/Users/lehuen/Desktop/CodeLab-MacOS-2101111334/ressources/libraries/java3d/j3dcore.jar) to method sun.awt.AppContext.getAppContext()
    WARNING: Please consider reporting this to the maintainers of org.jogamp.java3d.JoglPipeline
    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
    

    Has anyone found a solution to avoid these messages?

    Jerome

  • Reply | Threaded
    Open this post in threaded view
    |

    Re: Java3D: Illegal reflective access

    Jerome
    Good news, I found the solution! While exploring this forum, especially the thread entitled "Where is the latest version of Java3D" I discovered that there was a 1.7.0-final version of Java3D while I had stayed at a 1.7.0-pre1 version. This version fixes the mentioned bug, but also the parameter in processStimulus(Iterator criteria) of the class Behavior, and other little things.

    Thanks for maintaining Java3D!

    Jerome

    Reply | Threaded
    Open this post in threaded view
    |

    Re: Java3D: Illegal reflective access

    gouessej
    Administrator
    A more recent version of Java3D is mentioned in my tutorial:
    http://gouessej.wordpress.com/2012/08/01/java-3d-est-de-retour-java-3d-is-back/

    The only problem is that the latest build doesn't contain the Java documentation of the public APIs but as they haven't changed as far as I know (Phil, can you confirm please?), you can still use the Java documentation of Java3D 1.7.0-pre1 with Java3D 1.7.1.
    Julien Gouesse | Personal blog | Website
    Reply | Threaded
    Open this post in threaded view
    |

    Re: Java3D: Illegal reflective access

    goodwilling
    Using java3D 1.7.1 and JogAmp 2.4.0-rc-20210111, our program works great in both Windows and Linux,
    except the following messages come out in all platforms:

    WARNING: An illegal reflective access operation has occurred
    WARNING: Illegal reflective access by org.jogamp.java3d.JoglPipeline$1 (file: /home/test/lib/j3dcore.jar) to method sun.awt.X11GraphicsDevice.getScreen()
    WARNING: Please consider reporting this to the maintainers of org.jogamp.java3d.JoglPipeline$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

    Using the option --illegal-access=debug, we get the following stacktrace:

    WARNING: Illegal reflective access by org.jogamp.java3d.JoglPipeline$1 (file:/home/test/lib/j3dcore.jar) to method sun.awt.X11GraphicsDevice.getScreen()
            at org.jogamp.java3d.JoglPipeline$1.run(JoglPipeline.java:8601)
            at java.base/java.security.AccessController.doPrivileged(Native Method)
            at org.jogamp.java3d.JoglPipeline.getScreen(JoglPipeline.java:8596)
            at org.jogamp.java3d.Screen3D.<init>(Screen3D.java:354)
            at org.jogamp.java3d.Canvas3D.<init>(Canvas3D.java:1123)
            at org.jogamp.java3d.Canvas3D.<init>(Canvas3D.java:1025)
            at org.jogamp.java3d.Canvas3D.<init>(Canvas3D.java:989)
             ...

    Thank you very much.
    Reply | Threaded
    Open this post in threaded view
    |

    Re: Java3D: Illegal reflective access

    goodwilling
    The above message is removed by the following command option when booting java.  

      --add-exports=java.desktop/sun.awt=ALL-UNNAMED