Showing posts with label JDeveloper. Show all posts
Showing posts with label JDeveloper. Show all posts

June 20, 2017

Issue: REST web services are created in AppModule but disappeared

[JDev 12.1.3]

Issue:

I have created an ADF application in JDeveloper 12.1.3 in which I created restful web services in the app module for the business components. I created another ViewObject by custom sql query and added to app module and created rest services for it. Suddenly all my existing rest services are disappeared from the app module window and + button under REST tab is also disabled as shown in the below image. There is no error or alert shown.


I can see the xml files in the project structure but are not appeared in the AppModule window.

Solution:

While creating my new view object by sql , I have not given any key attribute and added it to app module. I rolled back my changes and created the same view object with a key attribute and created rest service for the same view object now and it worked. It added to the list of rest services in the app module and all are appeared.

When you create rest service to any VO, an xml file like below is created.
 "AppModule_<ResourceName>Resource.xml"

When you delete the REST service, this file will not be deleted. If you try to create REST service again with the same name, then also you face the above issue. So, check if this xml file is deleted from the project before creating new one.

April 27, 2017

Error: oracle.maf.impl.cd.datasynch not found

[maf 2.3.1]

I am developing a mobile application with MCS offline sync feature using Oracle MAF. I have used AMPA for the implementation. After deploying the application, on click of "Pending Sync Actions", I got the below error.

Feature not found with id "oracle.maf.impl.cd.datasynch"



This is because the library might be deleted or corrupted in the application. To avoid this error, we need to re-add the library. Below is the procedure to do so.
  • Go to application properties -> Libraries and Classpath
  • If you see libraries "DataSynchFeature.jar" and "WebServiceCallsFeature.jar", remove them
  • Click on "Add JAR/Directory..." and go to the path <jdev_home>/jdeveloper/jdev/extensions/oracle.maf/FARs/CDM
  • Selet both the jar files "DataSynchFeature.jar" and "WebServiceCallsFeature.jar" and add them
  • Click Ok
Now clean and re-deploy the application. It worked for me.




February 14, 2017

Error: Calling the constructor for class oracle.jbo.server.SequenceImpl is not permitted

[JDev 12.1.3]

I have created an EntityObject in the Model project and assigned a DB sequence to the key attribute of it. While running the project, I got the below error.

[Static type checking] - [ADF security error] Calling the constructor for class oracle.jbo.server.SequenceImpl is not permitted.


To avoid this issue,
  • Go to the source of the entity object xml file
  • Search for the tag "TransientExpression"
  • Check the attribute trustMode. It may have the value "untrusted"
  • Change the value to "trusted". Save and run the app
Now the issue should be solved.

Note: The same solution is given in my previous post for the below error. This solution worked for both the issues.




December 6, 2016

Error: [ADF security error] The method getDBTransaction on class oracle.jbo.server.EntityImpl is not permitted

[JDev 12.2.1.0]

I have created an EntityObject from database table and assigned an expression to its key attribute to get the value from a database sequance (See this post to know how to assign a db sequence to a property in entity object ). But while building the project, I got the below error.

Error(11,53): [Static type checking] - [ADF security error] The method getDBTransaction on class oracle.jbo.server.EntityImpl is not permitted.
 @ line 11, column 53. Locations.bcs D:\Application2\Model\src\model Model.jpr


Which means that the entity is not trusted the expression changes. To avoid this issue,

  • Go to the source of the entity object xml file 
  • Search for the tag "TransientExpression"
  • Check the value of the attribute "trustMode"
  • If it is "untrusted", change it to "trusted"
  • Now rebuild the project
The above change solved my issue .






November 1, 2016

How to open device camera or picture gallery from Oracle MAF app

MAF provides a device feature method getPicture() to open the device camera or picture gallery. You can create binding to it if you want to open camera on the app. But if you want to handle this from java code in MAF, then check the below post.

Below is the code should be used to access the camera from the java code in MAF.

DeviceManager dm = DeviceManagerFactory.getDeviceManager();
String result=   dm.getPicture(75, dm.CAMERA_DESTINATIONTYPE_DATA_URL, dm.CAMERA_SOURCETYPE_CAMERA, false, dm.CAMERA_ENCODINGTYPE_PNG, 300, 250);

This method returns a string value with either base46 encoding string or the file path of the image based on the given destination type.

Syntax of the method is:
getPicture(int quality, int destinationType, int sourceType, boolean allowEdit, int encodingType, int targetWidth, int targetHeight) 

Where

quality: Quality of saved image
destinationType: Type of the return value whether it is base64 encoding string or file path. For base64 use 0=DESTINATIONTYPE_DATA_URL or for file path use 1 = DESTINATIONTYPE_FILE_URI
sourceType: What is the source of the picture whether it is device camera or photo gallery. For gallery use 0=CAMERA_SOURCETYPE_PHOTOLIBRARY or for camera use 1=CAMERA_SOURCETYPE_CAMERA
allowEdit: Allow simple editing of image before selection
encodingType: the encoding of the returned image file. Select 0 = CAMERA_ENCODINGTYPE_JPEG for JPEG image or 1 = CAMERA_ENCODINGTYPE_PNG for PNG image
targetWidth: Width in pixels to scale image
targetHeight: Height in pixels to scale image

Note: you can not test camera in iOS Simulator or Android Emulator. The camera can be tested only on the device, but you can test the gallery in the Simulator or Emulator. To check if the running device is Simulator or Emulator, you have to give a condition like,

if (dm.getName().indexOf("Simulator") != -1)  // For iOS Simulator
if (dm.getName().indexOf("sdk") != -1)            //For Android Emulator

November 27, 2015

Connecting Git hub with JDeveloper 12c

I have created few screen shots which show how to connect Git hub from Oracle JDeveloper Studio. I have used JDeveloper 12.1.3.0 for this.

Click here for the screen shots.

August 18, 2015

Connect Git hub with JDeveloper

This post is to learn how to connect Git hub server to JDeveloper. Github is providing a Github Desktop client to connect github repository. But if you are a JDeveloper user, then you can also connect the repository from the JDeveloper. I am using JDeveloper version: 12.1.3.0.0 in this example and below is the procedure to do it.

Open the JDeveloper. Under the Team menu select "Connect Git" option.

Below screen will be shown
Click Next. You will be prompted for Git details as shown below.
Enter Repository Name: This should match with any branch name in the repository you want to connect.
Enter repository URL: make sure you have ".git"  at the end of the URL.
Enter username and password of the repository.

Click Next. You will see a window fetching the branches from the given repository.

 It will list out all the branches in the given repository as shown below.
 Un-select the branches which are not required.

Click Next. Below window will be shown which prompts for destination folder to where the project will be downloaded from the selected branch, clone name and check out branch from which you want to download the project.
Click Next. It will show the final summary window as below.

Click Finish. It will create a local repository and download the project from the selected Git branch to the local folder and open the project in JDeveloper.




February 25, 2014

Invoking constructor twice in JSFF with panelTabbed component

I have a JSFF page which has panelTabbed component with four tabs and one of the tabs is displaying data from a managed bean. While loading the page, the bean constructor is being called twice. To avoid this add the below property to the panelTabbed tag,  which will avoid loading the tab data until it shows.


childCreation="lazyUncached"

June 26, 2013

Error: Page template name already used in library


I have created a page template with name “PageTemplate.jspx” in JDeveloper for my application, but I deleted the file later. Again when I tried to create a page template with the same name “PageTemplate.jspx”  in the application then I got the below validation error “Page template name already used in library”.





Even if we delete the file from JDeveloper, entries from some configuration files may not be deleted. Hence, we get this error.
There are two solutions for this.
The simplest one is to give different name to the template :D .
Another one is,
  • Go to META-INF folder under Application Source of the project
  • Open the file “pagetemplate-metadata.xml”
  • You should find your pagetemplate entry with in the tags
     <pagetemplate-jsp-ui-def>…</pagetemplate-jsp-ui-def>
  • Remove the entry and save the xml file
  • Now you should be able to create the page template with the same name

June 21, 2013

Using HTTP Analyzer



JDeveloper provides a tool called “Http Analyzer “ which is very useful when we are using web service in our application and if we want to see what input request, the application is being sent to server via web service.

To start using the “Http Analyzer”, please do the below steps.

  • Go to Tools menu of JDeveloper and select Http Analyzer
  • Click on “Start HTTP Analyzer” button (Green button like arrow)
  • Start the Integrated web logic server and run the application
  • Do the necessary actions to invoke webservice integrated in the application
  • Now we can see request sent is logged in the HTTP Analyzer
  • Click on the request, it will open the XML request being sent to the server