[GLASSFISH-19108] "An error has occurred" was output in "Admin Service" page Created: 26/Sep/12  Updated: 20/Dec/16  Resolved: 21/Feb/13

Status: Resolved
Project: glassfish
Component/s: rest-interface
Affects Version/s: 4.0_dev
Fix Version/s: 4.0_dev, 4.0

Type: Bug Priority: Major
Reporter: zhouronghui Assignee: Jason Lee
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows XP, Windows 7


Attachments: Text File GLASSFISH-19108.patch    
Tags: admin-gui

 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



 Comments   
Comment by zhouronghui [ 26/Sep/12 ]

The patch for GLASSFISH-19108.

Comment by zhouronghui [ 26/Sep/12 ]

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?

Comment by zhouronghui [ 26/Sep/12 ]

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?

Comment by Anissa Lam [ 26/Sep/12 ]

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.

Comment by Anissa Lam [ 26/Sep/12 ]

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

Comment by zhouronghui [ 26/Sep/12 ]

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)
|#]
Comment by Jason Lee [ 23/Oct/12 ]

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.

Comment by Jason Lee [ 21/Feb/13 ]

Fix committed (r59729)

Generated at Sat Jan 21 14:18:36 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.