HttpSessionReplacer icon indicating copy to clipboard operation
HttpSessionReplacer copied to clipboard

How can i use payara server with HttpSessionReplacer?

Open abucreative99 opened this issue 6 years ago • 3 comments

I am using multitenancy and payara server to deploy my application. I added the library using gradle. How do i use this library in payara server?

abucreative99 avatar Apr 12 '18 02:04 abucreative99

Haven't tested it with glassfish/payera. Two approaches you could try Adding agent you can try to add agent to command line/jvm options: it would be something like adding -javagent:$SESSION_PATH/session-agent.jar where $SESSION_PATH is path to where you've downloaded agent jar. Another options is to add a SessionFilter as first filter in chain - this needs to be done in web.xml of your web app.

nbogojevic avatar Apr 12 '18 15:04 nbogojevic

Thank you for your expert feedback. Below is what i did: I have added the agent in the jvmoptions of my container(payara).

-javaagent:/home/session-agent-0.4.9.jar

Then I added the libraries to my project: the session-agent and the session-replacement library. Also, I have added the SessionFilter as the first filter in my web.xml as shown below:

<filter> <filter-name>SessionFilter</filter-name> <filter-class>com.amadeus.session.servlet.SessionFilter</filter-class> </filter> <filter-mapping> <filter-name>SessionFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>

I am not sure how to test if it works or how to access the sessionId saved.

Your quick help is greatly appreciated.

abucreative99 avatar Apr 12 '18 19:04 abucreative99

I did the same thing described by abucreative99, but I'm getting the following error when I open my login page. Any idea why?

arning: StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception java.lang.NullPointerException at org.jboss.weld.context.beanstore.http.AbstractSessionBeanStore.getLockStore(AbstractSessionBeanStore.java:116) at org.jboss.weld.context.beanstore.AttributeBeanStore.lock(AttributeBeanStore.java:251) at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:90) at org.jboss.weld.context.PassivatingContextWrapper$AbstractPassivatingContextWrapper.get(PassivatingContextWrapper.java:76) at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100) at org.jboss.weld.bean.ContextualInstanceStrategy$CachingContextualInstanceStrategy.get(ContextualInstanceStrategy.java:177) at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50)

RafaelAlthaus avatar Sep 13 '18 05:09 RafaelAlthaus