Time to time it happens, when we are keep saying - 'strange...', while developing something. It happened to me today, let me share what I was facing and how this 'strange' problem was resolved. My use case was - reusable ADF application packaged into ADF library JAR file and reused from main portal application. However, when accessing from main portal application, constantly it was throwing NullPointer exceptions from ADF Data Control. I managed to reproduce this problem with smaller simple application, NullPointer exception is generated when trying to load table component from ADF library:
Reusable ADF application is just standard ADF 11g application, it contains ADF BC and ADF Task Flows:
There is dependency set between ViewController and Model project:
Portal application is also standard ADF 11g application, it imports ADF library and includes reusable ADF region:
But it would take more closer look and browse through imported libraries, we would notice that reusable ADF library doesn't contain actual model project for our reusable ADF task flow:
Okej, so we are very close to solve the problem now, it means for some reason whole model package just was not included into ADF library. Of course, then we would look into deployment profile for ADF library and would see that Library Dependency section is empty. You must ensure deployment profile dependency is not empty, when deploying to ADF library. Its enough to have set only project dependency, when running application without deploying into ADF library JAR:
If you want to avoid one of those 'strange...' situations, make sure you will set deployment profile dependency from Model project:
Rebuild library, it will include model part now as well:
Data is loaded successfully now, through main portal application:
Download working sample application with reusable ADF library imported into main portal application - reusableapps.zip.
Reusable ADF application is just standard ADF 11g application, it contains ADF BC and ADF Task Flows:
There is dependency set between ViewController and Model project:
Portal application is also standard ADF 11g application, it imports ADF library and includes reusable ADF region:
But it would take more closer look and browse through imported libraries, we would notice that reusable ADF library doesn't contain actual model project for our reusable ADF task flow:
Okej, so we are very close to solve the problem now, it means for some reason whole model package just was not included into ADF library. Of course, then we would look into deployment profile for ADF library and would see that Library Dependency section is empty. You must ensure deployment profile dependency is not empty, when deploying to ADF library. Its enough to have set only project dependency, when running application without deploying into ADF library JAR:
If you want to avoid one of those 'strange...' situations, make sure you will set deployment profile dependency from Model project:
Rebuild library, it will include model part now as well:
Data is loaded successfully now, through main portal application:
Download working sample application with reusable ADF library imported into main portal application - reusableapps.zip.
13 comments:
Hi,
I have the same problem but my situation is a little bit different.
In your exemple, you deploy the project "ViewController" from your app "DepartmentsApp" like an ADF Library and this project has a dependency to "DepartmentsModel" project.
In my case, the "ViewController" project that I deploy like an ADF Library has no dependency to a model project. It uses a nested Application Module imported from an other ADF Library. I have a project organization like in your other post :
http://andrejusb.blogspot.com/2010/10/how-to-reduce-database-connections-and.html
The problem is, when I import My ADF Library (the library where are my reusable bounded task flows) in my main Application, jdevelopper don't generate "ADF Library Dependencies" library. So I have no link to my Models jar. And so I have the same exception "bc4j not found in the classpath".
If I import directly my Models projects in my main application it works fine but it is not a good solution. Do you know why jdevelopper doesn't generate ADF Library Dependenies?
Thanks for all your posts which help me a lot!
a beginner in ADF strange world.
Finally I resolved my problem, removing and readding mi ADF Library from the Ressource Palette 2 or 3 times. It is very strange because jdevelopper generates ADF Library Dependencies sometimes, and sometimes no.
Tis discussion helped me :
http://forums.oracle.com/forums/thread.jspa?threadID=1060633
Sorry for posting. Have a nice day!
a beginner in ADF strange world.
Hi,
Its not a problem, its by design :)
You should create simple test page inside JAR project and test from there, if don't want to run whole project.
Andrejus
Hi,
Its not workaround, its typical way to go to create Test page in your subproject. Its standard approach to use ADF library JAR file in ADF.
Yes, but if you dont want to use JAR files. You can add Project into Application and define dependency. All classes will be copied then during build process. However I would not recommend this approach, because you will end-up with duplicate classes inside different projects.
Keep in mind, JAR file is only referenced but is not copied - which allows to avoid duplications.
Andrejus
Hello - I think this is the same problem that I am experiencing within WebCenter Spaces. I am using the default WebCenterSpacesExtension project that Oracle has created for us to deploy new taskflows. When I create a new ViewController project that contains my taskflow everything works as expected. However, if I add a DataControl to the WebCenterSpacesExtension application and bind a table to my DataControl I recieve a null pointer exception on the DataControl within WebCenter. Have you tried this within the context of webcenter?
Thanks-
Hi,
Are you using ADF JAR library? If yes, make sure its packaged inside final EAR you are using to extend WebCenter.
Andrejus
Yes, I am deploying my project as an ADF JAR library. Then I am adding this ADF JAR library to my webcenterspaceextenstions deployment jars. I am able to see my new taskflow within webcenter (so I know the ADF Jar Library exists) but the data control isnt coming across..
Caused by: javax.naming.NameNotFoundException; remaining name 'URLConnection1'
at oracle.adf.share.jndi.ContextImpl.findObject(ContextImpl.java:662)
at oracle.adf.share.jndi.ContextImpl.lookup(ContextImpl.java:152)
at oracle.adf.share.jndi.ContextImpl.lookup(ContextImpl.java:157)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at oracle.adfinternal.model.adapter.url.csv.CSVDataControl.invokeOperation(CSVDataControl.java:259)
Do you ADF Library Dependency generated inside of your project (like here: http://1.bp.blogspot.com/-Y_SdatY7WW0/TfOJmJqoY6I/AAAAAAAAFLY/lcx8YsunIac/s1600/5.png)
If yes, try to add dependent libraries directly and avoid using ADF Library Dependency, it may cause issues in some scenarios.
Andrejus
Andrejus,
Thanks for the article.
I tried doing in the reusable ADF library(Generic project with webservice proxy datacontrols and ADF task flow) and tried adding in another project following the tutorial but when i add i could see the datacontrols, but randomly they just disappear from the datacontrols view, i could see just the datacontrol name can't see operations or return types.
Please suggest what to do in this scenario.
Thanks,
Sri
Hi Andrejus,
I have some external jar files in filesystem.I built a new project from ApplicationMenu New Project>Generic Project.
Jars are availble under new project.These jars are xmlparserv2-904 etc for generating reports.
How i import the packages/classes from this project to my Model Layer project as i want to use classes from this project in code editor in some of impl classes ?
If I add them in Model layer in Libraries & Classpath property, its working but I want to know by above way.
Thanks.
Hi,
I have 4 jars in my application.I am trying to integrate my project
I have a tabpannel in my application, and each task flow from one jar goes into one tab as a region.
There will be 2 variables that will set as session variables in my first region ( task flow from jar1).I have set action listener on a command button and sets the values on to a session variable.#{sessionScope.Varname}
I have sql queries in rest of the tabs based on the 2 variables that are set in the tab1 (taskflow in jar1).I used bind variables in sql queries.
I am trying to access the variables I have set in tab 1 like this #{sessionScope.Varname}.
it gives me java.lang.NullPointerException
Need you help.
Thanks
Hi,
I have an application that has connections.xml with some webservice details connections.
When I deploy this application to a jar and add it to my main application it fails because something uses some data from connections.xml.
An workaround for this is to copy the same connection's data to the main application.
I researched this http://docs.oracle.com/cd/E24382_01/web.1112/e16182/reusing_components.htm#BEIFEABF , but this does not help because it only merges connections.xml into main application and I do not want to have a big connections.xml file.
Please could you help me with this issue?
Hi Andrejus,
When an application is used as jar in other app, I dont see the logger functioning for the called application.
Is there any setting to be taken care of?
Thanks,
Vishnu
Post a Comment