IBM Verify

IBM Verify

Join this online user group to communicate across Security product users and IBM experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  [ReferenceError] 'javax' not found

    Posted Wed March 31, 2021 10:32 AM

    I am trying to use javax.mail.* class from IBM provided JAR to externalize one of my requirement. I am unable to use the classes in the workflow script node and getting the error like "[ReferenceError] 'javax' not found". I am currently testing my workflow in ISIM 7.0 VA. I am not sure how to update this jar in shared lib to be available for ISIM script node to use. Can any one help me with some inputs. Thanks.



    #Support
    #SupportMigration
    #Verify


  • 2.  RE: [ReferenceError] 'javax' not found

    Posted Wed March 31, 2021 05:06 PM

    Hi Bhavaniprasad...

    By default ISIM only supports JavaScript in the scripting contexts (workflow, provisioning policies, notifications, etc). So often you'll create a custom script extension using the Java Classes/Methods you'd like to call from ISIM, and register/expose those as JavaScript.

    That said, if you want to use Java Classes/methods directly in ISIM scripting contexts.. you would need to update the scriptframework.properties to allow/expose Java.

    Here's the section from the raw scriptframework.properties files that explains this:

    # # Direct Java Access Configuration # # To allow direct access to Java classes from scripts, add the Java classes # or java packages that you need access to here. The rules for adding access # is the same as in java import statements. You can add either a full java # class name, or a package name ".*". This means that "java.*" will not # include java classes in "java.lang.*". # # To add access to a class or package, the key must start with # "ITIM.java.access". If you have multiple statements each key must be unique. # # This is a feature of using the IBMJS engine only. # # Examples: # ITIM.java.access.lang=java.lang.* # ITIM.java.access.obj=java.lang.Object

    As this is the Virtual Appliance, you'd need to manually add those properties/values via the LMI.



    #Support
    #SupportMigration
    #Verify


  • 3.  RE: [ReferenceError] 'javax' not found

    Posted Thu April 01, 2021 07:56 AM

    Thanks for the response. Here is what i was trying and not succeeding.

    I am trying to load the custom java class in to the script node.

    Here is the process i have followed to load the custom jar.

    1) Java class is as below and converted this class into a jar file ->

    package com.ibm.isim.custom;

    import java.util.ArrayList;

    import java.util.List;

    import com.ibm.itim.mail.MailManager;

    import com.ibm.itim.mail.NotificationMessage;

    import com.ibm.itim.workflow.model.ActivityResult;

    public class SendMail {

    public ActivityResult sendMailToPersonalID(String mailAddress, String mailSubject, String mailBody) {

    try {

    List<String> addresses = new ArrayList<String>();

    addresses.add(mailAddress);

    NotificationMessage nMessage = new NotificationMessage(addresses, mailSubject, mailBody, mailBody);

    MailManager.notify(nMessage);

    return new ActivityResult(ActivityResult.STATUS_COMPLETE, ActivityResult.SUCCESS, "eMail Sent",

    null);

    } catch (Exception e) {

    return new ActivityResult(ActivityResult.STATUS_COMPLETE, ActivityResult.FAILED, "eMail Not Sent", null);

    }

    }

    }

    2) Imported into Configure -> Identity Manager -> External Library => SendMail.jar

    3) Updated the scriptframework.properties with the below key, value.

    ITIM.java.access.SendMail -> com.ibm.isim.custom.SendMail

    4) Created a workflow -> script node and calling the class by passing the appropriate varibles (All varibles has values. Total script not pasted here) as below.

    var sendMail = new com.ibm.isim.custom.SendMail();

    var response = sendMail.sendMailToPersonalID(mailAddress, mailSubject, mailBody);

    #########################

    I am getting the follwing error from the ISIM trace log. I am unsure if i am missiing any configuration here in this process. Please advise. Thanks.

    <LogText><![CDATA[CTGIMA428E The 884710766567845643 process has stopped.

    Error: <Message Id = "Script interpreter error, line=4, col=40: [ReferenceError] 'com' not found"></Message> ]]></LogText>

    <Source FileName="com.ibm.itim.workflow.engine.WorkflowEngine" Method="terminateProcess"/>

    <TranslationInfo Type="JAVA" Catalog="tmsMessages" MsgKey="com.ibm.itim.workflow.PROCESS_TERMINATED"><Param><![CDATA[884710766567845643]]></Param><Param><![CDATA[<Message Id = "Script interpreter error, line=4, col=40: [ReferenceError] 'com' not found"></Message>]]></Param></TranslationInfo>



    #Support
    #SupportMigration
    #Verify