tag:blogger.com,1999:blog-73760055768059424342024-02-20T02:12:55.055-08:00Working with ADF EssentialsMy experience with ADF Essentials on Glassfish while using Oracle Enterprise Pack for EclipseAshish Mishrahttp://www.blogger.com/profile/13649321524880482585noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-7376005576805942434.post-83958265169501810002014-03-09T17:23:00.000-07:002014-03-10T19:50:09.861-07:00Creating Search Form in ADF Essentials using JPA Entities<div dir="ltr" style="text-align: left;" trbidi="on">
In this post we will see how a search form can be created in ADF Essentials when the model layer is based on JPA entities. I am going to use the same ADFE application based on Oracle HR schema that I have previously used in other posts.<br />
<br />
We will create a search form that will let us search employees based on their first and last names. To achieve this we will first create a JPA named query for employee search based on employee's first and last name then we will expose this named query in ADF Data Control and from there we will use it in ADF Faces to create a search form.
<br />
<br />
Here are these steps in detail:
<br />
<br />
<span style="font-size: medium;"><b>Create a Named Query for search</b></span><br />
There is already a default named query that returns all employees but for our purpose we need to create a new named query which will accept two input parameters for first and last name and return the employee/employees matching that first and the last name.
<br />
<pre class="brush: csharp">@NamedQueries({
@NamedQuery(name = "Employee.findAll", query = "SELECT e FROM Employee e"),
@NamedQuery(name = "Employee.search", query = "SELECT e FROM Employee e WHERE e.firstName = :firstName and e.lastName = :lastName") })
</pre>
<br />
<br />
<span style="font-size: medium;"><b>Expose it in ADF Data Control</b></span><br />
This step is not required if we have not already created an ADF Data Control for our ADFE application. But if we already have an ADF Data Control then it needs to be refreshed to take in the new changes made in Employee entity. To refresh ADF Data Control, one way is to right click on the Session Bean and select Model Components > Edit Session Bean Facade. Then on the next screen unselect Employee entity and then select it back. Also, to see the changes in Data Control the ADFE Web project may need to be closed and opened again in Eclipse.
<br />
<br />
<span style="font-size: medium;"><b>Use it in Search Form</b></span><br />
We can see the new new named query we created for employee search appearing as a named collection in our Data Control for the ADFE Web project.
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggWz_XTSlJitqWMEKq9GGIhOjNDk6MkVPsZuloS0B80dNFUaw9yLP1IavaPh6M5ihx33PXX3Hk_Gt3558mgg72YLa5KZZbA6qCxkXmAUGaynZK6wv2tr9wFBPcFk102ckOID_WVWb6fj-c/s1600/ExecuteWithParams_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggWz_XTSlJitqWMEKq9GGIhOjNDk6MkVPsZuloS0B80dNFUaw9yLP1IavaPh6M5ihx33PXX3Hk_Gt3558mgg72YLa5KZZbA6qCxkXmAUGaynZK6wv2tr9wFBPcFk102ckOID_WVWb6fj-c/s1600/ExecuteWithParams_1.jpg" /></a></div>
<br/>
Also, we can see ExecuteWithParams operation for employeeSearch collection. This is the operation we are going to use to implement search functionality.
<br/>
We will drag and drop ExecuteWithParams on the page and choose Parameter > ADF Parameter Form. This will create a form with two input fields to enter first and last name and a button which will call ExecuteWithParams and pass the values provided in input fields as parameters to it.<br/>
Now we will drag and drop employeeSearch collection on the page as a table. This table will contain the search results. We will also Set partialTriggers property of table with the id of ExecuteWithParams button and make sure Partial submit property of button is set to true. By default Partial submit is set to true.<br/>
After building and running the page we will get to see a search form implementation like this:<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOa63Nig78Co6gk2hoTY8rQAgayQSAQ8pAXNMh0_nK-mq4ZBYFZnvpvIpP8TUaFEQSW4cfv5mxWI0pW8yIJz9UdoosnffMu8VlSgQoOch3707akG_TGjJlZpW-MxpqyrVbvQ8PsE1-vnBg/s1600/SearchEmployeeResults.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOa63Nig78Co6gk2hoTY8rQAgayQSAQ8pAXNMh0_nK-mq4ZBYFZnvpvIpP8TUaFEQSW4cfv5mxWI0pW8yIJz9UdoosnffMu8VlSgQoOch3707akG_TGjJlZpW-MxpqyrVbvQ8PsE1-vnBg/s1600/SearchEmployeeResults.jpg" /></a></div>
<br/>
The Named Query that we have used searches for the employee who has the specified first and last name and does not return any results if either one or both of criteria are null. To make search functionality more user friendly such that it works with null values, we can change it to following:<br/>
<pre class="brush: csharp">
@NamedQuery(name = "Employee.search", query = "SELECT e FROM Employee e WHERE (e.firstName = :firstName or :firstName is null) and (e.lastName = :lastName or :lastName is null)") })
</pre>
</div>Ashish Mishrahttp://www.blogger.com/profile/13649321524880482585noreply@blogger.com0tag:blogger.com,1999:blog-7376005576805942434.post-37829895621374375142014-01-08T07:14:00.001-08:002014-01-08T18:59:01.735-08:00Creating ADF Essentials application with Oracle Enterprise Pack for Eclipse Part 2 of 2 <div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div style="font-family: Calibri; font-size: 11.0pt; margin-left: .375in; margin: 0in;">
This post is in continuation of my previous post on Creating ADF Essential application for Glassfish server using Oracle Enterprise Pack for Eclipse. In this post we will add a new JSF page in our ADFE application which will display data coming from Departments and Employees tables of HR schema. We will use an ADF data control based on a session bean to make data available for ADF faces components in our JSF page.<br />
<br />
<span style="font-size: large;"><b>Create JPA Entities</b></span><br />
We will start with creating JPA entities for Emplyees and Departments tables. To do so, right
click on <span style="font-style: italic;">SampleADFEModel</span> and select <span style="font-style: italic;">Generate Entities From Tables</span> from <span style="font-style: italic;">JPA Tools.</span>
<br />
In the next window select the database connection in our case it is <i>HR_Conn</i> and database schema to connect to. You will see a list of available tables for HR schema<span style="font-style: italic;">. </span>Here<span style="font-style: italic;"> s</span>elect<span style="font-style: italic;"> Departments </span>and<span style="font-style: italic;"> Employees </span>tables<span style="font-style: italic;"> </span>and<span style="font-style: italic;"> </span>proceed<span style="font-style: italic;"> </span>to the next window. Keep all the information regarding entities to be generated in consecutive windows as default<span style="font-style: italic;"> a</span>nd finish the<span style="font-style: italic;"> Generate Custom Entities </span>wizard<span style="font-style: italic;">.</span><br />
<span style="font-style: italic;"> </span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwDFbFCHKDYcPj-cl1DGInYdd2YtbxJ_tyaUTMEKEhmsPcwXamFDbsNzTDzH6uIiokxvfLCaoJEJ5BkVnwgYzQblBfdDx3GoPrqwVlJl-ULmTIojTWWuGKLOXiTveGN3za_P12fuXSjGyT/s1600/Create-JPA-Entities-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwDFbFCHKDYcPj-cl1DGInYdd2YtbxJ_tyaUTMEKEhmsPcwXamFDbsNzTDzH6uIiokxvfLCaoJEJ5BkVnwgYzQblBfdDx3GoPrqwVlJl-ULmTIojTWWuGKLOXiTveGN3za_P12fuXSjGyT/s1600/Create-JPA-Entities-1.png" height="580" width="640" /></a></div>
<br />
<br />
<span style="font-size: large;"><b>Create Session Bean</b></span><br />
Right click on Model project and go to <i>New > Session Bean (EJB 3.x) from JPA Entities</i>
<br />
<div class="separator" style="clear: both; text-align: left;">
In<i> Create EJB Session Bean</i> wizard<span style="font-style: italic;"> </span>specify the session bean class name and package name it will be created in. Leave other settings as they are.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5LhNOUiyKVduM08aRkhrL-y5MQHdVzK5PuIjUM4cNHgT7hknkXAz5zvXyxDusDyhX4wM3q9tS3qcSdk0PzkUXWVc4lau326Re8GZp1sm0UKQItaeWWKZVFmoS9erWWcSuahv7BIoomej2/s1600/Create-SessionBean-1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5LhNOUiyKVduM08aRkhrL-y5MQHdVzK5PuIjUM4cNHgT7hknkXAz5zvXyxDusDyhX4wM3q9tS3qcSdk0PzkUXWVc4lau326Re8GZp1sm0UKQItaeWWKZVFmoS9erWWcSuahv7BIoomej2/s1600/Create-SessionBean-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5LhNOUiyKVduM08aRkhrL-y5MQHdVzK5PuIjUM4cNHgT7hknkXAz5zvXyxDusDyhX4wM3q9tS3qcSdk0PzkUXWVc4lau326Re8GZp1sm0UKQItaeWWKZVFmoS9erWWcSuahv7BIoomej2/s1600/Create-SessionBean-1.png" height="449" width="640" /></a></div>
<br />
<br />
In the next window select model.Department and model.Employee entites and press Finish to close the wizard. As a result a session bean class will be created in the model project.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijqZI_Ffq-6JTikE5gzbDEDZYK54LlKm5a_RcMzNeQiz_jSamODrKaxjWDNj-tZhHzFp5svKvxyOtAdAuKDzUgSSYpMtVQMBZpOlHe8v2iWo3soN4MfKB7kwGZuSDCEWcgm7g9_H7GHEmi/s1600/Create-SessionBean-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijqZI_Ffq-6JTikE5gzbDEDZYK54LlKm5a_RcMzNeQiz_jSamODrKaxjWDNj-tZhHzFp5svKvxyOtAdAuKDzUgSSYpMtVQMBZpOlHe8v2iWo3soN4MfKB7kwGZuSDCEWcgm7g9_H7GHEmi/s1600/Create-SessionBean-2.png" height="463" width="640" /></a></div>
<br />
<br />
<span style="font-size: large;"><b>Create Data Control</b></span><br />
Right click on SampleAppSessionBean.java and select <i>Model Components > Create ADF Data Control...</i>
<br />
In <i>New Data Control</i> wizard enter the name for data control and keep all the settings in subsequent windows as default.
<br />
Now a data control based on an EJB session bean is available for us to be used in our web project. Information about data controls created in the application can be found in DataControls.dcx file
<br />
<br />
<span style="font-size: large;"><b>Create JSF page</b></span><br />
We are ready to create a web page which uses data coming from HR schema in database through ADF data control.
<br />
Right click on SampleADFEAppWeb/WebContent and select <i>New > ADF Page</i>
<br />
In <i>New ADF Page</i> wizard specify the page name and select <i>Structure</i> as <i>Page</i> and <i>Technology</i> <i>JSP XML</i>. In the next window select <i>Create blank page</i> and finish the wizard
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8QqWIOBhWR6t3qaeqJrjOJAd20OcspKIf_NIM70X2FkrOaBIXqQzH9i-JSbXV25ySEZoaafBIN7dpxDBUZadDKNav6fBEX2NxH7EHkkBxeCeC9xeEQqI9pjeobkRXbXIXUr2oq65IVLwz/s1600/Create-ADFPage_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8QqWIOBhWR6t3qaeqJrjOJAd20OcspKIf_NIM70X2FkrOaBIXqQzH9i-JSbXV25ySEZoaafBIN7dpxDBUZadDKNav6fBEX2NxH7EHkkBxeCeC9xeEQqI9pjeobkRXbXIXUr2oq65IVLwz/s640/Create-ADFPage_2.png" /></a></div>
<br />
<br />
Now we will work on the jspx page we just created.
Make sure <i>Palette</i> window is visible in eclipse. It will provide available Data Controls and ADF Faces components that can be used in the web project. It can be enabled by going to <i>Window > Show View > Palette</i><br />
<br />
Open <i>Pallete > Data > Data Controls</i>. You will see the data control we created previously based on session bean. Expand it and you will find <i>departmentFindAll</i> and <i>employeeFindAll</i> which provide data from Departments and Employees tables through Department and Employee entities. There is a one-to-many relationship between Departments and Employees so on expanding <i>departmentFindAll</i> you will see an <i>employees</i> named collection. We will now see how easily master-detail data can be displayed in ADF faces using ADF data controls.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibikw8RN-4_H4fidpMfb-NssiGCw46-OSxdkd-7GpLqlEKYpGDZdbLqgHcmlQJZm2zBXmjyd88TRmlhIKGs0aU_z3vEEQJVUuv1lvmvvtpwNlhjWMevyRJESpwIDl4EtJZI5Ht5Mk1eZ-7/s1600/DataControl.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibikw8RN-4_H4fidpMfb-NssiGCw46-OSxdkd-7GpLqlEKYpGDZdbLqgHcmlQJZm2zBXmjyd88TRmlhIKGs0aU_z3vEEQJVUuv1lvmvvtpwNlhjWMevyRJESpwIDl4EtJZI5Ht5Mk1eZ-7/s640/DataControl.png" /></a></div>
<br />
Now either drag and drop <i>employees</i> under <i>departmentFindAll</i> on the new ADF page or right clik on <i>employees</i> and select <i>Insert in the page</i>. You will see some options on how to display the data on the page. We will select <i>Master-Detail</i> and <i>ADF Master Form, Detail Table</i> as display format. You can choose from other options as well for displaying data in master-detail relationship.
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4AYKPmzjHdzQME2aTvAcXdYKZzG_-ONQZ6mgMWrNs6KNLGBgDJ1lJZagVjrDazT7hF1TdvHEpcwK9gSLTnbkij9FA8Ygb2FyKKCJyMY9zgL35uUhLCWJ0Y3Z20tNVQutSjqomlTYb8RKm/s1600/Create-MasterDetail.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4AYKPmzjHdzQME2aTvAcXdYKZzG_-ONQZ6mgMWrNs6KNLGBgDJ1lJZagVjrDazT7hF1TdvHEpcwK9gSLTnbkij9FA8Ygb2FyKKCJyMY9zgL35uUhLCWJ0Y3Z20tNVQutSjqomlTYb8RKm/s640/Create-MasterDetail.png" /></a></div>
<br />
<br />
As a result the page will now contain a panel form layout for Departments data and a table containing Employees data. Page layout can be adjusted further as per the requirements. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaHgI3YJz3jZoPuQm-8BQb7KaW0XqGaYW1wuJ8AhCYe1clx_Cezo-8SnNIX-KKgIUDSESEhAk_M6BtGkrvRMVA3m7ilvS1kgMKsBwU-Y-SzJ-4ODUWzYrgPwAdyhLRNGjXNQCZmXDn5DZV/s1600/PageLayout.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaHgI3YJz3jZoPuQm-8BQb7KaW0XqGaYW1wuJ8AhCYe1clx_Cezo-8SnNIX-KKgIUDSESEhAk_M6BtGkrvRMVA3m7ilvS1kgMKsBwU-Y-SzJ-4ODUWzYrgPwAdyhLRNGjXNQCZmXDn5DZV/s640/PageLayout.png" /></a></div>
<br />
<br />
<span style="font-size: large;"><b>Run Application</b></span><br />
We are almost ready to test the JSF page we created but if you try to run the application on Glassfish server now you will get few exceptions. Make sure you have covered following points before running the application:<br />
1. <i>web.xml</i> looks like this:
<br />
<pre class="brush: csharp"><?xml version = '1.0' encoding = 'UTF-8'?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<display-name>SampleADFEAppWeb</display-name>
<filter>
<filter-name>adfBindings</filter-name>
<filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>adfBindings</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<filter>
<filter-name>trinidad</filter-name>
<filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>trinidad</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>resources</servlet-name>
<servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>resources</servlet-name>
<url-pattern>/adf/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>resources</servlet-name>
<url-pattern>/afr/*</url-pattern>
</servlet-mapping>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>resources.application</param-value>
</context-param>
<ejb-local-ref>
<ejb-ref-name>ejb/local/SampleAppSessionBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>model.SampleAppSessionBeanLocal</local>
<ejb-link>SampleAppSessionBean</ejb-link>
</ejb-local-ref>
</web-app> </pre>
2. All the attribute values of any type in jspx page need to be in EL expression form except <i>id</i>, <i>name</i> and <i>var</i> e.g. height="#{'10'}" instead of height=10<br />
3. A data source needs to be specified in persistence.xml
<br />
<pre class="brush: csharp"><?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="SampleADFEAppModel" transaction-type="JTA">
<jta-data-source>jdbc/test_hr</jta-data-source>
<class>model.Department</class>
<class>model.Employee</class>
</persistence-unit>
</persistence></pre>
<br />
Now run the JSF page on Glassfish server. At runtime you will see departments data in a form layout such that the data of only one department is displayed at a time. Data of employees related to the department currently being displayed will be available in a tabular format below the Departments form.
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRr3UDcG_GcEmhy3AQQFVbIDtOgFxsyRVAtoGFt_ll-e10kBUh7m63p5ET1vtTJcUSIJmnLafUe6JXsjky1SCjyp-38NiwTLiOJxekJLHiQ9yxijzdvdvtTyXTG2Rvi2ZiXw-xmD3sWDby/s1600/RuntimePage-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRr3UDcG_GcEmhy3AQQFVbIDtOgFxsyRVAtoGFt_ll-e10kBUh7m63p5ET1vtTJcUSIJmnLafUe6JXsjky1SCjyp-38NiwTLiOJxekJLHiQ9yxijzdvdvtTyXTG2Rvi2ZiXw-xmD3sWDby/s640/RuntimePage-1.png" /></a></div>
</div>
</div>
Ashish Mishrahttp://www.blogger.com/profile/13649321524880482585noreply@blogger.com0tag:blogger.com,1999:blog-7376005576805942434.post-47594531780164859482013-12-02T10:44:00.003-08:002014-03-10T17:32:26.662-07:00Creating ADF Essentials application with Oracle Enterprise Pack for Eclipse Part 1 of 2<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
I am going to describe the steps needed to create a sample data bound application built on ADF Essentials framework and developed using Oracle Enterprise Pack for Eclipse 12.1.2.1.1. The application server used is Glassfish 4.<br />
<br />
The list of online resources I referenced while creating this tutorial:<br />
<a href="https://blogs.oracle.com/shay/entry/deploying_oracle_adf_applications_to">https://blogs.oracle.com/shay/entry/deploying_oracle_adf_applications_to</a><br />
<a href="http://oracle-adf.org/how_to_install_Oracle_ADF_Essentials_on_GlassFish_Server.php">http://oracle-adf.org/how_to_install_Oracle_ADF_Essentials_on_GlassFish_Server.php</a><br />
<a href="http://docs.oracle.com/cd/E47843_02/12121/OEPUG/oracle_adf_tools.htm">http://docs.oracle.com/cd/E47843_02/12121/OEPUG/oracle_adf_tools.htm</a><br />
<br />
You need to follow below steps to create an ADF essentials application that can run on Glassfish server:<br />
<br />
<h2 style="text-align: left;">
<span style="font-size: large;">Download</span></h2>
1. Download Oracle Enterprise Pack for Eclipse 12.1.2.1.1 from <a href="http://www.oracle.com/technetwork/developer-tools/eclipse/downloads/index.html">OTN</a><br />
2. Download ADF essentials libraries (both Core and Client) from <a href="http://www.oracle.com/technetwork/developer-tools/adf/downloads/index.html">OTN</a><br />
<a href="http://www.blogger.com/blogger.g?blogID=7376005576805942434" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a>3. Download Glassfish 4 if you do not have it installed already.<br />
<br />
<h2 style="text-align: left;">
<span style="font-size: large;">Configure</span> </h2>
In order to run ADF application on Glassfish, ADF Runtime needs to be installed on the server. This requires ADF Essential core libraries to be copied into lib folder of your Glassfish domain. You will also need to deploy ADF Essentials Client libraries along with your code to Glassfish server by including them in your application EAR.<br />
There are ways of doing this but I prefer using Ant script provided in OEPE for configuring Glassfish as described in <a href="http://docs.oracle.com/cd/E47843_02/12121/OEPUG/oracle_adf_tools.htm#BABGABJH">Oracle docs</a><br />
<br />
<i>1. Create a Java project </i><i><i>in OEPE</i>.<br />2. In your OEPE install, go to $install_dir/plugins/oracle.eclipse.tools.adf_6.2.0.$buildrelease/adf-essentials-glassfish-config<br />3. Copy the files called build.xml and build.properties into the root of your Java Project .<br />4. Open the build properties file and update the properties to reflect your specific environment properties.<br />5. Save the build properties file with your changes.<br />6. In OEPE, right click on build.xml in the Project Explorer and select Run As > Ant Build... , which opens the Edit Configuration and Launch dialog.<br />7. Choose the JRE tab and select Run in same JRE as workspace.<br />8. Choose the Targets tab and select create-domain/recreate-domain. Make sure all of the other options under Name are unselected.<br />9. Click Apply.<br />10. Click Run.</i><br />
<br />
By following above steps you create/recreate a domain that you want to use for your ADFE application. By default Glassfish server provides<b> domain1</b> that can be configured and used as the domain for deploying ADFE applications. You can create a fresh new domain or change the configuration of domain1. One of the settings you may need to change is HTTP listen port of your Glassfish server. By default the server uses 8080, which in many cases has already been used by other apps on your machine e.g. on my machine Oracle XE database listens to 8080.<br />
<br />
Secondly you need to set up your domain for ADF Essentials applications. For that you can run build.xml again by selecting <b>install-adfe-full</b>.<br />
If this command does not execute properly or you want to perform steps involved in this process individually (my preferred way) then you need to do as follows:<span style="font-size: xx-small;"> </span><br />
1. Unzip the core library files into lib folder of your Glassfish domain by running <b>install-adfe-core </b>in build.xml<b> </b>or using<b> </b><b>unzip -j</b> command<br />
2. Unzip the client libraries into any folder of your choice by running <b>install-adfe-client </b>in build.xml or by using <b>unzip -j </b>command <br />
3. Start Glassfish server by running <b>start-dev-domain</b> in build.xml. Open admin console of Glassfish server using http://<your-host-name>:<glassfish_admin_port>. Go to Configurations->Server-config->JVM Settings and choose the JVM Options tab and add the following:<br />
<b> -XX:MaxPermSize=512m </b>(this entry should already be there so just modify it)<b><br /> -Doracle.mds.cache=simple</b><br />
<br />
Your Glassfish server is configured for running ADFE applications on it. Now you will need to create a Glassfish server connection in Eclipse using the domain you just configured before starting to create an ADFE application. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<h2 style="text-align: left;">
<span style="font-size: large;">Create </span></h2>
Create an ADF application. Go to File > New > ADF Application.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfNbtrdeH8E5zw6NPYM4Sckx6SCO8rqsWlpCg2nk2nior4-eGpplyqDkIOMGBS2OuwoauOw-p-AhY508rD3Vt1IMHcex-ngScWa8ZbKtN-upSkOtaBUmnW-K1QxfMIM7r3aUH1JVuP-KCJ/s1600/Create-ADF-Application.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfNbtrdeH8E5zw6NPYM4Sckx6SCO8rqsWlpCg2nk2nior4-eGpplyqDkIOMGBS2OuwoauOw-p-AhY508rD3Vt1IMHcex-ngScWa8ZbKtN-upSkOtaBUmnW-K1QxfMIM7r3aUH1JVuP-KCJ/s1600/Create-ADF-Application.png" height="302" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: left;">
In next window, specify the Application name and Target runtime. You will see the runtime for your Glassfish server if you have already created a server connection in eclipse, otherwise you can create one here. Now select New JPA Project as we need t o create a new JPAproject for our application.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinr8NsHgVDqZBveH8b1iNOjZWRFl2FHDy3RWXjbciqMb9LSUHuGtETdsZD8X4xUTvlJr6s4udpda87_5w5ytBEfDHjvMFH2E2o5asT0ddgk8cFRyQ2_sR95eqrO4qZ4OlRn5kKOo5PAbYl/s1600/Create-ADF-Application_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinr8NsHgVDqZBveH8b1iNOjZWRFl2FHDy3RWXjbciqMb9LSUHuGtETdsZD8X4xUTvlJr6s4udpda87_5w5ytBEfDHjvMFH2E2o5asT0ddgk8cFRyQ2_sR95eqrO4qZ4OlRn5kKOo5PAbYl/s1600/Create-ADF-Application_1.png" height="607" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In Create JPA Project wizard, keep default settings and press Next > , keep Java settings as they are and proceed to Java Facet window. Here select EclipseLink 2.5x as the platform, Glassfish System Library as JPA implementation. Create a new connection by clicking on Add connection and select the type of connection you want to use. In this example we are going to use Oracle XE database. So select Oracle Database Connection and in next window specify the database details. For this tutorial I have created a connection to HR schema of XE database. Keep rest of the settings as default and press Finish.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhujkCSdFJ4Bc1D1whYLX75Vfx50g1NZt5vbnaIUcmBQIppigp28UIwDDiSoXcaFfUNQqISBDSkZgNi4qhaacW7Pc98i3qjB_gkw0CXFVgRSYC0Oanrki2tf7nyVLI-Nbn07kj6fDgefrVJ/s1600/JPA-Facet.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhujkCSdFJ4Bc1D1whYLX75Vfx50g1NZt5vbnaIUcmBQIppigp28UIwDDiSoXcaFfUNQqISBDSkZgNi4qhaacW7Pc98i3qjB_gkw0CXFVgRSYC0Oanrki2tf7nyVLI-Nbn07kj6fDgefrVJ/s1600/JPA-Facet.PNG" height="640" width="486" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The JPA project will now appear in your new application window</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipXxXbXVIIuBIdMAisRPUdmWAx89DWfiYnHRkucCWgLQZFL7tIpQ1Pn4Y7764HpUsPoQ9nXoSNsunYj57qvFu2x5nvigspcvrRebph3xhW-p_zw2HYQBeKkTrcpWzQ18Ch4hv3sHGddPJn/s1600/Create-ADF-Application_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipXxXbXVIIuBIdMAisRPUdmWAx89DWfiYnHRkucCWgLQZFL7tIpQ1Pn4Y7764HpUsPoQ9nXoSNsunYj57qvFu2x5nvigspcvrRebph3xhW-p_zw2HYQBeKkTrcpWzQ18Ch4hv3sHGddPJn/s1600/Create-ADF-Application_2.png" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Proceeding to next window we need to create a user library which will consist of ADFE client libraries we unzipped in a folder during the configuration process. Click on Manage Libraries, and specify the library name in User Libraries window.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhL8DAj6kX3zQRRH1nFugzOdnuGK_YsdaRpcSOt85NKkDraVNCJkRk8eMQXRosaVUZrBxpoLt57YKKNYEBH7tAKq3-iqR0pIyOkADHWas00yAZgalfZxlA8QoNxeoqyy5_3xkRjshJWHo2I/s1600/Select-Client-lib-1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhL8DAj6kX3zQRRH1nFugzOdnuGK_YsdaRpcSOt85NKkDraVNCJkRk8eMQXRosaVUZrBxpoLt57YKKNYEBH7tAKq3-iqR0pIyOkADHWas00yAZgalfZxlA8QoNxeoqyy5_3xkRjshJWHo2I/s1600/Select-Client-lib-1.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim8RzwtHQE_t3bG_joX6FJKLCKMLSaQo0L333LzSTyGc0k_Wxq3pVaM58wBOVmX8dcfeBsHUPzg9azZ5f1Ep47D13G9pRk-JKDaYajuRMcnEaM0CCKnXBHz66DUcgJIK79wNUBxlsYze8O/s1600/Select-Client-lib-3.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim8RzwtHQE_t3bG_joX6FJKLCKMLSaQo0L333LzSTyGc0k_Wxq3pVaM58wBOVmX8dcfeBsHUPzg9azZ5f1Ep47D13G9pRk-JKDaYajuRMcnEaM0CCKnXBHz66DUcgJIK79wNUBxlsYze8O/s1600/Select-Client-lib-3.PNG" height="584" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Now Click on Add External JARs.. and naviagte to the folder where ADFE client libs have been extracted. Select and Open all the libraries </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFC5c2S8609dSbtH20864FkMvy5LviHV2AXVLeONDjVwx92DuAgxRndM_Ry488mbTfjCAgvSmb3uR1byGPjoe6VTlTwLZmlm1l-sLVfr_nOpWrUVoi55X8Vzf7JSPj2Rf3Vtd5a_Wk9307/s1600/Select-Client-lib-4.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFC5c2S8609dSbtH20864FkMvy5LviHV2AXVLeONDjVwx92DuAgxRndM_Ry488mbTfjCAgvSmb3uR1byGPjoe6VTlTwLZmlm1l-sLVfr_nOpWrUVoi55X8Vzf7JSPj2Rf3Vtd5a_Wk9307/s1600/Select-Client-lib-4.PNG" height="640" width="608" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
After verifying that all the libraries have been included , Click Ok.</div>
<div class="separator" style="clear: both; text-align: left;">
In next window, select the user library created in previous steps. Also select <i>Include libraries with this application </i>. This will make sure the client libraries are deployed as part of your your application EAR</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8boqiPca5TYdLc3t71zBZhv1Uime3KXjzzkF99RaEGU-mqrJMpmn01e-y9ao6tcxglGEyRWG1UGS4YQ_9BRq3eBTjUIJNJfsz08ocAlTmz_CQb-XbVi6ofRO89KWncWU35j8Q7Kz648PT/s1600/Select-Client-lib-5.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8boqiPca5TYdLc3t71zBZhv1Uime3KXjzzkF99RaEGU-mqrJMpmn01e-y9ao6tcxglGEyRWG1UGS4YQ_9BRq3eBTjUIJNJfsz08ocAlTmz_CQb-XbVi6ofRO89KWncWU35j8Q7Kz648PT/s1600/Select-Client-lib-5.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Click Finish and you will see three new projects created in your workspace </div>
<div class="separator" style="clear: both; text-align: left;">
SampleADFEApp : Root project containing EAR contents for the Application</div>
<div class="separator" style="clear: both; text-align: left;">
SampleADFEAppModel: JPA project</div>
<div class="separator" style="clear: both; text-align: left;">
SampleADFEAppWeb: Web project</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQfzdWZSJBFmYNdyjUBWIJbpabAH9989Fume-Wfb90nbBL0A_LtlDry1nnbK3gtA0Ma7skNru95iDnZCzJQkdnMmKpoIQvxM3rjdmxx6j7m7N_nYFMrSfjlIuZpUlP3BURr8nI_FkhU0LS/s1600/Project_Explorer.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQfzdWZSJBFmYNdyjUBWIJbpabAH9989Fume-Wfb90nbBL0A_LtlDry1nnbK3gtA0Ma7skNru95iDnZCzJQkdnMmKpoIQvxM3rjdmxx6j7m7N_nYFMrSfjlIuZpUlP3BURr8nI_FkhU0LS/s1600/Project_Explorer.PNG" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: left;">
To test whether the application has been created properly and it can run on Glassfish server, right click on index.jspx in the web project and select Run As > Run on Server. In subsequent windows select the Glassfish server instance that is configured for ADFE and the application to be deployed on it</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVhd15qWWt0R-fIYiqvmi3p7f4eSjqiVKZQPLR8Sj0qSpIvNf26DnSLqE46owvrIFAGSHDGeQFryXxYwjjOYo_cHxtzaK5LYkHJHBF9HBTliPF22UyT8ltEF8xYBSgJYPRk6wqyX66gnHs/s1600/Test_App_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVhd15qWWt0R-fIYiqvmi3p7f4eSjqiVKZQPLR8Sj0qSpIvNf26DnSLqE46owvrIFAGSHDGeQFryXxYwjjOYo_cHxtzaK5LYkHJHBF9HBTliPF22UyT8ltEF8xYBSgJYPRk6wqyX66gnHs/s1600/Test_App_1.png" height="518" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Monitor server console for any errors in server startup or during application deployment. If everything goes well then index.jspx should come up in your browser.</div>
<div class="separator" style="clear: both; text-align: left;">
You should see welcome message on the index page in your browser. If you do not see anything in your browser then open web.xml, which is located at WebContent/WEB-INF and add the following in it:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<pre class="brush: csharp"> <filter>
<filter-name>trinidad</filter-name>
<filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>trinidad</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
<servlet>
<servlet-name>resources</servlet-name>
<servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>resources</servlet-name>
<url-pattern>/adf/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>resources</servlet-name>
<url-pattern>/afr/*</url-pattern>
</servlet-mapping></pre>
<br />
Now Clean all the projects and run index.jspx again. You will see the welcome message in your browser.<br />
<br />
We will see how to use ADF model layer in an ADFE application to display data coming from database tables in part 2 of this series.</div>
</div>
<h2 style="text-align: left;">
</h2>
</div>
Ashish Mishrahttp://www.blogger.com/profile/13649321524880482585noreply@blogger.com0tag:blogger.com,1999:blog-7376005576805942434.post-39495513420634418252013-11-27T01:45:00.003-08:002013-11-27T20:09:53.609-08:00How to resolve java.lang.IllegalStateException: null windowId in OEPE ADF application<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: center;">
<br /></div>
<div style="text-align: left;">
I was getting this exception while trying to run the basic index.jspx page which was generated when I created a new ADF application using Oracle Enterprise Pack for Eclipse 12.1.2.1.1 with Glassfish 4.0<br />
<br />
<pre class="brush: csharp">
StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception<br />java.lang.IllegalStateException: null windowId<br /> at oracle.adfinternal.view.faces.webapp.rich.RichWindowManager._storeLoopbackId(RichWindowManager.java:1454)<br /> at oracle.adfinternal.view.faces.webapp.rich.RichWindowManager.updateRedirectURI(RichWindowManager.java:1234)<br /> at oracle.adfinternal.view.faces.config.rich.DetectRedirect.redirect(DetectRedirect.java:40)<br /> at javax.faces.context.ExternalContextWrapper.redirect(ExternalContextWrapper.java:578)<br /> at javax.faces.context.ExternalContextWrapper.redirect(ExternalContextWrapper.java:578)<br /> at oracle.adf.view.rich.context.UriManagerBase.addQueryParameters(UriManagerBase.java:44)<br /> at oracle.adfinternal.view.faces.webapp.rich.UriManagerImpl.addQueryParameters(UriManagerImpl.java:29)<br /> at oracle.adfinternal.controller.util.AdfvInterfaceImpl.addQueryParameters(AdfvInterfaceImpl.java:205)<br /> at oracle.adfinternal.controller.state.ControllerState.initializeUrl(ControllerState.java:715)<br /> at oracle.adfinternal.controller.state.ControllerState.synchronizeStatePart2(ControllerState.java:473)<br /> at oracle.adfinternal.controller.application.SyncNavigationStateListener.afterPhase(SyncNavigationStateListener.java:59)<br /> at oracle.adfinternal.controller.lifecycle.ADFLifecycleImpl$PagePhaseListenerWrapper.afterPhase(ADFLifecycleImpl.java:530)<br /> at oracle.adfinternal.controller.lifecycle.LifecycleImpl.internalDispatchAfterEvent(LifecycleImpl.java:120)<br /> at oracle.adfinternal.controller.lifecycle.LifecycleImpl.dispatchAfterPagePhaseEvent(LifecycleImpl.java:168)<br /> at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$PhaseInvokerImpl.dispatchAfterPagePhaseEvent(ADFPhaseListener.java:131)<br /> at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.afterPhase(ADFPhaseListener.java:74)<br /> at oracle.adfinternal.controller.faces.lifecycle.ADFLifecyclePhaseListener.afterPhase(ADFLifecyclePhaseListener.java:53)<br /> at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:447)<br /> at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:202)<br /> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)<br /> at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)<br /> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)<br /> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)<br /> at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)<br /> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)<br /> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)<br /> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)<br /> at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)<br /> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)<br /> at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)<br /> at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)<br /> at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)<br /> at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)<br /> at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)<br /> at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)<br /> at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)<br /> at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)<br /> at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)<br /> at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)<br /> at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)<br /> at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)<br /> at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)<br /> at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)<br /> at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)<br /> at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)<br /> at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)<br /> at java.lang.Thread.run(Thread.java:744)</pre><br />
<br />
I compared the configuration of my web project created in OEPE with the one of a normal ADF view-controller project created using Jdev and found out that my web.xml file was mising some settings. Following needs to be added in web.xml to get rid of the exception.<br />
<code class="html plain" style="-webkit-text-stroke-width: 0px; background-image: none !important; background-position: initial initial !important; background-repeat: initial initial !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; height: auto !important; left: auto !important; letter-spacing: normal; line-height: 16.328125px; margin: 0px !important; min-height: inherit !important; orphans: auto; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left; text-indent: 0px; text-transform: none; top: auto !important; vertical-align: baseline !important; white-space: pre; widows: auto; width: auto !important; word-spacing: 0px;"><br /></code><code class="html plain" style="-webkit-text-stroke-width: 0px; background-image: none !important; background-position: initial initial !important; background-repeat: initial initial !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; height: auto !important; left: auto !important; letter-spacing: normal; line-height: 16.328125px; margin: 0px !important; min-height: inherit !important; orphans: auto; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left; text-indent: 0px; text-transform: none; top: auto !important; vertical-align: baseline !important; white-space: pre; widows: auto; width: auto !important; word-spacing: 0px;"></code>
<pre class="brush: csharp"><filter>
<filter-name>trinidad</filter-name>
<filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>trinidad</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping></b></pre>
<span style="font-size: small;"><b><code class="html plain" style="-webkit-text-stroke-width: 0px; background-image: none !important; background-position: initial initial !important; background-repeat: initial initial !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; height: auto !important; left: auto !important; letter-spacing: normal; line-height: 16.328125px; margin: 0px !important; min-height: inherit !important; orphans: auto; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left; text-indent: 0px; text-transform: none; top: auto !important; vertical-align: baseline !important; white-space: pre; widows: auto; width: auto !important; word-spacing: 0px;"></code> </b></span></div>
</div>
Ashish Mishrahttp://www.blogger.com/profile/13649321524880482585noreply@blogger.com1