Sunday, August 5, 2012

Resolving Invalid ADF BC Library Import in JDeveloper 11g R2

This week I came across ADF BC library import problem onsite. ADF BC library was very large, around 1000 EO's. EO's were not visible through JDeveloper wizard from consuming project after import. At first I was this is related to library size - too many ADF BC objects, JDeveloper fails to list them through ADF library import. But this proved to be false assumption, when I tested with smaller library. At the end I found there was duplicate definition for EO package path inside consuming project, it was duplicate to the one from ADF library. This was a reason why JDeveloper wizard was not resolving imported ADF BC. I will describe this case in a bit more detail, I believe this might be helpful (JDeveloper version - 11g R2 (11.1.2.x)).

Download working sample application with ADF BC library import - adflibimport.zip.

ADF BC library contains one EO object - com.redsamurai.common.model.entities package:


Project is deployed as ADF library and connected through JDeveloper resource catalog - EO object for Employees is included:


All is correct ay this point. But in my case imported ADF lib JAR file was showing imported package, but content was empty. Exactly as you can see in this screenshot - no content for com.redsamurai.common.model.entities package:


It seems like JDeveloper randomly may register package from imported library inside local Model.jpx ADF BC configuration file. When this happens - there will be duplicate package on class path and no ADF library objects shown in JDeveloper wizards. Its what I had in my case - imported package name was populated as well into local Model.jpx file:


After imported package name entry was removed from local Model.jpx, JDeveloper wizard instantly started to show imported EO object name:


If you will encounter the same situation - no ADF BC objects visible from imported library, make sure to double check local Model.jpx file, may be you will find duplicate entry for package name from imported library.

4 comments:

Jang Vijay Singh said...

This has been the case with every version of JDeveloper as far as I can remember.
Every model project has a *.jpx file that defines the model packages contained in it. the packages need to be unique across projects (so that you don't encounter this situation when you import model libraries)

Andrej Baranovskij said...

Yes, but in 11g R2 - it generates automatically (randomly) package name from imported library into local Model.jpx and then it breaks. This happens without developer action, Is not simply about having unique package names across Model.jpx.

Thanks,
Andrejus

Yo said...

Duplicates, threeplicates, fourplicates... and so on... this is happening to us too, but seems that wizards show anyways the imported BC anyways... now is when I open a wizard and I didn't see the imported ones LOL...

Andrej Baranovskij said...

I'm with you :-)

Andrejus