OBIEE 11G - Action Framework - How to create and invoke a Java Method (EJB)

Saw Object


This article gives insights on how an EJB session bean must be created and then invoked by the OBIEE action framework.


Creation of the EJB


  • JNDI Location: Action Framework expects EJBs to be deployed to the default location of /ejb. The mappedName annotation of the Session bean must preceded by a ejb/
  • Binary document: In order to send documents, the Java method should include a specific Java data type (javax.activation.DataHandler) as a parameter.
@Stateless(name = "myEjb", mappedName = "ejb/myEjb")
public class myEjb
        implements myEjbLocal, myEjbRemote

        public String ArchiveReport(String filename,
			javax.activation.DataHandler report) throws FileNotFoundException, IOException {

		File f = new File(filename);
		FileOutputStream outputStream = new FileOutputStream(f);

		return "Report Archived";

Remote interface parameters

The Action Framework finds the Java methods exposed through the remote interface of the EJB. The parameters of exposed methods become the parameters for an action.

Note the import statement for to support the annotation @OBIActionParameter which allows you to specify parameter name and prompt value to display when creating an action in OBIEE.

package nl.hotitem.ejb;
import javax.ejb.Remote;

public interface myEjbRemote
    void sayOnlyHello(
    		@OBIActionParameter (name = "Name", prompt = "Enter your name:") 
    		String name);
    String ArchiveReport(
		@OBIActionParameter(name = "Filename", prompt = "Enter filename location:") String filename,
		@OBIActionParameter(name = "Analysis", prompt = "Report to Archive:") DataHandler document)
			throws FileNotFoundException, IOException;

Obiee Obiactionparameter

Configuration of Action Framework

Complete Minimum Configuration file

<?xml version="1.0" encoding="UTF-8"?>
<obi-action-config xmlns:xsi="" xsi:noNamespaceSchemaLocation="afconfig.xsd">
			<name>Sample EJBs</name>
			<description>Custom Java classes which can be invoked as action targets</description>
			<displayname>Java Actions</displayname>
			<description>Account used to access WLS JNDI.</description>

where the node definition are explain below.

After each change in this configuration file, a restart of the managed server is needed.


The registry entry defines where to find the Session Bean with the help of a lookup where:

  • the id must be unique
  • the name must be unique
  • the content-type must be always java and refers to the content-types > content type node in the same configuration file
  • the provider class must have as value:
  • the context factory must have as value: weblogic.jndi.WLInitialContextFactory
  • the account node refers to the accounts > account node in the same configuration file
  • the ejb-app > server must points to the correct server hosting the EJB
  • the ejb-app > context is just a contextual information

See this article for a complete JNDI lookup example on Weblogic. J2EE - EJB Remote Client with Eclipse OEPE on Weblogic (Outside the container).


The content type node contains standard definitions and parameters for action framework and must be contain once in the configuration file


The account node defines the account that will call the EJB where:

  • credentialkey
  • and credentialmap

gives the location of the credential created in the Credential Store

Weblogic Credential Store Map Key


Obiee Invoke Java Method

[Security:090398] Invalid Subject

When attempting to read the EJB in the Web front-end, you may receive this error:

The fault reported was: 
[Security:090398] Invalid Subject: principals=[weblogic, Administrators]

In the log, you may also find:

Message	** errorDiscoveringEJBs**
Supplemental Detail	javax.naming.CommunicationException 
[Root exception is java.rmi.UnmarshalException: Problem finding error class; nested exception is: 
java.lang.ClassNotFoundException: nl.hotitem.ejb.HotStarsEjbRemote]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(
at weblogic.jndi.internal.WLContextImpl.translateException(
at weblogic.jndi.internal.WLContextImpl.list(
at javax.naming.InitialContext.list(

This error Security:090398 is the error BEA-090398

BEA-090398: Invalid Subject: {0}
Cause: Principal validation failed for this subject.
Action: Ensure that subject was created by this domain or in a domain trusted by this domain.
Level: 1
Impact: Security

The call of the EJB remote interface is done through RMI and with a little search on the oracle support web site, we get this article: RMI Exception when Connecting Two Domains: java.lang.SecurityException: [Security:090398]Invalid Subject.

The problem comes from that the EJB called are not in the same domain. There is a security mechanism which prevents two domains without configuration to speak each other.

The solutions are:

Error finding J2EE app

You may receive this error:

Gerapporteerde fout: 
Error finding J2EE app Hotstars at JNDI url t3://localhost:7001/Hotstars

It can be caused by the fact that the registry name in the XML configuration file is not unique.

Error Reading Credential

Action Framework Error Reading Cred

The ejb-app > server node from the registry have a DNS name that is not known, not accessible of simply not good.

Discover More
Obiee11g Credential Store
(Weblogic|Fusion Middelware) - Credential Store Framework (CSF)

A credential store is the repository of security data that certify the authority of entities used by Java 2, J2EE, and ADF applications. Applications can use the Credential Store, a single, consolidated...
Saw Object
OBIEE 11G - Action

Users can create actions in the Oracle BI Presentation Services user interface. Actions provide functionality to: navigate to related content invoke operations, functions, or processes in external...

Share this page:
Follow us:
Task Runner