I am using the RESTClient firefox plugin to do some API testing against my vCD 5.1.1 installation. I can log in successfully, but then I always get the following error, no matter what REST operation I execute. I am wondering if there is some stale service/extension registered, but I don't know how to remove it.
- <?xml version="1.0" encoding="UTF-8"?>
- <Error xmlns="http://www.vmware.com/vcloud/v1.5" stackTrace="com.vmware.vcloud.api.rest.handlers.exceptions.InternalServerErrorRestApiException: Cannot send message to service with id: bd9bfdf1-0aee-40d9-be1e-243c507234ce. Check your service configuration.
- at com.vmware.vcloud.api.rest.common.handlers.ErrorHandler.getInternalServerErrorRestApiException(ErrorHandler.java:106)
- at com.vmware.vcloud.api.rest.common.handlers.ErrorHandler.errorInternalServer(ErrorHandler.java:63)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
- at java.lang.reflect.Method.invoke(Unknown Source)
- at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
- at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
- at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:164)
- at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:91)
- at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
- at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
- at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
- at java.util.concurrent.FutureTask.run(Unknown Source)
- at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
- at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
- at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
- at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:118)
- at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:208)
- at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)
- at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:166)
- at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:113)
- at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:184)
- at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:112)
- at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
- at com.vmware.vcloud.api.rest.jaxrs.servlet.CxfServlet.service(CxfServlet.java:161)
- at com.vmware.vcloud.api.rest.jaxrs.servlet.JaxRsDispatcherServlet.doService(JaxRsDispatcherServlet.java:97)
- at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
- at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
- at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
- at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
- at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565)
- at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
- at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
- at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:539)
- at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
- at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
- at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
- at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
- at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
- at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
- at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:288)
- at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:115)
- at org.springframework.security.web.firewall.RequestWrapper$FirewalledRequestAwareRequestDispatcher.forward(RequestWrapper.java:132)
- at com.vmware.vcloud.api.framework.web.ExtensibilityFilter.doFilter(ExtensibilityFilter.java:171)
- at sun.reflect.GeneratedMethodAccessor154.invoke(Unknown Source)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
- at java.lang.reflect.Method.invoke(Unknown Source)
- at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
- at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)
- at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)
- at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
- at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
- at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
- at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
- at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)
- at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)
- at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
- at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)
- at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
- at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
- at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
- at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
- at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
- at $Proxy733.doFilter(Unknown Source)
- at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
- at com.vmware.vcloud.security.filters.ValidityExceptionFilter.doFilterHttp(ValidityExceptionFilter.java:47)
- at com.vmware.vcloud.security.filters.HttpFilterBean.doFilter(HttpFilterBean.java:35)
- at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
- at com.vmware.vcloud.security.web.AuthenticationFilter.doFilter(AuthenticationFilter.java:155)
- at com.vmware.vcloud.api.rest.diagnostics.RestApiDiagnosticsInterceptor.doFilter(RestApiDiagnosticsInterceptor.java:129)
- at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
- at com.vmware.vcloud.api.rest.versioning.AcceptHeaderFilter.doFilter(AcceptHeaderFilter.java:108)
- at com.vmware.vcloud.api.rest.diagnostics.RestApiDiagnosticsInterceptor.doFilter(RestApiDiagnosticsInterceptor.java:129)
- at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
- at com.vmware.vcloud.security.web.ConversationFilter$1.run(ConversationFilter.java:39)
- at com.vmware.vcloud.security.web.ConversationFilter$1.run(ConversationFilter.java:37)
- at com.vmware.vcloud.common.persist.ConversationContextExecutor.execute(ConversationContextExecutor.java:67)
- at com.vmware.vcloud.security.web.ConversationFilter.doFilter(ConversationFilter.java:45)
- at com.vmware.vcloud.api.rest.diagnostics.RestApiDiagnosticsInterceptor.doFilter(RestApiDiagnosticsInterceptor.java:129)
- at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
- at com.vmware.vcloud.security.web.ThreadLocalCleanerFilter.doFilter(ThreadLocalCleanerFilter.java:65)
- at com.vmware.vcloud.api.rest.diagnostics.RestApiDiagnosticsInterceptor.doFilter(RestApiDiagnosticsInterceptor.java:129)
- at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
- at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
- at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
- at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
- at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
- at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:77)
- at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:144)
- at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
- at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:477)
- at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
- at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:521)
- at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
- at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
- at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
- at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
- at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
- at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
- at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
- at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
- at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
- at org.eclipse.jetty.server.Server.handle(Server.java:349)
- at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:449)
- at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:47)
- at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:910)
- at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
- at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
- at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:66)
- at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:254)
- at org.eclipse.jetty.server.ssl.SslSocketConnector$SslConnectorEndPoint.run(SslSocketConnector.java:665)
- at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
- at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
- at java.lang.Thread.run(Unknown Source)
- " minorErrorCode="INTERNAL_SERVER_ERROR" message="Cannot send message to service with id: bd9bfdf1-0aee-40d9-be1e-243c507234ce. Check your service configuration." majorErrorCode="500" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://172.17.232.49/api/v1.5/schema/master.xsd">
- </Error>
Hi,
Use the PUT which is an update operation. POST is generally for creating new objects/performing actions on the objects.
Regards,
Rajesh Kamal.
Hi,
Try this API URL and see if there are any regisrered services - https://vcloud/api/admin/extension/service/query
If any try deleting that service.
Regards,
Rajesh Kamal.
Thanks a lot Rajesh. I found a couple of registered sample extensions using your recommended method:
However, I am not able to delete either of the services. I get an exception saying the the service is enabled and I should disable it first.
How do I disable it? I can't find an operation to disable services in the REST API reference.
DELETE https://172.17.232.49/api/admin/extension/service/6bf32929-ed87-40aa-93a9-41f8e7f1e511
Also, when I do a GET on either service, I don't get any information:
GET https://172.17.232.49/api/admin/extension/service/6bf32929-ed87-40aa-93a9-41f8e7f1e511
Hi,
1. There is no seperate operation to disable the service. Instead try to do a PUT/Update operation with the enabled flag to false. Then you should be able to Delete it.
2. The very possible reason you are not seeing any data in the GET service call might you are not sending the application/*+xml;version=5.1 Accept header. You might be sending the 1.5 accept header.
Regards,
Rajesh Kamal.
Hi Rajesh,
Thanks. I was using the older version (1.5) in the REST header. Changing it to 5.1 fixed it.
However, I am unable to figure out the correct REST body format to send to disable the service. I tried sending the same body as I did when registering the service, except that I changed the enabled field to "false. However, I get an error that the service is already exists, so apparently this is not the correct request body to send.
POST https://172.17.232.49/api/admin/extension/service
<?xml version="1.0" encoding="UTF-8"?>
<vmext:Service xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5" xmlns:vcloud="http://www.vmware.com/vcloud/v1.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/extension/v1.5 http://10.23.6.103/api/v1.5/schema/vmwextensions.xsd http://www.vmware.com/vcloud/v1.5 http://10.23.6.103/api/v1.5/schema/master.xsd" name="Echo Service" type="application/vnd.vmware.admin.service+xml" operationKey="echo">
<vmext:Namespace>EchoNamespace</vmext:Namespace>
<vmext:Enabled>false</vmext:Enabled>
<vmext:RoutingKey>echo</vmext:RoutingKey>
<vmext:Priority>10</vmext:Priority>
<vmext:Exchange>ext</vmext:Exchange>
<vmext:RequestFilters>
<vmext:RequestFilter>
<vmext:UrlPattern>/api/.*</vmext:UrlPattern>
</vmext:RequestFilter>
</vmext:RequestFilters>
</vmext:Service>
<?xml version="1.0" encoding="UTF-8"?> <Error xmlns="http://www.vmware.com/vcloud/v1.5" stackTrace="com.vmware.vcloud.api.presentation.service.BadRequestException: "A service with the same namespace already exists."
Hi,
Use the PUT which is an update operation. POST is generally for creating new objects/performing actions on the objects.
Regards,
Rajesh Kamal.
Thanks for all your help, Rajesh. I was able to delete the extensions and everything seems to be back to normal now (all the REST operations are working as expected).
Cheers!
Hi,
I am unable to disable the service. I tried sending the same body as I did when registering the service, except that I changed the enabled field to "false and “PUT” method instead of “POST” as you suggested. However, I get an error "405 Method Not Allowed".
PUT https://xxx.xx.xxx.xx/api/admin/extension/service
<?xml version="1.0" encoding="UTF-8"?>
<vmext:Service xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5"
xmlns:vcloud="http://www.vmware.com/vcloud/v1.5"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.vmware.com/vcloud/extension/v1.5 http://xx.xx.xxx.xxx/api/v1.5/schema/vmwextensions.xsd http://www.vmware.com/vcloud/v1.5 http://xx.xx.xxx.xxx/api/v1.5/schema/master.xsd"
name="FaultTolerance" type="application/vnd.vmware.admin.service+xml"
operationKey="FaultTolerance">
<vmext:Namespace>FaultTolerance</vmext:Namespace>
<vmext:Enabled>false</vmext:Enabled>
<vmext:RoutingKey>faulttolerance</vmext:RoutingKey>
<vmext:Priority>10</vmext:Priority>
<vmext:Exchange>availability</vmext:Exchange>
<vmext:ApiFilters>
<vmext:ApiFilter>
<vmext:UrlPattern>/api/vApp/.*/ft/.*</vmext:UrlPattern>
</vmext:ApiFilter>
</vmext:ApiFilters>
</vmext:Service>
--Anurag
When modifying objects, you should specify the URL of the object. It's in the form: https://xxx.xx.xxx.xx/api/admin/extension/service/<uuid>
This URL is returned when doing the POST operation against the /service URL.
Regards,
Todor Todorov
Awesome, thanks for instant reply.
My problem is resolved thank you very much.
-Anurag