The Great Migration

ADF Applications – Migration from 12.1.3 to 12.2.1

Hi all and welcome to a new article on Red Mavericks!

This article will present some problems and respective solutions in order to migrate ADF applications from 12.1.3 to 12.2.1. In this case, we used an example application that consists in a framework with several ADF applications and dependencies between them. In the current version (12.1.3), the framework works without issues.

ADF 12.2.1 comes with several corrections of customer-reported and internal (unpublished) errors, along with a new features that can be useful when developing applications:

  • Responsive Layout (Masonry Layout, af:matchMediaBehavior)
  • Visualization components (NBox, new charts and enhancements)
  • ADF Business Components (Creating RESTfull Web Services with Application Modules)

For more information about the changes in the ADF 12.2.1, click here to visit oracle documentation.

For clarify any misleading concept, I will assume the following meanings in this document:

  • Application: Group of ADF applications
  • ADF application: Group of ADF project
  • ADF project: Single ADF project

 

JDeveloper wizard migration

In order to do the migration to the new ADF version, we used the JDeveloper 12.2.1 to open all ADF projects and followed the steps in the migration wizard:

MigrationsStep1

MigrationsStep2

MigrationsStep3

Repeat this steps for every ADF projects in your application.

In this process, we did the initial migration required by the JDeveloper with success in all projects.

Advice – Debug Problems

In my migration case, I had several problems with ADF projects that contains declarative components.

In complex ADF applications with multiple dependencies is hard to know what is going on. So my advice is to try to start with simple ADF projects, with fewer dependencies, and then move on to the more complex ones. If there are declarative components that you can insert into a test ADF application to try them out, do it, and see if you can run the test or if there is a problem with it.

Validate, Update and Add ADF projects missing dependencies

For each ADF project you migrate to the new version,  check the libraries in the ADF project properties:

  1. Right click on the ADF project and select “Project Properties…” (our double click over the ADF project)projectDependenciesStep1
  2. Check all the libraries tabs, including Facelets Tag Libraries, JSP Tag Libraries and Libraries and Classpath:projectDependenciesStep3
  3. Sometimes JDeveloper doesn’t correctly migrate all libraries to the new versions. In this case, you need to remove the faulty libraries and add them manually.projectDependenciesStep4

Another aspect to take a quick look is the ADF Model projects. Sometimes during the ADF project migration, the ADF generates ViewController files in the Model project. My advice is to delete this new files using the window explorer because they can be a source of problems when trying to run your ADF application (refresh the application in JDeveloper after removing the files).

ADFModelStep1

ADFModelStep2

Also update the BPM, UCM and others libraries you have inside your ADF projects. To do this copy the libraries you need from your <oracle_home>/oracle_commom/modules, where <oracle_home> is the directory home where your jdeveloper 12.2.1 was installed.

BPM_UCM_libs

 

Then you have to check and update (in case the library has a different name) any of this libraries decencies inside your project properties.

Clean ADF projects before compile and deploy

In order to certify all the ADF project will compile using the new configurations, I recommend you to do the following steps:

  1. For each ADF project, go to “Build” menu and select “Clean All

projectClean

  1. You can also delete any existing compiled code like .jar, .war, … Use file explorer for this.

jarsWarsClean

Classes not found errors

  1. application.ModuleException: java.lang.ClassNotFoundException: oracle.adfinternal.view.faces.facelets.rich.IncludeHandler and oracle.adf.view.faces.bi.webapp.GraphServlet

If you are stuck with this exception and already done all recommended steps in Validate, Update and Add ADF projects missing dependencies, try to add a new empty page to your adfc-config.xml (you can remove it after). This will automatically add some libraries in the project properties. In my case it adds the “ADF DVT Core Runtime”, “Oracle BI Graph” and correct some others dependencies if it’s the case.

 

  1. application.ModuleException: java.lang.ClassNotFoundException: oracle.dss.rules.ComponentTypeConverter

This typically is associated with ADF projects that contain declarative components. I usually leave this one to solve in the end, because it is more complex to find the problem.

First thing I like to do is cleaning up the dependencies and add new ones that are used when we created a new declarative components ADF project. To guide you, try to remove the dependencies that aren’t in the following list and add the ones that your project is missing:

  1. In project->properties->Libraries and Classpath:declarativeComponents1
  2. In project->properties->JSP Tag Libraries:declarativeComponents2
  3. In project->properties->Facelets Tag Libraries:declarativeComponents3

If this doesn’t solve your problem, let’s try another approach. Before this, make a quick backup of your project so if anything goes wrong you can rollback and without losing your application.

First thing, close the declarative components ADF application from JDeveloper. You need to do this because you will change the .jpr ADF project file.

Search in your project for the tag “<hash>” followed by “<value n=”displayName” v=”WEB-INF/lib”/>”. In my declarative component, I solved the problem removing a lot of .jars that are referred here:

    1. Not working:
<hash>
     <value n="displayName" v="WEB-INF/lib"/>
     <hash n="filters">
        <list n="rules">
           <hash>
              <value n="pattern" v="xml-apis-ext.jar"/>
              <value n="type" v="1"/>
           </hash>
           <hash>
              <value n="pattern" v="prefuse.jar"/>
              <value n="type" v="1"/>
           </hash>
           <hash>
              <value n="pattern" v="dvt-utils.jar"/>
              <value n="type" v="1"/>
           </hash>
           <hash>
              <value n="pattern" v="dvt-shared-js.jar"/>
              <value n="type" v="1"/>
           </hash>
           <hash>
              <value n="pattern" v="dvt-facesbindings.jar"/>
              <value n="type" v="1"/>
           </hash>
           <hash>
              <value n="pattern" v="dvt-databindings.jar"/>
              <value n="type" v="1"/>
           </hash>
           <hash>
              <value n="pattern" v="dvt-basemaps.jar"/>
              <value n="type" v="1"/>
           </hash>
           <hash>
              <value n="pattern" v="batik-xml.jar"/>
              <value n="type" v="1"/>
           </hash>
          (…)
           <hash>
              <value n="pattern" v="jarUtilities.jar"/>
              <value n="type" v="1"/>
           </hash>
           <hash>
              <value n="pattern" v="com.bea.core.apache.commons.collections_1.0.0.0_3-2.jar"/>
              <value n="type" v="1"/>
           </hash>
           <hash>
              <value n="pattern" v="**"/>
              <value n="type" v="0"/>
           </hash>
        </list>
     </hash>
     <value n="internalName" v="libraries"/>
     <list n="selectedLibraries">
        <string v="ADF Faces Runtime 11"/>
        <string v="ADF DVT Faces Runtime"/>
     </list>
     <value n="targetWithinJar" v="WEB-INF/lib"/>
     <value n="type" v="3"/>
  </hash>
    1. Working:
<hash>
     <value n="displayName" v="WEB-INF/lib"/>
     <hash n="filters">
        <list n="rules">
           <hash>
              <value n="pattern" v="**"/>
              <value n="type" v="0"/>
           </hash>
        </list>
     </hash>
     <value n="internalName" v="libraries"/>
     <value n="targetWithinJar" v="WEB-INF/lib"/>
     <value n="type" v="3"/>
     <list n="unselectedLibraries">
        <string v="JarUtilities.jar"/>
        <string v="AdfLibResourceBundles.jar"/>
     </list>
 </hash>

Compile and Run

Now you can compile all ADF projects and deploy them to the WebLogic server. Don’t forget to see for each ADF project if the deploy ends successfully.

projectCompileStatus

 

Conclusion

Sometimes the ADF applications migration is not a simple button press, so when you are thinking of migrate our ADF application take in consideration that it is possible to lose some time to make all your code working in a new ADF version. However, I hope that reading this document could help you and speed up any problem situation you face in this process.

Keep checking out Red Mavericks for additional tips of Oracle Middleware technology

Cheers,
Pedro Curto

(this article is also published at Link Consulting’s website)

Post image by Steve Corey

Error in JDeveloper 12.2.1 - OSB project with XQuery changes to SOA project

Error in JDeveloper 12.2.1 – OSB project with XQuery changes to SOA project

Hi all,

After having performed a quick dive into JDeveloper 12.2.1, I came across a quite interesting feature. OSB projects started to get converted to SOA projects! Being clueless about the reason for this strange phenomenon, I conducted a quick investigation and concluded it was due to adding XQuery transformations to the project. Below are my findings and how to go around this problem if you had the misfortune of coming across it as well.

Symptoms

While working on an OSB project in Jdeveloper 12.2.1, after adding an XQuery transformation, JDeveloper changes it to a SOA project. The project structure will change and an error will be produced by Jdeveloper when completing the XQuery creation. This will occur also when importing an OSB project that contains XQuery tranformations in Jdeveloper 12.2.1. Basically, as long as there is an XQuery file in the project, it will be converted to a SOA project. When trying to deploy the project, Jdeveloper will open the Wizard for SOA project deployment, which will fail, because we have in fact an OSB project.

Adding an XQuery file to the project

Below is an example of what happens when adding an XQuery file to an existing OSB Project.

Sample OSB project before adding XQuery

Sample OSB project before adding XQuery

 

Sample OSB project after adding XQuery

Sample OSB project after adding XQuery

Meanwhile, in the JDeveloper log, the below error can be seen as well:

Uncaught exception
java.lang.NullPointerException
at oracle.tip.tools.ide.fabric.addin.SCAProjectConfigurator.configSCAProject(SCAProjectConfigurator.java:216)
at oracle.tip.tools.ide.fabric.addin.SCAProjectConfigurator.configSCAProject(SCAProjectConfigurator.java:131)
at oracle.tip.tools.ide.fabric.addin.SCAProjectConfigurator.configSCAProject(SCAProjectConfigurator.java:126)
at oracle.tip.tools.ide.fabric.addin.wizard.CompositeCreator.createComposite(CompositeCreator.java:284)
at oracle.tip.tools.ide.fabric.addin.wizard.CompositeCreator.createEmptyComposite(CompositeCreator.java:202)
at oracle.tip.tools.ide.fabric.addin.SCATechnologyListener$2.run(SCATechnologyListener.java:123)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at oracle.javatools.internal.ui.EventQueueWrapper._dispatchEvent(EventQueueWrapper.java:169)
at oracle.javatools.internal.ui.EventQueueWrapper.dispatchEvent(EventQueueWrapper.java:151)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Trying to deploy the project

Let’s say we are brave enough to ignore what happened and go ahead and try to deploy the project. We will be presented with the Deployment Wizard for SOA projects, which will fail if we go through all the way, since we have an OSB project in hands. Below you can see highlighted an indication that JDeveloper is looking at the project mistakenly as a SOA project.

Trying to deploy affected OSB project

Trying to deploy affected OSB project

Solution

There is a patch to fix this problem. To retrieve it, go to Oracle Support and refer to

Doc ID 2090174.1. Be sure to shut down JDeveloper before applying the patch and also to recreate the Default Domain in your installation (if you happen to be using the Integrated Server). As for the projects already affected, the cleanest approach is to recreate them and import the old files into them. As an alternative, it’s also possible to delete all soa-related artefacts from the projects and manually editing the .jpr files to remove the line highlighted below.

<hash n="oracle.ide.model.TechnologyScopeConfiguration">
  <list n="technologyScope">
    <string v="SOA"/>
    <string v="ServiceBusTechnology"/>
    <string v="XML"/>
    <string v="XML_SCHEMA"/>
  </list>
</hash>

Applies to

JDeveloper 12.2.1.0.0, when creating XQuery files in OSB projects
JDeveloper 12.2.1.0.0 when importing OSB projects containing XQuery files

And there you go. I hope this helps you to tackle this odd problem.

 

Carlos Pona (@carlospona84)

Carlos Pona is a SOA Technical Leader at Link Consulting.

Post header image by lees bus pics