Hi On Fri, May 13, 2011 at 1:19 AM, Shenglin Qiu <dabaip...@hotmail.com> wrote: > > Hi Sergey: > > Here is the todo list which you have assigned: > > 1. Have one JAX-WS and JAX-RS endpoints > 2. Have your JMXServer as a separate endpoint > 3. Injecting a bus reference and registering a listener > > Your Tips: > 1. > In > the method where bus is injected, get ServerLifeCycleManager.class > extension from the bus and register your own ServerLifeCycleListener > impl > , it has methods such as startServer and stopServer, in > startServer(Server server) you can do > server.getEndpoint().getService().getQName(), > and keep these QNames > in the local list and have a method say getManagedEndpoints() which will > return the list of those QNames that will be a good start > > 2. >> <bean class="org.apache.cxf.management.web.JMXServer"> >> ? ?<property name="managedEndpoints"> >> ? ? ? ? <list> >> ? ? ? ? ? ?<value>{http://users.com/rs}UserService</value> >> ? ? ? ? ? ?<value>{http://users.com/ws}UserService</value> >> ? ? ? ? </list> >> ? ?</property> >> ? ?<property name="manager" ref="instrumentationManager"/> >> </bean> > but ?<property name="managedEndpoints"> can be dropped, you can get this list > from the bus > > > Currently, I have finished on Step 1 and 2, and you have told me that put > step 3 on hold, and make sure JMXServer as a separated enpoint is correct
OK. I don't understand what you've done so far, what decisions have been made to do with making sure that - list of managed endpoints is returned - all MBean representations for all the endpoints are returned, - MBeans related to an individual endpoint are returned Can you please describe what you've done ? > I am actually stopped at this GET request: > I tried: > http://localhost:8080/demoserver/jaxserver/jmxserver/service/{http://impl.service.ws.gsoc.cxf.apache.org/}CustomerServiceImpl > And obviously it doesn't work because of the slash in url is not accepted. (I > still didn't find a reasonable answer from searching google, shocking) > Shenglin, you are obviously very well prepared technically but you need to change the approach and do it asap. Why do you expect Google to tell you why the above URI does not work ? That URI seems too long anyway http://localhost:8080/demoserver/jmx?service={http://impl.service.ws.gsoc.cxf.apache.org/}CustomerServiceImpl Is the max really and in this particular case I'm presuming this query is about getting the list of MBeans reps for a particular managed service. Perhaps in the future we can allocate dynamic subresources instead for handling endpoint specific MBeans to make URIs shorter for this particular case. > > Then I reserve slash to back slash and got 500 errors: > http://localhost:8080/demoserver/jaxserver/jmxserver/service/{http:\\impl.service.ws.gsoc.cxf.apache.org\}CustomerServiceImpl > => There is a 500 error from CXF > here is the exception stacktrace: > > 2011-05-12 > 20:00:48.657:WARN::/demoserver/jaxserver/jmxserver/service/%7Bhttp:%5 > C%5Cimpl.service.ws.gsoc.cxf.apache.org%5C%7DCustomerServiceImpl > java.lang.RuntimeException: org.apache.cxf.interceptor.Fault: Unexpected > interna > l error near index 1<|\<| ^ > at > org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMess > age(AbstractFaultChainInitiatorObserver.java:102) > at > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercept > orChain.java:303) > at > org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainIniti > ationObserver.java:113) > at > org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDes > tination.java:97) > at > org.apache.cxf.transport.servlet.ServletController.invokeDestination( > ServletController.java:458) > at > org.apache.cxf.transport.servlet.ServletController.invoke(ServletCont > roller.java:146) > at > org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCX > FServlet.java:148) > at > org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(Ab > stractHTTPServlet.java:179) > at > org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHT > TPServlet.java:108) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) > at > org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(Abstract > HTTPServlet.java:159) > at > org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511 > ) > at > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:3 > 90) > at > org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.jav > a:216) > at > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:1 > 82) > at > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:7 > 65) > at > org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440) > > at > org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHand > lerCollection.java:230) > at > org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection. > java:114) > at > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:1 > 52) > at org.mortbay.jetty.Server.handle(Server.java:326) > at > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:54 > 2) > at > org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpCo > nnection.java:926) > at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549) > at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) > at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) > at > org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.ja > va:410) > at > org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.j > ava:582) > > > Any suggestions? Please understand how CXF JAX-RS handles requests, don't try changing "/" to "\\" and hope it will work > > Currently I can do the following: > http://localhost:8080/demoserver/jaxrs3/jmx/component/org.apache.cxf:type=Bus.Service.Endpoint,* > => get Mbean by ObjectName query What is "/jaxrs3" ? Are you really sure your JMXServer endpoint is separate ? > http://localhost:8080/demoserver/jaxserver/jmxserver/list > => get all Mbeans by > ObjectName('*:type=*,*') which query is *:type=*,* should be just http://localhost:8080/demoserver/jmx/list > http://localhost:8080/demoserver/jaxserver/jmxserver/type/Bus.Service.Endpoint > => get Mbean by type > http://localhost:8080/demoserver/jaxserver/jmxserver/port/%22UserServiceImpl%22 > => get Mbean by service, %22 is an issue which > I can't get rid of it, still working on it. > http://localhost:8080/demoserver/jaxserver/jmxserver/service/impl.service.ws.gsoc.cxf.apache.org > => get Mbean by part of service such as > {http://impl.service.ws.gsoc.cxf.apache.org/}CustomerServiceImpl -> > > > impl.service.ws.gsoc.cxf.apache.org > /demoserver/jaxserver/jmxserver/type/ or /demoserver/jaxserver/jmxserver/port/ is just too long /demoserver/jmx?mbean=somembeanname would probably do; well perhaps, introducing some "types" into URIs like /type/, /port/, etc, may also may make sense, but lets make sure we have a simple and straightforward approach for getting the list of all sorts of MBean representation Thanks, Sergey > > Thank you. > > Regards: > Shenglin Qiu >