Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-3903

Netbeans 11.2 fails to detect successful startup of Tomcat 9.0.31

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 11.0, 11.1, 11.2, 11.3
    • 12.0
    • MacOS Catalina 10.15.3
      Netbeans 11.2 (using installer)
      Netbeans 11.0 (using binary download)
      Tomcat 9.0.31 (via brew and binary download)
      Tomcat 8.5.51 (via brew and binary download)

    • Important

    Description

      • Example code - Not applicable 
      • Example project - Not applicable
      • Attachments...
      • Screenshot 1) Console shows success whilst minutes later Netbeans error appears
      • Screenshot 2) Netbeans 11.0 terminal output included and I suspect it the same error in Netbeans 11.2
      • apache-tomcat-9.0.31.zip that includes the tomcat configuration and logs for one attempt of running Tomcat (all looks good here) 
      • netbeans11-2-log for the latest Netbeans 11.2 logs
      • Exact steps 1. Add tomcat server 2. Run tomcat server, 3. Confirm it starts (browser success and console logs success), 4. Minutes later error appears to say "Starting of Tomcat Failed"
      • Actual results - Tomcat should start than then Netbeans would usually deploy the app, but Netbeans fails to detect Tomcat started successfully.  No projects required to recreate this - starting Tomcat up from within the Netbeans IDE shows success in the console <500ms but then reports as failed minutes later
      • Expected results - Netbeans should continue to deploy an application once detecting tomcat has started
      • NetBeans version - Multiple (11.0, 11.2)
      • JDK version JDK 13 Open JDK and Sun JDK
      • OS (Environment) Mac Catalina 10.15.3

      Deeper information follows...

      I installed the pre-requisite Open JDK 13 first.

      I had Netbeans 8.2 running on my iMac and decided to install the latest version of Netbeans on my MacBook Pro running Mac OS Catalina 10.15.3, so I opted for the latest NetBeans 11.2 installer.  

      I was surprised to see no 'customise' option during installation to choose Tomcat (which is what used to happen in Netbeans 8.2).  Once Netbeans 11.2 was running I went to the server tab and added Tomcat 9.0.31 by pointing to the Tomcat brew installation folder and added a private configuration folder, I entered a new user 'ide' and password and ticked the 'Create user if does not exist'.

      I can confirm it created the user in the tomcat-users.xml file correctly.

      ```

      <?xml version="1.0" encoding="UTF-8"?>
      <tomcat-users xmlns="http://tomcat.apache.org/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd">
      <role rolename="manager-script"/>
      <role rolename="manager-gui"/>
      <role rolename="admin"/>
      <user password="password" roles="manager-script,admin,manager-gui" username="ide"/>
      </tomcat-users>

      ```

      When I right-click on the server and choose "Start", or "Start in debug mode" tomcat starts and it is confirmed as starting within 317 milliseconds.

      I can load a browser manually and navigate to http://localhost:8084/manager/status and confirm Tomcat is indeed running.

      ```

      NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
      20-Feb-2020 21:09:28.879 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/9.0.31
      20-Feb-2020 21:09:28.883 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Feb 5 2020 19:32:12 UTC
      20-Feb-2020 21:09:28.883 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.31.0
      20-Feb-2020 21:09:28.883 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Mac OS X
      20-Feb-2020 21:09:28.883 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.15.3
      20-Feb-2020 21:09:28.883 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: x86_64
      20-Feb-2020 21:09:28.883 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home
      20-Feb-2020 21:09:28.883 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 13.0.2+8
      20-Feb-2020 21:09:28.883 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
      20-Feb-2020 21:09:28.884 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /Users/rob/Apache-Tomcat-Netbeans/apache-tomcat-9.0.31
      20-Feb-2020 21:09:28.884 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/local/Cellar/tomcat/9.0.31/libexec
      ... (full details in attachment)
      20-Feb-2020 21:09:29.494 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [317] milliseconds

      ```

      However a few minutes later the IDE reports it has not started Tomcat

      Please note that Netbeans 11.0 also reports the following error, but I just choose to 'Cancel' that.  The error doesn't appear in Netbeans 11.2.

      ```

      "libjnidispatch-440.jnilib" cannot be opened because the developer cannot be verified.

      ```

       

      Things I've tried based on https://stackoverflow.com/questions/22225764/starting-of-tomcat-failed-from-netbeans

      • Changing internet proxy settings -  try in NetBeans choose No Proxy in the Tools -> Options -> General tab.
      • In the server.xml file, in the Connector element for HTTP/1.1, adding the following attribute: server="Apache-Coyote/1.1".- see 
      • Ensuring the manager-script role is declared

      I've also tried in desperation 

      • Various Netbeans versions
      • Various Tomcat versions
      • Running Netbeans from Applications, Downloads, Documents folders
      • OpenJDK (via brew) then Oracle JDK (by uninstalling OpenJDK and using the Oracle JDK 13 installer)
      • Rebooting the Mac 🤷‍♂️
      • Running Netbeans 11.2 as sudo via

      sudo /Applications/NetBeans/Apache\ NetBeans\ 11.2.app/Contents/Resources/NetBeans/netbeans/bin/netbeans

      Suspicions

      • Installed Mac OS fresh with case SenSitiVe filenames - maybe this could upset something?
      • Mac OS Catalina has more security restrictions - maybe it's blocking some sort of file / process ID access
      • Network issue? I've seen reports of needing to bypass the proxy, or ticking the first three proxy settings, I've tried them all
      • When running as Sudo I did see some warnings about reflective access / FileMapStorage

      WARNING: package com.sun.tools.javadoc.main not in jdk.javadoc
      WARNING: An illegal reflective access operation has occurred
      WARNING: Illegal reflective access by org.netbeans.core.output2.FileMapStorage (jar:file:/Applications/NetBeans/Apache%20NetBeans%2011.2.app/Contents/Resources/NetBeans/netbeans/platform/modules/org-netbeans-core-output2.jar!/) to method java.nio.DirectByteBuffer.cleaner()
      WARNING: Please consider reporting this to the maintainers of org.netbeans.core.output2.FileMapStorage
      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

      Because NetBeans 11.0 runs with the terminal open (full logs uploaded) I can see errors relating to MonitorSupport and DebugSupport and synchronizeMonitorWithFlag smells like the reason why Netbeans can't detect Tomcat has actually run successfully.

      Here's an excerpt

      ```

      INFO [org.netbeans.modules.tomcat5.optional.MonitorSupport]
      java.lang.Exception: tomcat90:home=/usr/local/Cellar/tomcat/9.0.31/libexec:base=/Users/rob/Apache-Tomcat-Netbeans/apache-tomcat-9.0.31
      at org.netbeans.modules.tomcat5.optional.MonitorSupport.synchronizeMonitorWithFlag(MonitorSupport.java:109)
      at org.netbeans.modules.tomcat5.optional.StartTomcat$StartRunnable.run(StartTomcat.java:315)
      at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
      at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
      at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
      at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
      INFO [org.netbeans.modules.tomcat5.optional.DebugSupport]
      java.lang.Exception: tomcat90:home=/usr/local/Cellar/tomcat/9.0.31/libexec:base=/Users/rob/Apache-Tomcat-Netbeans/apache-tomcat-9.0.31
      at org.netbeans.modules.tomcat5.optional.DebugSupport.allowDebugging(DebugSupport.java:58)
      at org.netbeans.modules.tomcat5.optional.StartTomcat$StartRunnable.run(StartTomcat.java:332)
      at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
      at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
      at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
      at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)

      ```

       

      Attachments

        1. org-netbeans-modules-tomcat5.jar
          1.08 MB
          Nam Nguyen
        2. netbeans11-2-log.zip
          23 kB
          Rob
        3. apache-tomcat-9.0.31.zip
          86 kB
          Rob
        4. Netbeans11.0-terminal-output.log
          88 kB
          Rob
        5. Screenshot 2020-02-20 at 21.17.36.png
          438 kB
          Rob

        Issue Links

          Activity

            People

              bitsink Nam Nguyen
              devologyrob Rob
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m