Packages and returned objects

Hello,
I have several packages, one of which (call it package A) has three classes that are basically just structure classes(call them classes x, y, and z). Then in another package (package B), i have a function that creates and returns an object that is of class x type. this works just fine.
my problem comes when i have to use JNI to retrieve the object of type x. the following function call works fine (i think, doesnt return null):
jobject jPRData = env->CallObjectMethod(obj, mid, toTN);
now, i want to get the fields from this object. my problem is that ive tried to read it and it crashes.
     jobject jPRData = env->CallObjectMethod(obj, mid, toTN);
     if(jPRData == NULL){
          cout << "jPRData== null" << endl;
          killJVM();
     else
          cout << "found object method" << endl;
     jclass myClss = env->GetObjectClass(jPRData);
     if(env == NULL)
          cout << "env == NULL " << endl;
     else
          cout << "env okay" << endl;
     if(myClss == NULL)
          cout << "myclss is NULL" << endl;
     else {
          cout << "calling getfield" << endl;
          jfieldID myFid = env->GetFieldID(myClss, "clli", "com/intec/plantrecords/PairData");
          //CRASHES BEFORE RETURNING HERE
          cout << "back from getfieldid" << endl;
          if(myFid == NULL) {
               cout << "couldnt find field" << endl;
     }the error i get is:
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at getPairData(SByte* )
at main(Int32 argc, SByte** argv) in c:\documents and settings\..
but i have tested each item to see if they are null and they arent. just playing around i tried using the variable cls instead of myClss. and it just returns saying that it cant find the field. which is expected because its a different class reference. but i dont know why it is crashing w/ myClss.
uhmmm....help!? please... :)

just realized there was a mistake but even corrected it still crashed
jfieldID myFid = env->GetFieldID(myClss, "clli", "com/intec/plantrecords/PairData");
should be
jfieldID myFid = env->GetFieldID(myClss, "clli", "Ljava/lang/String;");
but i did change the way i found the class of the object. i used FindClass instead and it doesnt crash anymore. gotta convert data to c types and check values.

Similar Messages

  • JAVA Calling Oracle Function and Returning OBJECT

    HI,
    I am working as a developer in java/j2ee project.
    I am facing one issue:
    I need to call Oracle function from java code. Oracle User define function is residing in oracle package and returning Object which contains data.
    Can you please help me
    With Best Regards

    golduniya wrote:
    I need to call Oracle function from java code. Oracle User define function is residing in oracle package and returning Object which contains data.
    Can you please help meIt requires a great deal of Oracle jdbc driver specific code.
    [http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96654/oraint.htm#1012664]

  • Package and local object?

    Hello Gurus,
    While crating condition table(M/03), I am selecting field combinations(vend, plant, matl etc). After that, I am clicking on Generate button, it is asking me package name(pop up window). If i m avoiding that and clicking on local object, it is allowing me to create condition table.
    My doubt is :
    what is the use package name and local object in this context and why it is asking?

    Hello,
    You have to assign all the transportable development objects to any package (formerly called Development Class) and then only it becomes transportable. If you assign to $TMP package, then it will become local oject which is not transportable and no change request will be generated when your try to save the object.
    Package is nothing but a logical grouping of development objects.
    Thanks,
    Venu

  • Package and User Objects of reports/macros/...

    Hello,
    in my program I need to find out the package of a report. So for example I have a report with an include or macro statement. I know which report is included, but not its package.
    The table TRDIR seems to have no information about the containing package and TADIR contains user objects not reports.
    For example a global class ZCL_CAR is realized through reports like ZCL_CAR===(...)===CP and so on. Is there a way to obtain the package of arbitrary reports and the object in TADIR that contains that report? And do you know in which cases a user object can contain other reports?
    - thanks in advance

    Hi clemens heppner,
    Package is there in TADIR table itself
    See the field DEVCLASS
    Or elaborate more about ur requirement...
    Also pls have a look on below tables
    d010inc, trdir, eudb, title, d020t, trkey, tfdir, tmdir, tadir,
    Hope it will solve your problem
    Thanks & Regards
    ilesh 24x7

  • Package calling other package and passing back the control to calling package

    I have to loop through n number of package from a master package, any idea how to implement this?
    Master package Calling child package in for each loop , here I need to loop through n no or rec from a table and each record needs a call to child package and return control back to calling pkg.. need to do this till the end of all the records in a table.
    Child package1 -- Called perform some task and return control back to master package
    Child package2 -- Called perform some task and return control back to master package
    Child package n -- Called perform some task and return control back to master package
    Thanks
    Neil

    You'll need following
    1. A Execute SQL Task to retrieve the list of child packages to be called from table. Use your query inside, set ResultSet option as FullResultset and map the resultset index 0 to a object variable you create inside in the ResultSet tab.
    2. Use For Each Loop with ADO enumerator and map to earlier created object variable. Inside create variables to retrieve individual column values out one of which will contain package name
    3. Add a Execute Package Task inside the loop, choose Location as filesystem and map the Connection property to variable containing package name in expession window as per below
    I assume the table stores the full path of package variable otherwise you need to add another variable to hold the path and a third variable to concatenate path + packagename to get the fully qualified package path value and assign it to execute package
    task.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Import package and create view object

    Hi,
    How can i import package from another project and create a new view object with my package and with the imported package.
    Thanks
    null

    Hi,
    How can i import package from another project and create a new view object with my package and with the imported package.
    Thanks
    null

  • Return statement and accessing object's variable

    I want to return object variable but I am not sure how
    that is the constructor which takes int as arg.
    public class VHS implements MyInterface
    int year;
    public VHS (int year)
    this.year = year;
    Now I create new object in main class
    VHS currentMovie;
    currentMovie = new VHS(1995);
    int movieYear;
    System.out.println("enter the year of movie: ");
    movieYear=Keyboard.readInt();
    currentMovie.movieTitle(movieYear);
    System.out.println("passed as parameter when creating obj = new VHS(" currentMovie ")" );
    currentMovie.userInput();
    // it printout the year entered by user and works fine, however the thing above it dont, it is supposed to return the same thing
    // the problem is with currentMovie. I know I could do it differently, but I am curious if I could somehow printout the argument that was passed to the object using currentMovie.
    I quess I would need toString method but if I create it I got a message incompatible types :
    public String toString()
    return year; // year is an int
    If anyone is able to understand what I am trying to do, please respond
    and thank you , this forum already helped me very much, much more than my professors :) who are extremally weird

    public String toString()
    return year; // year is an int
    }Of course it says incompatible types. You're trying to return with an int, when you declared that the method should return String.
    String, although it is an object in Java, is treated differently. You can convert any primitive value to String easily. You also can convert any kind of objects to String as well.
    In case of primitives, one of the "wrapper" classes will be used to convert the primitive to string. In case of objects, the toString method of the object will be used to convert.
    Since you want to convert an int (primitive) to string, the easiest way perhaps:
    return "" + year;
    Since one of the operands has the type of String, the operator will change to be the "concatenate strings" operator, and the other operand will be converted to string. The returning type of the expression is String, and that's what it should be.
    You also might use the static method of the Integer wrapper class:
    return Integer.toString(year).

  • USE OF VARRAY and RECORD object vis-a-vis java.sql package

    Hi Geeks,
    I want to pass an array of java objects to a stored procedure and I will use them for table insertion or updation.
    Say I have a table TASK at DataBase end while the same TASK object is there at JAVA end.
    I want to pass an array of Task objects via my stored proc
    Please guide me how shall I use java.sql.Array and java.sql.SQLDataType etc etc. any mechanism in store!..
    Regards,
    Pratap
    London

    Thanks for you help
    I created the package and I get this error this time:
    javax.servlet.ServletException: bean test not found within scope
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:822)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:755)
         org.apache.jsp.login_jsp._jspService(login_jsp.java:68)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:268)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:277)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:223)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

  • Find AND return element of a TreeSet Object

    How can i find and return (a reference) to an element/object, that is contained inside a TreeSet?
    An existing method doesn't exist. I'll try to use the existing methods however to construct a new one. Is this possible? Is there anything else that i can do?

    > Is there anything else that i can do?
    You could iterate over the elements in your collection like this:
    TreeSet<Integer> ts = new TreeSet<Integer>();
    ts.add(new Integer(5));
    ts.add(new Integer(44));
    ts.add(new Integer(50));
    ts.add(new Integer(123));
    ts.add(new Integer(-6));
    Iterator<Integer> it = ts.iterator();
    while(it.hasNext()) {
        System.out.println(it.next());
    }

  • Development objects save automatically with out  asking package and TR

    Hi Experts,
    Development objects in R/3 dev server are saving automatically with out asking any package and TR .
    May be the development objects are saving in local package.
    How can we check in which package the objects are saving
    Please guide me how to solve this issue.
    Thanks&Regards,
    narasimha.

    Howdy,
    In that case check the Object Directory Entry to ensure that the objects are going to the correct package - you can also check Version Management to see which transport the objects are getting saved to.
    if the objects are already locked on a transport, when you make changes it won't ask for a new transport.
    Also try creating a new object and see if you get prompted for a transport then.
    Cheers
    Alex

  • [svn] 1366: BLZ-136 log an error and return no properties when IntrospectionException occurs when introspecting a value object

    Revision: 1366
    Author: [email protected]
    Date: 2008-04-23 14:45:47 -0700 (Wed, 23 Apr 2008)
    Log Message:
    BLZ-136 log an error and return no properties when IntrospectionException occurs when introspecting a value object
    Ticket Links:
    http://bugs.adobe.com/jira/browse/BLZ-136
    Modified Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/io/BeanProxy.java

    Hi,
    Please apply the following correction manually.
    1. Go to transaction ST03N
    2. Change user from 'Administrator' to 'Expert Mode'.
    3. Go to Collector and performance analysis -> Performance database
       -> Monitoring database -> Contents
    4. Search where further info contains the string "h/2"
    like the following monikeys:
      - 'days  h/2'
      - 'weeks  h/2'
      - 'months  h/2'  
    5. Double click on each, so that they become red and show ** delete
    6. Finally SAVE
    This will remove the corresponding database related history up to the deletion date. It will accumulate anew afterwards.
    How can I identify the monikey that has to be deleted?
    When you load the text of the dump and then jump off to the break point of the debugger you may find the error break point look like:
    "IMPORT HIST2 FROM DATABASE MONI(DB) ID MONIKEY".
    To find the right monikey entry causing the dump you can search for the word 'MONIKEY' within the text of the dump. This can be 'days  h/3' or
    'tabgrowth  2'...
    You can then go back to the procedure above and search where further info contains the monikey that you found in the text of the dump.
    997535     DB02: Problems with History Data.
    Award points if helpful.
    Thanks,
    Tanuj

  • Can I package and call a java object in the swf? (on the client)

    Hello,
    Can I package and call/execute a java object within the
    swf/adobe flash player?
    I want to embed a java object in my swf, and then whne the
    swf executes have it call the java object......
    E.

    ..... there are few instances where it would be nice to
    develope a single java object that can be used on the server and
    the client..... let's say for the case of server side validation,
    that could also be used by the client application for validation,
    instead of having to maintain 2 sets of validation logic in two
    different languages (java and AS).....

  • Ref cursor to object  and return to ref cursor

    how i will call object type from refcursor and return value to ref cursor .

    I need a help. please help me.
    takes oracle object types as input/output.
    PROCEDURE createserviceorder(
    P_serviceorder IN serviceorder,
    P_serviceid in out p_sm_type.serviceid,
    P_serviceorderid out p_sm_type.serviceorderid,
    Returnstatus out callstatus);
    The serviceorder, callstatus are oracle object types.
    The wrapper procedure for this API would be something like the example with pseudo code below
    PROCEDURE createserviceorderwrapper(
    P_serviceorder IN REFCURSOR,
    P_serviceid in out p_sm_type.serviceid,
    P_serviceorderid out p_sm_type.serviceorderid,
    Returnstatus out REFCURSOR)
    Map from ref cursor P_serviceorder to oracle object for serviceorder;
    Map from other data types to local variables;
    Call createserviceorder (pass the parameters here and get output….);
    Map output callstatus to its equivalent REF CURSOR variable;
    Return callstatus (and other out parameters if any )as REF CURSORS;
    }

  • I have a first gen ipod which is being recalled, and after going thru the process of registering my ipod I did not receive a barcode to send my old ipod back to apple with.  I wasn't sure if apple would send me some packaging to return the ipod.

    I have a first generation ipod nano which is being recalled, and after going thru the registration process was meant to get a barcode to send the old nano back with but it was blank.  In the registration process it also mentioned about apple sending out packaging to return the old ipod.  Just wondering if anyone has been thru this process and can offer advice?

    Yes they will send you a box with return label. I have been waiting for a month for a box. Just got off the phone with customer service and they said it would be another 3-4 weeks before I receive a box for replacement. Once I send it in it will take another 6 weeks to get the replacement after they receive it. I also hear it a 1st gen nano that will be the replacement.Apple says they were overwhelmed by the response to the recall.  Looks like they dropped the ball when they have to spend the money!

  • Package and error

    Hi was give this source code but when i compile i get this error it says package does not exist why is that my stack code seems to compile fine but my other code does not
    C:\Users\Owner\Desktop\Java Data Structures\Data Structures programs\ArrayStack.java:7: package java.foundations.exceptions does not exist
    import java.foundations.exceptions.*;
    ^
    C:\Users\Owner\Desktop\Java Data Structures\Data Structures programs\ArrayStack.java:10: cannot find symbol
    symbol: class Stack
    public class ArrayStack<T> implements Stack<T>
    ^
    C:\Users\Owner\Desktop\Java Data Structures\Data Structures programs\ArrayStack.java:10: interface expected here
    public class ArrayStack<T> implements Stack<T>
    ^
       package javafoundations;
        public interface Stack<T>
           public void push (T element);
           public  T pop ();
           public T peek();
           public boolean isEmpty();
           public int size();
           public String toString();
       package javafoundations;
       import java.foundations.exceptions.*;
        public class ArrayStack<T> implements Stack<T>
          private final int DEFAULT_CAPACITY = 10;
          private int count;
          private T[] stack;
           public ArrayStack()
             count = 0;
             stack = (T[]) (new Object[DEFAULT_CAPACITY]);
           public void push (T element)
             if (count == stack.length)
                expandCapacity();
             stack[count] = element;     
             count++;
           public String toString()
             String result = "<top of stack>\n";
             for(int index = count-1; index >= 0; index--)
                result += stack[index] + "\n";
             return result + "<bottom of stack>";
           private void expandCapacity()
             T[] larger = (T[]) (new Object[stack.length*2]);
             for (int index = 0; index< stack.length; index++)
                larger[index] = stack[index];
             stack = larger;
       }

    Given that the current package is "javafoundations", are you sure that you should be calling import with:
    import java.foundations.exceptions.*; and not instead call:
    import javafoundations.exceptions.*; ?
    Otherwise without seeing your code and your current package and directory hierarchy, it may be hard for us to know what is wrong.

Maybe you are looking for

  • Hyperlink in OO-ALV to Sap-Business- Workplace-Dokuments

    Hello specialists, I  have implemented hyperlinks to an oo-based ALV-List ( please see sample code later ). Now we have the problem that these hyperlinks only work in a local network-area. But we have also foreign-departments on our SAP-system, that

  • How do I make a Smart Folder for Applications last opened over a month ago?

    Can anyone give me some pointers on generating a Spotlight saved search/Smart Folder under Leopard that will give me all applications NOT opened in a given time period (say one month)? I can do Kind:Application and Last Opened:before a given date (1

  • How can I make my calendar private?

    I was added into a hosted calendar on my mac, but now every time I want to put in an event to my calendar, everyone in this group can see it in their calendars too. How can I make all the events in my calendar private?

  • Excise Duty handling for Inter company Stock Transport Orders in SAP 4.6C

    I want to handle Excise Duty handling for Inter company Stock Transport Orders in SAP 4.6C. I know that SAP has provided standard solutions in 4.7C by giving one standard table OIH09 which can be maintained through Customisation. In 4.6C, even the Go

  • App download error, always error for download ,can't clean temp

    right now, I'm Using Mountain lion as OS At App Store, I was try to download imovie , but it fail to completed the program and install its show error ("small") red word before install botton no matter how i did, just can't completed the program I did