Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7083712

Main agent fails to start with exception on Java SE 7.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1 P1
    • jt4.5
    • jt4.4
    • tools
    • b04
    • x86
    • windows_2000
    • Verified

      When agent is trying to start it fails with exception:
      Exception in thread "Agent164" THREAD Agent725 STARTED com.sun.javatest.agent.Agent$1java.lang.NoClassDefFoundError: Could not initialize class java.net.SocksSocketImpl

      This exception caused by security exception thrown by own JavaTest security manager since PlainSocketImpl class in Java SE 7 tries to read system properties in privilige block. But JavaTest denies this for all security domains, not only for tests classes.
      Fix failed because:

      Without option -Djavatest.security.allowPropertiesAccess=true all tests fail in MultiJVM group mode with the following error:
      java.lang.NoClassDefFoundError: Could not initialize class java.net.SocksSocketImpl
      at java.net.ServerSocket.setImpl(ServerSocket.java:289)
      at java.net.ServerSocket.<init>(ServerSocket.java:230)
      at java.net.ServerSocket.<init>(ServerSocket.java:128)
      at com.sun.jck.lib.multijvm.group.TaskManager.run(TaskManager.java:151)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)
      or with the following exception:
      java.lang.ExceptionInInitializerError
      at java.net.ServerSocket.setImpl(ServerSocket.java:289)
      at java.net.ServerSocket.<init>(ServerSocket.java:230)
      at java.net.ServerSocket.<init>(ServerSocket.java:128)
      at com.sun.jck.lib.multijvm.group.TaskManager.run(TaskManager.java:151)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)
      Caused by: java.lang.SecurityException: Action forbidden by JavaTest Harness: checkPropertiesAccess
      at com.sun.javatest.JavaTestSecurityManager.checkPropertiesAccess(JavaTestSecurityManager.java:135)
      at java.lang.System.getProperties(System.java:622)
      at java.net.PlainSocketImpl$1.run(PlainSocketImpl.java:62)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.PlainSocketImpl.<clinit>(PlainSocketImpl.java:58)
      ... 7 more
      Tests pass in MultiJVM mode. Tests also pass in MultiJVM group mode if option is specified.

      Passive agent:
      java.lang.NoClassDefFoundError: Could not initialize class java.net.SocksSocketImpl
         at java.net.Socket.setImpl(Socket.java:493)
         at java.net.Socket.<init>(Socket.java:414)
         at java.net.Socket.<init>(Socket.java:208)
         at com.sun.javatest.agent.SocketConnection.<init>(SocketConnection.java:91)
         at com.sun.javatest.agent.InterruptableSocketConnection.<init>(InterruptableSocketConnection.java:40)
         at com.sun.javatest.agent.AgentManager.connectToPassiveAgent(AgentManager.java:210)
         at com.sun.javatest.agent.AgentManager.connectToPassiveAgent(AgentManager.java:190)
         at com.sun.javatest.agent.PassiveAgentCommand.run(PassiveAgentCommand.java:119)
         at com.sun.javatest.Script.invokeClass(Script.java:1091)
         at com.sun.javatest.Script.invokeCommand(Script.java:1002)
         at com.sun.jck.lib.IntermediateScript.invokeCommand(IntermediateScript.java:110)
         at com.sun.javatest.Script.execute(Script.java:893)
         at com.sun.jck.lib.JCKScript.runRuntimeTest(JCKScript.java:707)
         at com.sun.jck.lib.JCKScript.run(JCKScript.java:139)
         at com.sun.javatest.Script.run(Script.java:228)
         at com.sun.jck.lib.IntermediateScript.run(IntermediateScript.java:223)
         at com.sun.javatest.DefaultTestRunner.runTest(DefaultTestRunner.java:174)
         at com.sun.javatest.DefaultTestRunner.access$100(DefaultTestRunner.java:43)
         at com.sun.javatest.DefaultTestRunner$1.run(DefaultTestRunner.java:66)

      Active agent:
      Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not
      initialize class java.net.SocksSocketImpl
             at java.net.ServerSocket.setImpl(ServerSocket.java:289)
             at java.net.ServerSocket.<init>(ServerSocket.java:230)
             at java.net.ServerSocket.<init>(ServerSocket.java:181)
             at com.sun.javatest.agent.SocketConnection.createServerSocket(SocketConn
      ection.java:226)
             at com.sun.javatest.agent.SocketConnection.createServerSocket(SocketConn
      ection.java:204)
             at com.sun.javatest.agent.ActiveAgentPool.setListening(ActiveAgentPool.j
      ava:493)
             at com.sun.javatest.agent.AgentMonitorTool$AgentPoolSubpanel.itemStateCh
      anged(AgentMonitorTool.java:235)
             at javax.swing.AbstractButton.fireItemStateChanged(AbstractButton.java:2
      046)
             at javax.swing.AbstractButton$Handler.itemStateChanged(AbstractButton.ja
      va:2348)
             at javax.swing.DefaultButtonModel.fireItemStateChanged(DefaultButtonMode
      l.java:455)
             at javax.swing.JToggleButton$ToggleButtonModel.setSelected(JToggleButton
      .java:272)
             at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.
      java:289)
             at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonL
      istener.java:252)
             at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:2
      89)
             at java.awt.Component.processMouseEvent(Component.java:6504)
             at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
             at java.awt.Component.processEvent(Component.java:6269)
             at java.awt.Container.processEvent(Container.java:2229)
             at java.awt.Component.dispatchEventImpl(Component.java:4860)
             at java.awt.Container.dispatchEventImpl(Container.java:2287)
             at java.awt.Component.dispatchEvent(Component.java:4686)
             at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832
      )
             at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)

             at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
             at java.awt.Container.dispatchEventImpl(Container.java:2273)
             at java.awt.Window.dispatchEventImpl(Window.java:2713)
             at java.awt.Component.dispatchEvent(Component.java:4686)
             at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)
             at java.awt.EventQueue.access$000(EventQueue.java:101)
             at java.awt.EventQueue$3.run(EventQueue.java:666)
             at java.awt.EventQueue$3.run(EventQueue.java:664)
             at java.security.AccessController.doPrivileged(Native Method)
             at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDo
      main.java:76)
             at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDo
      main.java:87)
             at java.awt.EventQueue$4.run(EventQueue.java:680)
             at java.awt.EventQueue$4.run(EventQueue.java:678)
             at java.security.AccessController.doPrivileged(Native Method)
             at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDo
      main.java:76)
             at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)
             at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
      ad.java:211)
             at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
      java:128)
             at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
      ad.java:117)
             at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)

             at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)

             at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
      Fix failed because without option -Djavatest.security.allowPropertiesAccess=true JavaTest doesn't execute tests. All tests executions result to ERROR with the following output:
      java.lang.ExceptionInInitializerError
      at java.net.ServerSocket.setImpl(ServerSocket.java:288)
      at java.net.ServerSocket.<init>(ServerSocket.java:230)
      at java.net.ServerSocket.<init>(ServerSocket.java:128)
      at com.sun.jck.lib.multijvm.group.TaskManager.run(TaskManager.java:151)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)
      Caused by: java.lang.SecurityException: Action forbidden by JavaTest Harness: checkPropertiesAccess
      at com.sun.javatest.JavaTestSecurityManager.checkPropertiesAccess(JavaTestSecurityManager.java:135)
      at java.lang.System.getProperties(System.java:622)
      at java.net.PlainSocketImpl$1.run(PlainSocketImpl.java:62)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.PlainSocketImpl.<clinit>(PlainSocketImpl.java:58)
      ... 7 more
      result: Error. Unexpected: java.lang.ExceptionInInitializerError

            bkurotsu Brian Kurotsuchi (Inactive)
            alalexee Alexander Alexeev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: