Using classes outside of the default package in OATS 12.3.0.1.0

Hello,
OpenScript - Version: 12.3.0.1 Build 376.
The test fails when I use classes that are not in the default package.
Here is a simple example:
TempClass - in the default package, I can create new objects and use it's methods without any errors.
AlienClass - in another package (which name is anotherPackage) of the same project, I import that package into the script.java but I get an exception while creating new class object:
"An unexpected exception occurred in the script. Script section: Unspecified. Caused by: ClassNotFoundException occured. anotherPackage.AlienClass "
import anotherPackage.*;
public void run() throws Exception {
  TempClass tmp = new TempClass(); // no errors while creating
  info(tmp.generateMessage());           // this method works correctly
  AlienClass al = new AlienClass();
  /* here I've got error
  *An unexpected exception occurred in the script.
  * Script section: Unspecified.
  * Caused by: ClassNotFoundException occured. anotherPackage.AlienClass 
There are no such problems in OpenScript Version: 12.2.0.1 Build 223.
Could you help me, please?
Best regards,
Natalie

Hi, Sri!
It was not necessary to name the root package "lib" in previous versions of OpenScript (12.2.0.1, 9.X.X).
Except the default package, my work project in 12.2.0.1 included one main user package named by the testing application (let's call it "myApp"). And other packages and classes were located there.
For example:
D:\Development\TestProject\myApp\core\DB.java
D:\Development\TestProject\myApp\test\Test1.java
D:\Development\TestProject\myApp\test\Test2.java
D:\Development\TestProject\myApp\web\common\Authorization.java
etc.
Project with such structure worked in OpenScript 12.2.0.1 but doesn't work in 12.3.0.1.
According to your advice I created a new package - D:\Development\TestProject\lib, moved "myApp" with all included packages and classes into that package and corrected import statements (like lib.myApp.core.* instead of myApp.core.*).
And then no errors appeared! So thank you very much! But it's interesting, why behaviour of OpenScript concerning package's name has changed?
As for example from the first message,  import statement was in the same place where OpenScript added others packages during creating a new project. I've just tried to save some space in the message
The full script.java is:
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.adf.api.*;
import anotherPackage.*;
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.adf.api.ADFService adf;
  public void initialize() throws Exception {
  public void run() throws Exception {
  TempClass tmp = new TempClass(); // no errors
  info(tmp.generateMessage());     // this method works correctly
  AlienClass al = new AlienClass();
  /* here I've got error
  *An unexpected exception occurred in the script.
  * Script section: Unspecified.
  * Caused by: ClassNotFoundException occured. anotherPackage.AlienClass 
  public void finish() throws Exception {

Similar Messages

  • How to save library symbols' class files in packages that are not the default package?

    Hi,
    I perform the following in Flash CS5 with Flash Builder 4
    1) Create a new library symbol.
    2) Do a RightClick->Properties on the new symbol
    3) Check the options for "Export for ActionScript" and "Export in frame 1".
    4) I write a new name for my class "Class1" and click on the pencil icon "edit class definition" to edit the class.
    At this point my FlashBuilder 4 takes over and opens the "New ActionScript" dialog.
    4) I then click on Package-Browse to select a package e.g. com.mycompany.myfiles as the new class destination.
    The as file is created as com.mycompany.myfiles/Class1.as as everything seems just fine.
    5) I close the ActionScript file and back in Flash CS5 I RightClick on the symbol and select "Edit Class".
    At this time, FB4 suggests again to create the file, ignoring the fact that I already created it before.
    Do you know of a way I can make Flash CS5 remember where I created the file?
    Thanks.

    Hi,
    I didn't remove the project or delete any of the files.
    All I did was create the class file under a package that is not the default package. Then when I clicked on the Flash symbol's "Edit Class" It asked me again to create the same class file.
    Only if I create the class in the default package, it won't ask me to recreate it again.
    Bye,
      RaamEE-IL

  • Netbeans - refactoring from in a package to the default package

    Hello,
    I have a problem, I have some JNI code (two .dll's) and a wrapper that connects my java program to an external USB board.
    I didn't write the original code, that was done by Mike Peter and the dlls have been compiled so that I can call the JNI functions only in the default package. Whenever I try to put the code in a package of its own, the JNIs stop working. So my problem now is that I want to access this interface class from my code that is in a package.
    I don't know how to import the code as a library into my programs package so perhaps a solution might be to de-package my program code so that it can access Mike Peters code.
    Trouble is I have used the netbeans GUI editor that does not let me access all the code and I dont know how to refactor the package from being in one to not being in one.
    removing the package declartion from my code manually causes lots of errors.
    Any ideas?
    Mike Peters code downloadable here:
    http://www.re-applications.be/downloads/J-K8055-Wrapper.zip
    the usb_interface class has no constructor and is not in a package, how do I go about making it a library and importing it?
    I'd greatly appreciate it if anyone can help, if more details are needed I can try to provide them but I didn't think it was worth putting up all my code here as there is no real problem with it, just an access issue.

    What I really need to do is find a way to import a class from the default package.
    I was led to believe that classes in the default package should be readily accessible, however my compiler says otherwise when my code is in a package and the class I want to access can only be accessed when my code is not in a package. This is really frustrating because the GUI editor doesn't like it when the GUI is not in a package... so I either lose and my USB interface doesn't work or I lose and my GUI doesn't work.
    help!

  • Importing from the "default package"

    Hi,
    I've got a class ("A") which contains an inner class ("Inner") in it, and I have another class ("B") which needs to use the inner class. To make the code more readable I would like to import the inner class directly into class "B", so that I could write something like: "Inner in = ...", instead of "A.Inner in = ...".
    The problem is that all of these classes are placed in the "default package", and Java won't let me import without specifying a package in the import path.
    Is there any way to make a reference to the "default package" and use it inside an import?
    Thanks...

    I think that you should avoid using the default package whenever possible, and in this situation you have to avoid using it. I'm curious, what argument do you have against using packages? Also, why not pull that inner class out if it's to be used by other classes? I think that your code will be more readable and maintainable this way. But then again, I'm kind of new myself, so I'd be interested to hear what others have to say.

  • Where is the location of the default package?

    I'm using jdk1.6.0_14. There is a folder src. I guess the folder contains all the default package. And I try to delete the src folder, and then compile and run a simple program:
    import java.util.Scanner;
    public class TesImport {
         public static void main(String[] args) {
              Scanner s = new Scanner(System.in);
              System.out.println(s.nextDouble());
    }...but it still work... Actually, where is the location of the default package?
    Really need your help.
    Thanks

    JoachimSauer wrote:
    georgemc wrote:
    Eclipse defaults to thisSince I'm using maven, I really like the default structure of files there:
    - */src/main/java* is for Java sources
    - */src/main/resources* is for resources
    - */src/test/java* is for Java sources for the tests
    - */src/test/resources* is for resources for the tests
    - */target* contains everything produced by the build
    - */target/classes* contains compiled Java classes from /src/main/java and resources from /src/main/resources
    - */target/test-classes* contains compiled Java classes from /src/test/java and resources from /src/test/resourcesMe too. Presumably you use the Maven plugin to generate Eclipse projects too? One of the things Maven-haters moan about is that it enforces it's own directory structure on you, which quite apart from not being not true, isn't a bad thing anyway. That structure is a pretty sensible default

  • Cannot resolve symbol when the classes are in the same package

    i have one interface and two classes all in the same package. am getting " cannot resolve symbol", when the code refers to the interface or the class .
    the package name is collections.impl and
    the directory i used to store all the java files:
    c:\jdk\bin\collections\impl.
    isthere any othe option other than compiling all the files from the comand line at the same time?
    please help - i m new to java.

    If you have:
    I.java:
    package some;
    public interface I {
        void method();
    }A.java:
    package some;
    public class A implements I {
        public void method() {
            new B();
    }B.java:
    package some;
    public class B implements I {
        public void method() {
            new A();
    }in c:/temp/some for example
    you can compile your files with
    javac c:/temp/some/*.java
    It seems that you have errors in your code.
    Recheck it twice or use NetBeans IDE(http://www.netbeans.org) it will do this for you ;)

  • [svn] 1091: compiler: class renaming in the compiler package

    Revision: 1091
    Author: [email protected]
    Date: 2008-04-03 13:32:09 -0700 (Thu, 03 Apr 2008)
    Log Message:
    compiler: class renaming in the compiler package
    * flex2.compiler:Context to CompilerContext
    * flex2.compiler.util:Console to ConsoleLogger
    Bugs: n/a
    QA: No
    Doc: No
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/API.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilationUnit.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilerSwcContext.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/PersistenceStore.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/Source.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/SymbolTable.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/abc/Compiler.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/Compiler.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/EmbedExtension.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/StyleExtension.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/SyntaxTreeEvaluator.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/binding/DataBindingExtension. java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/binding/DataBindingFirstPassE valuator.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/binding/TypeAnalyzer.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/genext/GenerativeSecondPassEv aluator.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ASDocExtension.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/css/Compiler.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/i18n/Compiler.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/ImplementationCompiler.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/InterfaceCompiler.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/AbstractDocumentBuil der.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/MxmlDocument.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/tools/oem/internal/OEMConsole.java
    Added Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilerContext.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/ConsoleLogger.java
    Removed Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/Context.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/util/Console.java

    Out of curiosity, do you have a directory called WEB-INF inside of
    MyPortal\portalApp\portlets\WFWeb? If so, can you try removing/renaming it?
    "Gavin" <[email protected]> wrote in message
    news:40581f2e$[email protected]..
    >
    I create a Application naming "MyPortal" in WorkShop.
    And create a Project naming "portalApp".
    In folder "portalApp", I create a folder "portlets"
    And create a PageFlow in folder "portlets", so I get a jpf naming"WFWebController.jpf"
    >
    >
    W:\bea\user_projects\applications\MyPortal\portalApp\portlets\WFWeb\WFWebCon
    troller.jpf
    >
    But I add some java code in the method of WFWebController.jpf
    when I run the WFWebController.jpf from workshop
    the compiler throws a ERROR message "A PageFlowController at the root ofthe web
    application must be in the default package."
    Have any solution about this ERROR ?
    Thanks,
    Gavin.

  • What is the default package tu put in a data model ?

    Hi,
    I want to call a procedure *"EXTRACTION"* which is located in the default pachkage of my database.
    What shoud i put in my data model? i feel that this line is wrong :
    *<dataTrigger name="beforeReport" source="Extraction"/>*
    Thnaks,
    SAAD

    Hi,
    i have plaeced my procedure directly in my procedure folder not in a package.
    so if im correct, the default package will be nothing so i just put the name of the procedure.
    is that true?
    Tnaks,
    SAAD.

  • [svn] 1090: compiler: class renaming in the mxml package

    Revision: 1090
    Author: [email protected]
    Date: 2008-04-03 11:59:00 -0700 (Thu, 03 Apr 2008)
    Log Message:
    compiler: class renaming in the mxml package
    * flex2.compiler.mxml.builder:ApplicationBuilder to AbstractDocumentBuilder
    * flex2.compiler.mxml.builder:Builder to AbstractBuilder
    * flex2.compiler.mxml.dom:ApplicationNode to DocumentNode
    Bugs: n/a
    QA: No
    Doc: No
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/CompilationUnit.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/ImplementationCompiler.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/InterfaceCompiler.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/AnonymousObjectGraph Builder.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/ArrayBuilder.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/ComponentBuilder.jav a
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/InlineComponentBuild er.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/PrimitiveBuilder.jav a
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/XMLBuilder.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/XMLListBuilder.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/Scanner.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/ValueNodeHandler.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/DocumentInfo.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/rep/MxmlDocument.java
    Added Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/AbstractBuilder.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/AbstractDocumentBuil der.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/DocumentNode.java
    Removed Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/ApplicationBuilder.j ava
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/builder/Builder.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/dom/ApplicationNode.java

    Plz help me...

  • [svn:osmf:] 15863: Remove FLEXOSMF 4.0 tagging, the OSMF for Flex 4 version of this class lives in the display package

    Revision: 15863
    Revision: 15863
    Author:   [email protected]
    Date:     2010-05-02 19:20:15 -0700 (Sun, 02 May 2010)
    Log Message:
    Remove FLEXOSMF 4.0 tagging, the OSMF for Flex 4 version of this class lives in the display package
    Modified Paths:
        osmf/trunk/framework/OSMF/org/osmf/layout/ScaleMode.as

    What I've done is remove osmf.swc from the Flex 4.0 sdk, then I added the new osmf.swc file to my libs folder for my project. Is there a for updating osmf in Flex 4.0 it works nativly with the sdk. The original reason why I got errors was because the frameworks/projects/osmf/src/OSMFClasses.as  packages in Flex 4 were not the same as the new osmf.swc (most of the flex 4 swc have these package reference files). So those would have to be updated every time the osmf packages change.

  • When using Zoho CRM- by default they use Skype as the "dialer". They said the browser can be configured to use Google Voice as the default dialer. Please help

    When using Zoho CRM- by default it uses Skype as the "dialer". They said the browser can be configured to use Google Voice as the default dialer. Please help by telling me how to make Google Voice the default dialer instead of Skype. Thanks

    Try the following changes to the JS file
    Lines 103 and 104 change the values
    this.showDelay = 100; // was 250
    this.hideDelay = 200; // was 600
    Comment out line 286
    Spry.Widget.MenuBar.prototype.bubbledTextEvent = function()
    //    return Spry.is.safari && (event.target == event.relatedTarget.parentNode || (event.eventPhase == 3 && event.target.parentNode == event.relatedTarget));
    Comment out line 366 and add new lines 366 and 367
    var self = this;
    this.addEventListener(listitem, 'click', function(e){self.Click(listitem, e);}, false);
    this.addEventListener(listitem, 'click', function(e){self.mouseOver(listitem, e);}, false);
    //   this.addEventListener(listitem, 'mouseover', function(e){self.mouseOver(listitem, e);}, false);
    this.addEventListener(listitem, 'mouseout', function(e){if (self.enableKeyboardNavigation) self.clearSelection(); self.mouseOut(listitem, e);}, false);
    I have not tested the above changes ontouch screens; they do seem to work Ok on desktops.
    NOTE: Line numbers could be different because of the difference in our versions.

  • I have just downloaded an alternative keyboard (Fast Keyboard)How do I get my Ipad2 to use it instead of the default keyboard, please?

    I have just downloaded an alternative keyboard (Fast Keyboard).
    How do I get my Ipad2 to use it instead of the default keyboard, please?
    Thanks for your help

    First, please don't shout.
    Second, don't post personal information.
    Third, restore, if iTunes will let you.  Everything except the password will be restored.  Connect via cable to the computer that you use for sync.  Be forewarned that it takes a long time.  From iTunes, select the iPad/iPod and then select the Summary tab.  Follow directions for Restore and be sure to say "yes" to the backup.  You will be warned that all data (apps, music, movies, etc.) will be erased but, as the Restore finishes, you will be asked if you wish the contents of the backup to be copied to the iPad/iPod.  Again, say "yes."
    At the end of the basic Restore, you will be asked if you wish to sync the iPad/iPod.  As before, say "yes."  Note that that sync selection will disappear and the Restore will end if you do not respond within a reasonable time.  If that happens, only the apps that are part of the IOS will appear on your device.  Corrective action is simple -  choose manual "Sync" from the bottom right of iTunes.
    If you're unable to do the Restore, go into Recovery Mode per the instructions here.

  • Makepkg with custom dwm ends up installing the default package!

    I have a directory where I edit the source of dwm and then run 'makepkg -efi' to build and install my own version.
    I have been doing this for quite a while now, and everything worked fine.
    Then a few days ago I installed the default dwm with pacman to show my freind what it looks like without the patches that I've applied.
    I removed it with pacman afterward, but now when I run the pkgbuild in my customized dwm directory, it ends up installign the default package!
    I had to go into the source and do a striaght 'make install' to get my custom binary installed again.
    Does anyone know what's going on?

    Are you sure that you did not miss the  "-e" there once and have re-extracted the original tarball?

  • How to use classes from different user defined Packages

    well i made 2 packages... one containing employee class and realted matter and other contaning bankaccounts and bank related work... now how can i use them in an another.. i know about the import statement but still couldn't make it work.... now suppose iam makin a obejct of employee class and passing in name and salary and all in the constructor... now i want that when i create the bankaccount class then the name of the employee should be passed to the bankaccount class so that it can assigen a account no. .. now how do i do this as when i create a object of employee class its made at runtime.. and if i create a object of bankaccount.. how wil it take that name as before goin to bank account i should already have a list of emplyees and then this list should be worked upon by the backaccount class to assign the accountno.s
    Hope my question was clear... would appriciate a explanation and guidance!!!

    Thank you so much ... i was able to solve the problem... i passed the object in the constructor of the accounts class and it all worked out the way i wanned... thank you so much... it wasn't that difficult but the idea was just not clicking...this place is wonderful... everyone rocks!!! and so greatful about all the help.. please keep up the good work and even i will try to contribute as much as possible!!

  • About the default package

    We all know , in the java.lang package , we don't import .but I want to know whether I can set a package for example "xxxx" , just as "java.lang " . In the later code, I don't import the xxxx package , it can use the class in the xxxx package ?
    Thanks a lot.

    No. The fact that public type names declared in the java.lang package are automatically imported is part of the vm spec. So, unless you write your own jvm, I don't think you'll be able to do this.

Maybe you are looking for

  • IPad fails to connect to Wi-Fi????

    After eliminating e-mail's with no message my iPad fails to connect to my Wi-Fi, yet my Touch connects. How to resolve?

  • AQ Sort Order (priority,enq_time)

    HI I am trying to subscribe to a topic with Sort Order (priority,enq_time) using oracle.jms API.Payload type is an ADT generated from jpublisher.Though the same worked with Oracle.AQ API.After publishing i am updating the priority.But the subscribing

  • Troble configuring Hyperion Shared Services with SQL Server 2005

    I recently installed SQL server (SQL SERVER 2005) in my machine and then am trying to install Hyperion (9.3.1) products. I started with Shared services. It was installed successfully. Problem is occuring when am trying to configure Shared service wit

  • Using Windows Network Policy Server to authenticate Prime Infrastructure 1.4 admin access

    I am using Prime Infrastructure 1.4 and I am needing to set up RADIUS Authencation.  I am using Microsoft Network Policy Server.   I have done all of the setup on both systems.  I have matched up the settings the best I can on both systems.  I am try

  • How to configure header note in quotation through va22.

    how to configure header note in quotation through va22. i want a manually enter the data through va22.. please give me idea step by step process how to solve <h4>We have not configured text determination because the there are no fixed rules mentioned