Wednesday, May 20, 2009

Using the Essbase Java API with JDeveloper

Not sure if this is covered in any document or on any other blog but I could not find it so I thought I would share the steps I took to do this.

Pre Requites:

  1. Essbase is installed and working and is accessible from the machine where you plan to do your development work.
  2. APS (Analytic Provider Services) is installed, this does not have to be running to use the API but you will need files from this installation.
  3. JDeveloper is installed.  I am using JDeveloper 11.1.1.0.1 but I am sure earlier versions will also work.

 

In JDeveloper create a new 'Generic Application' by selecting File New...

image

 

Give your application a name (i.e. Essbase Java API) and click finish.

image

With the new application selected create a new 'Generic Project' by selecting the File New menu or right clicking on the application in the application navigator.

image

Give the new project a name and select Java for it's technology.

image

Click Next and enter a default package name (i.e. com.oracle.essbase.japi) and click finish.

image

On the server where you have installed APS and Essbase copy the following files and put them in a directory that will be accessible from the JDeveloper project:

  • %HYPERION_HOME%\products\Essbase\aps\lib\cpld14.jar
  • %HYPERION_HOME%\products\Essbase\aps\lib\ess_es_server.jar
  • %HYPERION_HOME%\products\Essbase\aps\lib\ess_japi.jar
  • %HYPERION_HOME%\common\loggers\Log4j\1.2.8\lib\log4j-1.2.8.jar
  • %HYPERION_HOME%\products\Essbase\aps\bin\essbase.properties

When copying these files to your machine make sure you have following directory structure:

  • Local Folder\lib - This folder has all the jar files.
  • Local Folder\bin - This folder has properties file.
  • Local Folder\data - This folder is empty and when you run your first application a file will be created there for you called domain.db.

image

In JDeveloper right click on the project created above and select 'Project Properties'.

Select the section named 'Libraries and Classpath' and add a reference to the 4 jar files from above.

image

Select the section ' Run/Debug/Profile' and edit the default profile.

In the Java Options for the client JVM add the following parameter:

-DESS_ES_HOME=<Path to the files from above or the APS_HOME directory> (i.e. -DESS_ES_HOME=C:\JDeveloper\mywork\EssbaseJAPI\japi)

image

Now you are ready to program using the JAPI to do this you will need a Java class.  Right click on the project and select New...

image

Select New Java Class and click OK.

image

Give the class a name and select any of the options you want.

 

You are now ready to start writing code against Essbase using the JAPI in JDeveloper.  You can find code samples in the directory %HYPERION_HOME%\products\Essbase\aps\samples\japi

 

image

7 comments:

Raj said...

Hi, I could not find file "cpld14.jar" in my installation, where I can get this file. I am using Essbase 9.3.1 .

Thanks

Matt Milella said...

I am pretty sure that Jar is only for 11.x. For 9.x you can ignore it.

pbsl said...

you have a nice site.thanks for sharing this site. various kinds of ebooks are available here

http://feboook.blogspot.com

julian said...

Hi, excellent article, but i have a problem whit essbase, the APS how do you get? or the essbase server Includes APS or how to get. Is there a cost?

Matt Milella said...

You should be able to download any software you have licensed from edelivery. As far as cost it would be best to talk to your sales rep.

kp said...

Thanks for the excellent article. One change is that the Project Name should not have spaces. When i tried to execute Essbase Java API, it failed. I renamed to EsbJavaAPI and it worked.

Matt Milella said...

Huh, that is odd. The screenshot are based on an actual project on my local machine and it works fine. OH well to be safe I say just skip the spaces...