glassfish
  1. glassfish
  2. GLASSFISH-19108

"An error has occurred" was output in "Admin Service" page

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0_b54
    • Fix Version/s: 4.0_b80_EE7MS6, 4.0
    • Component/s: rest-interface
    • Labels:
      None
    • Environment:

      Windows XP, Windows 7

      Description

      [Bug Description]
      When open Admin Service page , "An error has occurred" error message was output.

      [Operations]
      Open GlassFish Server Administration Console. and enter into
      Configurations -> default-config/server-config -> Admin Service.

      After that, "An error has occurred" error message was output to the page.

      [affected versions]
      1 4.0_b542 Glassfish's trunk until 2012/09/25

        Activity

        Hide
        zhouronghui added a comment -

        The patch for GLASSFISH-19108.

        Show
        zhouronghui added a comment - The patch for GLASSFISH-19108 .
        Hide
        zhouronghui added a comment -

        It seems that cased by failed in getting the value of JMXServiceURL.

        I find that if initialize the attribute "habitat" of JmxServiceUrlsResource.java, the value of JMXServiceURL will be get successfully, and the "An error has occurred" error message should not be output.

        I made a patch for this ISSUE, Would you please check it?

        Show
        zhouronghui added a comment - It seems that cased by failed in getting the value of JMXServiceURL. I find that if initialize the attribute "habitat" of JmxServiceUrlsResource.java, the value of JMXServiceURL will be get successfully, and the "An error has occurred" error message should not be output. I made a patch for this ISSUE, Would you please check it?
        Hide
        zhouronghui added a comment -

        Dear Anissa

        There are other 6 classes under trunk\main\nucleus\admin\rest\rest-service have the similar codes.

        • GeneratorResource.java(L70)
        • MonitoringResource.java(L92)
        • PropertiesBagResource.java(L84)
        • StatusGenerator.java(L93)
        • custom\LogNamesResource.java(L64)
        • custom\StructuredLogViewerResource.java(L73)

        Through debugging, I have found the same error will occur in custom\StructuredLogViewerResource.java。 But I have no idea about how to debug the other 5 classes because I don't know their usage. Would you please look into it and give me some advices?

        Show
        zhouronghui added a comment - Dear Anissa There are other 6 classes under trunk\main\nucleus\admin\rest\rest-service have the similar codes. GeneratorResource.java(L70) MonitoringResource.java(L92) PropertiesBagResource.java(L84) StatusGenerator.java(L93) custom\LogNamesResource.java(L64) custom\StructuredLogViewerResource.java(L73) Through debugging, I have found the same error will occur in custom\StructuredLogViewerResource.java。 But I have no idea about how to debug the other 5 classes because I don't know their usage. Would you please look into it and give me some advices?
        Hide
        Anissa Lam added a comment -

        Thanks for debugging and attaching the patch.
        The error shows up in the admin console, but the cause and the fix (as you attached) is in the admin code. I am transferring this to "admin" so that the admin infrastructure team will look into that.

        Show
        Anissa Lam added a comment - Thanks for debugging and attaching the patch. The error shows up in the admin console, but the cause and the fix (as you attached) is in the admin code. I am transferring this to "admin" so that the admin infrastructure team will look into that.
        Hide
        Anissa Lam added a comment -

        Do you see any error in server.log ? If so, can you also attach the stack trace ? thanks.

        Show
        Anissa Lam added a comment - Do you see any error in server.log ? If so, can you also attach the stack trace ? thanks.
        Hide
        zhouronghui added a comment -

        The NullPointerException was thrown out and
        the stack trace in server.log was as follows.

        [#|2012-09-26T14:54:20.781+0800|SEVERE|44.0|org.glassfish.jersey.server.ApplicationHandler|_ThreadID=90;_ThreadName=admin-listener(1);|java.lang.NullPointerException
        	at org.glassfish.admin.rest.resources.custom.JmxServiceUrlsResource.getJmxServiceUrl(JmxServiceUrlsResource.java:78)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        	at java.lang.reflect.Method.invoke(Method.java:601)
        	at org.glassfish.jersey.server.model.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:80)
        	at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:113)
        	at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(AbstractJavaResourceMethodDispatcherProvider.java:219)
        	at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79)
        	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:268)
        	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:84)
        	at org.glassfish.jersey.process.internal.RequestInvoker$AcceptingInvoker.apply(RequestInvoker.java:241)
        	at org.glassfish.jersey.process.internal.AsyncInflectorAdapter.apply(AsyncInflectorAdapter.java:157)
        	at org.glassfish.jersey.process.internal.RequestInvoker$2.run(RequestInvoker.java:188)
        	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:309)
        	at org.glassfish.jersey.process.internal.RequestInvoker$3.run(RequestInvoker.java:201)
        	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        	at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:262)
        	at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:43)
        	at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:40)
        	at org.glassfish.jersey.process.internal.RequestInvoker.apply(RequestInvoker.java:197)
        	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:758)
        	at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:298)
        	at org.glassfish.admin.rest.adapter.RestAdapter$1.service(RestAdapter.java:327)
        	at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:189)
        	at com.sun.enterprise.v3.server.HK2Dispatcher.dispatch(HK2Dispatcher.java:113)
        	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:236)
        	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164)
        	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:175)
        	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
        	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265)
        	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
        	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134)
        	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
        	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
        	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:825)
        	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
        	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
        	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
        	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
        	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:578)
        	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:558)
        	at java.lang.Thread.run(Thread.java:722)
        |#]
        
        Show
        zhouronghui added a comment - The NullPointerException was thrown out and the stack trace in server.log was as follows. [#|2012-09-26T14:54:20.781+0800|SEVERE|44.0|org.glassfish.jersey.server.ApplicationHandler|_ThreadID=90;_ThreadName=admin-listener(1);|java.lang.NullPointerException at org.glassfish.admin.rest.resources.custom.JmxServiceUrlsResource.getJmxServiceUrl(JmxServiceUrlsResource.java:78) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.glassfish.jersey.server.model.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:80) at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:113) at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(AbstractJavaResourceMethodDispatcherProvider.java:219) at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:268) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:84) at org.glassfish.jersey.process.internal.RequestInvoker$AcceptingInvoker.apply(RequestInvoker.java:241) at org.glassfish.jersey.process.internal.AsyncInflectorAdapter.apply(AsyncInflectorAdapter.java:157) at org.glassfish.jersey.process.internal.RequestInvoker$2.run(RequestInvoker.java:188) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:309) at org.glassfish.jersey.process.internal.RequestInvoker$3.run(RequestInvoker.java:201) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:262) at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:43) at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:40) at org.glassfish.jersey.process.internal.RequestInvoker.apply(RequestInvoker.java:197) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:758) at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:298) at org.glassfish.admin.rest.adapter.RestAdapter$1.service(RestAdapter.java:327) at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:189) at com.sun.enterprise.v3.server.HK2Dispatcher.dispatch(HK2Dispatcher.java:113) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:236) at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164) at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:175) at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265) at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200) at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134) at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112) at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:825) at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55) at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:578) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:558) at java.lang.Thread.run(Thread.java:722) |#]
        Hide
        Jason Lee added a comment -

        With the recent HK2 changes, the Habitat/SerivceLocator is injected correctly by the system, but the lookup of the MBeanServer is failing:

        MBeanServer mBeanServer = habitat.getService(MBeanServer.class);

        I'll have to talk to the JMX team to make sure we're acquiring the reference correctly.

        Show
        Jason Lee added a comment - With the recent HK2 changes, the Habitat/SerivceLocator is injected correctly by the system, but the lookup of the MBeanServer is failing: MBeanServer mBeanServer = habitat.getService(MBeanServer.class); I'll have to talk to the JMX team to make sure we're acquiring the reference correctly.
        Hide
        Jason Lee added a comment -

        Fix committed (r59729)

        Show
        Jason Lee added a comment - Fix committed (r59729)

          People

          • Assignee:
            Jason Lee
            Reporter:
            zhouronghui
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: