This Essbase discussion board is provided as a free service and dedicated to all the Essbase professionals out there!
  << Previous Topic | Next Topic >>Return to Index  

JAPI error

November 12 2009 at 6:31 AM
Score 5.0 (1 person)

sroux 
from IP address 213.190.76.3

Hi,

I developed a JAVA class that lists Essbase connections.
I access the info through provider services connector => http://myserver:13080/aps/JAPI
I'm using ess_japi.jar library only, JDK is 1.5.0_17 and my JRE is 1.6.0_11

I developed and tested the class/jar on my laptop without any error. Now I'm trying to connect to the company server (exactly same version 11.1.1.3 ...but... 64 bits vs 32 on my laptop...) from my professional laptop (JRE 1.5.0_22).

I get the following msg (traduced) :
No way to connect to the provider. Make sure that connection params are fine and that provider is up and running...

I couldn't find anything related in the logs directory (strange).
I tried different server names : IP, server name... no success

Any help is welcome!

 
Scoring disabled. You must be logged in to score posts.Respond to this message   
AuthorReply



213.190.76.3

Re: JAPI error

No score for this post
November 12 2009, 6:46 AM 

Here's an extract of the jar, with the full ListEssConnection class - where everything related to Essbase happens indeed. I save you the Swing classes that kept me busy all day long yesterday...
I'm not a java guru so that code may not be the most beautiful and optimized.


----------------------------------------------


import com.essbase.api.base.*;
import com.essbase.api.session.*;
import com.essbase.api.datasource.*;
import com.essbase.api.domain.*;
import java.util.Vector;

public class ListEssConnections {

private static String usr = "";
private static String pwd = "";
private static String svr = "";
private static String prv = "http://" + svr + ":13080/aps/JAPI";
private static final int FAILURE_CODE = 1;

public Vector main(String[] args) {

int statusCode = 0;
IEssbase ess = null;
IEssOlapServer olapSvr = null;

Vector<Vector<String>> dataVector = new Vector<Vector<String>>();

try {
// Contrôle des arguments
checkArgs(args);

// Initialisation de l'instance
ess = IEssbase.Home.create(IEssbase.JAPI_VERSION);

// Connexion au fournisseur
IEssDomain dom = ess.signOn(usr, pwd, false, null, prv);

// Connexion à l'appli et database
olapSvr = (IEssOlapServer) dom.getOlapServer(svr);
olapSvr.connect();

IEssIterator requests = olapSvr.getRequests(null, null, null);

String etat = "";
String requete = "";

// entete
//System.out.println("Utilisateur" + "\t" + "Source" + "\t" + "Application" + "\t" + "Base" + "\t" + "Requete" + "\t" + "Temps" + "\t" + "Statut");

// Listing des connexions en cours
for (int i = 0; i < requests.getCount(); i++) {

Vector<String> data = new Vector<String>();
IEssOlapRequest request = (IEssOlapRequest) requests.getAt(i);

// Etat de la requête
switch (request.getRequestState()) {
case 0:
etat = "en cours...";
break;
case 1:
etat = "en cours d'arrêt";
break;
case 2:
etat = "terminé";
break;
default:
break;
}

// Requête de requête (Restructure, ClearData, GetStats, Calculate, DataLoad)
if (request.getRequestString().equals("Restructure")) {
requete = "Restructuration";
} else if (request.getRequestString().equals("ClearData")) {
requete = request.getRequestString();
} else if (request.getRequestString().equals("GetStats")) {
requete = request.getRequestString();
} else if (request.getRequestString().equals("Calculate")) {
requete = "Calcul";
} else {
requete = request.getRequestString();
}

//System.out.println(request.getUserName() + "\t" + request.getRequestSource() + "\t" + request.getOlapApplicationName() + "\t" + request.getCubeName() + "\t" + requete + "\t" + request.getRequestTime() + "\t" + etat);

data.add(request.getUserName());
data.add(request.getRequestSource());
data.add(request.getOlapApplicationName());
data.add(request.getCubeName());
data.add(requete);
data.add(String.valueOf(request.getRequestTime()));
data.add(etat);
dataVector.add(data);
}

} // Gestion des exceptions
catch (EssException x) {
GMessage gmessage = new GMessage();
gmessage.msg("Erreur : " + x.getMessage(), "Erreur");
//System.out.println("Error: " + x.getMessage());
statusCode = FAILURE_CODE;
} finally {
// Deconnexion
try {
if (olapSvr != null && olapSvr.isConnected() == true) {
olapSvr.disconnect();
}
} catch (EssException x) {
GMessage gmessage = new GMessage();
gmessage.msg("Erreur : " + x.getMessage(), "Erreur");
//System.out.println("Error: " + x.getMessage());
}

try {
if (ess != null && ess.isSignedOn() == true) {
ess.signOff();
}
} catch (EssException x) {
GMessage gmessage = new GMessage();
gmessage.msg("Erreur : " + x.getMessage(), "Erreur");
//System.out.println("Error: " + x.getMessage());
}
}
// Set status to failure only if exception occurs and do abnormal termination
// otherwise, it will by default terminate normally
if (statusCode == FAILURE_CODE) {
System.exit(FAILURE_CODE);
}
return dataVector;
}

static void checkArgs(String[] args) throws EssException {

if (args.length == 3) {
usr = args[0];
pwd = args[1];
svr = args[2];
} else {
System.err.println("Argument error!");
System.err.println(
"Usage: java " + ListEssConnections.class.getName() +
" user password server");
System.exit(1);
}
}
}


 
Scoring disabled. You must be logged in to score posts.Respond to this message   

sroux

213.190.76.3

last recall for a JAPI lover around...

No score for this post
November 17 2009, 6:42 AM 


 
Scoring disabled. You must be logged in to score posts.Respond to this message   
Glenns

170.22.76.10

Re: last recall for a JAPI lover around...

No score for this post
November 17 2009, 8:58 AM 

Sroux,
Tim Tow is the best one to answer this. He normally watches the board, I'm amazed he has not answered your question

 
Scoring disabled. You must be logged in to score posts.Respond to this message   


64.134.188.42

Re: JAPI error

No score for this post
November 17 2009, 9:52 AM 

Hi Sebastien,

Sorry I didn't get to this earlier.. In your code, you have:

private static String prv = "http://" + svr + ":13080/aps/JAPI";

A couple of questions:

1. Is the server running APS on port 13080?
2. Can you reach the server from our client via a web browser using: http://<servername>:13080/aps/JAPI?

Tim

Tim Tow
Oracle ACE Director
Applied OLAP, Inc

 
Scoring disabled. You must be logged in to score posts.Respond to this message   



213.190.76.3

Re: JAPI error

No score for this post
November 17 2009, 11:11 AM 

Hi Tim,

Thanks for helping.

Indeed when I run the URL I get the following page

Hyperion Provider Services: Hello!

Time = Tue Nov 17 17:10:04 CET 2009

 
Scoring disabled. You must be logged in to score posts.Respond to this message   


64.134.188.42

Re: JAPI error

No score for this post
November 17 2009, 11:27 AM 


Hi Sebastien,

Two more things to look at..

1. When you connect to EAS, then open up your provider services node and connect to that node, is the Essbase server you are trying to connect to present?

2. Have you tried embedded mode? Try using "embedded" instead of the http url in your connect string. The Java API will bypass your APS server altogether. Note that some situations call for using an http connection via APS and others don't. Further, you will need to include ess_es_server.jar, cpld14.jar and log4j-1.2.8.jar in your classpath (for JAPI 11.1.1.3).

Tim

Tim Tow
Oracle ACE Director
Applied OLAP, Inc

 
Scoring disabled. You must be logged in to score posts.Respond to this message   

sroux

213.190.76.3

Re: JAPI error

No score for this post
November 18 2009, 6:22 AM 

I can image that you're busy Tim, so get get stressed by this post!

1. When I display connection on APS, no connection is displayed. Which seems normal regarding the error message.

2. Didn't tried embedded mode as I though it would work better with APS mode.

 
Scoring disabled. You must be logged in to score posts.Respond to this message   

sroux

81.250.17.205

Re: JAPI error

No score for this post
November 18 2009, 5:31 PM 

I kept trying during one hour - still the same error message trying to reach APS on dev server (64bits). No problem on my personal laptop (32bits).

It seems that it cannot find the Provider... as I really don't get anything in the logs (I played with the essbase.properties file to enable tracing).

Tried replacing the server name by IP. Set ClassPath to JRE path (who knows)...

I finally copied the jar+lib on the server itself and ... IT WORKS!!! So it seems that it cannot locate the server however the url test http://server:13080/aps/JAPI works fine from my profesional laptop.
For information the only lib I'm using is the ess_japi.jar one.

 
Scoring disabled. You must be logged in to score posts.Respond to this message   


72.242.26.178

Re: JAPI error

No score for this post
November 18 2009, 7:39 PM 


Hi Sebastien,

I have never seen an issue like this one in my 9+ years of working with the Java API.. What version of the Java JRE do you have? I have seen strange things in other areas with JRE 1.6.

Tim Tow
Oracle ACE Director
Applied OLAP, Inc

 
Scoring disabled. You must be logged in to score posts.Respond to this message   

SRoux

213.190.76.3

Case solved

No score for this post
November 26 2009, 3:46 AM 

Ok so it works now! Case solved!

It was not working from my professional laptop because of the s_provider variable :

public class Main {

private static String s_userName = "";
private static String s_password = "";
private static String s_olapSvrName = "";
>>> private static String s_provider = "http://" + s_olapSvrName + ":13080/aps/JAPI";
private static final int FAILURE_CODE = 1;

...

Nom it works if I set it in that way :

private static String s_userName = "";
private static String s_password = "";
private static String s_olapSvrName = "";
private static final int FAILURE_CODE = 1;

public static void main(String[] args) {
int statusCode = 0;
IEssbase ess = null;
IEssOlapServer olapSvr = null;

try {
acceptArgs(args);
ess = IEssbase.Home.create(IEssbase.JAPI_VERSION);
IEssDomain dom = ess.signOn(s_userName, s_password, false, null, "http://" + s_olapSvrName + ":13080/aps/JAPI");


Seems to be related to a variable visibility I guess. However I still don't understand why it works locally...

 
Scoring disabled. You must be logged in to score posts.Respond to this message   


193.194.132.71

Maybe acceptArgs overides the variable s_provider

No score for this post
November 26 2009, 4:20 AM 

If you define s_provider variable after accept args, it works.

Maybe you should try to trace s_provider after acceptArgs has been called, and check if the value is correct.

From your laptop, arguments passed to the program may be slightly different from the server.

 
Scoring disabled. You must be logged in to score posts.Respond to this message   
Glenns

170.22.76.10

Re: JAPI error

No score for this post
November 17 2009, 11:12 AM 

Well Tim its about time you answered :) Don't you monitor the board 24 hours a day 7 days a week

 
Scoring disabled. You must be logged in to score posts.Respond to this message   


64.134.188.42

Re: JAPI error

No score for this post
November 17 2009, 11:30 AM 


Hi Glenn,

I did see it on my iPhone but have been pretty busy lately (working on some new and exciting features in Dodeca).. I was hoping someone else would take the opportunity to answer it.. <BigGrin>

Tim

Tim Tow
Oracle ACE Director
Applied OLAP, Inc

 
Scoring disabled. You must be logged in to score posts.Respond to this message   
Current Topic - JAPI error
  << Previous Topic | Next Topic >>Return to Index  

RSS feed for this forum - http://www.network54.com/Forum/58296?xml=rss. Please email hypess (at) gmail.com, if you have any questions/feedback/issues.