glassfish
  1. glassfish
  2. GLASSFISH-14951

Glassfish 2.1.1Patch8 Cluster profile to Glassfish 3.1 Upgrade gives NullPointerException

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 3.1_b31
    • Fix Version/s: 3.1_ms07
    • Component/s: upgrade_tool
    • Labels:
      None
    • Environment:

      Redhat Enterprise Linux Server 5.3 ( Linux 5)

      Description

      Redhat Enterprise Linux Server 5.3 ( Linux 5)

      Steps to reproduce:
      1)Install glassfish v2.1.1 Patch8.
      2) Start the domain and the database
      3)create a node agent, and two instance.
      4) Deploy some applications.
      5)install 3.1 B31 nightly build ( glassfish-3.1-b31-11_19_2010.zip)
      6)cd to glassfish3/glassfish/bin and execute
      ./asupgrade --source ../../../v211p8/asb1/domains/domain1
      Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
      at com.sun.enterprise.tools.upgrade.common.VersionExtracter.extractVersionFromConfigFile(VersionExtracter.java:100)
      at com.sun.enterprise.tools.upgrade.common.SourceAppSrvObj.getVersionEdition(SourceAppSrvObj.java:72)
      at com.sun.enterprise.tools.upgrade.common.BaseDomainInfoObj.getVersion(BaseDomainInfoObj.java:112)
      at com.sun.enterprise.tools.upgrade.common.CommonInfoModel.isUpgradeSupported(CommonInfoModel.java:109)
      at com.sun.enterprise.tools.upgrade.gui.MainFrame.processArguments(MainFrame.java:437)
      at com.sun.enterprise.tools.upgrade.gui.MainFrame.nextButtonActionPerformed(MainFrame.java:307)
      at com.sun.enterprise.tools.upgrade.gui.MainFrame.access$200(MainFrame.java:77)
      at com.sun.enterprise.tools.upgrade.gui.MainFrame$3.actionPerformed(MainFrame.java:181)
      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
      at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
      at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
      at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
      at java.awt.Component.processMouseEvent(Component.java:6263)
      at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
      at java.awt.Component.processEvent(Component.java:6028)
      at java.awt.Container.processEvent(Container.java:2041)
      at java.awt.Component.dispatchEventImpl(Component.java:4630)
      at java.awt.Container.dispatchEventImpl(Container.java:2099)
      at java.awt.Component.dispatchEvent(Component.java:4460)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
      at java.awt.Container.dispatchEventImpl(Container.java:2085)
      at java.awt.Window.dispatchEventImpl(Window.java:2478)
      at java.awt.Component.dispatchEvent(Component.java:4460)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
      [root@ejp-172x-154 bin]# java -version
      java version "1.6.0_20"
      Java(TM) SE Runtime Environment (build 1.6.0_20-b02)

      When this happens asupgrade does nothing.
      the domain1 dir is moved to domain1.original, No server.log is generated.

      1. server-start-domain--upgrade-domain1.log
        173 kB
        sss150302
      2. server-with-new-upgrade-tool-jar.log
        529 kB
        sss150302

        Activity

        Hide
        sss150302 added a comment -

        server.log with new upgrade-too.jar and " asadmin start-domain --upgrade domain1"

        Show
        sss150302 added a comment - server.log with new upgrade-too.jar and " asadmin start-domain --upgrade domain1"
        Hide
        Bobby Bissett added a comment -

        "Domain is not started with "asadmin start-domain --upgrade domain1" command "

        That's right. Doing this performs the upgrade and then the server is shut down. Server log looked normal to me, but you haven't tried the new upgrade-tool.jar file I attached.

        You need to run asupgrade to run the upgrade tool. Running asadmin manually is a workaround for if the tool has a bug. Again, the tool does NOT perform upgrades – it just collects data from the user and then runs asadmin.

        Show
        Bobby Bissett added a comment - "Domain is not started with "asadmin start-domain --upgrade domain1" command " That's right. Doing this performs the upgrade and then the server is shut down. Server log looked normal to me, but you haven't tried the new upgrade-tool.jar file I attached. You need to run asupgrade to run the upgrade tool. Running asadmin manually is a workaround for if the tool has a bug. Again, the tool does NOT perform upgrades – it just collects data from the user and then runs asadmin.
        Hide
        sss150302 added a comment -

        I have tried the new upgrade-tool.jar.
        I could start the domain after asadmin start-domain --upgrade domain1 normally
        All the deployed applications worked fine after domain startup.

        Show
        sss150302 added a comment - I have tried the new upgrade-tool.jar. I could start the domain after asadmin start-domain --upgrade domain1 normally All the deployed applications worked fine after domain startup.
        Hide
        Bobby Bissett added a comment -

        No you DID NOT try the new upgrade tool jar if you ran "asadmin start-domain --upgrade"

        If you don't believe me, delete the jar and run asadmin again.

        Here's a recap of what happens:
        1) you run asupgrade
        2) the asupgrade script runs an upgrade tool inside upgrade-tool.jar
        3) the upgrade tool runs "asadmin start-domain --upgrade" to perform the upgrade
        4) asadmin exits after the upgrade
        5) the upgrade tool says the upgrade is finished
        6) you can then start the domain normally with asadmin

        If you start with step 3 and run the upgrade manually, you are not using any code in upgrade-tool.jar. I told you how to do the upgrade manually so you wouldn't be blocked by a bug in the tool.

        Show
        Bobby Bissett added a comment - No you DID NOT try the new upgrade tool jar if you ran "asadmin start-domain --upgrade" If you don't believe me, delete the jar and run asadmin again. Here's a recap of what happens: 1) you run asupgrade 2) the asupgrade script runs an upgrade tool inside upgrade-tool.jar 3) the upgrade tool runs "asadmin start-domain --upgrade" to perform the upgrade 4) asadmin exits after the upgrade 5) the upgrade tool says the upgrade is finished 6) you can then start the domain normally with asadmin If you start with step 3 and run the upgrade manually, you are not using any code in upgrade-tool.jar. I told you how to do the upgrade manually so you wouldn't be blocked by a bug in the tool.
        Hide
        Bobby Bissett added a comment -

        I haven't recreated the original failure, but I can see how it would happen if the domain.xml file in the source domain could not be read for some reason. I've committed code in revision 43542 to handle this.

        Now, if there's an error like not having the right permissions on domain.xml to parse it, the upgrade log will contain:

        Could not create xml document object from file name /Users/bobby/work/gfv2/dev/glassfish/domains/domain1/config/domain.xml due to: java.io.FileNotFoundException: /Users/bobby/work/gfv2/dev/glassfish/domains/domain1/config/domain.xml (Permission denied)

        If there is some problem in the xml itself, this will come out in the log:

        Could not create xml document object from file name /Users/bobby/work/gfv2/dev/glassfish/domains/domain1/config/domain.xml due to: org.xml.sax.SAXParseException: Content is not allowed in prolog.

        Before, any errors like these were being ignored and then an NPE resulted by trying to parse a non-existent xml Document object. Let me know if you're seeing any other troubles.

        Show
        Bobby Bissett added a comment - I haven't recreated the original failure, but I can see how it would happen if the domain.xml file in the source domain could not be read for some reason. I've committed code in revision 43542 to handle this. Now, if there's an error like not having the right permissions on domain.xml to parse it, the upgrade log will contain: Could not create xml document object from file name /Users/bobby/work/gfv2/dev/glassfish/domains/domain1/config/domain.xml due to: java.io.FileNotFoundException: /Users/bobby/work/gfv2/dev/glassfish/domains/domain1/config/domain.xml (Permission denied) If there is some problem in the xml itself, this will come out in the log: Could not create xml document object from file name /Users/bobby/work/gfv2/dev/glassfish/domains/domain1/config/domain.xml due to: org.xml.sax.SAXParseException: Content is not allowed in prolog. Before, any errors like these were being ignored and then an NPE resulted by trying to parse a non-existent xml Document object. Let me know if you're seeing any other troubles.

          People

          • Assignee:
            Bobby Bissett
            Reporter:
            sss150302
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: