Forum Stats

  • 3,750,460 Users
  • 2,250,181 Discussions
  • 7,866,986 Comments

Discussions

NullPointerException at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.initSessionInfo

hoanvuphan
hoanvuphan Member Posts: 26 Blue Ribbon
edited Jul 21, 2021 6:38AM in JDeveloper and ADF

Hi,

I am using ADF 12.1.3 and weblogic 12.1.3.

Recent weeks, I am facing a crash on production. But I cannot reproduce it all the time.

My weblogic is restarted every day. After the restart, I have 2 batch jobs running using commonj.timers.TimerManager to schedule the job.

After the jobs done, the first user login seems successfully, but got error on next PPR request (PprResponseWriter included in the stacktrace)

The later users got the same NPE but right after login, (PprResponseWriter not included in the stacktrace)

I tried to look at the code of SessionHelper.initSessionInfo at line 3085, it seems the contextManager is null, and context is null too.

I tried to restart the weblogic, sometimes it's back to normal, but sometimes it cannot.

I also try to uncheck the Enable Keepalives in weblogic console, and also tried to remove the tmp folder of weblgic before restart, but the problem is still happened again and again.

Do you have some clue for me?

Thank you very much,

Vu




The stacktrace for first user is right below:


java.lang.NullPointerException

at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.initSessionInfo(ServletRequestImpl.java:3085)

at weblogic.servlet.internal.ServletRequestImpl$SessionHelper._getSessionInternal(ServletRequestImpl.java:2795)

at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.getSessionInternal(ServletRequestImpl.java:2783)

at weblogic.servlet.internal.ServletRequestImpl$SessionHelper.getSession(ServletRequestImpl.java:2773)

at weblogic.servlet.internal.ServletRequestImpl.getSession(ServletRequestImpl.java:1459)

at weblogic.servlet.internal.ServletResponseImpl.encodeURL(ServletResponseImpl.java:681)

at javax.servlet.http.HttpServletResponseWrapper.encodeURL(HttpServletResponseWrapper.java:112)

at com.sun.faces.context.ExternalContextImpl.encodeActionURL(ExternalContextImpl.java:514)

at org.apache.myfaces.trinidad.util.ExternalContextURLEncoder.encodeActionURL(ExternalContextURLEncoder.java:73)

at org.apache.myfaces.trinidad.util.URLEncoderWrapper.encodeActionURL(URLEncoderWrapper.java:43)

at org.apache.myfaces.trinidad.util.URLEncoderWrapper.encodeActionURL(URLEncoderWrapper.java:43)

at org.apache.myfaces.trinidad.util.URLEncoderWrapper.encodeActionURL(URLEncoderWrapper.java:43)

at org.apache.myfaces.trinidadinternal.config.URLEncoderExternalContext.encodeActionURL(URLEncoderExternalContext.java:125)

at javax.faces.context.ExternalContextWrapper.encodeActionURL(ExternalContextWrapper.java:104)

at javax.faces.context.ExternalContextWrapper.encodeActionURL(ExternalContextWrapper.java:104)

at javax.faces.context.ExternalContextWrapper.encodeActionURL(ExternalContextWrapper.java:104)

at javax.faces.context.ExternalContextWrapper.encodeActionURL(ExternalContextWrapper.java:104)

at oracle.adfinternal.view.faces.renderkit.rich.PprResponseWriter._writeFormActionScript(PprResponseWriter.java:492)

at oracle.adfinternal.view.faces.renderkit.rich.PprResponseWriter.endDocument(PprResponseWriter.java:84)

at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1722)

at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1600)

at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:525)

Answers

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 37,460 Red Diamond
    edited Jul 21, 2021 4:29PM

    You first need to try to narrow down the area of the problem.


    Is the production running on one or more than one server?

    If you use more than one server, make sure the sessions are always routed to the same server (sticky sessions).

    If you only use one server in production, disable the scheduled jobs completely, then restart the server and see if the login to your application works. If yes you know the scheduled jobs are the problem. If you still have the same problem you have to dig deeper into your application.

    In this case, you should check the login process. Is there any code you have written in this area?

    If yes check if this code can cause the problem.


    Timo


  • hoanvuphan
    hoanvuphan Member Posts: 26 Blue Ribbon

    Hi Timo,


    The production is running on one server.

    I will disable the batch jobs and dig more on the login and keep you updated.


    Regards,

    Vu