Tuesday, April 21, 2015

ADF Essentials: Error "No credential could be loaded for Reference = Reference Class Name: oracle.jdeveloper.db.adapter.DatabaseProvider" after deployment ADF 12.3 application to Glassfish 3.1.2

Today about horrible error message:
 
[#|2015-03-31T15:46:47.729+0200|WARNING|glassfish3.1.2|oracle.adf.share.jndi.ReferenceStoreHelper|_ThreadID=198;_ThreadName=Thread-2;|No credential could be loaded for Reference = Reference Class Name: oracle.jdeveloper.db.adapter.DatabaseProvider
Type: subtype
Content: thirdParty
Type: user
Content: funzone
, SecureRefAddr = password. Setting default value of "".|#]

[#|2015-03-31T15:46:50.337+0200|SEVERE|glassfish3.1.2|oracle.adf.controller.internal.binding.TaskFlowRegionModelViewPort|_ThreadID=198;_ThreadName=Thread-2;|java.lang.NullPointerException
 at oracle.adf.model.binding.DCIteratorBinding.executeQueryIfNeeded(DCIteratorBinding.java:2275)
 at oracle.adf.model.binding.DCBindingContainer.internalRefreshControl(DCBindingContainer.java:3286)
 at oracle.adf.model.binding.DCBindingContainer.refreshControl(DCBindingContainer.java:2947)
 at oracle.adf.model.binding.DCBindingContainer.refresh(DCBindingContainer.java:2933)
 at oracle.adfinternal.controller.util.model.DataBindingActivityImpl.beforeExecute(DataBindingActivityImpl.java:142)
 at oracle.adfinternal.controller.engine.ControlFlowEngine.executeActivity(ControlFlowEngine.java:1223)
 at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:1087)
 at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:979)
 at oracle.adfinternal.controller.engine.ControlFlowEngine.invokeTaskFlow(ControlFlowEngine.java:253)
 at oracle.adfinternal.controller.state.ChildViewPortContextImpl.invokeTaskFlow(ChildViewPortContextImpl.java:110)
 at oracle.adfinternal.controller.state.ControllerState.createChildViewPort(ControllerState.java:1558)
 at oracle.adfinternal.controller.ControllerContextImpl.createChildViewPort(ControllerContextImpl.java:92)
 at oracle.adf.controller.internal.binding.TaskFlowRegionModelViewPort.createRegionViewPortContext(TaskFlowRegionModelViewPort.java:881)
 at oracle.adf.controller.internal.binding.TaskFlowRegionModelViewPort.getViewPort(TaskFlowRegionModelViewPort.java:679)
 at oracle.adf.controller.internal.binding.TaskFlowRegionModelViewPort.doProcessBeginRegion(TaskFlowRegionModelViewPort.java:262)
 at oracle.adf.controller.internal.binding.TaskFlowRegionModelViewPort.processBeginRegion(TaskFlowRegionModelViewPort.java:163)
 at oracle.adf.controller.internal.binding.TaskFlowRegionModelLocal.processBeginRegion(TaskFlowRegionModelLocal.java:12)
 at oracle.adf.view.rich.component.fragment.UIXRegion$RegionContextChange.doChangeImpl(UIXRegion.java:1436)
 at oracle.adf.view.rich.context.DoableContextChange.doChange(DoableContextChange.java:91)
 at oracle.adf.view.rich.component.fragment.UIXRegion._beginInterruptibleRegion(UIXRegion.java:777)
 at oracle.adf.view.rich.component.fragment.UIXRegion.processRegion(UIXRegion.java:520)
 at oracle.adf.view.rich.component.fragment.UIXRegion._preRenderView(UIXRegion.java:1064)
 at oracle.adf.view.rich.component.fragment.UIXRegion.processEvent(UIXRegion.java:1025)
 at oracle.adfinternal.view.faces.lifecycle.PreRenderViewUtils$1.visit(PreRenderViewUtils.java:122)
 at oracle.adfinternal.view.faces.lifecycle.PreRenderViewVisitContext._invokeVisitCallback(PreRenderViewVisitContext.java:153)
 at oracle.adfinternal.view.faces.lifecycle.PreRenderViewVisitContext.invokeVisitCallback(PreRenderViewVisitContext.java:132)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:604)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:405)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:504)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:482)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:774)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:631)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:405)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:504)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:482)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:774)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:631)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:405)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:504)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:482)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:774)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:631)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:405)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:504)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:482)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:774)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:631)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:405)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:504)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:482)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:774)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:631)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:405)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:504)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:482)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:774)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:631)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:405)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitAllChildren(UIXComponent.java:504)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:482)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitChildren(UIXComponent.java:774)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:631)
 at org.apache.myfaces.trinidad.component.UIXComponent.visitTree(UIXComponent.java:405)
 at javax.faces.component.UIComponent.visitTree(UIComponent.java:1623)
 at oracle.adfinternal.view.faces.lifecycle.PreRenderViewUtils._visit(PreRenderViewUtils.java:110)
 at oracle.adfinternal.view.faces.lifecycle.PreRenderViewUtils.__deliverPreRenderViewEvents(PreRenderViewUtils.java:61)
 at oracle.adfinternal.view.faces.lifecycle.ResponseRenderManager._processViewDefinitionLanguage(ResponseRenderManager.java:115)
 at oracle.adfinternal.view.faces.lifecycle.ResponseRenderManager.runRenderView(ResponseRenderManager.java:41)
 at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:1095)
 at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:389)
 at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:255)
 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
 at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
 at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:192)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
 at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:105)
 at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:502)
 at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
 at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:502)
 at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:327)
 at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:229)
 at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
 at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
 at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
 at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
 at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
 at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
 at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
 at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
 at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
 at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
 at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
 at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
 at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
 at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
 at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
 at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
 at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
 at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
 at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
 at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
 at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
 at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
 at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
 at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
 at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
 at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
 at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
 at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
 at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
 at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
 at java.lang.Thread.run(Thread.java:745)
|#]

[#|2015-03-31T15:46:50.365+0200|INFO|glassfish3.1.2|oracle.dfw.incident|_ThreadID=198;_ThreadName=Thread-2;|An incident has been signalled with the incident facts: [problemKey=ADFC-00032 [ADFc] incidentSource=SYSTEM incidentTime=Tue Mar 31 15:46:50 CEST 2015 errorMessage=ADFC-32 executionContextId=0000Klk4dLhFw0iM96PpYT1L6eHs000003]|#]
What is the cause of this error? Heh. Its very simple but hard to find:)

In my case this error was "introduced" by JDeveloper which "magically" changes JDBC connection URL in AppModule Configuration from jdbc/myDS to java:comp/env/jdbc/myDS.

Tuesday, March 31, 2015

ADF and PostgreSQL: how to change database collation to non-english on debian

Few days ago I encountered following issue:
I have to install and run my ADF application based on PostgreSQL 9.4 on Debian Wheezy. After I installed Postgre I noticed I can't create database with collation different than en_US.UTF8.
"Unfortunatelly" my application needs Polish Collation pl_PL.UTF8.

After some googling I found solution, the steps of which I describe bellow:

1. Log in as root (or sudo) user and edit file /etc/locale.gen
 # nano /etc/locale.gen

2. Uncomment desired locale:



3. Run command  locale-gen
# locale-gen

Generating locales (this might take a while)...
  en_US.UTF-8... done
  pl_PL.UTF-8... done

Just now the new locale should be available in your PL/SQL.

But optionally you can change default locale of the all server (cluster). To do this run following steps:

4. Drop the PostgreSQL cluster (this will destroy all cluster data, so do this only on the fresh installation)

# pg_dropcluster --stop 9.4 main

5. Recreate the cluster with new default locale

# pg_createcluster --locale pl_PL.UTF-8 --start 9.4 main

In my case the new cluster is re-created with new configuration. The listen port was changed to 5433 and to correct this I must go to /etc/postgre/9.4/main/postgre.conf and set old port value. After service restrat all works perfect.

Sunday, March 1, 2015

ADF how to: debugging ADF applications

This message has been inspired by the question from ADF exam:
You are debugging an application module method that seems to be causing an error
when the argument value is anything but "2". How could you most efficiently debug this issue?

A. Set a breakpoint on the first line of the method implementation and set the
breakpoint property to break only for threads named oracie.jbo.Exception.
B. Set a breakpoint on the first line of the method implementation and set the
breakpoint pass count property to 2.
C. Set a breakpoint on the first line of the method implementation and set the
breakpoint condition to arg ! = 2.
D. Set a breakpoint on the method declaration (where the argument is defined) and
step through the breakpoint at execution to determine the argument value.
E. Set a breakpoint on the method declaration (where the argument is defined) and
set the condition to arg == 2.

To customize breakpoint execution right click on code editor left margin and select Edit Breakpoint:

 

Next, when dialog appears, go to Conditions tab, and insert desired condition:


On our case valid answer: C