You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Niels Bo <ni...@gmail.com> on 2007/11/18 19:49:45 UTC

Session.bind() in newSession()

Hi

I am setting locale and a userid to my custom Session in the
application.newSession() method
(the information comes from a front end proxy),
and this works fine under Jetty, but I get this nullpointer exception under
WebLogic.

Is that the wrong place to call bind()? 

java.lang.NullPointerException
	at org.apache.wicket.Session.bind(Session.java:392)
	at
oet.applications.branch.BranchApplication.newSession(BranchApplication.java:87)
	at org.apache.wicket.Session.findOrCreate(Session.java:225)
	at
org.apache.wicket.protocol.http.WicketFilter.getLastModified(WicketFilter.java:894)
	at
org.apache.wicket.protocol.http.WicketServlet.getLastModified(WicketServlet.java:210)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:736)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
	at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
	at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
	at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
	at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
	at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
	at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
	at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
	at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
	at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

Using 1.3.0-rc1, Session.java:392 contains RequestCycle.get().getRequest()

Niels
-- 
View this message in context: http://www.nabble.com/Session.bind%28%29-in-newSession%28%29-tf4831304.html#a13822138
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Session.bind() in newSession()

Posted by Timo Rantalaiho <Ti...@ri.fi>.
On Mon, 19 Nov 2007, Niels Bo wrote:
> I was tracking a problem where the several Session was created with just my
> local browser, 
> but it was caused by myself alternating between Jetty and Weblogic without
> closing the browser.
> There were then two session cookies (but different path), so WebLogic was
> unable to overwrite the jsessionid from Jetty.

It's a good idea to configure different cookie names for 
development, test and production (and whatever other
environments you might have).

Best wishes,
Timo


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Session.bind() in newSession()

Posted by Niels Bo <ni...@gmail.com>.
No, I don't really need the bind() anyway!

I was tracking a problem where the several Session was created with just my
local browser, 
but it was caused by myself alternating between Jetty and Weblogic without
closing the browser.
There were then two session cookies (but different path), so WebLogic was
unable to overwrite the jsessionid from Jetty.

Niels
-- 
View this message in context: http://www.nabble.com/Session.bind%28%29-in-newSession%28%29-tf4831304.html#a13844577
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Session.bind() in newSession()

Posted by Johan Compagner <jc...@gmail.com>.
You really want to create a persisted session immediately?
Why are you calling bind?

The problem that in the getLastModified() call there is no complete
RequestCycle.
because those must be very fast.

I can test if RequestCycle.get() returns something in that method.
But then bind() call really doesn't do anything..

johan



On Nov 18, 2007 7:49 PM, Niels Bo <ni...@gmail.com> wrote:

>
> Hi
>
> I am setting locale and a userid to my custom Session in the
> application.newSession() method
> (the information comes from a front end proxy),
> and this works fine under Jetty, but I get this nullpointer exception
> under
> WebLogic.
>
> Is that the wrong place to call bind()?
>
> java.lang.NullPointerException
>        at org.apache.wicket.Session.bind(Session.java:392)
>        at
> oet.applications.branch.BranchApplication.newSession(
> BranchApplication.java:87)
>        at org.apache.wicket.Session.findOrCreate(Session.java:225)
>        at
> org.apache.wicket.protocol.http.WicketFilter.getLastModified(
> WicketFilter.java:894)
>        at
> org.apache.wicket.protocol.http.WicketServlet.getLastModified(
> WicketServlet.java:210)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:736)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>        at
> weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(
> ServletStubImpl.java:971)
>        at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(
> ServletStubImpl.java:402)
>        at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(
> ServletStubImpl.java:305)
>        at
> weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run
> (WebAppServletContext.java:6350)
>        at
> weblogic.security.acl.internal.AuthenticatedSubject.doAs(
> AuthenticatedSubject.java:317)
>        at
> weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
>        at
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(
> WebAppServletContext.java:3635)
>        at
> weblogic.servlet.internal.ServletRequestImpl.execute(
> ServletRequestImpl.java:2585)
>        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
>        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>
> Using 1.3.0-rc1, Session.java:392 contains RequestCycle.get().getRequest()
>
> Niels
> --
> View this message in context:
> http://www.nabble.com/Session.bind%28%29-in-newSession%28%29-tf4831304.html#a13822138
> Sent from the Wicket - User mailing list archive at Nabble.com<http://nabble.com/>
> .
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>