cancel
Showing results for 
Search instead for 
Did you mean: 

OpenDocument and java.lang.NullPointerException

Former Member
0 Kudos

Hi all, we are trying to call a report via openDocument URL managing the logon with a jsp page on BO XI 4.


We create in the JSP the logon token



//Create session token enterpriseSession = CrystalEnterprise.getSessionMgr() .logon(bo_username, bo_password, BO_CMS_NAME, BO_AUTH_TYPE);

logonTokenMgr = enterpriseSession.getLogonTokenMgr();

defaultToken = logonTokenMgr.createLogonToken("",120,100);

String tokenEncode = URLEncoder.encode(defaultToken, "UTF-8");

enterpriseSession.logoff();


Then we do the redirect ....


sDocNameStr = IDOCID_NAME_PARAMETER + "=" + "Ab3R7uNJ0F9Ot6Bg4mLhjaQ" +"&"+ IDOCTYPE_NAME_PARAMETER;

bo_cms_url = BO_CMS_PROTOCOL + BO_CMS_NAME + ":"+ BO_CMS_PORT + "/" + BO_CMS_PATH + "?"+ sDocNameStr;

response.sendRedirect(bo_cms_url + "&token="+tokenEncode);


But from the server we receive the following error : java.lang.NullPointerException (see the attachment IMG1) This is the output.println ...

http://....:8080/BOE/OpenDocument/opendoc/openDocument.jsp?iDocID=Ab3R7uNJ0F9Ot6Bg4mLhjaQ&sIDType=CU...


Seems that the token is not valid or correct to open the report but if we open a CMC session then we are able to load the report (see the attachment IMG2)


May you help me?

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member199597
Participant
0 Kudos

Ciao Roberto,

Not sure if I can help you much but if I were you I would create log messages so you know what is really null.

What's really strange is:

  1. /Create session token enterpriseSession = CrystalEnterprise.getSessionMgr() .logon(bo_username, bo_password, BO_CMS_NAME, BO_AUTH_TYPE); 
  2. logonTokenMgr = enterpriseSession.getLogonTokenMgr();  
  3. defaultToken = logonTokenMgr.createLogonToken("",120,100);  
  4. String tokenEncode = URLEncoder.encode(defaultToken, "UTF-8");  

->>>> enterpriseSession.logoff(); 


Why do you logoff before you even call the redirect?


Anyhow I would add debug information so I know what is really null and where it is happening.

Or you debug the request?


Hth.

Andreas

Former Member
0 Kudos

Hi Andreas. Thank you for your support. Also for me it's strange the logoff but in the guide http://help.sap.com/businessobject/product_guides/boexir4/en/xi4_opendocument_en.pdf there is a script on how to obtain the token. In that script there is the logoff. However I tried to remove this action without success. Really I don't know how I can debug the response because in the jsp page the redirect is formally correct. Regards

former_member199597
Participant
0 Kudos

But could you print out the debug infos so you know whats in the registers or variables?

somthing like "write" or you have log4j to write a local file with the variable infos.

If you dont know which variable is null or where it happens, its really hard to find that

Former Member
0 Kudos

Yes I'm agree with you .... The problem, from my point of view, is related to the response.sendRedirect(bo_cms_url + "&token="+tokenEncode); Formally the url is correct: http://NTBO4:8080/BOE/OpenDocument/opendoc/openDocument.jsp?iDocID=Ab3R7uNJ0F9Ot6Bg4mLhjaQ&sIDType=C... Is there a trace on BO that I can check?

former_member199597
Participant
0 Kudos

Hmm there should be, since its using REST-WS.

But another question:

Did you try the serialized session aswell?

I would do it like this:

1. Try sending the URL without the token - if you receive a promtp - you should be fine.

-> if not - Problem is the Token

2. Try using the serialized session - if it works -decide wether to use sS  or figure out the token problem.

3. Analyse the token problem. Since the token is using an additional licence, you should be able to verify the token ID - or even get the encoded URL.

Let me know.

Cheers,.

former_member199597
Participant
0 Kudos

So did you manage to solve this?

Let me know ...

thx