Hi there!

Can somebody please help me with the following issue:

I defined the method of interface as

    @GET
    @Path("/image")
    @Produces("image/jpeg")
    @Consumes(MediaType.WILDCARD)
    public BufferedImage loadBodyPart(@Context MessageContext context,
            @QueryParam("position") Triple3D position,
            @QueryParam("lookdir") Triple3D locationDir);

Now, when I am trying to invoke it from WEB, I am getting the error:

WARNING: Application has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: No SessionHandler or SessionManager
        at 
org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155)
        at 
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:121)
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:130)
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:82)
        at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        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:236)
        at 
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
        at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:312)
        at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:276)
        at 
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
        at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
        at 
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
        at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:326)
        at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536)
        at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:915)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
        at 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
        at 
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: java.lang.IllegalStateException: No SessionHandler or SessionManager
        at org.mortbay.jetty.Request.getSession(Request.java:1209)
        at org.mortbay.jetty.Request.getSession(Request.java:1199)
        at 
nl.greenvalley.hba.web.rest.EndpointService.loadBodyPart(EndpointService.java:50)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at 
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
        at 
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
        ... 24 more

As far as I understood, the error means that I did not configure any session
manager for the underlying Jetty transport.

I am configuring things like this:


        JAXRSServerFactoryBean sfb = new JAXRSServerFactoryBean();
        sfb.setResourceClasses(EndpointServiceInterface.class);
        SingletonResourceProvider srp = new SingletonResourceProvider(
                new EndpointService(imageStorage, imageAction,
                        new DefaultBodyPartStateHandler(),
                        new BodyPartMapStorageInterface() {
        sfb.setResourceProvider(EndpointServiceInterface.class, srp);
        sfb.setProviders(Arrays.asList(new ImageBodyWriter(),
                new ImageBodyReader()));
        sfb.setAddress("http://localhost:9000/";);
        server = sfb.create();

So at this point I don't see any way to configure Jetty. Can somebody please
advice?

Thank you!

-- 
Eugene N Dzhurinsky

Attachment: pgpZdYvcVddWu.pgp
Description: PGP signature

Reply via email to