Showing posts with label ADFBC. Show all posts
Showing posts with label ADFBC. 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.

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 .






February 6, 2013

Data Source connection to AppModule


By default AppModule is configured to database through the connection created in JDeveloper. But if we want to change the connection type to “JDBC DataSource” from “JDBC URL”, it expects a Datasource name as an input. But we need to pass the JNDI name to this field instead of data source name.

January 8, 2013

Assign DBSequence to a property in Entity Object

I want to add a sequence to the user_id field in user_info table of my database. For which I have followed the below procedure.
  • Create a db sequence named “userid”
Create sequence userid start with 10000000001

  • Open the Entity Attribute, “user_id” in the Entity Object of the application
  • Select Type as Integer and  click on Value type “Expression” radio button
  • Enter the below expression in the value field
 (new oracle.jbo.server.SequenceImpl("USERID",adf.object.getDBTransaction())).getSequenceNumber()

Where “USERID” is the sequence name which is created already
  • Click on Ok