Month: May 2014

Changing the password of the embedded LDAP server

When the default domain for the internal weblogic server is created by JDeveloper, the password for the embedded LDAP server is automatically generated and can not be retrieved. So, in order to access the embedded LDAP server from an external client, this default password needs to be set to a well-known one: Open the weblogic administration console (like https://www.labcorner.de:7101/console), and navigate to the default domain:

Then, select the “Security” Tab:

From there, open the “Embedded LDAP” sub-tab:

Finally choose a new password and save it with the “save” button at the bottom of the page:

This does not have any impact on running and deploying the application, but will now allow access from external tools like JExplorer. Note that the WebLogic server needs to be restarted for the change to take effect.

Fixing class layout in MS Visio when using Stereotypes

There is one annoying thing in MS Visio when using Stereotypes in an UML class diagram: sometimes, the stereotype name is shown on the same line as the class name, where it should really be above the class name:

It is not really reproducable when this happens – sometimes adding attributes or operations fixes the layout, sometimes changing the class name breaks the layout. In any case, this article describes a solution how to fix it: 

  • Choose the text tool and select the class name in the class node.
  • Place the cursor before the class name and press RETURN.

This adds a line feed in front of the class name and makes the stereotype render properly above the class name:

Setting security credentials in Application Module test cases

With code like

   ...
   import oracle.jbo.client.Configuration;
   import oracle.jbo.ApplicationModule;
   ...
   String amDef = "model.AppModule";
   String config = "AppModuleLocal";
   ApplicationModule am = Configuration.createRootApplicationModule(amDef, config);
   ...

it is possible to instantiate an ApplicationModule in a standalone Java application (means, without the need to launch an application server and deploy the application). Based on the created ApplicationModule instance, the View Objects and View Links defined in the Application Module’s data model can be accessed and test cases for the common CRUD operations (Create, Read, Update, Delete) can be implemented against them. Executing (and debugging) these test cases is very simple since they can be launched as a standalone Java application. However, when the application is configured with ADF security, the following error might occur when executing the above code, and creation of the ApplicationModule fails:

javax.security.auth.login.LoginException: Null or empty password was provided.

In order to solve this, we need to provide login credentials to the application module. They can be configured in the application module configuration:

  • Open the application module’s xml file
  • Select the “Configurations” Tab
  • Select the configuration which is used when creating the application module
  • Click the “Edit” icon to open the Configuration Editor
  • Select the “Properties” tab
  • Set the properties java.naming.security.principal to a valid user name and java.naming.security.credentials to the user’s password

 

Note: You should use a separate user for the test cases, and make sure that this user is not automatically deployed to any production environment!