glassfish
  1. glassfish
  2. GLASSFISH-16703

Admin console-deployed life-cycle module triggers a NumberFormatException

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1.1_dev
    • Component/s: lifecycle_modules
    • Labels:
      None

      Description

      Deploying a simple lifecycle module with the admin console without filling out "Load Order" and using an absolute classpath to the JAR triggers the following exception on startup of the server once it has been registered :

      SEVERE: java.lang.NumberFormatException: For input string: ""
      at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
      at java.lang.Integer.parseInt(Integer.java:470)
      at java.lang.Integer.parseInt(Integer.java:499)
      at com.sun.enterprise.v3.server.LifecycleModuleService.onInitialization(LifecycleModuleService.java:163)
      at com.sun.enterprise.v3.server.LifecycleModuleService.postConstruct(LifecycleModuleService.java:106)
      at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
      at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
      at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
      at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
      at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
      at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
      at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:243)
      at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:135)
      at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
      at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
      at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)

      While this does not prevent the server from starting or the lifecycle module from being registered, an additional check should be made to avoid empty strings in ServerTags.LOAD_ORDER and com/sun/enterprise/v3/server/LifecycleModuleService.java:163 should probably read :
      if (strOrder != null && strOrder.length() > 0) {

      Having an empty property rather than no property may be related to how the admin console translates the empty "Load Order: " field.
      Nonetheless the backend should be made more robust.

        Activity

        Hide
        Alexis MP added a comment -

        sample Lifecycle module

        Show
        Alexis MP added a comment - sample Lifecycle module
        Hide
        Hong Zhang added a comment -

        Yes, good point. Will use the suggestion to make this code more robust.

        Show
        Hong Zhang added a comment - Yes, good point. Will use the suggestion to make this code more robust.
        Hide
        Hong Zhang added a comment -

        Why fix this issue in 3.1.1?
        To make lifecycle module creation code more robust.

        Which is the targeted build of 3.1.1 for this fix?
        3.1.1_b06.

        Do regression tests exist for this issue?
        Manual test will be run to verify this admin console use case.

        Which tests should QA (re)run to verify the fix did not destabilize GlassFish?
        Lifecycle module related tests. The change has very small risk.

        Show
        Hong Zhang added a comment - Why fix this issue in 3.1.1? To make lifecycle module creation code more robust. Which is the targeted build of 3.1.1 for this fix? 3.1.1_b06. Do regression tests exist for this issue? Manual test will be run to verify this admin console use case. Which tests should QA (re)run to verify the fix did not destabilize GlassFish? Lifecycle module related tests. The change has very small risk.
        Hide
        scatari added a comment -

        Approved for 3.1.1.

        Show
        scatari added a comment - Approved for 3.1.1.
        Hide
        Hong Zhang added a comment -

        Fixed with the suggestion in both branch and trunk.

        Show
        Hong Zhang added a comment - Fixed with the suggestion in both branch and trunk.

          People

          • Assignee:
            Hong Zhang
            Reporter:
            Alexis MP
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: