Showing posts with label Oracle ADF. Show all posts
Showing posts with label Oracle ADF. Show all posts

Friday, 22 June 2018

How to monitor the Heap size in jDeveloper IDE

This below blog we will see how to monitor the heap size in jDeveloper IDE. There is chance to monitor during runtime consumed heap and permgen memory by jDeveloper IDE. Even it is possible at runtime through jDeveloper user can force garbage collection.

Now open your jdev.conf file (path:C:\Oracle\Middleware\jdeveloper\jdev\bin[path depends upon installation directory]) and add the below property
AddVMOption -DMainWindow.MemoryMonitorOn=true

Now you can see in the jDeveloper lower right corner - heap and permgen memory statistics will be available, along with garbage collector button.


Generally maximum range for heap memory is set in ide.conf (C:\Oracle\Middleware\jdeveloper\ide\bin[path depends upon installation directory]) file.


Thanks...

Clear the table filters programmatically


This blog we will see how to clear the table filters programmatically.

The below code we need to add to clear the table filter
jspx/jsff:
 Bean:

    public void resetFilter(ActionEvent actionEvent) {
        FilterableQueryDescriptor fqd = (FilterableQueryDescriptor)t1.getFilterModel();
               if (fqd != null && fqd.getFilterCriteria() != null) {
                 fqd.getFilterCriteria().clear();
                 t1.queueEvent(new QueryEvent(t1, fqd));          
              }
    }

  Thanks..

Wednesday, 10 January 2018

Failed to start Integrated Weblogic instance in Windows10

Generally, if you are running your jdeveloper in windows 10 OS first time, while starting the integrated WebLogic server it will fail and we will get the below error.


If you will go and check the log file which is mentioned in the error log of jdeveloper, you will get the below error.

Adding environment variable to WLST script USER_MEM_ARGS = -Xms32m -Xmx1024m -XX:MaxPermSize=384m
Log File:      C:\Users\.....\AppData\Roaming\JDeveloper\system12.2.1.0.42.151011.0031\o.j2ee.adrs\BuildDefaultDomain.log
Label:         JDEVADF_MAIN_GENERIC_151011.0031.S
Product Home:  F:\Installations\jdevinstallation\Oracle\Middleware\Oracle_Home\jdeveloper\jdev\
Domain:        C:\Users\.....\AppData\Roaming\JDeveloper\system12.2.1.0.42.151011.0031\DefaultDomain

BuildDefaultDomain1.py      2018-01-09 23:27:54

cmd.exe /c ""F:\Installations\jdevinstallation\Oracle\Middleware\Oracle_Home\oracle_common\common\bin\wlst.cmd" "C:\Users\....\AppData\Roaming\JDeveloper\system12.2.1.0.42.151011.0031\o.j2ee.adrs\BuildDefaultDomain1.py""
Process started
wlst >
wlst > Initializing WebLogic Scripting Tool (WLST) ...
wlst >
wlst > Welcome to WebLogic Server Administration Scripting Shell
wlst >
wlst > Type help() for help on available commands
wlst >
wlst > Failed to get environment, environ will be empty: (0, 'Failed to execute command ([\'sh\', \'-c\', \'env\']): java.io.IOException: Cannot run program "sh": CreateProcess error=2, The system cannot find the file specified')
wlst > Error:  ADRS_DOMAIN_PASSWORD environment variable not set.
wlst >
wlst >
wlst > Exiting WebLogic Scripting Tool.
wlst >
wlst > Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384m; support was removed in 8.0
Elapsed time:  5479 ms

For this above problem we need to follow the below steps

1. Go to your jdeveloper install directory and search jython-modules.jar file.

NOTE: the same file path depends upon your installation directory. For me path is like
F:\Installations\jdevinstallation\Oracle\Middleware\Oracle_Home\wlserver\common\wlst\modules

2. extract the jython-modules.jar using an utility like zip.

3. Open javashell.py python script inside lib folder

4. Add the entry for Windows 10 e.g. ‘Windows 10’ and Save it.

The same file should looks like the below

_osTypeMap = (
        ( "nt", ( 'nt', 'Windows NT', 'Windows NT 4.0', 'WindowsNT',
                  'Windows 2000', 'Windows 2003', 'Windows XP', 'Windows CE',
                  'Windows Vista', 'Windows Server 2008', 'Windows 7', 'Windows 8', 'Windows 10',
                  'Windows Server 2012' )),
        ( "dos", ( 'dos', 'Windows 95', 'Windows 98', 'Windows ME' )),
        ( "mac", ( 'mac', 'MacOS', 'Darwin' )),
        ( "None", ( 'None', )),
        )

Now restart your jdeveloper and start your server.

Thanks..!!

Tuesday, 1 November 2016

Consume JSON based ADF REST Services in ADF 12.2.1 (with REST Data Control)

In this blog we will see how to consume REST web Service and how to use in UI.

NOTE: - This features newly introduced in ADF 12.2.1.

Follow the below steps to consume the rest web services

1. From the “Gallery” select “Web Service Data Control (SOAP/REST)”.

2. The created web service data control wizard will launch and select REST.

3. Now add the rest connection, click on the green plus icon. Enter the input including the describe url in URLEndpoint.

4. As we don’t have any security policies, we can skip the next step.

5. Net you can choose “Add all resources below and allow me to refresh resources from the data control palette”.

6. Now next and finish. The data control will create from the rest meta data.

7. Now we will use the created data control in UI. Drag and drop the collection in UI as a table.

8. Now the the page and all the data will display in UI.

You can download the code: Download

Thanks...

Monday, 31 October 2016

Create a restful web service directly from application module in ADF 12.2.1

This blog we will see, how to create a restful web service directly from application module.

NOTE: - This features newly introduced in ADF 12.2.1.

Need to follow the below steps to create a REST web service from application module.

1. Created a application module using employee table (Connected HR schema).

2. Now open the application module and click on web service tab, then click on green plus icon, but you will get the below error like below.

3. As we have not define the release version and name in adf-config.xml to create REST Web Service, so we are getting this above error. Now let’s update adf-config.xml.

4. Now go to application module --> web service tab --> REST tab. Click on the ADD green icon. Provide the resource name and release version.

5. On click OK, jdeveloper will create a separate project for REST web services.

6. Now run the RESTWebservice application.

7. Now run the application and the URL will generate in integrated weblogic server. Click on the same URL, it will open the HTTP Analyzer.

8. Now click on “Send Request”. All the employee information will display.

9. We can pass the employee ID as a parameter in URL and display the whole information on the employee ID.

You can download the code: Download

Thanks..

Oracle JDeveloper and Oracle ADF 12c : New Features

The below is the reference location for new features of Oracle Jdeveloper and Oracle ADF

Oracle JDeveloper and Oracle ADF 12c (12.1.2.0.0): New Features
http://www.oracle.com/technetwork/developer-tools/jdev/documentation/1212-nf-1964675.html

Oracle JDeveloper and Oracle ADF 12c (12.1.3.0.0): New Features
http://www.oracle.com/technetwork/developer-tools/jdev/documentation/1213-newfeatures-2714203.html

Oracle JDeveloper and Oracle ADF 12c (12.2.1.1.0): New Features
http://www.oracle.com/technetwork/developer-tools/jdev/documentation/1213nf-2222743.html

Thanks...

Saturday, 2 July 2016

How to reset af:table pagination to first page in Oracle ADF

This blog we will see how to reset the af:table pagination to predefine page.
Sometimes due to MDS the last visited page number will persist. we need to reset the old page number and set the new page number.
You can use the below code for rest the pagination 


DCIteratorBinding dcIter = (DCIteratorBinding)(BindingContext.getCurrent().getCurrentBindingsEntry()).get("your iterrator Name");
int taskIndex = 1; // It will navigate to the page where 1st element exist.
int range = dcIter.getRangeSize();
int oldStart = dcIter.getRangeStart();
int newStart = taskIndex-(taskIndex % range);
dcIter.getRowSetIterator().setRangeStart(newStart);
dcIter.setRangeStart(newStart);
RangeChangeEvent event = new RangeChangeEvent(tableBinding, oldStart, oldStart+range, newStart, newStart+range);
tableBinding.broadcast(event);
dcIter.getRowSetIterator().setCurrentRowAtRangeIndex(taskIndex % range);
dcIter.setCurrentRowIndexInRange(taskIndex % range);
AdfFacesContext.getCurrentInstance().addPartialTarget(tableBinding);

Thanks...