glassfish
  1. glassfish
  2. GLASSFISH-18228

The OSGi Admin Console seems to randomly swap between port 8080 and 4848

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1.2_b19, 4.0_b21
    • Component/s: OSGi
    • Labels:
      None
    • Status Whiteboard:
      Hide

      Workaround:
      In order to cause webconsole to bind to HTTP Service listen on 8080 (default http port), create a file called
      glassfish/domain1/autodeploy/bundles/org.apache.felix.webconsole.internal.servlet.OsgiManager.cfg
      with following content:
      http.service.filter=VirtualServer=server

      Show
      Workaround: In order to cause webconsole to bind to HTTP Service listen on 8080 (default http port), create a file called glassfish/domain1/autodeploy/bundles/org.apache.felix.webconsole.internal.servlet.OsgiManager.cfg with following content: http.service.filter=VirtualServer=server

      Description

      The OSGi Admin Console seems to randomly swap between port 8080 and 4848

      When running on 8080 it is accessible from the Server -> OSGi Console link under http://localhost:4848/

      However when it magically/randomly flips to running on 4848 the Server -> OSGi Console link returns a 404 error.

      I haven't done enough investigation to determine what is causing the port flipping. But it seems extremely strange that it happens at all.

      Off the top of my head (without any investigation), if two instances of HttpService are registered the ordering would be random and sometimes it gets the correct one and others it gets the wrong one... shrug

        Activity

        aaronjwhiteside created issue -
        Tom Mueller made changes -
        Field Original Value New Value
        Assignee Tom Mueller [ tmueller ] Sanjeeb Sahoo [ ss141213 ]
        Component/s admin [ 10589 ]
        Component/s admin_gui [ 10588 ]
        Hide
        Sanjeeb Sahoo added a comment -

        Yes, I have seen this issue and the submitter has analysed it correctly, thanks. This is a regression. See GLASSFISH-12359 where we had earlier fixed the issue, but it has resurfaced as we have stoppsed picking cfg files from modules/autostart/.

        Show
        Sanjeeb Sahoo added a comment - Yes, I have seen this issue and the submitter has analysed it correctly, thanks. This is a regression. See GLASSFISH-12359 where we had earlier fixed the issue, but it has resurfaced as we have stoppsed picking cfg files from modules/autostart/.
        Hide
        Sanjeeb Sahoo added a comment -

        See workaround.

        Show
        Sanjeeb Sahoo added a comment - See workaround.
        Sanjeeb Sahoo made changes -
        Status Whiteboard Workaround:
        In order to cause webconsole to bind to HTTP Service listen on 8080 (default http port), create a file called
        glassfish/domain1/autodeploy/bundles/org.apache.felix.webconsole.internal.servlet.OsgiManager.cfg
        with following content:
        http.service.filter=VirtualServer=server
        Hide
        Sanjeeb Sahoo added a comment - - edited

        trunk: svn rev #52257

        A appserver/osgi-platforms/felix-webconsole-extension/src/main/java/org/glassfish/osgi/felixwebconsoleextension/FelixWebConsoleExtensionActivator.java
        A appserver/osgi-platforms/felix-webconsole-extension/src/main/java/org/glassfish/osgi/felixwebconsoleextension/GlassFishBrandingPlugin.java
        D appserver/osgi-platforms/felix-webconsole-extension/src/main/resources/META-INF/webconsole.properties
        M appserver/osgi-platforms/felix-webconsole-extension/osgi.bundle
        M appserver/osgi-platforms/felix-webconsole-extension/pom.xml
        D nucleus/osgi-platforms/felix/src/main/resources/glassfish/modules/autostart/org.apache.felix.webconsole.internal.servlet.OsgiManager.cfg

        trunk: svn rev #52272

        M appserver/packager/felix/src/main/resources/pkg_proto.py

        Show
        Sanjeeb Sahoo added a comment - - edited trunk: svn rev #52257 A appserver/osgi-platforms/felix-webconsole-extension/src/main/java/org/glassfish/osgi/felixwebconsoleextension/FelixWebConsoleExtensionActivator.java A appserver/osgi-platforms/felix-webconsole-extension/src/main/java/org/glassfish/osgi/felixwebconsoleextension/GlassFishBrandingPlugin.java D appserver/osgi-platforms/felix-webconsole-extension/src/main/resources/META-INF/webconsole.properties M appserver/osgi-platforms/felix-webconsole-extension/osgi.bundle M appserver/osgi-platforms/felix-webconsole-extension/pom.xml D nucleus/osgi-platforms/felix/src/main/resources/glassfish/modules/autostart/org.apache.felix.webconsole.internal.servlet.OsgiManager.cfg trunk: svn rev #52272 M appserver/packager/felix/src/main/resources/pkg_proto.py
        Sanjeeb Sahoo made changes -
        Tags 3_1_2_review
        Hide
        Sanjeeb Sahoo added a comment -
        • What is the impact on the customer of the bug?

        Yes, this is a regression. It has been filed by a user and seen by others as well.

        • What is the cost/risk of fixing the bug?

        No risk, as the fix is in an addon component.

        • Is there an impact on documentation or message strings?

        No.

        • Which tests should QA (re)run to verify the fix did not destabilize GlassFish?

        NA

        • Which is the targeted build of 3.1.2 for this fix?
          b19
        Show
        Sanjeeb Sahoo added a comment - What is the impact on the customer of the bug? Yes, this is a regression. It has been filed by a user and seen by others as well. What is the cost/risk of fixing the bug? No risk, as the fix is in an addon component. Is there an impact on documentation or message strings? No. Which tests should QA (re)run to verify the fix did not destabilize GlassFish? NA Which is the targeted build of 3.1.2 for this fix? b19
        Joe Di Pol made changes -
        Fix Version/s 3.1.2_b20 [ 15486 ]
        Tags 3_1_2_review 3_1_2_approved
        Hide
        Sanjeeb Sahoo added a comment -

        3.1.2 branch:
        Sending osgi-platforms/felix/src/main/resources/glassfish/modules/autostart
        Deleting osgi-platforms/felix/src/main/resources/glassfish/modules/autostart/org.apache.felix.webconsole.internal.servlet.OsgiManager.cfg
        Sending osgi-platforms/felix-webconsole-extension
        Sending osgi-platforms/felix-webconsole-extension/osgi.bundle
        Sending osgi-platforms/felix-webconsole-extension/pom.xml
        Adding osgi-platforms/felix-webconsole-extension/src/main/java
        Adding osgi-platforms/felix-webconsole-extension/src/main/java/org
        Adding osgi-platforms/felix-webconsole-extension/src/main/java/org/glassfish
        Adding osgi-platforms/felix-webconsole-extension/src/main/java/org/glassfish/osgi
        Adding osgi-platforms/felix-webconsole-extension/src/main/java/org/glassfish/osgi/felixwebconsoleextension
        Adding osgi-platforms/felix-webconsole-extension/src/main/java/org/glassfish/osgi/felixwebconsoleextension/FelixWebConsoleExtensionActivator.java
        Adding osgi-platforms/felix-webconsole-extension/src/main/java/org/glassfish/osgi/felixwebconsoleextension/GlassFishBrandingPlugin.java
        Deleting osgi-platforms/felix-webconsole-extension/src/main/resources/META-INF/webconsole.properties
        Sending packager/felix/src/main/resources/pkg_proto.py
        Transmitting file data ...
        Committed revision 52276.

        Show
        Sanjeeb Sahoo added a comment - 3.1.2 branch: Sending osgi-platforms/felix/src/main/resources/glassfish/modules/autostart Deleting osgi-platforms/felix/src/main/resources/glassfish/modules/autostart/org.apache.felix.webconsole.internal.servlet.OsgiManager.cfg Sending osgi-platforms/felix-webconsole-extension Sending osgi-platforms/felix-webconsole-extension/osgi.bundle Sending osgi-platforms/felix-webconsole-extension/pom.xml Adding osgi-platforms/felix-webconsole-extension/src/main/java Adding osgi-platforms/felix-webconsole-extension/src/main/java/org Adding osgi-platforms/felix-webconsole-extension/src/main/java/org/glassfish Adding osgi-platforms/felix-webconsole-extension/src/main/java/org/glassfish/osgi Adding osgi-platforms/felix-webconsole-extension/src/main/java/org/glassfish/osgi/felixwebconsoleextension Adding osgi-platforms/felix-webconsole-extension/src/main/java/org/glassfish/osgi/felixwebconsoleextension/FelixWebConsoleExtensionActivator.java Adding osgi-platforms/felix-webconsole-extension/src/main/java/org/glassfish/osgi/felixwebconsoleextension/GlassFishBrandingPlugin.java Deleting osgi-platforms/felix-webconsole-extension/src/main/resources/META-INF/webconsole.properties Sending packager/felix/src/main/resources/pkg_proto.py Transmitting file data ... Committed revision 52276.
        Sanjeeb Sahoo made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 3.1.2_b19 [ 15333 ]
        Fix Version/s 4.0_b21 [ 14807 ]
        Fix Version/s 3.1.2_b20 [ 15486 ]
        Resolution Fixed [ 1 ]
        Hide
        aaronjwhiteside added a comment -

        This isn't actually fixed in 3.1.2 - it is still happening...

        Show
        aaronjwhiteside added a comment - This isn't actually fixed in 3.1.2 - it is still happening...
        Hide
        Sanjeeb Sahoo added a comment -

        Are you sure it didn't work for you? I specifically bind the web console to http service corresponding to port 8080, so I can't understand why it didn't work for you. I tried reproducing and could not. I doubt you are not using correct version of glassfish-osgi-gui.zip. Download version 3.1.2 of this zip and use.

        Show
        Sanjeeb Sahoo added a comment - Are you sure it didn't work for you? I specifically bind the web console to http service corresponding to port 8080, so I can't understand why it didn't work for you. I tried reproducing and could not. I doubt you are not using correct version of glassfish-osgi-gui.zip. Download version 3.1.2 of this zip and use.
        Hide
        aaronjwhiteside added a comment - - edited

        Shouldn't it be bound to the admin listener and not the normal server/application http listener?

        We typically restrict access to the admin ports, even though the osgi console is password protected I'd rather not have it be served up at all to clients.

        Btw the glassfish-osgi-gui.zip artifact hasn't been pushed out to the maven repositories yet. I know I can use the auto update tool, but that's not how we deploy into production (we pre-package everything into a tar.gz using the maven assembly plugin). So if you could ensure that everything is published correctly I would be grateful.

        http://mvnrepository.com/artifact/org.glassfish.packager/glassfish-osgi-gui

        I assume the -bx versions are not the official stable/final releases?

        Show
        aaronjwhiteside added a comment - - edited Shouldn't it be bound to the admin listener and not the normal server/application http listener? We typically restrict access to the admin ports, even though the osgi console is password protected I'd rather not have it be served up at all to clients. Btw the glassfish-osgi-gui.zip artifact hasn't been pushed out to the maven repositories yet. I know I can use the auto update tool, but that's not how we deploy into production (we pre-package everything into a tar.gz using the maven assembly plugin). So if you could ensure that everything is published correctly I would be grateful. http://mvnrepository.com/artifact/org.glassfish.packager/glassfish-osgi-gui I assume the -bx versions are not the official stable/final releases?
        Hide
        Sanjeeb Sahoo added a comment -

        You are looking at the wrong artifact. Our build team have renamed the groupId for some good reason. The artifact is actually available at:

        http://search.maven.org/#artifactdetails|org.glassfish.main.packager|glassfish-osgi-gui|3.1.2|distribution-base-zip

        Whether the console should be available at 8080 or 4848 is a different issue. We have currently made it available at 8080. If you want to change it to 4848, please try adding autodeploy/bundles/org.apache.felix.webconsole.internal.servlet.OsgiManager.cfg with following content:
        http.service.filter=VirtualServer=__asadmin

        Show
        Sanjeeb Sahoo added a comment - You are looking at the wrong artifact. Our build team have renamed the groupId for some good reason. The artifact is actually available at: http://search.maven.org/#artifactdetails |org.glassfish.main.packager|glassfish-osgi-gui|3.1.2|distribution-base-zip Whether the console should be available at 8080 or 4848 is a different issue. We have currently made it available at 8080. If you want to change it to 4848, please try adding autodeploy/bundles/org.apache.felix.webconsole.internal.servlet.OsgiManager.cfg with following content: http.service.filter=VirtualServer=__asadmin
        Hide
        aaronjwhiteside added a comment -

        Oh thanks for the info about the groupId rename, much appreciated.

        Will the link in the admin console to the osgi console still work if I adding the custom OsgiManager.cfg file?

        Show
        aaronjwhiteside added a comment - Oh thanks for the info about the groupId rename, much appreciated. Will the link in the admin console to the osgi console still work if I adding the custom OsgiManager.cfg file?
        Hide
        Sanjeeb Sahoo added a comment -

        yes, the cfg file should still work.

        Show
        Sanjeeb Sahoo added a comment - yes, the cfg file should still work.
        Hide
        aaronjwhiteside added a comment -

        I tried putting the org.apache.felix.webconsole.internal.servlet.OsgiManager.cfg file under modules/autostart but it doesn't seem to work there. I don't want to put it under <domain>/autodeploy/bundles as it is a system level configuration detail and not related to the application.

        Show
        aaronjwhiteside added a comment - I tried putting the org.apache.felix.webconsole.internal.servlet.OsgiManager.cfg file under modules/autostart but it doesn't seem to work there. I don't want to put it under <domain>/autodeploy/bundles as it is a system level configuration detail and not related to the application.
        Hide
        Sanjeeb Sahoo added a comment -

        No, you can't put it under modules/autostart. You have to place it under a directory that's monitored by fileinstall and autodeploy/bundles/ is that directory.

        Show
        Sanjeeb Sahoo added a comment - No, you can't put it under modules/autostart. You have to place it under a directory that's monitored by fileinstall and autodeploy/bundles/ is that directory.
        Hide
        aaronjwhiteside added a comment -

        OK, do you want me to open another bug to have the OSGi console run on the admin listener (4848) instead of the http-listener (8080)? Or can you reuse this issue?

        Show
        aaronjwhiteside added a comment - OK, do you want me to open another bug to have the OSGi console run on the admin listener (4848) instead of the http-listener (8080)? Or can you reuse this issue?
        Hide
        Sanjeeb Sahoo added a comment -

        Pl. open a new enhancement request if you are not able to configure it using cfg file as suggested earlier.

        I don't understand your point of using modules/autostart for cfg file. You are not supposed to modify anything inside installation directory. domain_dir is a user controlled area and hence you should use that to do any domain level configuration such as this.

        Show
        Sanjeeb Sahoo added a comment - Pl. open a new enhancement request if you are not able to configure it using cfg file as suggested earlier. I don't understand your point of using modules/autostart for cfg file. You are not supposed to modify anything inside installation directory. domain_dir is a user controlled area and hence you should use that to do any domain level configuration such as this.
        Hide
        aaronjwhiteside added a comment -

        I'll open a new issue, the point was I shouldn't have to be telling the OSGi console to run on the admin port. It should be doing that by default. Running an admin console even if it is OSGi's admin console on the normal application port (8080) is not a good idea, IMHO.

        Show
        aaronjwhiteside added a comment - I'll open a new issue, the point was I shouldn't have to be telling the OSGi console to run on the admin port. It should be doing that by default. Running an admin console even if it is OSGi's admin console on the normal application port (8080) is not a good idea, IMHO.
        Hide
        Sanjeeb Sahoo added a comment -

        I certainly don't understand why admin port is different from 8080 for an appserver. What advantage it has for an app server which is always behind firewall? Do you understand?

        Show
        Sanjeeb Sahoo added a comment - I certainly don't understand why admin port is different from 8080 for an appserver. What advantage it has for an app server which is always behind firewall? Do you understand?
        Hide
        aaronjwhiteside added a comment -

        Usually only the admin port is locked behind a firewall... and 8080 is mapped to 80 on the outside world. My point is it requires extra effort to block /osgi/* at the load balancer while allowing everything else through.

        If the default were to keep all the administration related functionality restricted to the admin port (4848) then we wouldn't need any extra configuration to block access to /osgi/*.

        Show
        aaronjwhiteside added a comment - Usually only the admin port is locked behind a firewall... and 8080 is mapped to 80 on the outside world. My point is it requires extra effort to block /osgi/* at the load balancer while allowing everything else through. If the default were to keep all the administration related functionality restricted to the admin port (4848) then we wouldn't need any extra configuration to block access to /osgi/*.

          People

          • Assignee:
            Sanjeeb Sahoo
            Reporter:
            aaronjwhiteside
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: