Fórum

Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplorer

arti ln, modificado 11 Anos atrás.

Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplorer

New Member Postagens: 15 Data de Entrada: 29/04/11 Postagens Recentes
Hi Neil,

I tried Liferay 6.0.x + PrimeFaces 3 Demo Portlet posted on liferay demo site.Ajax update for datatable is not working in InternetExplorer browser. It works well in firefox.

Also In firefox I cannot read the uploaded file contents.Every time FileNotFoundException appears in log. Absolute path for the file somehow only contains filename i.e. "uploadedfile.txt" whereas in InternetExplorer it is the full path of uploaded file i.e."c:\uploadedfile.txt".

Exception while uploading a file in firefox
java.io.FileNotFoundException: uploadedfile.txt (The system cannot find the file specified)

Am i missing something at my end.Please help.

Thanks
thumbnail
Neil Griffin, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
I've reproduced the problem and I'll get back to you (hopefully tomorrow) with an answer.
liferay user, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

New Member Postagens: 15 Data de Entrada: 29/04/11 Postagens Recentes
Thanks Neil for quick reply.
thumbnail
Neil Griffin, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
I think that the main problem you ran into was fixed in FACES-1204 so please try Liferay Faces Bridge version 3.0.0-RC1-SNAPSHOT and see if it works. You can download it from the snapshot repository.

The good news is that I was able to upload files with p:fileUpload with IE8. The files were indeed received on the server.

The crummy news is that the IE8 browser is not updated properly afterward. The portlet continues to function fine -- it's just that the user is not alerted to the fact that the files were uploaded. I documented this problem in FACES-1227 in order to track it to closure.
liferay user, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

New Member Postagens: 15 Data de Entrada: 29/04/11 Postagens Recentes
Hi Neil,

In IE i was able to read the contents of the file and do the processing only if liferay is running locally but if liferay runs remote i get FileNotFoundException.


Portlets are not working if i use liferay-faces-bridge-impl-3.0.0-RC1-20120516.184344-21.jar. Below is the exception i am seeing in the logs.Also attached is the stack trace.


19:48:23,335 ERROR [PortletRequestDispatcherImpl:108] javax.servlet.ServletException: File "/invoke.jsp" not found
javax.servlet.ServletException: File "/invoke.jsp" not found


Do i have to add some more libs?

Attached is the screen shot of libs i have in my environment
liferay user, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

New Member Postagens: 15 Data de Entrada: 29/04/11 Postagens Recentes
Hi Neil

I tried liferay-faces-bridge-impl-3.0.0-BETA2.jar and liferay-faces-bridge-impl-3.0.0-BETA1.jar but still unable to load file using firefox.

Also , if i try uploading file remotely i.e. in an environment where liferay runs on one box and i access web url from different machine then i am unable to read the contents any file irrespective of browser. Log file show FileNotFoundException.



Please help.

Thanks
thumbnail
Neil Griffin, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
I just tried it with FireFox 12 and it's working fine for me. So the only problem that I am able to reproduce is FACES-1227 with IE. Please "watch" that issue for more info. I spoke to Çağatay just now and he said he would try to reproduce the problem.

So here is what I recommend that you do:

1. Download a new/clean version of Liferay Portal 6.0 (bundled with Tomcat)
2. Start the new version of Liferay Portal
3. Download the SNAPSHOT version of the primefaces3-portlet demo. (Not the bridge JAR, but the demo WAR).
4. Copy the WAR to the Liferay /deploy folder
5. Add a new portal page named PF3
6. Add the "PrimeFaces 3" portlet (found under samples) to the PF3 page
7. Visit the page with FireFox and try uploading a file.
liferay user, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

New Member Postagens: 15 Data de Entrada: 29/04/11 Postagens Recentes
Hi Neil,

Tried on firefox 12

I did all the steps suggested by you.Downloaed Liferay Portal 6.0 (bundled with Tomcat) and deployed SNAPSHOT version war file in deploy folder.

As i deployed error came related to jstl.jar "java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config" . After copying jstl libraires in webinf\lib of portlet got the following error

javax.servlet.ServletException: File "/invoke.jsp" not found

- Component Tree

<UIViewRootBridgeImpl id="_jpfcpncuivr_A7813_j_id1" inView="true" locale="en_US" renderKitId="HTML_BASIC" rendered="true" transient="false" viewId="/invoke.jsp"/>

Please help.
thumbnail
Neil Griffin, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
Just wanted to let you know that I reproduced the error: javax/servlet/jsp/jstl/core/Config

I'll investigate now...
thumbnail
Neil Griffin, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
OK I just fixed FACES-1233 which was causing problems for all kinds of JSF portlets (not just PrimeFaces) and Liferay 6.0. When you get a chance, please download the newest/latest 3.0.0-RC1-SNAPSHOT version of the primefaces3-portlet and give it a try.

Thanks,

Neil
liferay user, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

New Member Postagens: 15 Data de Entrada: 29/04/11 Postagens Recentes
Hi Neil,

Thanks alot for fixing the errors related to javax/servlet/jsp/jstl/core/Config. Newest/latest 3.0.0-RC1-SNAPSHOT version of the primefaces3-portlet is working.

But there are still problems while reading the contents of uploaded files.Files are indeed received on server but when i do FileInputStream fstream = new FileInputStream(data.getAbsolutePath()); FileNotFoundException appears in log. So i have to use the following approach to read the contents

String dir = (String)initParam.get("javax.faces.UPLOADED_FILES_DIR");
PortletSession ps = (PortletSession) ec.getSession(false);
String sessionId = ps.getId();
for (UploadedFile data : fileList) {
/* This is for unix servers as c:\a.txt gets translated to c--a-txt
*/
uploadedFileName = dir + "/"+sessionId+ "/"+data.getAbsolutePath().replaceAll("\\\\", "-").replaceAll(":","-").replace(".", "-");
fstream= new FileInputStream(uploadedFileName);
javax.mail.util.ByteArrayDataSource b = new javax.mail.util.ByteArrayDataSource(fstream,data.getContentType());
}


Is this is the only way to read the contents of uploaded file or there is another approach which i can try?

Thanks
thumbnail
Neil Griffin, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
The primefaces3-portlet uses an approach that is different than the FileInputStream approach that you mentioned. If look at the updated/latest source code for the primefaces3-portlet demo, then it will show you how to get the contents of the uploaded file(s).

For more information, see ApplicantBackingBean.java and UploadedFileWrapper.java
liferay user, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

New Member Postagens: 15 Data de Entrada: 29/04/11 Postagens Recentes
I tried getAbsolutePath().but whenever i upload a file an empty upload.dat is created under temp folder
thumbnail
Neil Griffin, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
Does the primefaces3-portlet create an empty upload.dat under the temp folder as well?
liferay user, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

New Member Postagens: 15 Data de Entrada: 29/04/11 Postagens Recentes
primefaces3-portlet also create empty upload.dat file under tmp.But i can see the uploaded file in one of the subfloder in tmp .Name of subfloder is portletsessionid.

For eg: if i upload c:\try.txt following are the contents in temp folder

temp\89589D3EA49495F7A431D4784EFD9986 ----- try-txt (Uploaded file)

temp\upload4874100566500527477.dat (empty file)


Exception in log
... 166 more
Caused by: java.lang.UnsupportedOperationException
at com.liferay.faces.bridge.renderkit.primefaces.FileUploadRendererPrimeFacesImpl$PrimeFacesFileItem.get(FileUploadRendererPrimeFacesImpl.java:140)
at org.primefaces.model.DefaultUploadedFile.getContents(DefaultUploadedFile.java:51)
at com.liferay.faces.demos.dto.UploadedFileWrapper.getAbsolutePath(UploadedFileWrapper.java:62)
at com.liferay.faces.demos.bean.ApplicantBackingBean.handleFileUpload(ApplicantBackingBean.java:103)
thumbnail
Neil Griffin, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
OK thanks -- I'll try and reproduce this tomorrow.
thumbnail
Neil Griffin, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
I wanted to let you know that I have reproduced this problem -- thanks for reporting it, and thanks for your patience! I'll try to fix it early next week.
thumbnail
Neil Griffin, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
Correction -- it turns out that I did not reproduce this problem. I had a programming error in a local copy of the primefaces3-portlet that made me think I reproduced the problem, but really I didn't.

Regardless, I just did a large commit to the Git repository, focussing entirely on file upload fixes/enhancements:

FACES-300
Unable to determine if file upload failed because RequestParameterMapMultiPartImpl is swallowing the exception

FACES-1241
Refactor UploadedFile interface to better align with Servlet 3.0, ICEfaces, PrimeFaces, and RichFaces

FACES-1242
Normal UTF-8 encoded text fields have incorrect content with multipart file upload requests

FACES-1243
Multipart file upload fails when com.liferay.faces.bridge.optimizePortletNamespace=false

FACES-1244
Support HTML5 multiple attribute for bridge:inputFile

FACES-1245
Repackage UploadedFile from com.liferay.faces.bridge.component to com.liferay.faces.bridge.model

FACES-1246
Temporary folder for uploaded files not being created in a platform independent manner

FACES-1247
Refactor jsf2-portlet to support multiple file upload with a single bridge:inputFile component tag

FACES-1248
Refactor icefaces3-compat-portlet to use ice:dataTable and ice:panelPopup

FACES-1250
Develop support for bridge:inputFile fileUploadListener attribute and value attribute

FACES-1251
Develop support for new UploadedFileFactory

When you get a chance, please download the latest primefaces3-portlet demo from the snapshot repository and give it another try. If you're still having the problem please let me know.

Thanks for your patience,

Neil
liferay user, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

New Member Postagens: 15 Data de Entrada: 29/04/11 Postagens Recentes
Hi Neil,

primefaces3-portlet-3.0.0-RC1-SNAPSHOT is working fine.But primefaces3-portlet-3.1.0-RC1 from snaphpot repository is not working.It is throwing the error: javax/servlet/jsp/jstl/core/Config.

Thanks
thumbnail
Neil Griffin, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
I've reproduced the javax/servlet/jsp/jstl/core/Config problem on Liferay 6.0.6 -- looks like a regression. I'll start working on it and let you know when it's fixed.
thumbnail
Neil Griffin, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
Clarification: I was able to reproduce the javax/servlet/jsp/jstl/core/Config problem, but only because I made the mistake of using 3.1.0-RC1-SNAPSHOT inside of Liferay Portal 6.0.6, when I should have used 3.0.0-RC1-SNAPSHOT instead.

As I read what you wrote more closely:
primefaces3-portlet-3.0.0-RC1-SNAPSHOT is working fine. But primefaces3-portlet-3.1.0-RC1 from snaphpot repository is not working. It is throwing the error: javax/servlet/jsp/jstl/core/Config.


Is it possible that you made the same mistake as me?

So I take back my words -- I don't think this is a regression. But if we both made this mistake, then I think others will too eventually. So in order to avoid this problem, I just applied the fix for FACES-1233 to the 3.0.x AND 3.1.x (master) branches. Previously it was only applied to the 3.0.x branch because it is Liferay Portal 6.0.x compatibility issue.

When you get a chance, please try the snapshot artifact repository again.

Thanks,

Neil
liferay user, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

New Member Postagens: 15 Data de Entrada: 29/04/11 Postagens Recentes
Yep i also did the same mistake of using 3.1.0 jar in liferay 6.0 .

I tried the 3.0.x and 3.1.x file upload from snapshot repository and they are working fine.

Also do you have any idea if catagay has reproduced the bug related to dom not being updated in Internet Explorer i.e. FACES-1227 and if he has any fix available for this?

Thanks
thumbnail
Neil Griffin, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
Çağatay is aware of the FACES-1227 issue in the Liferay issue tracker but for the sake of consistency, I just created a corresponding issue in the PrimeFaces issue tracker:
http://code.google.com/p/primefaces/issues/detail?id=4154

There is a chance that it might get fixed in PrimeFaces 3.3 but I can't say for sure.
thumbnail
Neil Griffin, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

Liferay Legend Postagens: 2655 Data de Entrada: 27/07/05 Postagens Recentes
Update: I saw today that PrimeFaces 3.3 was released but the blog announcement indicates that there will be a 3.3.1 version that contains some patches I contributed. Those patches don't include a fix for the IE problem discussed here, but perhaps it will get fixed.
liferay user, modificado 11 Anos atrás.

RE: Liferay 6.0.x + PrimeFaces 3 Demo Portlet not working in InternetExplor

New Member Postagens: 15 Data de Entrada: 29/04/11 Postagens Recentes
Thanks Neil for update.I will watch this issue.