facebook

Incredibly Odd Scenario

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #270614 Reply

    flamebaud
    Member

    I’m faced with an error I can’t seem to explain. I’m attempting to run a batch from an ant script.

    I have a class which imports and uses another class, however, my issue is that I cannot create an instance of the imported class. I know this seems trivial, but let me explain a little more. I’m able to declare the object, but not instantiate it. Here’s an example of what it looks like:

    package craPackage;

    import craPackage.objectClass;

    public class mainClass {

    public void executeMethod(){
    System.out.println(“Test1”);
    objectClass obj;
    System.out.println(“Test2”);
    obj = new objectClass();
    System.out.println(“Test3”);
    obj.objectMethod();
    System.out.println(“Test4”);
    }
    }

    So what’s happening, in relation to my example, is that execution is stopping after instantiating the obj Object (obj = new objectClass();). So my console will have printed Test1 and Test2, but not Test3 or Test4. I’ve already done some toying around, I’ve attempted to declare that class outside of the method, I’ve put a println in the objectClass constructor (which doesn’t show up, which means it’s not even getting to the constructor). I’ve also tried putting it all into a try, catch block, but no exception is caught, it just stops executing. Also, I know the class is deployed with the EAR file, because I’ve seen it in there, and I don’t think it would matter with the import anyway

    #270616 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Incredibly Odd Scenario

You must be logged in to post in the forum log in