Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Primefaces unable to create resources for jquery
Hello,
We have a portlet on Liferay DXP 7.1, JSF 2.2 and Primefaces 6.2.There is message on the logs concerning the Jquery resources form Primefaces. The Primefaces library is as provided no modifications have done on it.11:02:00,106 ERROR [MissingResourceImpl:94] Resource handler=[com.sun.faces.application.resource.ResourceHandlerImpl@7b8db7f8] was unable to create a resource for resourceName=[jquery/jquery.js] libraryName=[primefaces] contentType=[null
]
11:02:00,170 ERROR [MissingResourceImpl:94] Resource handler=[com.sun.faces.application.resource.ResourceHandlerImpl@7b8db7f8] was unable to create a resource for resourceName=[jquery/jquery-plugins.js] libraryName=[primefaces] contentTy
pe=[null]
did somebody has ever had a similar problem?thx Jose
We have a portlet on Liferay DXP 7.1, JSF 2.2 and Primefaces 6.2.There is message on the logs concerning the Jquery resources form Primefaces. The Primefaces library is as provided no modifications have done on it.11:02:00,106 ERROR [MissingResourceImpl:94] Resource handler=[com.sun.faces.application.resource.ResourceHandlerImpl@7b8db7f8] was unable to create a resource for resourceName=[jquery/jquery.js] libraryName=[primefaces] contentType=[null
]
11:02:00,170 ERROR [MissingResourceImpl:94] Resource handler=[com.sun.faces.application.resource.ResourceHandlerImpl@7b8db7f8] was unable to create a resource for resourceName=[jquery/jquery-plugins.js] libraryName=[primefaces] contentTy
pe=[null]
did somebody has ever had a similar problem?thx Jose
If you create a new portlet project with the PrimeFaces archetype, build it, and copy the resulting WAR to $LIFERAY_HOME/deploy, then do you see the same error in the logs?
mvn archetype:generate \
-DarchetypeGroupId=com.liferay.faces.archetype \
-DarchetypeArtifactId=com.liferay.faces.archetype.primefaces.portlet \
-DarchetypeVersion=5.0.7 \
-DgroupId=com.mycompany \
-DartifactId=com.mycompany.my.primefaces.portlet
Hi Neil,Thanks for your reply.I did follow your instructions, the error is the same:15:59:30,774 ERROR [MissingResourceImpl:94] Resource handler=[com.sun.faces.application.resource.ResourceHandlerImpl@a951d48] was unable to create a resource for resourceName=[jquery/jquery.js] libraryName=[primefaces] contentType=[null]
15:59:30,828 ERROR [MissingResourceImpl:94] Resource handler=[com.sun.faces.application.resource.ResourceHandlerImpl@a951d48] was unable to create a resource for resourceName=[jquery/jquery-plugins.js] libraryName=[primefaces] contentType=[null]
Jose
15:59:30,828 ERROR [MissingResourceImpl:94] Resource handler=[com.sun.faces.application.resource.ResourceHandlerImpl@a951d48] was unable to create a resource for resourceName=[jquery/jquery-plugins.js] libraryName=[primefaces] contentType=[null]
Jose
Hi Jose,
I just did the following, in order to deploy a PrimeFaces portlet to Liferay DXP 7.1:
The portlet rendered fine. I am unable to reproduce your error.Therefore I would recommend that you try deploying the archetype to a clean install of Liferay DXP 7.1 and see if you encounter the same error.
Kind Regards,
Neil
I just did the following, in order to deploy a PrimeFaces portlet to Liferay DXP 7.1:
mvn archetype:generate \
-DarchetypeGroupId=com.liferay.faces.archetype \
-DarchetypeArtifactId=com.liferay.faces.archetype.primefaces.portlet \
-DarchetypeVersion=5.0.7 \
-DgroupId=com.mycompany \
-DartifactId=com.mycompany.my.primefaces.portlet
mvn archetype:generate
mvn clean package
cp target/*.war to $LIFERAY_HOME/deploy
And then I added the portlet to a portal page and reloaded the page.The portlet rendered fine. I am unable to reproduce your error.Therefore I would recommend that you try deploying the archetype to a clean install of Liferay DXP 7.1 and see if you encounter the same error.
Kind Regards,
Neil
Hi Neil,Yes that is what we have done, but it the error remains on the logs.Any idea what could be causing this issue?
On the source of the page we have this:
On the source of the page we have this:
<script data-senna-track="permanent" type="text/javascript" src="[url=http://vpp-sn.slcloud.ch:8080/o/VPPportlet/RES_NOT_FOUND&v=6.2]/o/VPPportlet/RES_NOT_FOUND&v=6.2[/url]" id="primefaces:jquery/jquery.js">
</code></pre>Thanks for your answer.José</script>
To solve the issue we have implemented a class:public class VppCustomJsfResourceHandler extends javax.faces.application.ResourceHandlerWrapper {
.... @Override
public Resource createResource(final String resourceName, final String libraryName) {
final Resource resource = super.createResource(resourceName, libraryName);
if ("primefaces".equals(libraryName) && "jquery/jquery.js".equals(resourceName)) {
Resource localResource = new ResourceWrapper() {
@Override
public String getRequestPath() {
return "/o/theme/libs/jquery/jquery.js";
}
...}Extract the jquery.js library from the PF jar file and place it on the theme so this can be returned when required by jsf.
Cheers.José
.... @Override
public Resource createResource(final String resourceName, final String libraryName) {
final Resource resource = super.createResource(resourceName, libraryName);
if ("primefaces".equals(libraryName) && "jquery/jquery.js".equals(resourceName)) {
Resource localResource = new ResourceWrapper() {
@Override
public String getRequestPath() {
return "/o/theme/libs/jquery/jquery.js";
}
...}Extract the jquery.js library from the PF jar file and place it on the theme so this can be returned when required by jsf.
Cheers.José
Hi José,
Apologies for the delay in my reply. Thank you for posting your solution. I am very glad to know that it is working for you, but it is a workaround that you should not have to be doing.
Are you certain that you exactly/precisely followed my instructions regarding deploying a PrimeFaces portlet to Liferay DXP 7.1 using mvn archetype:generate? Also, did you try it with a clean install of DXP 7.1? Again, I was not able to reproduce the problem.
Kind Regards,Neil
Apologies for the delay in my reply. Thank you for posting your solution. I am very glad to know that it is working for you, but it is a workaround that you should not have to be doing.
Are you certain that you exactly/precisely followed my instructions regarding deploying a PrimeFaces portlet to Liferay DXP 7.1 using mvn archetype:generate? Also, did you try it with a clean install of DXP 7.1? Again, I was not able to reproduce the problem.
Kind Regards,Neil
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™