Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7184951

[macosx] Exception at java.awt.datatransfer on headless mode (only in GUI session)

    Details

    • Subcomponent:
    • Resolved In Build:
      b22
    • CPU:
      generic
    • OS:
      os_x
    • Verification:
      Verified

      Backports

        Description

        FULL PRODUCT VERSION :
        Java(TM) SE Runtime Environment (build 1.7.0_06-ea-b19)
        Java HotSpot(TM) 64-Bit Server VM (build 23.2-b08, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        Darwin macmini-4002-2 11.4.0 Darwin Kernel Version 11.4.0: Mon Apr 9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64

        A DESCRIPTION OF THE PROBLEM :
        1. Try the attached short test in GUI session in headless mode;
        java -Djava.awt.headless=true GetF4NTests
        2. Get the following exception:

        java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:601)
            at sun.awt.datatransfer.DataTransferer$1.run(DataTransferer.java:333)
            at sun.awt.datatransfer.DataTransferer$1.run(DataTransferer.java:299)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.awt.datatransfer.DataTransferer.getInstance(DataTransferer.java:345)
            at java.awt.datatransfer.SystemFlavorMap.parseAndStoreReader(SystemFlavorMap.java:392)
            at java.awt.datatransfer.SystemFlavorMap.initSystemFlavorMap(SystemFlavorMap.java:268)
            at java.awt.datatransfer.SystemFlavorMap.getNativeToFlavor(SystemFlavorMap.java:132)
            at java.awt.datatransfer.SystemFlavorMap.getNativesForFlavor(SystemFlavorMap.java:689)
            at java.awt.datatransfer.SystemFlavorMap.getFlavorsForNative(SystemFlavorMap.java:820)
            at GetF4NTests.SystemFlavorMap0016(GetF4NTests.java:20)
            at GetF4NTests.main(GetF4NTests.java:9)
        Caused by: java.lang.ClassCastException: sun.awt.HeadlessToolkit cannot be cast to sun.lwawt.macosx.LWCToolkit
            at sun.lwawt.macosx.CToolkitThreadBlockedHandler.<init>(CToolkitThreadBlockedHandler.java:31)
            at sun.lwawt.macosx.CDataTransferer.<init>(CDataTransferer.java:230)
            at sun.lwawt.macosx.CDataTransferer.getInstanceImpl(CDataTransferer.java:94)
            ... 15 more
        Exception in thread "main" java.awt.AWTError: Cannot instantiate DataTransferer: sun.lwawt.macosx.CDataTransferer
            at sun.awt.datatransfer.DataTransferer$1.run(DataTransferer.java:336)
            at sun.awt.datatransfer.DataTransferer$1.run(DataTransferer.java:299)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.awt.datatransfer.DataTransferer.getInstance(DataTransferer.java:345)
            at java.awt.datatransfer.SystemFlavorMap.parseAndStoreReader(SystemFlavorMap.java:392)
            at java.awt.datatransfer.SystemFlavorMap.initSystemFlavorMap(SystemFlavorMap.java:268)
            at java.awt.datatransfer.SystemFlavorMap.getNativeToFlavor(SystemFlavorMap.java:132)
            at java.awt.datatransfer.SystemFlavorMap.getNativesForFlavor(SystemFlavorMap.java:689)
            at java.awt.datatransfer.SystemFlavorMap.getFlavorsForNative(SystemFlavorMap.java:820)
            at GetF4NTests.SystemFlavorMap0016(GetF4NTests.java:20)
            at GetF4NTests.main(GetF4NTests.java:9)

        Please note that this test is passed when executed in ssh session.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        Affected tests (JCK-runtime-7):
        api/java_awt/datatransfer/DataFlavor/index.html#rclass[DataFlavor2010]
        api/java_awt/datatransfer/SystemFlavorMap/index.html#GetF4N[SystemFlavorMap0016]
        api/java_awt/datatransfer/SystemFlavorMap/index.html#GetF4N[SystemFlavorMap0018]
        api/java_awt/datatransfer/SystemFlavorMap/index.html#GetF4N[SystemFlavorMap0019]
        api/java_awt/datatransfer/SystemFlavorMap/index.html#SetF4N[SystemFlavorMap0026]
        api/java_awt/datatransfer/SystemFlavorMap/index.html#SetN4F[SystemFlavorMap0029]
        If this is a TCK-RED it MUST be fixed. I've asked for JCK (Leonid) to wrk with engineering ASAP - to further evaluate

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  kizune Alexander Zuev
                  Reporter:
                  tledkov Taras Ledkov (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: