Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Laurens van der Blom
JDeveloper, ADF 11g and Liferay
August 6, 2010 6:29 AM
Answer

Laurens van der Blom

Rank: New Member

Posts: 11

Join Date: August 6, 2010

Recent Posts

Hello,

I'm trying to get ADF 11g based portlets working in Liferay for an enterprise application. So far without much success. I have managed to get JSF portlets working using JDeveloper, but as soon as I expand the technology scope to include ADF Faces and ADF Task Flow, things get messy.

The majority of this week at work I've been spending to find a solution to this problem. My findings are that ADF and Liferay do not really mix very well. Many developers are questioning the application of ADF in Liferay portlets. Only one has apparently managed to do it, but does not really go into detail on how it's done (click). So I'm pretty much at a loss here. ADF is a necessity in our application and since we want to extend it in the form of portlets in a portal, I've been trying to get it working in Liferay, whatever the costs are.

So, what's the problem? As I've said before, I got JSF applications working in Liferay, but as soon as I add ADF components (and of course the required libraries on the Tomcat server, of which I know they work as I've done ADF 11g on Tomcat before as standalone application), I get the following exception whenever I add the portlet to the portal (deployment goes without problems):

1ERROR [jsp:154] java.lang.ClassCastException: com.liferay.portlet.RenderRequestImpl cannot be cast to javax.servlet.ServletRequest


(I'd post the complete stacktrace, but for some reason Tomcat doesn't show that exception in the logfile, only in the console. If someone could give me insight into how to enable logging stacktraces in the logfile, I'd appreciate it. It's only with Liferay; normally deployed applications on the other Tomcat server do provide stacktraces in the logfile, while logging settings of both servers are the same.)

I've already searched for that exception, but in all of the topics I've found there are explicit references to Java code that does the call or casting with sessions or anything that has to do with HTTP and servlets. In my case, there is hardly any Java code, only two simple JSPX pages, backed with simple beans that refer to the ADF components, with some text and navigation between them via buttons. So what do you think this could be? Or is it just an impossible task: ADF 11g and Liferay? This is a general question, as I've seen it's a very difficult challenge. However, if you do need specific code, like from web.xml, portlet.xml or the Liferay descriptors, for the solution of the exception above, then I'll happily provide them.

Just so you know, the JSF application I'm talking about is the sample JSF 2.0 portlet provided on the Liferay homepage. I just translated it into JDeveloper terms and modernised it with .jspx extensions, proper backing beans and such. This works, but it stops functioning whenever there are ADF components (or even when there are none, but the project technology scope contains ADF Faces and/or ADF Task Flow).

Version information:
ADF 11g
JDeveloper 11.1.1.30
Liferay 6.0.4 (I know the next version comes out tomorrow, I saw that in another thread, so I'm also going to give that a try on Monday)
Tomcat 6.0.29 (standalone, not a bundle with Liferay)

It'd be nice to know if there is any solution to this issue, not just for me but also for other people who are surely struggling with this. Many thanks in advance!
Jelmer Kuperus
RE: JDeveloper, ADF 11g and Liferay
August 6, 2010 3:11 PM
Answer

Jelmer Kuperus

Rank: Liferay Legend

Posts: 1192

Join Date: March 10, 2010

Recent Posts

It's really hard to comment without seeing the full stacktrace.

your best bet is probably just to debug it

start tomcat with ./catalina.sh jpda run

then attach a remote debugger to port 8000

make sure the adf jars are on the debuggers classpath, and associate the sources with it if you have access to them, or decompile the adf classes then point to the resulting sourcefiles

put a breakpoint on the line it fails (check the full stacktrace) and see whats going on there
Laurens van der Blom
RE: JDeveloper, ADF 11g and Liferay
August 9, 2010 1:28 AM
Answer

Laurens van der Blom

Rank: New Member

Posts: 11

Join Date: August 6, 2010

Recent Posts

Thanks for your helpful reply! Last Friday I didn't have the time to post the full stacktrace by typing it all over, since copy&paste wouldn't work. Now, in the early morning, I've typed over the stacktrace, so here it is:

 1
 2ERROR [jsp:154] java.lang.ClassCastException: com.liferay.portlet.RenderRequestImpl cannot be cast to javax.servlet.ServletRequest
 3    at org.apache.myfaces.trinidadinternal.config.GlobalConfiguratorImpl._isSetRequestBugPresent(GlobalConfiguratorImpl.java:556)
 4    at org.apache.myfaces.trinidadinternal.config.GlobalConfiguratorImpl.getExternalContext(GlobalConfiguratorImpl.java:339)
 5    at org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$CacheRenderKit.<init>(FacesContextFactoryImpl.java:86)
 6    at org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl.getFacesContext(FacesContextFactoryImpl.java:64)
 7    at com.sun.faces.portlet.FacesPortlet.renderFaces(FacesPortlet.java:388)
 8    at com.sun.faces.portlet.FacesPortlet.doView(FacesPortlet.java:328)
 9    at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java.328)
10    at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
11    at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:101)
12    at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil:64)
13    at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:92)
14    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
15    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
16    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
17    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
18    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
19    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
20    at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:628)
21    at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:713)
22    at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:424)


As for the debugger, this part of the GlobalConfiguratorImpl Java class seems to cause the problem (the specific line is in bold):

 1
 2static private boolean _isSetRequestBugPresent(ExternalContext ec)
 3  {
 4    // This first check is here in order to skip synchronization until
 5    // absolutely necessary.
 6    if (!_sSetRequestBugTested)
 7    {
 8      synchronized (GlobalConfiguratorImpl.class)
 9      {
10        //This second check is here in case a couple of things enter before the
11        //boolean is set.  This is only an exception case and will make it so
12        //the initialization code runs only once.
13        if (!_sSetRequestBugTested)
14        {
15          [b]ServletRequest orig = (ServletRequest) ec.getRequest();[/b]
16          // Call getInitParameterMap() up front
17          ec.getInitParameterMap();
18
19          ec.setRequest(new TestRequest(orig));
20
21          _sHasSetRequestBug = !TestRequest.isTestParamPresent(ec);
22          _sSetRequestBugTested = true;
23
24          ec.setRequest(orig);
25        }
26      }
27    }
28
29    return _sHasSetRequestBug;
30  }


I am not very familiar with Liferay and portlets, although in trying to get ADF working, I have learned a lot in a short time. Unfortunately, I do not know what would be the solution for this issue. I hope you can help me out. Thanks again in advance!

Edit: Below is the code that calls the above method. It seems it's related to a bug in JSF 1.2_03 and earlier. However, that does not apply here, as the current version of JDeveloper uses JSF 1.2_09 in the applications that I develop with it.

 1
 2  public ExternalContext getExternalContext(ExternalContext ec)
 3  {
 4    RequestStateMap state = RequestStateMap.getInstance(ec);
 5    RequestType type = (RequestType) state.get(_REQUEST_TYPE);
 6
 7    if (type == null)
 8    {
 9      beginRequest(ec);
10      type = (RequestType) state.get(_REQUEST_TYPE);
11    }
12    else if (!ExternalContextUtils.getRequestType(ec).equals(type))
13    {
14      throw new IllegalStateException("The expected request type is not the same as the current request type.");
15    }
16
17    if (!_isDisabled(ec))
18    {
19      if (!type.isPortlet() && _isSetRequestBugPresent(ec))
20      {
21        //This handles bug 493 against the JSF-RI 1.2_03 and earlier.  If the bug
22        //is present in the current system, add a wrapper to fix it
23
24        //TODO sobryan this is somewhat inefficient so should be removed when we
25        //are no longer dependant on JSF1.2_03 or earlier.  Still, we only wrap
26        //when we have to so it should be no biggy under normal circumstances.
27        ec = new ClearRequestExternalContext(ec);
28      }
29
30      // Wrap ExternalContexts
31      for (Configurator config: _services)
32      {
33        ec = config.getExternalContext(ec);
34      }
35    }
36
37    return ec;
38  }
Jelmer Kuperus
RE: JDeveloper, ADF 11g and Liferay
August 9, 2010 1:01 PM
Answer

Jelmer Kuperus

Rank: Liferay Legend

Posts: 1192

Join Date: March 10, 2010

Recent Posts

Well judging by the code you posted it's not recognizing the request as a portlet request, _isSetRequestBugPresent should never be called if type.isPortlet returns true

!type.isPortlet() && _isSetRequestBugPresent(ec)

So focus on why it's not returning true

RequestType seems to be determined in ExternalContextUtils.getRequestType(ExternalContext ec) so single step through that method with the debugger

Also it seems that you need javax.portlet.faces.Bridge on your classpath, if you don't have it it will treat the request as a servlet request and you will see the behaviour you are seeing now

I can't really test it for you but thats what i got from going over the trinidad code
Laurens van der Blom
RE: JDeveloper, ADF 11g and Liferay
August 11, 2010 7:53 AM
Answer

Laurens van der Blom

Rank: New Member

Posts: 11

Join Date: August 6, 2010

Recent Posts

Thank you for your reply. It does make sense what you're saying. It appears I didn't configure the application properly, so that it is identified as a portlet. Now it is. I'm using the Oracle Portlet Bridge, as I believe it is the only one that supports ADF 11g.

However, not all is well. There are two scenarios I've applied here, for testing purposes. (Note that this post is rather lengthy, so please bear with me. It's just that I want to solve this issue badly, as I've been at it for nearly two weeks, so I want to provide all I have and know. My knowledge about portals and portlets is rather limited, unfortunately.)

1. Pure JSF implementation:
No ADF components at all. There are two pages, index.jspx and welcome.jspx with navigation between them in faces_config.xml with the help of a HTML button on the first page and a HTML link on the second page. Deployment goes without problem, but when adding the portlet to the portal, I get the following message: The requested resource (/SampleJSFApp/invoke) is not available.

I've already searched for a solution to that problem and that is adding information in web.xml (as shown here). I did exactly that, but the problem still remains. Given below are all XML descriptors:

liferay-display.xml
On a side note, for some reason, the portlet category is classified as Undefined rather than Sample, even though the portlet descriptor says otherwise.
 1
 2<?xml version="1.0"?>
 3<!DOCTYPE display PUBLIC "-//Liferay//DTD Display 5.2.0//EN" "http://www.liferay.com/dtd/liferay-display_5_2_0.dtd">
 4
 5<display>
 6    <category name="category.sample">
 7        <portlet id="1" />
 8    </category>
 9</display>


liferay-portlet.xml
 1
 2<?xml version="1.0"?>
 3<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 4.3.1//EN" "http://www.liferay.com/dtd/liferay-portlet-app_4_3_1.dtd">
 4
 5<liferay-portlet-app>
 6    <portlet>
 7        <portlet-name>SampleJSFApp</portlet-name>
 8        <instanceable>true</instanceable>
 9    </portlet>
10    <role-mapper>
11        <role-name>administrator</role-name>
12        <role-link>Administrator</role-link>
13    </role-mapper>
14    <role-mapper>
15        <role-name>guest</role-name>
16        <role-link>Guest</role-link>
17    </role-mapper>
18    <role-mapper>
19        <role-name>power-user</role-name>
20        <role-link>Power User</role-link>
21    </role-mapper>
22    <role-mapper>
23        <role-name>user</role-name>
24        <role-link>User</role-link>
25    </role-mapper>
26</liferay-portlet-app>


oracle-portlet.xml
 1
 2<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 3<portlet-app-extension xmlns="http://xmlns.oracle.com/portlet/oracle-portlet-app">
 4    <portlet-extension>
 5        <portlet-name>SampleJSFApp</portlet-name>
 6        <portlet-id>adf_jsf__index_jspx</portlet-id>
 7        <allow-export>false</allow-export>
 8        <allow-import>true</allow-import>
 9        <require-iframe>true</require-iframe>
10    </portlet-extension>
11</portlet-app-extension>


portlet.xml
 1
 2<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 3<portlet-app version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 4    <portlet id="adf_jsf__index_jspx">
 5        <description>SampleJSFApp</description>
 6        <portlet-name>SampleJSFApp</portlet-name>
 7        <display-name>SampleJSFApp</display-name>
 8        <portlet-class>oracle.portlet.bridge.adf.application.ADFBridgePortlet</portlet-class>
 9        <init-param>
10            <name>javax.portlet.faces.defaultViewId.view</name>
11            <value>/index.jspx</value>
12        </init-param>
13        <supports>
14            <mime-type>text/html</mime-type>
15            <portlet-mode>VIEW</portlet-mode>
16        </supports>
17        <supported-locale>en</supported-locale>
18        <portlet-info>
19            <title>SampleJSFApp</title>
20            <short-title>SampleJSFApp</short-title>
21        </portlet-info>
22    </portlet>
23    <custom-portlet-mode>
24        <portlet-mode>about</portlet-mode>
25    </custom-portlet-mode>
26    <custom-portlet-mode>
27        <portlet-mode>config</portlet-mode>
28    </custom-portlet-mode>
29    <custom-portlet-mode>
30        <portlet-mode>edit_defaults</portlet-mode>
31    </custom-portlet-mode>
32    <custom-portlet-mode>
33        <portlet-mode>preview</portlet-mode>
34    </custom-portlet-mode>
35    <custom-portlet-mode>
36        <portlet-mode>print</portlet-mode>
37    </custom-portlet-mode>
38</portlet-app>


web.xml
 1
 2<?xml version = '1.0' encoding = 'UTF-8'?>
 3<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 4         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
 5         version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
 6  <servlet>
 7    <servlet-name>SampleJSFApp</servlet-name>
 8    <servlet-class>com.liferay.portal.kernel.servlet.PortletServlet</servlet-class>
 9    <init-param>
10      <param-name>portlet-class</param-name>
11      <param-value>oracle.portlet.bridge.adf.application.ADFBridgePortlet</param-value>
12    </init-param>
13    <load-on-startup>0</load-on-startup>
14  </servlet>
15  <servlet-mapping>
16    <servlet-name>SampleJSFApp</servlet-name>
17    <url-pattern>/SampleJSFApp/*</url-pattern>
18  </servlet-mapping>
19  <servlet>
20    <servlet-name>Faces Servlet</servlet-name>
21    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
22    <load-on-startup>1</load-on-startup>
23  </servlet>
24  <servlet-mapping>
25    <servlet-name>Faces Servlet</servlet-name>
26    <url-pattern>/faces/*</url-pattern>
27  </servlet-mapping>
28</web-app>



2. JSF with ADF Faces and Business Components
Same as before, but now the HTML button is an ADF command button and the HTML is an ADF command link. Navigation remains the same. On welcome.jspx there is now an ADF table that displays information from a MySQL database. Deployment already fails with the following message (it's a large stacktrace):

  1
  2ERROR [PortletServlet:96] javax.portlet.PortletException: doBridgeDispatch failed:  error from Bridge in executing the request
  3javax.portlet.PortletException: doBridgeDispatch failed:  error from Bridge in executing the request
  4        at javax.portlet.faces.GenericFacesPortlet.doBridgeDispatch(GenericFacesPortlet.java:502)
  5        at javax.portlet.faces.GenericFacesPortlet.doRenderDispatchInternal(GenericFacesPortlet.java:449)
  6        at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:241)
  7        at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328)
  8        at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:209)
  9        at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
 10        at oracle.portlet.bridge.adf.application.ADFBridgePortlet.render(ADFBridgePortlet.java:287)
 11        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:101)
 12        at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
 13        at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:92)
 14        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 15        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 16        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 17        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
 18        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
 19        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
 20        at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:628)
 21        at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:713)
 22        at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:424)
 23        at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1436)
 24        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 25        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 26        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
 27        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
 28        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
 29        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 30        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 31        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 32        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
 33        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
 34        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
 35        at com.liferay.portal.util.PortalImpl.renderPortlet(PortalImpl.java:3647)
 36        at com.liferay.portal.util.PortalUtil.renderPortlet(PortalUtil.java:1164)
 37        at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processPortlet(RuntimePortletUtil.java:160)
 38        at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processPortlet(RuntimePortletUtil.java:94)
 39        at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processTemplate(RuntimePortletUtil.java:259)
 40        at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processTemplate(RuntimePortletUtil.java:181)
 41        at org.apache.jsp.html.portal.layout.view.portlet_jsp._jspService(portlet_jsp.java:817)
 42        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 43        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 44        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
 45        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
 46        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
 47        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 48        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 49        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 50        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
 51        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
 52        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
 53        at com.liferay.portal.action.LayoutAction.includeLayoutContent(LayoutAction.java:361)
 54        at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:618)
 55        at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:229)
 56        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
 57        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
 58        at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:152)
 59        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
 60        at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
 61        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
 62        at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:502)
 63        at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:479)
 64        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 65        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 66        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 67        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
 68        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:107)
 69        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 70        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 71        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
 72        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:107)
 73        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 74        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 75        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
 76        at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:288)
 77        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
 78        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 79        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 80        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
 81        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:107)
 82        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 83        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 84        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
 85        at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:137)
 86        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
 87        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 88        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 89        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
 90        at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:204)
 91        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
 92        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 93        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 94        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
 95        at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:254)
 96        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
 97        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 98        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 99        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
100        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
101        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
102        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
103        at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:133)
104        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
105        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
106        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
107        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
108        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:107)
109        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
110        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
111        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
112        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:107)
113        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
114        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
115        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
116        at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:259)
117        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
118        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
119        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
120        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
121        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:107)
122        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
123        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
124        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
125        at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:126)
126        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
127        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
128        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
129        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
130        at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:204)
131        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
132        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
133        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
134        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
135        at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:221)
136        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
137        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
138        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
139        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
140        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:107)
141        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
142        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
143        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
144        at com.liferay.portal.servlet.filters.cache.CacheFilter.processFilter(CacheFilter.java:440)
145        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
146        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
147        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
148        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
149        at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:45)
150        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
151        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
152        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
153        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
154        at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:254)
155        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
156        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
157        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
158        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
159        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
160        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
161        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
162        at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:312)
163        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
164        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
165        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
166        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
167        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:107)
168        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
169        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
170        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
171        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:107)
172        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
173        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
174        at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
175        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
176        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
177        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:177)
178        at com.liferay.portal.servlet.filters.threadlocal.ThreadLocalFilter.processFilter(ThreadLocalFilter.java:35)
179        at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:104)
180        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
181        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
182        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
183        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
184        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
185        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
186        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
187        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
188        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
189        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
190        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
191        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
192        at java.lang.Thread.run(Unknown Source)
193Caused by: javax.portlet.faces.BridgeException
194        at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:587)
195        at javax.portlet.faces.GenericFacesPortlet.doBridgeDispatch(GenericFacesPortlet.java:498)
196        ... 188 more
197ERROR [jsp:154] javax.portlet.faces.BridgeException
198        at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:587)
199        at javax.portlet.faces.GenericFacesPortlet.doBridgeDispatch(GenericFacesPortlet.java:498)
200        at javax.portlet.faces.GenericFacesPortlet.doRenderDispatchInternal(GenericFacesPortlet.java:449)
201        at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:241)
202        at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328)
203        at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:209)
204        at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
205        at oracle.portlet.bridge.adf.application.ADFBridgePortlet.render(ADFBridgePortlet.java:287)
206        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:101)
207        at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
208        at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:92)
209        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
210        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
211        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
212        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
213        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
214        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
215        at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:628)
216        at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:713)
217        at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:424)


I suspect that there is a conflict between the Oracle Portlet Bridge and the JSR-168 container in Liferay, both providing a version of javax.portlet.GenericPortlet, so it may not be possible to use them simultaneously. I haven't had the chance to figure this out, so I will get back to it tomorrow. Debugging the source code is rather cumbersome, as I cannot attach the source code of the portlet bridge to the debugger (I'm now doing it manually, following the stacktrace and decompiling class files). In the meantime, maybe you can suggest something else? Maybe this error looks familiar to you?

Edit: I can attach the two different applications to this post, if you'd like. Currently I'm running out of time, but if you want them, then I'll post them here tomorrow as I need to revert some of the changes I've made in the hope of getting them to work.
Jelmer Kuperus
RE: JDeveloper, ADF 11g and Liferay
August 11, 2010 11:59 AM
Answer

Jelmer Kuperus

Rank: Liferay Legend

Posts: 1192

Join Date: March 10, 2010

Recent Posts

On a side note, for some reason, the portlet category is classified as Undefined rather than Sample, even though the portlet descriptor says otherwise


The portlet id must match the portlet-name used in portlet.xml

Maybe this error looks familiar to you?


Not really

I can attach the two different applications to this post, if you'd like.


Sure, no promises though, but maybe i can look at them tomorrow evening
Laurens van der Blom
RE: JDeveloper, ADF 11g and Liferay
August 12, 2010 2:59 AM
Answer

Laurens van der Blom

Rank: New Member

Posts: 11

Join Date: August 6, 2010

Recent Posts

The portlet id must match the portlet-name used in portlet.xml


Go figure. It appears I accidentally copied the file from a different application and didn't notice the mismatching ID. This part is fine now. emoticon


Here are the two small applications as promised. It might be necessary for you to make adjustments in the libraries. In my case, I have all required libraries in the tomcat/lib folder. Only the ADF Portlet Bridge library is included in the WAR file, the rest is empty. Including the ADF libraries makes the files too large for inclusion in this post.

As for my findings regarding the GenericPortlet class: it does seem that portlet.jar from Liferay (as included by default on the Tomcat server) contains that class and jsf-portlet-bridge-api.jar from the portlet bridge does as well. Removing the latter library from the application gives a ClassNotFound exception for the GenericPortlet class. This leads me to believe that the one from portlet.jar on the server is not used, hence there shouldn't be a conflict after all. I'm not 100% sure, though.

I'll continue trying to find a solution (although I have done many things by now and without success) and I do appreciate your help in this. emoticon

Just encountered this thread. I'll have a look into it. It might be useful.
Attachments: SampleJSFADFApp.war (231.1k), SampleJSFApp.war (205.8k)
Jelmer Kuperus
RE: JDeveloper, ADF 11g and Liferay
August 12, 2010 1:24 PM
Answer

Jelmer Kuperus

Rank: Liferay Legend

Posts: 1192

Join Date: March 10, 2010

Recent Posts

I'd be happy to help you but with libraries missing there's not much i can do. I have no idea which libraries to include or where to download them. If you have a complete jar i'll be happy to take a look
Laurens van der Blom
RE: JDeveloper, ADF 11g and Liferay
August 12, 2010 11:43 PM
Answer

Laurens van der Blom

Rank: New Member

Posts: 11

Join Date: August 6, 2010

Recent Posts

I was afraid of that. The thing is that all of the libraries together are quite a lot of MBs, something that I can't upload here on the forums.

I'll figure something out and then post a download link here.
Laurens van der Blom
RE: JDeveloper, ADF 11g and Liferay
August 13, 2010 9:09 AM
Answer

Laurens van der Blom

Rank: New Member

Posts: 11

Join Date: August 6, 2010

Recent Posts

Sorry for the delay. Company policies did not allow to use file-uploading sites until now. Here are the files:

Minimal: click here
Complete: click here

Minimal is what I believe, after some research, is the minimum amount of ADF libraries in order to get an ADF application working.

Complete is what I currently have in my Tomcat server for ADF applications (tomcat/lib, with the exception of the Oracle Portlet Bridge) and is my testing environment.

In both the Oracle Portlet Bridge (adfmportlet.jar, adf-portlet-bridge.jar, adf-portlet-bridge-api.jar, jsf-portlet-bridge-api.jar and jsf-portlet-bridge-impl.jar) is included for completeness, so don't forget not to include them when installing the libraries on the server, as they are already in the WEB-INF/lib folder of the small applications.

I find having a nice weekend very important, so you don't have to feel obliged to work on it this weekend. I already appreciate your help so far. emoticon Enjoy your weekend!
Laurens van der Blom
RE: JDeveloper, ADF 11g and Liferay
August 19, 2010 11:08 PM
Answer

Laurens van der Blom

Rank: New Member

Posts: 11

Join Date: August 6, 2010

Recent Posts

jelmer kuperus:
I'd be happy to help you but with libraries missing there's not much i can do. I have no idea which libraries to include or where to download them. If you have a complete jar i'll be happy to take a look


I am sorry for the triple post, but I was wondering if there is anything you have found with the libraries I have provided. So far, even with the newest version of Liferay (6.0.5), I'm unsuccessful in getting ADF to work.
Laurens van der Blom
RE: JDeveloper, ADF 11g and Liferay
August 26, 2010 1:37 AM
Answer

Laurens van der Blom

Rank: New Member

Posts: 11

Join Date: August 6, 2010

Recent Posts

This is my last post in this thread. I've given up on building a native ADF Liferay portlet. Instead, I figured that considering ADF, JSF and so on output HTML in the end, I might as well use plain HTML in the portlet itself. That said, the solution for now is to use an iFrame that points to an ADF application not bound to Liferay on the same or separate server. This works perfectly fine and now I have an ADF application in Liferay! I just need to find a way to pass on the current Liferay session to the application, but that'll be a minor obstacle considering all the work I've had to go through in getting ADF to work as a native portlet.

Just my two cents for those facing the same issue.
Drew Poggemann
RE: JDeveloper, ADF 11g and Liferay
September 28, 2011 7:10 PM
Answer

Drew Poggemann

Rank: New Member

Posts: 1

Join Date: December 15, 2007

Recent Posts

Did you ever get the session information to go back and forth? Did you try using WSRP to serve up the portlet instead? Just wondering where you ended up...

Thanks!

Drew