This discussion is archived
1 Reply Latest reply: Feb 17, 2011 7:16 AM by 835737 RSS

ESSBASE API: Problem when trying to copy a script from the server(1030201)

840634 Newbie
Currently Being Moderated
Hello,

I have a problem when i try to copy a script from an essbase server using the essbase api.
The connexion to essbase works. However, when the copyOlapFileObjectFromServer method is launched (i have used the debug function for verifying it), i have an error :


com.essbase.api.base.EssException: (1030201): Cannot create object: ../data/1
     at com.essbase.server.framework.EssOrbPluginDirect.ex_olap(Unknown Source)
     at com.essbase.server.framework.EssOrbPluginDirect.essMainGetObject(Unknown Source)
     at com.essbase.api.session.EssOrbPlugin._invokeMainMethod(Unknown Source)
     at com.essbase.api.session.EssOrbPlugin._invokeMethod2(Unknown Source)
     at com.essbase.api.session.EssOrbPlugin._invokeMethod(Unknown Source)
     at com.essbase.server.framework.EssOrbPluginDirect._invokeProtected(Unknown Source)
     at com.essbase.api.session.EssOrbPluginEmbedded.invokeMethod(Unknown Source)
     at com.essbase.api.session.EssOrbPluginEmbedded.invokeMethod(Unknown Source)
     at com.essbase.api.session.EssOrbPlugin.essMainGetObject(Unknown Source)
     at com.essbase.api.datasource.EssCube.copyOlapFileObjectFromServer(Unknown Source)
     at com.inetpsa.sdg.services.essbase.EssSpy.launchScript(EssSpy.java:221)
     at com.inetpsa.sdg.services.verrouillage.SetValidationService.doExecute(SetValidationService.java:174)
     at com.inetpsa.fwk.service.BusinessService.execute(BusinessService.java:409)
     at com.inetpsa.sdg.action.validation.ValidationAction.doExecute(ValidationAction.java:45)
     at com.inetpsa.fwk.struts.action.FWKActionWrapper.doExecute(FWKActionWrapper.java:125)
     at com.inetpsa.fwk.struts.action.FWKActionWrapper.execute(FWKActionWrapper.java:104)
     at com.inetpsa.fwk.struts.action.FWKAction.execute(FWKAction.java:94)
     at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
     at com.inetpsa.fwk.struts.action.FWKRequestProcessor.parentProcessActionPerform(FWKRequestProcessor.java:248)
     at com.inetpsa.sdg.action.RequestProcessor.processActionPerform(RequestProcessor.java:41)
     at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
     at com.inetpsa.fwk.struts.action.FWKRequestProcessor.parentProcess(FWKRequestProcessor.java:202)
     at com.inetpsa.fwk.struts.action.FWKRequestProcessorWrapper.process(FWKRequestProcessorWrapper.java:592)
     at com.inetpsa.fwk.struts.action.FWKRequestProcessor.process(FWKRequestProcessor.java:75)
     at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
     at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
     at java.lang.Thread.run(Unknown Source)
ERROR: (1030201): Cannot create object: ../data/1


The code that i use for getting my script :

File inputFile = null; FileReader in = null; StringWriter out = null; String output=null;
     
     String textFileName=System.getenv("java.io.tmpdir") + File.separator + "sdgcpbb.txt";
     inputFile = new File(textFileName);
     try{
          cube.copyOlapFileObjectFromServer(IEssOlapFileObject.TYPE_CALCSCRIPT, "sdgcpbb", textFileName, false);
     }catch (EssException e) {
                    e.printStackTrace();
                    throw e;
     }

in = new FileReader(inputFile);
     out=new StringWriter();
     int c;
     while ((c = in.read()) != -1) out.write(c);
     output=out.toString();
     System.out.println("script: " + output);
     
     inputFile.delete();



Thanks you for your help.

Vinou
  • 1. Re: ESSBASE API: Problem when trying to copy a script from the server(1030201)
    835737 Expert
    Currently Being Moderated
    Hi Vinou,

    Based on your StackTrace, you are not giving Essbase the correct object type so it cannot find it.

    cube.copyOlapFileObjectFromServer(IEssOlapFileObject.TYPE_CALCSCRIPT, "sdgcpbb", textFileName, false);

    Should be:

    cube.copyOlapFileObjectFromServer(IEssOlapFileObject.TYPE_TEXT, "sdgcpbb", textFileName, false);

    Also,

    When you debug, what does the String textFileName have for a value after it is assigned by System.getenv("java.io.tmpdir") + File.separator + "sdgcpbb.txt"; ?

    Here I would advise against using Java to access Environment Variables. In my experience this is quite unreliable. Read it from a properties file or feed it in as an arg to main().

    Robb Salzmann

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points