Wednesday, December 21, 2011

ServletException /oracle/apps/fnd/applcore/templates/UIShell.jspx: Line #57

When running your application UI, if your page renders blank with the following error :

...............................
]] Root cause of ServletException.
oracle.jsp.parse.JspParseException:
/oracle/apps/fnd/applcore/templates/UIShell.jspx: Line # 57,
Error: Encountered deferred syntax #{ in template text. If intended as a literal, escape it or set directive deferredSyntaxAllowedAsLiteral
at oracle.jsp.parse.JspParseTagXMLTextContainer.processAttributeForELFunctions(JspParseTagXMLTextContainer.java:118)
at oracle.jsp.parse.JspParseTagXMLTextContainer.processAttributeValue(JspParseTagXMLTextContainer.java:103)
at oracle.jsp.parse.JspParseTag.parseXMLSrc(JspParseTag.java:1565)
at oracle.jsp.parse.JspParseTag.parse(JspParseTag.java:1610)
at oracle.jsp.parse.JspParseTag.genXMLSrcTag(JspParseTag.java:886)
at oracle.jsp.parse.JspParseTag.parseXMLSrcNextTag(JspParseTag.java:780)
at oracle.jsp.parse.JspParseTag.parseXMLSrcBody(JspParseTag.java:1297)
at oracle.jsp.parse.OpenJspTagHandler.parseXMLSrcBody(OpenJspTagHandler.java:782)
at oracle.jsp.parse.JspParseTag.parseXMLSrc(JspParseTag.java:1572)
at oracle.jsp.parse.JspParseTag.parse(JspParseTag.java:1610)
at oracle.jsp.parse.OpenJspTagHandler.parse(OpenJspTagHandler.java:846)
at oracle.jsp.parse.JspParseTag.genXMLSrcTag(JspParseTag.java:923)
at oracle.jsp.parse.JspParseTag.parseXMLSrcNextTag(JspParseTag.java:780)
at oracle.jsp.parse.JspParseTag.parseXMLSrcBody(JspParseTag.java:1297)
at oracle.jsp.parse.OpenJspTagHandler.parseXMLSrcBody(OpenJspTagHandler.java:782)
at oracle.jsp.parse.JspParseTag.parseXMLSrc(JspParseTag.java:1572)
at oracle.jsp.parse.JspParseTag.parse(JspParseTag.java:1610)
at oracle.jsp.parse.OpenJspTagHandler.parse(OpenJspTagHandler.java:846)
at oracle.jsp.parse.JspParseTag.genXMLSrcTag(JspParseTag.java:923)
at oracle.jsp.parse.JspParseTag.parseXMLSrcNextTag(JspParseTag.java:780)
at oracle.jsp.parse.JspParseTag.parseXMLSrcBody(JspParseTag.java:1297)
at oracle.jsp.parse.OpenJspTagHandler.parseXMLSrcBody(OpenJspTagHandler.java:782)
at oracle.jsp.parse.JspParseTag.parseXMLSrc(JspParseTag.java:1572)
at oracle.jsp.parse.JspParseTag.parse(JspParseTag.java:1610)
at oracle.jsp.parse.OpenJspTagHandler.parse(OpenJspTagHandler.java:846)
at oracle.jsp.parse.JspParseTag.genXMLSrcTag(JspParseTag.java:923)
at oracle.jsp.parse.JspParseTag.parseXMLSrcNextTag(JspParseTag.java:780)
at oracle.jsp.parse.JspParseTag.parseXMLSrcBody(JspParseTag.java:1297)
at oracle.jsp.parse.OpenJspTagHandler.parseXMLSrcBody(OpenJspTagHandler.java:782)
at oracle.jsp.parse.JspParseTag.parseXMLSrc(JspParseTag.java:1572)
at oracle.jsp.parse.JspParseTag.parse(JspParseTag.java:1610)
at oracle.jsp.parse.OpenJspTagHandler.parse(OpenJspTagHandler.java:846)
at oracle.jsp.parse.JspParseTag.genXMLSrcTag(JspParseTag.java:923)
at oracle.jsp.parse.JspParseTag.parseXMLSrcNextTag(JspParseTag.java:780)
at oracle.jsp.parse.JspParseTag.parseXMLSrcBody(JspParseTag.java:1297)
at oracle.jsp.parse.JspParseTag.parseXMLSrc(JspParseTag.java:1572)
at oracle.jsp.parse.JspParseTagFile.parseXMLSrc(JspParseTagFile.java:341)
at oracle.jsp.parse.JspParseTagFile.parse(JspParseTagFile.java:256)
at oracle.jsp.parse.OracleJsp2Java.transformImpl(OracleJsp2Java.java:439)
at oracle.jsp.parse.OracleJsp2Java.transform(OracleJsp2Java.java:593)
at oracle.jsp.runtimev2.JspPageCompiler.attemptCompilePage(JspPageCompiler.java:691)
at oracle.jsp.runtimev2.JspPageCompiler.compileBothModes(JspPageCompiler.java:490)
at oracle.jsp.runtimev2.JspPageCompiler.parseAndGetTreeNode(JspPageCompiler.java:457)
at oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:624)
at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:645)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:385)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:785)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:523)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:444)
at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:163)
at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:184)
at oracle.adfinternal.view.faces.taglib.region.IncludeTag.__include(IncludeTag.java:440)
at oracle.adfinternal.view.faces.taglib.region.IncludeTag.doEndTag(IncludeTag.java:230)
at oracle.adfinternal.view.faces.taglib.region.PageTemplateTag.doEndTag(PageTemplateTag.java:162)
at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:62)
at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
at oracle.jsp.runtime.tree.OracleJspClassicTagNode.evalBody(OracleJspClassicTagNode.java:87)
at oracle.jsp.runtime.tree.OracleJspBodyTagNode.executeHandler(OracleJspBodyTagNode.java:58)
at oracle.jsp.runtime.tree.OracleJspCustomTagNode.execute(OracleJspCustomTagNode.java:261)
at oracle.jsp.runtime.tree.OracleJspNode.execute(OracleJspNode.java:89)
at oracle.jsp.runtimev2.ShortCutServlet._jspService(ShortCutServlet.java:89)
at oracle.jsp.runtime.OracleJspBase.service(OracleJspBase.java:29)
at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:665)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:385)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:785)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:523)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:253)
at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:410)
at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
at oracle.adfinternal.view.faces.config.rich.RecordRequestAttributesDuringDispatch.dispatch(RecordRequestAttributesDuringDispatch.java:44)
at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
at org.apache.myfaces.trinidad.context.ExternalContextDecorator.dispatch(ExternalContextDecorator.java:44)
at org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$OverrideDispatch.dispatch(FacesContextFactoryImpl.java:267)
at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:469)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:140)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:189)
at org.apache.myfaces.portlet.faces.application.PortletViewHandlerImpl.renderView(PortletViewHandlerImpl.java:259)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:189)
at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:777)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:293)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:213)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.webcenter.framework.events.dispatcher.EventDispatcherFilter.doFilter(EventDispatcherFilter.java:44)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.apps.financials.expenses.creditCard.setup.ui.CardIssuerMDSFilter.doFilter(CardIssuerMDSFilter.java:63)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.apps.fnd.applcore.common.ApplSessionFilter.doFilter(ApplSessionFilter.java:598)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.wcps.client.PersonalizationFilter.doFilter(PersonalizationFilter.java:75)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.webcenter.content.integration.servlets.ContentServletFilter.doFilter(ContentServletFilter.java:168)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:175)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:114)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:97)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:164)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:114)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:97)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:164)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)


Solution :
This issue occurs when you have a public_html folder created in one of the Model/UiModel projects present in the working set. Delete this folder from the terminal and close and reopen the application. Running the page after this should solve the issue.

Tuesday, November 29, 2011

Accessing an entity based ViewAccessor from a ViewObject

View accessors in ADF Business Components are value accessor objects that point from an entity object attribute (or view object) to a destination view object or shared view instance in the same application workspace . The view accessor returns a row set that by default contains all rows from the destination view object. You can optionally filter this row set by applying view criteria to the view accessor. The base entity object or view object on which you create the view accessor and the destination view object need not be in the same project or application module, but they must be in the same application workspace.

Because view accessors give you the flexibility to reach across application modules to access the queried data, they are ideally suited for accessing view instances of shared application modules.

When you create a ViewAccessor at the entity level, accessing the same at the ViewObject level is a little tricky, especially if you want to have it as part of a groovy expression in a transient attribute. An expression that works is :

row = (object.getEntity(0).ViewAccessorName.first())
return (row == null) ? null : row.Name

Jdeveloper IDE table-inspector error

When you're working with jdeveloper and the ide gives the below error in the property inspector :

Error : Error constructing column editor

Reason : This mostly happens when the related AM data control is not loaded properly in the data controls section.

Soln : Clean, build, and deploy the model project.
Re-load the data controls region.
Now., clicking on the property inspector shud render the column editor for your table!!

Friday, September 23, 2011

ORA-01031:insufficient privileges

I was stuck with this particular error as part of running my UI. Now, you know for sure that there is some username / password that you are using which does not have the required grants or privileges. Or it is some security related issue.

The log inside jdeveloper could actually sometimes be misleading, in that it could show a SQLstatement exception for some unrelated tables (EOs, VOs, etc).

However, running the SQL query that was shown as part of the log inside the SQL worksheet in jdev actually gave me the clue. I was able to reproduce the same ORA error with the username and password as fs_runtime. However, the error was gone once I changed to username to fs.

I had to subsequently change the credentials inside the properties file and re-created the domain, to help get rid of the error in UI!

Alternatively, giving grants to the username that does not have the required grants also works fine!

Sunday, July 17, 2011

ADF Lifecycle

The ADF Lifecycle provides support allowing a web page to interact with ADF Model data bindings. The lifecycle calls the correct binding container needed for a JSP or UIX page, updates values in the binding container's bindings if necessary, and
prepares the data to be rendered. The binding container stores this data locally before rendering the page.

Implementations of Lifecycle should be thread-safe and use the LifecycleContext object as the place to store any per-request state they may need.


ADF Lifecycle phases:

1. initialize
This phase initializes the values of the associated request, binding container and lifecycle. The method that is used from the Interface Lifecyle for this purpose is :

initializeMethodParameters(LifecycleContext lcContext, oracle.jbo.uicli.binding.JUCtrlActionBinding actionBinding)
This method is invoked before any ControlBinding or custom method is being executed.

2. prepareModel

This phase prepares and initializes the Model. Page parameters are set and methods in the executable section of the page definition of the ADF page are executed. The interface LifeCycle method used :

prepareModel(LifecycleContext lcContext)


3. applyInput
This phase handles the request parameters. These may come by adding the request parameters in the URL or as a result of HTML form post action. A list of events is build using these request parameters. These are actually mapped to the bindings in the pageDef. This phase resolves the list of request parameters bind to attributes in the page def. This results into a list of updatedValues which is used in Update Model phase.

The interface LifeCycle method used :

buildEventList(LifecycleContext lcContext)
Builds the list of events with their possible associated action binding from the request parameters.


4. validateInput

This phase validates the list of values built in the Apply input values field with model.

5. updateModel

This phase updates data model with the list of values created in apply input values phase.

The interface LifeCycle method used :
processUpdateModel(LifecycleContext lcContext)
Update the data model with values submitted in the request.



6. validateModelUpdates

This phase validates the Updates in the previous phase by calling the associated lifecycle's binding container .
The interface LifeCycle method used :

validateModelUpdates(LifecycleContext lcContext)
Forces model-level validation to occur.

7. Process Component Updates

This phase handles any events in the list built during the apply input values phase. Named events as well as all the events tied to the databindings created in the pagdef are handled in this phase.

The interface LifeCycle method used :
processComponentEvents(LifecycleContext lcContext)
Handle any events in the action binding list previously built in processUpdateModel using the buildEventList method.

8. Metadata Commit

This phase commits the runtime metadata changes to the model. This phase is always executed before prepare render phase.


9. Prepare Render

This is the final phase where page is sent for rendering. prepareRender event is sent to all the registered listeners. This notification signals bindings to prepare or process the data for rendering. Binding container is also refreshed. This helps
in updating any changes that happened during validation phases.



References :
- Lifecycle (Oracle Fusion Middleware Java API reference for Oracle ADF Lifecycle)

- Phases in ADF LifeCycle

Saturday, July 16, 2011

What are ADF business components and which component provides transaction management?

A challenge every Java developer developing applications using data from a database faces is mapping Java objects to relational tables, managing transactions and locking, and ensuring adequate performance. There are many frameworks that help us handle this, without us needing to build everything from scratch. The open source community has produced a large number of more or less complete and robust frameworks for working with databases and Java objects. Oracle's solution is the Oracle Application Development Framework Business Components.

The main components of the ADF Model layer are:

1. The Entity objects or EO's
2. The View objects or VO's and
3. Entity Association's
4. View Object ViewLinks
5. The Application modules or AM's
6. The Business Component Tester or AM tester

The EO/VO is similar to Object relational mapping elements.
So, in essence, EO/VO provide a standard way of interacting with database tables and serve as the data model source.

The Entity Object

An EO represents a table in simple terms. It defines the table's attributes, the data types, validation on the data, the primary keys and the entire business logic that needs to be defined for pushing data into the target table.


The View Object

The view object can be based on EO's, which are similar to SQL queries used to extract data, or it can be programatically populated, or with a static list.

However VO's based on EO's are most used option. While a few validations can be done even at the VO level, it's better to have business logic on the EO's as this will help provide a central point for all VO's dependent on them.


Associations and Viewlinks

They define the join or the link among EO's and VO's. Associations defines link between EO's. They can be considered as PrimaryKey/ForeignKey relationships between tables. They define the Join conditions.

A viewlink defines the link between VO's and can be based on an association or on attributes.

The Application Module

The application module packages the VO's and serves as the data control.The AM creates and manages the database transaction for ADF Model layer. It is the Application Module that exposes the data needed by the client. So, for an end user, the interaction and transactional capabilities are provided by the application module.

The Business Component Tester

The most used component of the model layer is the tester. It can be run to check the data model that is implemented. This serves as the first line of defense to see if data is exposed as desired, without the need to create a UI.

Thursday, June 16, 2011

If you hit oracle.security.jps.JpsRuntimeException: Cannot read from policy store.

When trying to start your integrated weblogic server, if you come across the following error :-



oracle.security.jps.JpsRuntimeException: Cannot read from policy store.
at oracle.security.jps.internal.policystore.xml.XmlPolicyStore.buildFromFile(XmlPolicyStore.java:425)
at oracle.security.jps.internal.policystore.xml.XmlPolicyStore.(XmlPolicyStore.java:224)
...
Caused by: oracle.security.jps.JpsRuntimeException: javax.xml.stream.XMLStreamException: End Document reached prematurely.
at oracle.security.jps.internal.core.datastore.xml.XmlDataStoreParser.getDataStoreEntryStax
(XmlDataStoreParser.java:166)
...
... 28 more
...
weblogic.security.SecurityInitializationException: The loading of OPSS java security policy provider failed due to exception, see the exception stack trace or the server log file for root cause. If still see no obvious cause, enable the debug flag -Djava.security.debug=jpspolicy to get more information. Error message:

oracle.security.jps.JpsException: [PolicyUtil] Exception while getting default policy Provider
at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadOPSSPolicy
(CommonSecurityServiceManagerDelegateImpl.java:1398)
...
Caused By: oracle.security.jps.JpsRuntimeException: oracle.security.jps.JpsException: [PolicyUtil] Exception while getting default policy Provider
at oracle.security.jps.internal.policystore.PolicyDelegationController.(PolicyDelegationController.java:291)
...
Caused By: java.security.PrivilegedActionException: oracle.security.jps.JpsException: [PolicyUtil] Unable to obtain default JPS Context!
at java.security.AccessController.doPrivileged(Native Method)
...
Caused By: oracle.security.jps.JpsRuntimeException: Cannot read from policy store.
at oracle.security.jps.internal.policystore.xml.XmlPolicyStore.buildFromFile(XmlPolicyStore.java:42


Solution:-

This issue mostly occurs due to a corruption in the jazn-data.xml file. You could delete the jazn-data.xml file under the DefaultDomain directory or delete the 'DefaultDomain' directory under the system directory inside your view. This will create the domain afresh the next time you start your WLS.

Saturday, May 21, 2011

oracle.jbo.attributeloadexception: JBO-27022

Problem scenario :

I was in the process of replacing a particular table in the database with a new table (table name and attribute names changed). Correspondingly this involved creating new Entity Object, View Object, Entity Associations and View Object links. This meant replacing the old associations that are present in any of the VOs with the new ones.

As part of this, all required attributes from the EO need to be shuttled properly to be present as part of the VO. The catch here is, if the EO has any transient or calculated attributes, then these should not be shuttled into the VO. If you happen to do this, you are bound to hit the above exception when testing the VO:-

(oracle.jbo.AttributeLoadException) JBO-27022: Failed to load value at index 19 with java object of type java.lang.Long due to java.sql.SQLException.

Solution :
Remove the extra transient attributes (in the VO) that were added from the EO.
The VO test should now pass fine. The number of attributes in the Select clause of the VO object query and the number of attributes in the VO should potentially be the same!

The below link provides some more useful information on the same front :-
http://oracle-hack.blogspot.com/2009_05_01_archive.html

Sunday, April 24, 2011

Removing hard coded set-attribute in EOImpl

I was faced with the below issue and posted it on several forums :-

Some EO's in my application have hard-coded setAttribute in order to get around an ADF issue where we have these transient attributes for EO assocations, but they don't show up on newly created rows.


For example:

protected void create(AttributeList attributeList) {
super.create(attributeList);
this.setAttribute("TransientAttribute1","SOME_LITERAL_VALUE1");
this.setAttribute("TransientAttribute2","SOME_LITERAL_VALUE2");
this.setAttribute("TransientAttribute3","SOME_LITERAL_VALUE3");
}

Our requirement is to get away with this method and instead achieve the above using either groovy expression or derived from sql expression. Using this, the values of the Transient attributes show up as null currently. We need to have the literal values show up on creating a new row.

Finally, what worked for me was :-

I had the setAttribute in the EOImpl file removed.
Instead I had the literal values set in the 'Literal' window and the 'Derived from SQL expression' window.
The test cases for most entities passed fine.
I added tests in entity unit tests to test the default values for common association attributes in case of new row creation as well as fetch row from DB. They worked perfectly fine in both cases

Monday, April 11, 2011

Recursively copying files along with directory structure in linux

Although this is something relatively simple, sometimes doesnt work correctly especially if you're trying it after a long time. You could be faced with errors like :

cp: cannot create symbolic link , etc.

If you wanna copy say, multiple files along with directory structure from
/ab/cd/ef/gh/ij/kl/mn/op/qr/st/uv/*

to

/aba/cdc/efe/ghg/iji/klk/mnm/opo/qrq/sts/uvu/*

then typically

cp -R /ab/cd/ef/gh/ij/kl/mn/op/qr/st/uv/ /aba/cdc/efe/ghg/iji/klk/mnm/opo/qrq/sts/uvu/

should work good for you.

The entire list of files along with the directory structure, gets copied at the destination location. It is important here to give the complete paths for source as well as destination instead of trying to use relative paths!

Thursday, March 24, 2011

Installing and using ScrumWorks on Linux

ScrumWorks is an agile management software by CollabNet meant for an enterprise and comes in 2 flavors : ScrumWorks Pro and ScrumWorks Basic.

To run Scrumworks on your linux box, you need to install the server.
a. Download the ScrumWorks Basic Linux distribution file from the download site.
b. Extract the file in the directory you want to install ScrumWorks Basic to.
c. Change to the directory that was created during extraction.
d. Run ./setup.sh to configure your server and get instructions for starting it.

A pre-requisite to do the above installation is to have JDK already installed on your machine. However, right now, apparently, Scrumworks Basic only supports JDK2. Higher versions are not supported yet. So, you need to have version 2 necessarily installed for sure!!

Sunday, February 27, 2011

Error 46 initializing SQL*Plus HTTP proxy setting has incorrect value SP2-1502: The HTTP proxy server specified by http_proxy is not accessible

I hit the above error when I was trying to startup the zipdb installed on my linux box, after a system reboot. What I precisely did to get rid of this error and successfully start the Db is:-

1. Unset the environment variable http_proxy
2. Set / Export the variable http_proxy to http://localhost.

That worked and....the zip db was UP and RUNNING!!

Friday, February 18, 2011

Installing sqldeveloper on a linux box

To install sqldeveloper on a linux 64 bit machine, follow the below steps:-

1. Download the sqldeveloper rpm.
2. Install the rpm using the command 'rpm -ivh '
3. If you're not logged in as root user, you could encounter an error like
error: can't create transaction lock on /var/lib/rpm/__db.000. In this case log
in as root used and retry the installation.
4. The sqldeveloper mostly gets installed at location
/opt/sqldeveloper/sqldeveloper and can be invoked using the command :-
/opt/sqldeveloper/sqldeveloper.sh
5. A pre-requisite to install and run the sqldeveloper in your linux box is to
have jdk installed. At the time of invoking sqldeveloper you might come across a
warning message which reads :-
'Type the full pathname of a J2SE installation (or Ctrl-C to quit), the path will
be stored in ~/.sqldeveloper/jdk'.
6. In such a case you need to quit and put in the path of the jdk install location
in the 'SetJavaHome' variable inside a file called sqldeveloper.conf.





(Sqldeveloper software or other softwares meant for linux boxes are packaged in the rpm file format. RPM typically stands for Red Hat Package Manager / RPM Package Manager)

Friday, February 4, 2011

My first look at Soa Composite Applications

The basics of a Soa-composite application :-

A composite.xml is a file that is automatically created when you create a SOA project. This file describes the entire composite assembly of services, service components,references, and wires that make up a Soa composite application.

The following are the four basic components of a Soa-composite application

* Service Components - Once you create your application, often the next step is to add service components that implement the business logic or processing rules of your application. You can use the Component Palette from the SOA Composite Editor to drag and drop service components into the composite.

* Service Binding Components - You add a service binding component to act as the entry point to the SOA composite application from the outside world.

* Reference Binding components - You add reference binding components that enable the SOA composite application to send messages to external services in the outside world. (The reference binding components should be services with wsdl's created either by you or someone else on a local or a remote machine which can be given a reference to, from your application)

* Wires - You wire (connect) services, service components, and references. For this example, you wire the web service and service component. You cannot wire services and composites that have different interfaces. For example, you cannot connect a web service configured with a synchronous WSDL file to an asynchronous BPEL process


The adjacent figure shows a diagrammatic view of a bpel process



















This figure shows a diagrammatic view of the composite.xml file




Oracle SOA Suite Service components:

*Oracle Mediator
*Oracle BPEL process
*Human workflow (using a human task)
*Oracle Business Rules
*Spring
*Oracle User Messaging Service
*Oracle Business Activity Monitoring
*Oracle Metadata Repository

Thursday, January 27, 2011

EOs with transient Attributes - will they be locked if no other change?

Found this post on an internal forum and thought of putting it down here :-

Problem :
We have some EOs with some attributes not mapped to any DB Table Column whereas some other attributes are mapped to DB Table columns. During runtime, sometimes we set only these "transient" attributes in the underlying EO and not the Column-mapped Attributes.
The question is, if we call am.commit(), will ADF Framework try to lock()/commit() these EOs with only changes in transient attributes?

Solution:
1.Modifying an attribute marks the entity as changed whether it's transient or not. To avoid this, you can use populateAttribute instead of setAttribute to set the transient attributes. If they are set from the UI, you can override setAttribute to call populateAttribute. The overview for EntityImpl javadoc here has a good explanation of set and populate methods. Same methods available in the view row.

2.Run time would mark the specific EO instance as dirty (STATUS_MODIFIED), and will take the EO through normal Txn cycle. However only those modified persistable attributes are posted back to DB

Thursday, January 20, 2011

InvalidOperException : JBO-25221

Requirement: AUTO-COLLAPSE OF REGIONAL AREA WHEN IN THE INSIDE FORECAST AREA (which is the main area). In my case, the Regional area and main area taskflows belong to different projects.

Implementation: This requires methodAction bindings to be added in the page definition files where the collapse and disclose needs to be implemented. Also, a separate RegionController bean which will have the method call.

Exception : At run time, I faced an exception which looked something like this :-
JBO-25221: Method FndUIShellController.dataProvider.collapseRegionalArea() not supported
ADF_FACES-60097:For more information, please see the server's error log for an entry beginning with: ADF_FACES-60096:Server Exception during PPR, #2

Solution:
The issue got resolved after I added the following to the dataBindings.cpx file :-
<dc id="FndUIShellController"
path="oracle.apps.fnd.applcore.uicomponents.view.FndUIShellController"/>

Sunday, January 16, 2011

Composition Associations



A composition association represents a relationship between entities, such as an entity A (eg: DepartmentEO) referenced by an entity B(eg:EmployeeEO) or a entity C(eg:BonusEO) contained in an entity B(eg:EmployeeEO). When you create composition associations, it is useful to know about the kinds of relationships you can represent, and the various options.

Associations between entity objects can represent two styles of relationships depending on whether the source entity:

* References the destination entity
* Contains the destination entity as a logical, nested part

For example, an EmployeeEO entry references a DepartmentEO. This relationship represents the first kind of association, reflecting that a DepartmentEO or an EmployeeEO entity object can exist independent from each other. In addition, the removal of an Employee does not imply the cascade removal of the Department to which it was referring.

In contrast, the relationship between EmployeeEO and its collection of related BonusEO details is stronger than a simple reference. The BonusEO entries comprise a logical part of the overall EmployeeEO. In other words, a EmployeeEO is composed of BonusEO entries. It does not make sense for a BonusEO entity row to exist independently from an EmployeeEO, and when an EmployeeEO is removed — assuming the removal is allowed — all of its composed parts should be removed as well. This kind of logical containership represents the second kind of association, called a composition association.

Wednesday, January 12, 2011

Steps to deploy a simple standalone test application to a standalone server

1. Create a sample standalone test application say Application1 as per the steps in

http://myadfexperiences.blogspot.com/2010/12/steps-for-creating-sample-fusion-web.html

2. Create a new Application server connection to the standalone server (to which you want to deploy
the application) using the Resource palette IDE connections ->Application Server connections.
3. Right click on the Application and choose deploy. Deploy to the Application Server. Here you
should be able to see the connection which you created in the previous step to the standalone
Application Server. Go through the wizard to complete the required steps.
4. Once the deployment completes successfully, you should be able to see your application in the
list of deployments in the Application Server console.