Tuesday 29 December 2015

JDeveloper : A fatal error has been detected by the Java Runtime Environment:

Hi,

I have faced below mentioned issue while debugging the application in JDeveloper 12.1.3.


#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000005a7763ea, pid=8676, tid=9608
#
# JRE version: Java(TM) SE Runtime Environment (7.0_51-b13) (build 1.7.0_51-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.51-b03 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# V  [jvm.dll+0x1163ea]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\kmatada\AppData\Roaming\JDeveloper\system12.1.3.0.41.140521.1008\DefaultDomain\hs_err_pid8676.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
#
Debugger connection to debuggee process has been lost.
[04:52:05 PM] [IntegratedWebLogicServer is shutting down.  All applications currently running will be terminated and undeployed.]
[Application termination requested.  Undeploying application RmsProcurement.]
Stopping Derby server...
[04:52:11 PM] [J2EE Deployment SPI:260010]Unable to connect to "t3://localhost:7101" as user, "weblogic". Error received: t3://localhost:7101: Destination 127.0.0.1, 7101 unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available router to destination
#### There was an error undeploying application RmsProcurement from IntegratedWebLogicServer.[04:52:11 PM] [J2EE Deployment SPI:260010]Unable to connect to "t3://localhost:7101" as user, "weblogic". Error received: t3://localhost:7101: Destination 127.0.0.1, 7101 unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available router to destination

[04:52:11 PM] [J2EE Deployment SPI:260010]Unable to connect to "t3://localhost:7101" as user, "weblogic". Error received: t3://localhost:7101: Destination 127.0.0.1, 7101 unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available router to destination
[04:52:11 PM] t3://localhost:7101: Destination 127.0.0.1, 7101 unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available router to destination
[04:52:11 PM] t3://localhost:7101: Destination 127.0.0.1, 7101 unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available router to destination
[04:52:11 PM] t3://localhost:7101: Destination 127.0.0.1, 7101 unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available router to destination
[04:52:11 PM] Destination 127.0.0.1, 7101 unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available router to destination
[Application RmsProcurement terminated]
[Terminating IntegratedWebLogicServer.]
Derby server stopped.




Solution: I could not get proper solution. I have just deleted my Jdev system folder and it started working. If any one know alternative solution or reason for this issue, please let me know. 

Sunday 13 December 2015

Caused by: java.lang.ClassNotFoundException: sqlj.runtime.ref.DefaultContext

Caused by: java.lang.ClassNotFoundException: sqlj.runtime.ref.DefaultContext

Solution: Just edit the startWeblogic.cmd file from JDev system folder and add the runtime12.jar
set CLASSPATH=%SAVE_CLASSPATH%;C:\Oracle\Middleware\jdeveloper\sqlj\lib\runtime12.jar;

Friday 4 December 2015

Issue with ‘Set Source Order’ in VO wizard - ADF

Problem statement: 
I had VO with few Transient Attributes. These attribute values needs be populated based on calling DB package call. 
I already had Java wrapper class contains logic to call DB packages
So I  override my createInstanceFromResultSet method in VO Impl to populate transient attributes.
My page is search page, so created view criteria on VO to create standard query panel.
At later point, I wanted to re-order or shuffle attributes/fields in the standard query panel.
So I used ‘Set Source Order’ option to re-order the attributes.
Problem it created: attribute mis-match happened and one attribute showing another attribute value.
                                                                                       
Solution I did: Taken backup of VO impl custom method(other than setter and getter methods)and VO Row Impl and Client interface(VO-Java file),
          Go to VO wizard.
       From the Java section un- check for VO impl and VO Row Impl
      Select  ‘Query’  options from the left panel and click on ‘Update Mappings’ button

Once done, just restart the JDeveloper, and Generate VOImpl , VORow Impl  and Client interface java
Copy custom method you implemented in VOImpl from back up file and re-run. It works fine for me.

As per my observation, whenever you want to change VO query/ attribute order, it is better to do it in source mode instead of directly doing in wizard

Hope it helps!...

Monday 23 November 2015

ORA-01446: cannot select ROWID from......... in ADF VO

I have search page - (af:querypanel  based on view criteria and result will be displayed in af:table) based on entity based VO and query contains union operation

My VO does not have primary key attribute so i have added ROWID from entity as a primary key.

When I run the page and hit on search button in the standard query panel, I was getting below mentioned error

ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP BY, etc

From the on line resources I found that, either I have to remove ROWID or remove DISTINCT, GORUP By clause.

Solution I have did to overcome from this issue,

Since mine is search screen and does not involve any transactions so better approach would be to create query based VO(or Read only VO) instead of Entity based VO to avoid ROWID.

So, I have just re-shuffle the Selected Entity under "Entity Objects" in VO overview editor to convert entity based vo to read only or query based VO.

So, try to have one primary key attribute for your VO if it is entity based VO. If read only VO meets your requirement then go for it to avoid unnecessary errors.

Hope it helps :)

Saturday 21 November 2015

Programmatically executing View criteria in VOImpl in ADF

Below is the code snippet to execute view criteria in your VOImpl

ViewCriteria vc = this.getViewCriteriaManager().getViewCriteria("DeptVOCriteria");

//Manages named variables and their values.         
VariableValueManager vvm = vc.ensureVariableManager();

// Set bind parameter values  
 vvm.setVariableValue("bindDept", <dept value>);

//apeend View Criteria
this.appendViewCriteria(vc);

// Executing the query          
 this.executeQuery();

Friday 28 August 2015

JDev 12c Performance Improvement tips

Hi All,

When working with ADF 12c project with JDev 12c(12.1.3.0.0) I faced issues related to J Developer slowness.
So, from the online I found few tips to improve the speed/performance of J Developer and documented here for my reference

1. Disable auto build on save
Tools -> Preferences -> Code Editor -> Save Actions -> Remove Build project on save(by Clicking on Save)

2. Change look and feel to Windows instead of Oracle theme
Tools -> Preferences -> Environment -> Look and Feel to ‘Windows’

3. Disable/Un-install updates which you are not using
Tools -> Features -> In Manage Features and Updates
Uncheck the updates which you are not using

4. In ide.conf file (located under Oracle home directory\jdeveloper\ide\bin)

AddVMOption  -Xms1024M
AddVMOption  -Xmx1024M

5. In jdev.conf file(located under Oracle Home Directory\jdeveloper\jdev\bin)

AddVMOption -Doracle.ide.osgi.buddy.delegate.resource.exempt.paths=META-INF/services/javax.xml.ws.spi.Provider
# optimize the JVM for strings / text editing
        AddVMOption -XX:+UseStringCache
        AddVMOption -XX:+OptimizeStringConcat
        AddVMOption -XX:+UseCompressedStrings

        # if on a 64-bit system, but using less than 32 GB RAM, this reduces object pointer memory size
        AddVMOption -XX:+UseCompressedOops

        # use an aggressive garbage collector (constant small collections)
        AddVMOption -XX:+AggressiveOpts

        # for multi-core machines, use multiple threads to create objects and reduce pause times
        AddVMOption -XX:+UseConcMarkSweepGC

6. Use Fast Swap Jdev feature to speedup the development
      Tools -> Preferences -> Run -> Weblogic -> Fast Swap

7. Use source editor for JSP and JSFF instead of design editor

     Tools -> Preferences -> File types -> Default editor

8. Also set high priority in the windows task manager as shown below
 
     Right click on jdev64w.exe -> set priority -> High



9. If you application does not use mds, locally you clean up contents of few folders in system directory on a daily basis. I see some bit of help by deleting contents of below folders daily. Do not delete folder itself. Just delete its contents.

.diagnostics , .history and .system cache 





Some of the Reference Blog link

1. Shay blog
https://blogs.oracle.com/shay/entry/is_your_jdeveloper_slow_it_sho

2. Oracle blog
https://blogs.oracle.com/angelo/entry/improving_the_performance_of_jdeveloper

3. http://waslleysouza.com.br/en/2014/04/increase-the-performance-of-jdeveloper-11g/

4. http://bexhuff.com/2012/09/jdeveloper-memory-and-performance

Thank you.

Sunday 2 August 2015

Difference between BindingContext and BindingContainer in ADF


BindingContext is a container Object that holds a list of available data controls and data binding objects.It is the Java representation
of all cpx files marked in your adfm.xml file

BindingContext class is an interface that exposes generic methods to access the binding layer


The BindingContainer class represents Java representation of the page definition file.
To read bindings or executable entries present in the page definition we may need to access binding container object.

BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();

Thursday 30 July 2015

Oracle ADF - Regular Expression and Attribute validation Notes

Regular Expression for Email validation


if you want to put this for optional field then we have to allow null/empty values as well

So the above expression becomes


^ begin of the string
$ is end of String
| is OR



Regular Expression for Alphanumeric character and also '_' (UnderScore) is allowed

[a-z A-Z 0-9 _]


Regular Expression for Number validation(Only Numbers are allowed not Decimals like 1.5)

[0-9]{1,10}|null

| -> OR
null -> the input text allows null values as well


Attribute validation 

We can perform attribute validation using <af:validateRegExp> component

For Ex, If input text is allowed to have only alphanumeric then put following <af:validateRegExp> within af:inputText component



<af:validateRegExp messageDetailNoMatch="Only alphanumeric, '_'(Underscore) and '-'(Hyphen) characters are allowed" pattern="[a-z A-Z 0-9]*"/>

Friday 29 May 2015

Populating Primary key of table Using Sequence in ADF

-> Create the sequence
-> In the entity, identify the primary key attribute
-> Select Value Type as Expression in the Entity Attribute wizard
-> and provide expression value
ex value :
(new oracle.jbo.server.SequenceImpl("SXRCM0_COLUMN_MAPPINGS_ID_SEQ",object.getDBTransaction())).getSequenceNumber()

where "SXRCM0_COLUMN_MAPPINGS_ID_SEQ" is the name of the sequence

Saturday 18 April 2015

ADF Basics - Memory scope

Here I am documenting Information on ADF Memory scopes which Frank Nimphius explained in ADF insider tutorial series for my quick reference.


ADF Memory scopes
There are 6 types of memory scopes
3 from standard JSF application
  1. Application Scope 2)Session scope 3)request scope
In addition to above ADF Faces provides the following
4) PageFlowScope  5)backingBeanscope 6) ViewScope
Application Scope :
- Attributes and managed beans are available for an entire application and shared among users.
- Information should not have session dependency.
- This scope may be used to hold static objects that are the same for all users.
Session Scope:  
- Attributes and beans are user instance specific, and exists from the
 time of their creation to the time they are deleted or the session ends
- Example usecase is a user info bean that stores information about a user
 to avoid unnecessary queries.


Page flow Scope:
- Available for the duration of a task flow
- Exited when exiting the task flow
- If used with nested task flows, the Page Flow Scope of the caller flow
  is suspended and activated upon return from the called Task Flow
- PageFlow scope is not available until after the JavaServer Faces Restore View phase
A pageFlow scope exists for each task flow instance and has a lifespan between request and session scope. The lifetime of the scope spans across all pages in a bounded task flow.The object is available as long as the user continues navigating from one page to another. If the user opens a new browser window and begins navigating, that series of windows will have its own pageFlowScope scope.
View Scope
- Stores objects used by a single page
- Automatically released when the user leaves the page
- A View scope instance exists for each view that the ADF Controller manages
- The lifetime begins and ends with the change of the view id of a view port


Request scope:
- Represents the smallest available scope
- Lasts for the time it takes to transition from one view activity to the next
The object is available from the time an HTTP request is made until a response is sent back to the client. Use request scope when the managed bean does not need to persist longer than the current request. From another perspective, a request scope starts with a request to be issued from one view to another for navigation cases that don't perform a redirect but a default server-side forward. The scope spans across all non-view activities that follow the view of interest to the next view activity.
Backing bean scope:
- Special case of request scope
- Associated with a specific manage bean instance
- Used with declarative components,regions and page fragments that use a
 managed bean to hold view state information
- Allows multiple instances of the components to co-exists on a single page
Use this scope if it is possible that your task flow appears in two ADF regions on the same JSF page and you want to isolate each instance of ADF region


None
- Use for beans that don't require to keep state so that bean does not need

to remain in memory