Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
donino pienni
ClassNotFoundException: javax.faces.webapp.FacesServlet when PACL enabled
June 11, 2014 3:06 PM
Answer

donino pienni

Rank: Junior Member

Posts: 82

Join Date: July 2, 2011

Recent Posts

Hi,

I develop a portlet application which enables the security manager in liferay-plugin-package.properties:

1security-manager-enabled=true


When the application starts, we get the stacktrace below in liferay 6.2 EE and 6.2.1 CE logs. It happens only once and it does not look to break anything, despite of this message the portlet works finely. If we disable the security manager in liferay-plugin-package.properties of the portlet, then this exception does not happen. This class "javax.faces.webapp.FacesServlet" is not in the .WAR of the portlet, and it is not invoked anywhere in the code. The portlet makes use of these dependencies, not sure if it could be related:

1portal-dependency-jars=jstl-api.jar,jstl-impl.jar


Please has someone else experienced this issue? Any idea to workaround it?

Any suggestion wille be much appreciated!
Thanks!

 120:23:06,406 ERROR [localhost-startStop-1][BasePortalLifecycle:94] java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet
 2java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet
 3    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
 4    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
 5    at com.liferay.portal.kernel.util.InstanceFactory.newInstance(InstanceFactory.java:52)
 6    at com.liferay.portal.kernel.util.InstanceFactory.newInstance(InstanceFactory.java:27)
 7    at com.liferay.portal.kernel.servlet.SecureServlet.doPortalInit(SecureServlet.java:101)
 8    at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:44)
 9    at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:64)
10    at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:56)
11    at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:54)
12    at com.liferay.portal.kernel.servlet.SecureServlet.init(SecureServlet.java:76)
13    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
15    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16    at java.lang.reflect.Method.invoke(Method.java:606)
17    at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:277)
18    at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:274)
19    at java.security.AccessController.doPrivileged(Native Method)
20    at javax.security.auth.Subject.doAsPrivileged(Subject.java:536)
21    at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:309)
22    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:169)
23    at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:123)
24    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1268)
25    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
26    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
27    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
28    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
29    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
30    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
31    at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:133)
32    at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:156)
33    at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:145)
34    at java.security.AccessController.doPrivileged(Native Method)
35    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
36    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
37    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1113)
38    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1671)
39    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
40    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
41    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
42    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
43    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
44    at java.lang.Thread.run(Thread.java:724)
Subhash Pavuskar
RE: ClassNotFoundException: javax.faces.webapp.FacesServlet when PACL enabl
June 11, 2014 10:18 PM
Answer

Subhash Pavuskar

Rank: Regular Member

Posts: 234

Join Date: March 12, 2012

Recent Posts

No Sure !! did you added these Jars
1. jsf-api-2.0.3.jar
2. primefaces-2.2.RC2.jar in WEB-INF/lib folder ?
Neil Griffin
RE: ClassNotFoundException: javax.faces.webapp.FacesServlet when PACL enabl
June 12, 2014 7:24 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2352

Join Date: July 26, 2005

Recent Posts

Here is the relevant Java code from Liferay's SecureServlet:

 1    @Override
 2    protected void doPortalInit() throws Exception {
 3        ServletContext servletContext = servletConfig.getServletContext();
 4
 5        ClassLoader classLoader = (ClassLoader)servletContext.getAttribute(
 6            PluginContextListener.PLUGIN_CLASS_LOADER);
 7
 8        String servletClass = servletConfig.getInitParameter("servlet-class");
 9
10        servlet = (Servlet)InstanceFactory.newInstance(
11            classLoader, servletClass);
12
13        servlet.init(servletConfig);
14    }


The error message you are seeing and the aforementioned Java code indicates that there is a servlet-mapping entry in your WEB-INF/web.xml descriptor for the FacesServlet.

Are you developing a JSF portlet, or a non-JSF portlet?
donino pienni
RE: ClassNotFoundException: javax.faces.webapp.FacesServlet when PACL enabl
June 12, 2014 2:32 PM
Answer

donino pienni

Rank: Junior Member

Posts: 82

Join Date: July 2, 2011

Recent Posts

Brilliant! Thank you very much for replies!

Neil, i develop a non-JSF portlet. But thanks to your reply i realized i have this content below in my web.xml before it is deployed. I don't have any idea how it landed here, i assume it has been generated by maven after a wrong handling: i included javax faces as test dependency a few times ago to make use of org.springframework.mock.web.portlet in junit tests.

Anyway after removing this from web.xml it works like a charm. Thanks a million, i was struggling with this!

 1    <context-param>
 2        <param-name>javax.faces.PROJECT_STAGE</param-name>
 3        <param-value>Development</param-value>
 4    </context-param>
 5    <servlet>
 6        <servlet-name>Faces Servlet</servlet-name>
 7        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
 8        <load-on-startup>1</load-on-startup>
 9    </servlet>
10    <servlet-mapping>
11        <servlet-name>Faces Servlet</servlet-name>
12        <url-pattern>/faces/*</url-pattern>
13    </servlet-mapping>
Neil Griffin
RE: ClassNotFoundException: javax.faces.webapp.FacesServlet when PACL enabl
June 12, 2014 2:38 PM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2352

Join Date: July 26, 2005

Recent Posts

It was my pleasure Donino. Thanks for the kind words and for using Liferay Portal. emoticon