Wednesday, May 11, 2016

Sonar Configuration: Common Issues

Following are some common issues that someone might face while working with Sonar for the first time:

1) Caused by: Status returned by url : 'http://localhost:9000/api/server/version' is invalid : 404

Solution: This error might come because of incorrect URL configuration in sonar-runner.properties. If sonar.web.context property in sonar.properties is not default then sonar.host.url property in the sonar-runner.properties must include that context. So if sonar.web.context=/sonar then sonar.host.url should be http://localhost:9000/sonar

2) Caused by: You must define the following mandatory properties for '<sonar.projectKey value>': sonar.sources

Solution: This error indicates that sonar.sources is missing in the sonar-project.properties. This property should point to source files on which report is to be generated like Java files.

Tuesday, December 22, 2015

Oracle ADF 12c New Features By Release

Following is a list of some new important features in Oracle ADF 12c collected from various resources along with the features listed in Oracle documentation:

Oracle ADF 12.1.2.0.0:

1) Git: For managing source code.
2) Java EE 6 Support
3) JSP to Facelets conversion
4) REST/WADL Support
5) SOAP over JMS
6) Shared Libraries: Ability to package and deploy shared libraries to WebLogic Server.
7) Oracle Public Cloud Ready: Develop applications and deploy directly to Oracle Public Cloud and the Java Cloud Service
8) New Components 
    a) Treemap
    b) Sunburst
    c) Timeline
    d) List View
    e) PanelGridLayout
    f) Code Editor
    g) Panel Drawer
    h) Panel Springboard
9) Paging Support for Pivot Table and Gantt
10) New Skyros Skin
11) Enable Runtime Skin Updates
12) Calendar support for 15min appointments and the ability to zoom in
Pretty URLs
13) Bean Data Control: New options for scrolling and range paging.
14) Support for RowFinder feature
15) Support for multiple required View Criteria
16) Code Review:  integrated into many features of Team Productivity Center and enables to create a code review workflow for code changes.

Oracle ADF 12.1.3.0.0:

1) Support for creating JAX-RS 1.1 and 2.0 REST services and clients
2) Creation and deployment of GAR files for Coherence projects
3) Ant task generation for ojdeploy now supports options to use ojserver instead
4) Aligned with SQL Developer 4.0
5) New DVT Client Side Charting Solution which provides
    a) Ability to resize and fit to containers without going back to the server
    b) Reducing server workload
    c) Rich Set of Features
6) New Gauges: LED, status meter, dial, and the new rating gauge
7) Improved Thematic Map
8) New DVT Component: 
    a) Diagram
    b) af:deck: Shows one child component at a time and allows the transition between children (ie. fade, slide in)
    c) 
9) New Tablet First Page Template
10) Client side CSS rules
11) New feature to hide table scrollbars until a user needs them
12) Export to CSV along with Excel
13) Support for calling bounded task flows recursively
14) Ability set breakpoints and use the JDeveloper debugger to debug Groovy expressions
15) ADF DI Support for Windows 8 & Excel 2013 support
16) ADF DI New Components:
    a) Image component to add image to worksheet
    b) OutputText to display worksheet and database table errors.
17) ADF Query item reordering on runtime: Using this feature user can choose the order in which criteria items are displayed in ADF Query panel section.

Oracle ADF 12.2.1.0.0:

1) Direct integration with Oracle Developer Cloud Service
2) REST service development improvements
3) Visual UI in Memory Profiler
4) Alta Skin
5) Theme Editor which provides a user-friendly interface to create themes
6) Remote Regions to run taskflow from other ADF application
7) Masonry Layout
8) af:matchMediaBehavior to change state of the component according to a media Query
9) Responsive LayoutTemplate
10)New Data Visualization Component
    a) NBox 
    b) "Donut" chart look in Pie chart
    c) New Funnel chart
    d) Polar coordinate system is also now supported by bar, line, area, scatter and bubble chart types.
11) New Charting Design Time UI
12) Creating RESTful Web Services with Application Modules
13) Consuming RESTful Web Services Using ADF REST Data Controls
14) Groovy Expression Type Validation: Type checking during project compilation
15) ADF Query Item Reordering and Custom Operators

Other Features:

1) Entity Level Trigger: This allow declarative method addition in entity object before or after row update, delete.
2) Separate Groovy file instead of inline groovy expression.
3) Declarative filtering of master view object based on view criteria executed on detail view object.
4) Dynamic Forms: These allow business component to display form dynamically. The attributes from view objects are not bind directly to the page definition. Instead, a generic collection binding is created based on the attributes selected under "UI Categories" option in view object.
5) "Load More" scroll policy on ADF table.

The lists are not yet complete and will keep on updating. There are some other features that are yet to be added :)

Tuesday, November 10, 2015

Oracle ADF 12.2.1 Change Maven Local Repository Location

Following post describe the solution for an issue which might come after changing the maven local repository location in JDeveloper.

To change the Maven local repository location, go to Tools -> Preferences -> Maven -> Repositories in JDeveloper and enter the path of your own repository location:


After changing the local repository location, localRepository tag will get added in the settings.xml file (by default present in C:\Users\username\.m2 directory ), if not present already.

Now since the new repository don't have required ADF libraries, following issue might be faced while running the build for ADF project.


[ERROR] Failed to execute goal on project ChildModel: Could not resolve dependencies for project DeploymentTest_ChildApplication:ChildModel:jar:1.0-SNAPSHOT: Failed to collect dependencies at com.oracle.adf.library:BC4J-Runtime:pom:12.2.1-0-0 -> com.oracle.fmwshare:adf-share-support:jar:[12.2.1,12.2.2): No versions available for com.oracle.fmwshare:adf-share-support:jar:[12.2.1,12.2.2) within specified range -> [Help 1]



The solution for above issue is to populate new repository with all the required libraries:

Following are the steps for configuring new repository with weblogic maven plugin:

        1)    Open command prompt and change directory to

        ORACLE_HOME\oracle_common\plugins\maven\com\oracle\maven\oracle-maven-sync\12.2.1

        2)    Execute following command

        mvn install:install-file -DpomFile=oracle-maven-sync-12.2.1.pom -Dfile=oracle-maven-sync-12.2.1.jar

        3)    Now execute following command to push libraries into local repository

        mvn com.oracle.maven:oracle-maven-sync:push -DoracleHome=MIDDLEWARE_HOME

Once the above command is successful, it will populate the repository with all required libraries and build will run successfully.

Saturday, November 7, 2015

Oracle ADF - Maven Build And Deploy Issues

Following are some issues which might be faced while using maven with Oracle ADF:

1) [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project MasterModel: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [Help 1]

Solution: Add distributionManagement tag in POM.xml file for the project mentioned in the error. Like MasterModel project mentioned in above error.

<distributionManagement>
  <repository>
    <id>MasterModel</id>
    <name>localRepo</name>
    <url>file://C:/Users/Username/.m2/repository/</url>
  </repository>
</distributionManagement>

The vale in <url> will differ based on the repository location. Also the above tag will need to be added in all the pom.xml files (i.e pom.xml file for model, viewController and complete application ) otherwise the same error will come at different time in the build.

2) [ERROR] Failed to execute goal on project MasterViewController: Could not resolve dependencies for project deploy.masterapp:MasterViewController:war:1.0-SNAPSHOT: Failure to find com.oracle.adf.library:ADF-Library:pom:12.2.1-0-0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

Solution: The above issue came while running the pom build for the project which is accessing a taskFlow from ADF library jar file. After creating the File System connection for the taskflow to be used, when the taskflow was dropped on the page, this library dependency was automatically added in pom.xml file of consuming application. However this was not resolved during build. So the workaround of this was to remove this from the pom.xml file and add the dependency using "Add From Repository" option. Another post describes, how to add dependency from repository.

3) oracle.adf.controller.ControllerException: ADFC-02001: The ADF Controller cannot find '/WEB-INF/child-task-flow-definition.xml'....
Caused by: oracle.mds.core.MetadataNotFoundException: MDS-00013: no metadata found for metadata object "/WEB-INF/child-task-flow-definition.xml"
MDS-00201: PDocument not found in MetadataStore : [store-type=DefaultMetadataStore app-name=DeploymentTest_MasterApp lookup-order=ServletContext,Classpath]

Solution: This issue came on running the jsf page (i.e. right click and run in JDeveloper) which was having taskflow added from a ADF library jar. Please note, this issue only came with the application which was created by selecting Maven as build tool in the last step of application creation wizard. It was not faced for the application which was created using default build option in the last step.

The solution for the above issue is to first run the install target of master application pom.xml file. This will place all the artifacts (jar, war of the projects in master application as well as child application) in the repository. The above seems to be because of missing artifact from MDS but there is no MDS configuration in application. After successful completion of install target of the master application, this issue was not faced on running the application from JDeveloper.

Monday, November 2, 2015

Oracle ADF 12.2.1 Create Rest Data Control

Following are the steps of creating REST DataControl based on REST service exposed by application module as mentioned in this post:

1) Open Create Web Service Data Control wizard from gallery:


2) Click on green plus icon to create rest service connection: Following is the format of the URL

http://[host:port]127.0.0.1:8001/[Context]ADFRESTWebService/rest/[ReleaseVersion]RestRelease1/[ResourceName]Departments/describe

3) Click Ok.


4) Click Next and select any policy to be applied:


5) Click Next and select the resources to be exposed:


6) Click Test Rest Connection and finish after connection is successful.


7) Data Control will get created in Data Control palette


Another way of creating Data Control is by using Rest Connection:

1) Create Rest Connection and right click on the resource/connection to create data control:



2) Select the project in which data control is to be created:


Finally we can drag and drop the Department resource from the data control on the page as usual:


Wednesday, October 28, 2015

Oracle ADF 12.2.1 Template Not Found Issue

Following is the issue I faced while developing application in latest ADF 12.2.1 release. This issue came after running an application with single blank page based on responsive page template.

com.sun.faces.context.FacesFileNotFoundException: /oracle/templates/responsiveTemplate.jspx Not Found in ExternalContext as a Resource
    at com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:270)
    at com.sun.faces.facelets.impl.DefaultFacelet.getRelativePath(DefaultFacelet.java:283)
    at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:348)
    at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)..........

This issue was faced when Maven was selected as deployment descriptor on the last step of creating ADF application. If we create the application with default deployment option then this issue will not be faced. As in second scenario JDeveloper automatically adds the required "Oracle Page Templates" library to the project properties. However, in case of application using Maven, the library dependency was not added automatically in pom.xml file. Bad news was, even after adding the "Oracle Page Templates" in pom.xml, the issue was not resolved.

So the only solution for this issue was to create the application with default deployment option.

Tuesday, October 27, 2015

Oracle ADF 12.2.1 Release Installation Issue

Oracle ADF 12.2.1 Release Installation Issue

While installing Oracle ADF 12.2.1 release make sure you have installed jre1.8.0_51 and jdk1.8.0_51 or any later version of java. Any previous version will give Unsupported major.minor version 52.0   error while creating domain. Also while invoking the setup,use jdk1.8.0_51 version. If any prior java version is used, the setup will show the warning for unsupported java version while installing as shown below: