Hi everyone, I’m new here and in Sdk’s.
I have a big problem.
On my actual job, I have a portal where the users create pdf instances of several reports on BO and send to a specific location on the company network.
But the company only had a BO Production system, now, it has Dev, QAS and PRD.
We did upgrade the DEV and QAS systems to BO 4.2 SP6 from SAP BO4.0;
All the .jsp files were copied and updated with the data of the respective server.
But I’m getting an error now, my code is:
<%@ page contentType=“text/html; charset=utf-8” language=“java” %>
<%@ page import=“com.crystaldecisions.sdk.framework." %>
<%@ page import=“com.crystaldecisions.sdk.exception.SDKException” %>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.” %>
<%@ page import=“com.crystaldecisions.sdk.plugin.CeKind” %>
<%@ page import=“com.businessobjects.sdk.plugin.desktop.webi." %>
<%@ page import="com.crystaldecisions.sdk.properties.,com.crystaldecisions.sdk.plugin.destination.smtp." %>
<%@ page import="java.util.,java.lang.Integer,java.io., java.lang.Object., java.net." %>
<%@ page import ="com.crystaldecisions.sdk.properties., com.businessobjects.sdk.plugin.desktop.profile., com.crystaldecisions.sdk.plugin.desktop.usergroup., com.crystaldecisions.sdk.plugin.desktop.user." %>
<%@ page import ="com.businessobjects.rebean.wi.” %>
<%@ page import =“com.crystaldecisions.sdk.plugin.desktop.report." %>
<%@ page import ="com.crystaldecisions.sdk.plugin.destination.diskunmanaged.” %>
<%@ page import=“java.io.FileInputStream” %>
<%@ page import=“java.io.File” %>
<%@ page import=“java.io.InputStreamReader” %>
<%@ page import=“java.net.URL” %>
<%@ page import=“java.io.FileReader” %>
<%@ page import=“java.io.BufferedReader” %>
<%!JspWriter out;%>
<%
this.out = out;
final String BO_USERNAME=(String)request.getParameter(“user”);
final String BO_PASSWORD=(String)request.getParameter(“pass”);
boolean loginSuccessful = false;
IEnterpriseSession boEnterpriseSession = null;
final String REPORT_NAME1 = “XPTO1”;
final String REPORT_NAME2 = “XPTO2”;
final String REPORT_NAME3 = “XPTO3”;
final String REPORT_NAME4 = “XPTO4”;
final String REPORT_NAME5 = “XPTO5”;
// actualizar esta informacao quando o servidor for configurado
final String BO_CMS_NAME = “xxx-xx-xx:6400”;
final String BO_AUTH_TYPE = “secSAPR3”;
// Read file
String jspPath = "D:\\SAPBO\\Tomcat6\\webapps\\mig\\";
String fileName = "defaults.txt";
String txtFilePath = jspPath + fileName;
BufferedReader reader = new BufferedReader(new FileReader(txtFilePath));
StringBuilder sb = new StringBuilder();
request.setAttribute("periodDefault", reader.readLine());
request.setAttribute("exercDefault", reader.readLine());
request.setAttribute("versaoDefault", reader.readLine());
request.setAttribute("anoDefault", reader.readLine());
try{
boEnterpriseSession = CrystalEnterprise.getSessionMgr().logon(BO_USERNAME, BO_PASSWORD, BO_CMS_NAME, BO_AUTH_TYPE);
On this point the boEnterpriseSession are “Null” and the following error appears:
java.lang.NullPointerException: while trying to invoke the method com.crystaldecisions.sdk.framework.IEnterpriseSession.logoff() of a null object loaded from local variable ‘boEnterpriseSession’
org.apache.jsp.porOrcam_jsp._jspService(porOrcam_jsp.java:730)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:443)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Anyone can help me please?
Thank you!
Regards.
Shaktar (BOB member since 2018-01-24)