java - 业务对象程序对象时间表

标签 java jar executable-jar business-objects business-objects-sdk

package com.ghc.bo.extract;

 //import com.crystaldecisions.sdk.plugin.desktop.program.IProgramBase;
 import com.crystaldecisions.sdk.framework.IEnterpriseSession;
 import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
 import com.crystaldecisions.sdk.exception.*;
 import com.crystaldecisions.sdk.framework.*;


 public class ExecuteExtract implements com.crystaldecisions.sdk.plugin.desktop.program.IProgramBase
 {


    public void run(IEnterpriseSession boEnterpriseSession, IInfoStore InfoStore, String[] args) 
    {
        System.out.println("Arguments are: ");

        for (int i=0; i<args.length; i++)
        {
            System.out.println("args[" + i + "]=" + args[i]);
        }

        try
        {
            String name = boEnterpriseSession.getUserInfo().getUserName();
            System.out.println("user \"" + name + "\" logged in via run() method");
        }
        catch(SDKException ske)
        {
            System.out.println(ske);
        }

        System.out.println("CMS is " + boEnterpriseSession.getCMSName());
    }

    public static void main(String[] args) 
    {

        IEnterpriseSession boEnterpriseSession = null;
        ISessionMgr boSessionMgr = null;
        IInfoStore boInfoStore = null;

        String userName = null;
        String cmsName = null;
        String password = null;
        String authType = null;     

        userName = args[0];
        password = args[1];
        cmsName = args[2];
        authType = args[3];


   if ((args.length == 4 || args.length == 5) && args[0] != null) 
       try
       {
          boSessionMgr = CrystalEnterprise.getSessionMgr();

          boEnterpriseSession = boSessionMgr.logon(userName, password, cmsName, authType);
          System.out.println("user \"" + userName + "\" logged in via main() method");

          boInfoStore = (IInfoStore) boEnterpriseSession.getService("", "InfoStore");
       }
       catch (SDKException e)
       {
           System.out.println(e.getMessage());
           System.exit(1);
       }

       //call the run() method
       ExecuteExtract pot = new ExecuteExtract();
       pot.run(boEnterpriseSession, boInfoStore, args);

    }    
 }

嗨,我跑了这个,我做了这里的所有事情http://scn.sap.com/community/bi-platform/blog/2014/11/25/how-to-create-a-program-file-in-bi4#comment-613074这基本上只是创建一个 jar 文件并为计划进行最少的配置。我将 jar 创建为可运行的实用程序 jar,我打包/提取了包含的 jar,并将它们排除在外。我尝试了所有这些方法,并将类名“ExecuteExtract”放入程序参数中,但仍然收到错误

Failed to load class: [ExecuteExtract]. Reason: [java.lang.ClassNotFoundException: ExecuteExtract].

有人知道我缺少什么吗?

最佳答案

使用默认包,或指定完全限定类名 (com.ghc.bo.extract.ExecuteExtract) 作为程序对象参数中的类名。

关于java - 业务对象程序对象时间表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32261431/

相关文章:

java - 执行窦功能 |计算时间

java - 我在 intellij 上运行 Spring Boot 应用程序时遇到错误。有人能帮我吗?

java - 内部异常 : com. mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:

java - 如何在没有任何 GUI 组件的情况下创建可执行 jar 文件?

java - 如何更改 File.createTempFile 中的临时目录?

java - Maven:不正确(且不稳定)的传递依赖版本

java - 在 Java jar (ear,war,...) 文件中搜索类/方法

tomcat - 像war文件一样在tomcat中部署一个jar

java - 以千字节为单位比较 java-app 和 c-app

java - launch4j maven 插件 - 配置 .exe 以需要管理员角色