Hello,
I created a simple OSLC app (this is the url to the project on git : GitHub - onsDridi/ObjOSLC) and in my serviceProviderService1 class, I tried to add a parameter projectId to my url as follow :
@OslcService(Oslc_objectiverDomainConstants.OBJECTIVERWEB_DOMAIN)
@Path(“goals/{projectId}”)
public class ServiceProviderService1
{
@Context private HttpServletRequest httpServletRequest;
@Context private HttpServletResponse httpServletResponse;
@Context private UriInfo uriInfo;
…
and of course , I specified in queryGoals and queryGoalsAsHtml methods that I will be use a path parameter projectId to process the request :
public Goal[] queryGoals(
@PathParam(“projectId”) final String projectid ,
@QueryParam("oslc.where") final String where,
@QueryParam("oslc.prefix") final String prefix,
@QueryParam("oslc.paging") final String pagingString,
@QueryParam("page") final String pageString,
@QueryParam("oslc.pageSize") final String pageSizeString) throws IOException, ServletException
{
…
When I run my app and try to access this url : http://localhost:8083/adaptor-objectiver/services/catalog/singleton , I get an HTTP 500 Error :
java.lang.IllegalArgumentException: The template variable ‘projectId’ has no value
at org.glassfish.jersey.uri.UriTemplate$1ValuesFromArrayStrategy.valueFor(UriTemplate.java:1020)
at org.glassfish.jersey.uri.UriTemplate.resolveTemplate(UriTemplate.java:706)
at org.glassfish.jersey.uri.UriTemplate.createUriComponent(UriTemplate.java:1030)
at org.glassfish.jersey.uri.UriTemplate.createURIWithStringValues(UriTemplate.java:964)
at org.glassfish.jersey.uri.UriTemplate.createURIWithStringValues(UriTemplate.java:827)
at org.glassfish.jersey.uri.UriTemplate.createURI(UriTemplate.java:790)
at org.glassfish.jersey.uri.internal.JerseyUriBuilder._buildFromMap(JerseyUriBuilder.java:822)
at org.glassfish.jersey.uri.internal.JerseyUriBuilder.buildFromMap(JerseyUriBuilder.java:801)
at org.eclipse.lyo.oslc4j.core.model.ServiceProviderFactory.resolvePathParameters(ServiceProviderFactory.java:356)
at org.eclipse.lyo.oslc4j.core.model.ServiceProviderFactory.createQueryCapability(ServiceProviderFactory.java:219)
at org.eclipse.lyo.oslc4j.core.model.ServiceProviderFactory.handleResourceClass(ServiceProviderFactory.java:98)
at org.eclipse.lyo.oslc4j.core.model.ServiceProviderFactory.initServiceProvider(ServiceProviderFactory.java:79)
at org.eclipse.lyo.oslc4j.core.model.ServiceProviderFactory.createServiceProvider(ServiceProviderFactory.java:49)
at cetic.be.objectiver.oslc.servlet.ServiceProvidersFactory.createServiceProvider(ServiceProvidersFactory.java:98)
at cetic.be.objectiver.oslc.servlet.ServiceProviderCatalogSingleton.initServiceProviders(ServiceProviderCatalogSingleton.java:225)
at cetic.be.objectiver.oslc.servlet.ServiceProviderCatalogSingleton.getServiceProviderCatalog(ServiceProviderCatalogSingleton.java:87)
at cetic.be.objectiver.oslc.services.ServiceProviderCatalogService.getHtmlServiceProvider(ServiceProviderCatalogService.java:130)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$VoidOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:143)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1623)
at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:214)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1700)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1667)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:152)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:505)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:698)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:804)
at java.base/java.lang.Thread.run(Thread.java:834)
do you have any idea why i have this bug ?