Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8505051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:12:36+00:00 2026-06-11T02:12:36+00:00

I develop a cayenne project with a java rich client and an remote obejct

  • 0

I develop a cayenne project with a java rich client and an remote obejct persistence server. If i the rich cient connects with a Cayenne-ROP-Server that is deployed on the same machine on localhost (on Jetty from maven goal like explained inside the cayenne rop tutorial) everythings fine:

ClientConnection clientConnection = new HessianConnection("http://localhost:8080/rop.server   /cayenne-service",
            "cayenne-user", "secret", SHARED_CAYENNE_SESSION_NAME);
DataChannel channel = new ClientChannel(clientConnection);
ObjectContext context = new CayenneContext(channel);
List<Object> someEntities = context.performQuery(allMovies);

If i change the url that i want to connect to in the first line to a non local host (Tomcat7 on ubuntu) then everything works till it comes to the 4th line:

List<Object> someEntities = context.performQuery(allMovies);

Then i get the Error “No session associated with request”

Here is the full Output of the Client:

Running de.pss.hdlist.client.dataservice.MovieDataServiceCayenneImplTest
Sep 07, 2012 10:21:37 AM org.apache.cayenne.remote.hessian.HessianConnection connect
INFO: Connecting to [cayenne-user:*******@http://comunity-server.hopto.org:8080    /rop.server-3.0.2/cayenne-service] - shared session 'global-cayenne-session'
Sep 07, 2012 10:21:40 AM org.apache.cayenne.remote.hessian.HessianConnection connect
INFO: === Connected, session:  org.apache.cayenne.remote.RemoteSession@12241e[sessionId=C47DD36ACE2A043401C8D0C44D5BD8C3,n    ame=global-cayenne-session] - took 3182 ms.
Sep 07, 2012 10:21:53 AM org.apache.cayenne.remote.BaseConnection sendMessage
INFO: --- Message 0: Bootstrap
Sep 07, 2012 10:21:53 AM org.apache.cayenne.remote.BaseConnection sendMessage
INFO: === Message 0: Bootstrap done - took 406 ms.
Sep 07, 2012 10:21:53 AM org.apache.cayenne.remote.BaseConnection sendMessage
INFO: --- Message 1: Query
Sep 07, 2012 10:21:53 AM org.apache.cayenne.remote.BaseConnection sendMessage
INFO: *** Message error for 1: Query - took 187 ms.

Here is the Serverside output of the Apache Tomcat log:

WARNING: org.apache.cayenne.remote.service.MissingSessionException: [v.3.0.2 Jun 19 2011 09:29:50] No session associated with request.
org.apache.cayenne.remote.service.MissingSessionException: [v.3.0.2 Jun 19 2011 09:29:50] No session associated with request.
    at    org.apache.cayenne.remote.service.BaseRemoteService.processMessage(BaseRemoteService.java:148)
    at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:180)
    at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:109)
    at com.caucho.hessian.server.HessianServlet.service(HessianServlet.java:396)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:679)

I use Apache Cayenne 3.0.2, Apache-Tomcat 7.0.29 and Java 7 sdk

THX in advance for every Help

PS. Maybe the local Jetty server handles things in another way as the Tomcat Server on remote unix machine.

Edit:
After the hint given by Andrus in the answer below i added an SessionListern that looks like this:

public class HttpSessionListenerLogImpl implements HttpSessionListener {

private final static Logger LOGGER = Logger.getLogger(HttpSessionListenerLogImpl.class.getName());

@Override
public void sessionCreated(HttpSessionEvent hse) {
    LOGGER.log(Level.SEVERE,
            "!__Session created with ID: " + hse.getSession().getId());
    LOGGER.log(Level.SEVERE, "!__Session created by: " + hse.getSource());
    LOGGER.log(Level.SEVERE, "!__Session Attributes: " + hse.getSession().getAttributeNames());
    LOGGER.log(Level.SEVERE, "!__Session max inactivity: " + hse.getSession().getMaxInactiveInterval());
    LOGGER.log(Level.SEVERE, "!__Session context: " + hse.getSession().getServletContext().getServletContextName());
}

@Override
public void sessionDestroyed(HttpSessionEvent hse) {
    LOGGER.log(Level.SEVERE, "!__Session killed with ID: " + hse.getSession().getId());
    LOGGER.log(Level.SEVERE, "!__Session killed by: " + hse.getSource());
    LOGGER.log(Level.SEVERE, "!__Session Attributes: " + hse.getSession().getAttributeNames());
    LOGGER.log(Level.SEVERE, "!__Session max inactivity: " + hse.getSession().getMaxInactiveInterval());
    LOGGER.log(Level.SEVERE, "!__Session context: " + hse.getSession().getServletContext().getServletContextName());
}

So this listern gives me the following output when executing the 4 lines of code statet on top of this Question:

Sep 11, 2012 11:06:27 AM de.pss.hdlist.HttpSessionListenerLogImpl sessionCreated
SEVERE: !__Session created with ID: B07648A2A5F0005AF6DF0741D7EF2D21
Sep 11, 2012 11:06:27 AM de.pss.hdlist.HttpSessionListenerLogImpl sessionCreated
SEVERE: !__Session created by: org.apache.catalina.session.StandardSessionFacade@515f9553
Sep 11, 2012 11:06:27 AM de.pss.hdlist.HttpSessionListenerLogImpl sessionCreated
SEVERE: !__Session Attributes: java.util.Collections$2@5a44a5e1
Sep 11, 2012 11:06:27 AM de.pss.hdlist.HttpSessionListenerLogImpl sessionCreated
SEVERE: !__Session max inactivity: 216000
Sep 11, 2012 11:06:27 AM de.pss.hdlist.HttpSessionListenerLogImpl sessionCreated
SEVERE: !__Session context: Cayenne Tutorial
Sep 11, 2012 11:06:27 AM com.caucho.hessian.server.HessianSkeleton invoke
WARNING: org.apache.cayenne.remote.service.MissingSessionException: [v.3.0.2 Jun 19 2011 09:29:50] No session associated with request.
org.apache.cayenne.remote.service.MissingSessionException: [v.3.0.2 Jun 19 2011 09:29:50] No session associated with request.
    at  org.apache.cayenne.remote.service.BaseRemoteService.processMessage(BaseRemoteService.java:148)
    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:616)
    at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:180)
    at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:109)
    at com.caucho.hessian.server.HessianServlet.service(HessianServlet.java:396)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:679)

Here you can see there is a session that gets created and there is no session that gets killed. So why does the ObjectContext from my line of code

List<Object> someEntities = context.performQuery(allMovies);

does ignore the session. Do i have to set it explicitly before doing a query? What is the standard initializing code on the client side to access an remotly deployed cayenne server. Does it differ from the one given inside the cayenne rop tutorial?

THX in advance.

Edit:
I upgraded to cayenne 3.1B1 hoping to get rid of this error, but same Situation here: “No session…” when trying to send a query.

I also setup a tomcat on localhost and configured it the same as the remote is. Same Problem here “No Session…” when trying to send a query.

So the Jetty on localhost is the only one that takes the 4 line init code from above and holds the session for every following query. So here is my Question. Does anyone on this planet ever tried to deploy a cayenne rop server on a tomcat and succeeded?

THX in advance for every little hint.

Edit:
So i did a litte bit of server side debugging on my local tomcat7.

1.Client executes line 2 of code from above:

DataChannel channel = new ClientChannel(clientConnection);

on the Serverside my session listener gets triggerd and tells me a session has been created with id: B6565298F222294F601B76333DBE4911

2.Client executes line 3 from above:

ObjectContext context = new CayenneContext(channel);

On the server side the method of class org.apache.cayenne.remote.service.HttpRemoteSession gets called:

/**
 * Returns a ServerSession object that represents Cayenne-related state associated
 * with the current session. If ServerSession hasn't been previously saved, returns
 * null.
 */
@Override
protected ServerSession getServerSession() {
    HttpSession httpSession = getSession(true);
    return (ServerSession) httpSession.getAttribute(SESSION_ATTRIBUTE);
}

a new session gets created by line one of this method. Its ID is: ECC4A81D6240A1D04DA0A646200C4CE6. This new Session contains exactly one attribute: the key is “org.apache.cayenne.remote.service.HttpRemoteService.ServerSession” and the value is (who guessed it?) the session created before in step 1
What makes me wonder is that my serveltListener dont gets triggerd though a new session gets created.

3.Client executes line 4 from above

List<Object> someEntities = context.performQuery(allMovies);

at the serverside now the getServerSession() method is called again. This time also a new session gets created (why?). And this session does not contain any attribute. So the line “return (ServerSession) httpSession.getAttribute(SESSION_ATTRIBUTE);” inside the method getServerSession() returns null and exactly this triggers the exception “No Session associated with request”.

So why is the cayenne serverside creating e ne session and doesnt use the old one created befor? Do i have to explicitly send the session within the query?

Edit:
I made screenshots from the netbeans http-monitor while running the four lines of code from above:
http monitor tomcat cayenne

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T02:12:38+00:00Added an answer on June 11, 2026 at 2:12 am

    This is an issue between Cayenne ROP and newer containers:

    https://issues.apache.org/jira/browse/CAY-1739

    Here is a Tomcat solution – create context.xml file with the following contents, and place it in META-INF/ of your webapp:

    <Context>
        <Valve className="org.apache.catalina.authenticator.BasicAuthenticator"
            changeSessionIdOnAuthentication="false" />
    </Context>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We develop a Java EE application that uses a Postgres database as persistence medium.
I develop a Java application with 4 tiers : database (MySQL), persistence (JPA), business
I develop on VS2010 WPF on Window 7. I have a project that does
I develop a client-server application and I have log in the server, so I
I develop a library that is referenced by a SmartDevice project and a WinForm
I develop a Java program using the SVNKit library that will be responsible to
I develop a web application that let users to upload files like images and
I develop Qt-based project and use Mercurial repository (bitbucket.org service) for version control. Each
I develop application in Java and Spring AOP. Anything is good, but I've created
I develop in eclipse using pydev plugin. When I run project in eclipse everything

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.