Steps required to create .class file and custom .jar files for usage in Java Custom Function feature for use in BusinessEvents.

Steps required to create .class file and custom .jar files for usage in Java Custom Function feature for use in BusinessEvents.

book

Article ID: KB0091063

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition -
Not Applicable -

Description

Resolution:
Description:
===========
Steps required to create .class file and custom .jar files for usage in Java Custom Function feature for use in BusinessEvents.

Environment:
===========
TIBCO BusinessEvents 3.x
All Operating Systems

Resolution:
========
1). Put the .class file of the generated Java custom function (Along with Folder Structure) and functions.catalog file in the same folder. Before generating the .class file, set the classpath by the following steps at command prompt.

   a). Create a BusinessEvents system variable, so that it can be set in classpath as and when required. Example: create a BE_JAR_HOME and assign the jars of BusinessEvents in lib and hotfix/lib to it.
      BE_JAR_HOME=C:\tibco\be\3.0\hotfix\lib\be-functions.jar;C:\tibco\be\3.0\hotfix\lib\be-oracle.jar;C:\tibco\be\3.0\hotfix\lib\cep-common.jar;C:\tibco\be\3.0\
      hotfix\lib\cep-container.jar;C:\tibco\be\3.0\hotfix\lib\cep-drivers.jar;C:\tibco\be\3.0\hotfix\lib\cep-kernel.jar;C:\tibco\be\3.0\hotfix\lib\cep-modules.ja
      r;C:\tibco\be\3.0\hotfix\lib\cep-query.jar;C:\tibco\be\3.0\hotfix\lib\ext\coherence.jar;C:\tibco\be\3.0\hotfix\lib\ext\tangosol.jar;C:\tibco\be\3.0\hotfix\
      lib\palettes\be-bw.jar;C:\tibco\be\3.0\hotfix\lib\palettes\be-palettes.jar;C:\tibco\be\3.0\lib\be-functions.jar;C:\tibco\be\3.0\lib\be-oracle.jar;C:\tibco\
      be\3.0\lib\cep-common.jar;C:\tibco\be\3.0\lib\cep-container.jar;C:\tibco\be\3.0\lib\cep-drivers.jar;C:\tibco\be\3.0\lib\cep-instrumentation.jar;C:\tibco\be
      \3.0\lib\cep-kernel.jar;C:\tibco\be\3.0\lib\cep-migration.jar;C:\tibco\be\3.0\lib\cep-modules.jar;C:\tibco\be\3.0\lib\cep-query.jar;C:\tibco\be\3.0\lib\ext
      \antlr-2.7.7.jar;C:\tibco\be\3.0\lib\ext\antlr-runtime-3.0.1.jar;C:\tibco\be\3.0\lib\ext\coherence.jar;C:\tibco\be\3.0\lib\ext\javassist.jar;C:\tibco\be\3.
      0\lib\ext\je.jar;C:\tibco\be\3.0\lib\ext\jide-all.jar;C:\tibco\be\3.0\lib\ext\stringtemplate.jar;C:\tibco\be\3.0\lib\ext\tangosol.jar;C:\tibco\be\3.0\lib\e
      xt\tomsawyer-viz-all.jar;C:\tibco\be\3.0\lib\palettes\be-bw.jar;C:\tibco\be\3.0\lib\palettes\be-palettes.jar;C:\tibco\be\3.0\lib\palettes\be-statemodeler.j
      ar;C:\tibco\be\3.0\lib\palettes\TIBCOilogkit.jar;C:\tibco\be\3.0\lib\palettes\TIBCOllogkit.jar;C:\tibco\be\3.0\lib\palettes\TIBCOtkitaeui.jar;
      
   b). Before compiling, set this variable in classpath at the command prompt.
Example:  > SET CLASSPATH=%CLASSPATH%;%BE_JAR_HOME%;
  
    
2). Generate the .jar file.

    Execute the following command :
       jar -cvf &ltName of desired jar file> &ltfolder containing files> &ltfunctions.catalog file>
      
    Example,  :
           > jar -cvf GetConceptData.jar com functions.catalog
        
Here folder com contains the .class file (com\tibco\be\functions\sort\GetConceptData.class)  


3). Put the jar file in the BusinessEvents classpath. In the above, put the GetConceptData.jar in the BE classpath.
    
NOTE: Sometimes .class files get corrupted when generated and exported to jar using some tool instead of using the command line option. Example: when you generate using Eclipse, you need to disable compiler options for generating information used by the debugger before exporting to the jar file.

Issue/Introduction

Steps required to create .class file and custom .jar files for usage in Java Custom Function feature for use in BusinessEvents.