Forum Stats

  • 3,874,114 Users
  • 2,266,686 Discussions
  • 7,911,729 Comments

Discussions

Openscript : Null pointer exception is displayed when try to Run As -> Java Application

I am trying to create an executable JAR file. Currently , I am running my scripts as playback script from Open script.

1) First of all added a main () function. Created object of the class "script" in main () and called run().

import oracle.oats.scripting.modules.basic.api.*;

import oracle.oats.scripting.modules.browser.api.*;

import oracle.oats.scripting.modules.functionalTest.api.*;

import oracle.oats.scripting.modules.utilities.api.*;

import oracle.oats.scripting.modules.utilities.api.sql.*;

import oracle.oats.scripting.modules.utilities.api.xml.*;

import oracle.oats.scripting.modules.utilities.api.file.*;

import oracle.oats.scripting.modules.webdom.api.*;

import oracle.oats.scripting.modules.formsFT.api.*;

import oracle.oats.scripting.modules.applet.api.*;

public class script extends IteratingVUserScript {

@ScriptService oracle.oats.scripting.modules.utilities.api.UtilitiesService utilities;

@ScriptService oracle.oats.scripting.modules.browser.api.BrowserService browser;

@ScriptService oracle.oats.scripting.modules.functionalTest.api.FunctionalTestService ft;

@ScriptService oracle.oats.scripting.modules.webdom.api.WebDomService web;

@ScriptService oracle.oats.scripting.modules.applet.api.AppletService applet;

@ScriptService oracle.oats.scripting.modules.formsFT.api.FormsService forms;

public static void main(String[] args) throws Exception

{

script s=null;

    s=new script();

System.out.println("In main func");

    s.run();

}

public void run() throws Exception {

System.out.println("In run func");

int PropRcdCnt = 0;

PropRcdCnt=getDatabank("Properties_Keystone").getDatabankRecordCount();

}

2) Now click Run-> Run As -> Java Application

3) Following error is displayed in the console

In main func

In run func

Exception in thread "main" java.lang.NullPointerException

at oracle.oats.scripting.modules.basic.api.IteratingVUserScript.getDatabank(IteratingVUserScript.java:675)

at script.run(script.java:39)

at script.main(script.java:25)

4) This issue actually occurs at "

PropRcdCnt=getDatabank("Properties_Keystone").getDatabankRecordCount();

Kindly help me in solving this issue.

"

This discussion has been closed.