Problem with big fileupload, nullpointerException

UI Components for JSF
Post Reply
drbeka
Posts: 2
Joined: 30 Jan 2013, 01:26

30 Jan 2013, 01:43

Hi,

I use primefaces 3.4.2 and p:fileupload
<p:fileUpload fileUploadListener="#{updates.handleFileUpload}" mode="advanced" auto="true" />
and have big problems if I upload files which are big (> 1 GB) and need long time for upload (> 1 h).
For smaller files (600 MB) all is ok, but if upload bigfiles the progressbar continued until 100%, the upload seems to be finished but the UploadListener is not called and in the logfile appears a nullpointer-exception (see below).
I have set the session-timeout to 120 minutes and in the uploadDirectory I can see the temporary uploadfile with the expected size, so the upload seems to be successfull but the listener seems not to be called.

The application runs in websphere 8 and the URL of the webapp is
secured by <security-constraint>.

What is the problem?



[1/29/13 17:34:07:536 CET] 0000002d FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on /opt/IBM/WebSphere/Profiles/base/logs/ffdc/mis-member1-0_7b20159_13.01.29_17.34.07.5312770823311730766952.txt com.ibm.ws.security.auth.ContextManagerImpl.getCallerCredentials 1062
[1/29/13 17:34:07:537 CET] 0000002d WASSessionCor E SessionContext checkSecurity SESN0008E: A user authenticated as anonymous has attempted to access a session owned by user:PAI Realm/uid=D0X00504,type=Person,scope=LTPA.
[1/29/13 17:34:07:546 CET] 0000002d ErrorPageWrit E An exception occurred
java.lang.NullPointerException
at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:107)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:185)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1188)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:763)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:454)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:125)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:77)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:919)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1016)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:895)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1659)

[1/29/13 17:34:07:547 CET] 0000002d WASSessionCor E SessionContext checkSecurity SESN0008E: A user authenticated as anonymous has attempted to access a session owned by user:PAI Realm/uid=D0X00504,type=Person,scope=LTPA.
[1/29/13 17:34:07:561 CET] 0000002d FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on /opt/IBM/WebSphere/Profiles/base/logs/ffdc/mis-member1-0_7b20159_13.01.29_17.34.07.5485342178476080926762.txt com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest() finilizer 865
[1/29/13 17:34:07:562 CET] 0000002d webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[Faces Servlet]: com.ibm.websphere.servlet.session.UnauthorizedSessionRequestException: SESN0008E: A user authenticated as anonymous has attempted to access a session owned by user:PAI Realm/uid=D0X00504,type=Person,scope=LTPA.
at com.ibm.ws.session.SessionContext.checkSecurity(SessionContext.java:1319)
at com.ibm.ws.session.SessionContext.isValid(SessionContext.java:842)
at com.ibm.ws.webcontainer.srt.SRTRequestContext.getSession(SRTRequestContext.java:95)
at com.ibm.ws.webcontainer.srt.SRTServletRequest.getSession(SRTServletRequest.java:2102)
at com.ibm.ws.webbeans.services.JCDIWebListener.requestDestroyed(JCDIWebListener.java:287)
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletRequestDestroyed(WebApp.java:1836)
at com.ibm.wsspi.webcontainer.collaborator.CollaboratorHelper.postInvokeCollaborators(CollaboratorHelper.java:505)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1126)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:895)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1659)

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

30 Jan 2013, 06:51

please answer this, do you search this forum before asking questions?

i responded to another post, between 5 and 10 hours ago, with a similar issue, but in that topic, they implemented or want to implement max file exceeded for upload.

clearly, you need to do the same. i have never heard of anyone uploading 1GB files. I don't even try to do that when I'm uploading videos to youtube.com.

add a file limit to your implementation and i'm sure this issue will be resolved.
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

30 Jan 2013, 07:03

Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

drbeka
Posts: 2
Joined: 30 Jan 2013, 01:26

30 Jan 2013, 17:37

Hi,

thanks for the answer.

I have seen the mentioned post but I do not want to restrict the filesize cause my customer want to upload such big files.
The app is secured so only a few person can use the app.
I wonder why the upload is successful but after the upload an exception is thrown?
What is the reason of the exception?

And another question: how can I define the filename for the uploaded file on the server so I can easier find the uploaded file after the app throws this exception?

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

30 Jan 2013, 18:28

1. look at my signature below
2. click your username at top right corner of this page, go to user control panel, your profile, and update your signature with your details like you see in my signature below
3. go to myfaces user list and ask this question there, since you are some 'some' version of websphere 'or' myfaces, and since the nullpointerexception is at/in myfaces code

Code: Select all

[1/29/13 17:34:07:536 CET] 0000002d FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on /opt/IBM/WebSphere/Profiles/base/logs/ffdc/mis-member1-0_7b20159_13.01.29_17.34.07.5312770823311730766952.txt com.ibm.ws.security.auth.ContextManagerImpl.getCallerCredentials 1062
[1/29/13 17:34:07:537 CET] 0000002d WASSessionCor E SessionContext checkSecurity SESN0008E: A user authenticated as anonymous has attempted to access a session owned by user:PAI Realm/uid=D0X00504,type=Person,scope=LTPA.
[1/29/13 17:34:07:546 CET] 0000002d ErrorPageWrit E An exception occurred
java.lang.NullPointerException
at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:107)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:185)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)
4. when you ask the question on myfaces user list, then give them a brief description of the problem, and provide the full stacktrace that you provided in the OP (original post)

5. the session owned by user part of the exception/stacktrace? you may want to search google or stackoverflow .com for that exception; maybe someone out there has a way to upload big files and not interrupt/end sessions (evidently, you need some type of keep session alive method, if enduser is uploading a big file; i've seen discussion about keep session alive on stackoverflow.com)
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

30 Jan 2013, 18:41

5, 5, 5, 5, 5...... Yes, follow 5...

Posting the class in which the error occurs in in google leads to session timeout during posting... PLEASE do some basic searching when errors in NON PRIMEFACES classes occur... Took me only 2 minutes to get a pointer in the direction of sessiontimeout...

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests