Dlopen within JNI routine?

Hello,
I have a set of JNI-callable C++ routines in lib1.so,
From within one of these I would like to dlopen() a second
C++ library lib2.so.
dlopen() of this' second library always fails, with dlerror() reporting
'ld.so.1: java: fatal: JNI_OnLoad: can't find symbol'
This second library is purely for local use within a single
JNI-callable routine. Example code below.
How can I make this work please?
Thanks
-- Steve
sun01% java -version
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
sun01% CC -V
CC: Forte Developer 7 C++ 5.4 2002/03/09
sun01% more Jmaster.java
import java.util.*;
public class Jmaster
static
System.loadLibrary("lib1");
private native void lib1doit();
public static void main(String[] dummy)
Jmaster me = new Jmaster();
me.lib1doit();
sun01% more liblib1.cpp
#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>
#include <link.h>
#include <errno.h>
#include "Jmaster.h"
JNIEXPORT void JNICALL Java_Jmaster_lib1doit(JNIEnv* env, jobject obj)
char* dlerr;
fprintf(stderr,"Loaded liblib1.so from Java, about to dlopen liblib2.so\n");
// Open lib2
void* mydll = dlopen("liblib2.so",RTLD_NOW);
if ((dlerr=dlerror()) != NULL)
fprintf(stderr,"ERROR! dlopen of liblib2 failed: %s\n",dlerr);
exit(-1);
// Get call to 'lib2doit()'
void(*doit2)() = (void(*)()) dlsym(mydll,"lib2doit");
if ((dlerr=dlerror()) != NULL)
fprintf(stderr,"ERROR! dlsym of lib2doit failed: %s\n",dlerr);
exit(-1);
// Call 'doit2()'
doit2();
// Close lib2
dlclose(mydll);
if ((dlerr=dlerror()) != NULL)
fprintf(stderr,"ERROR! dlclose of liblib2 failed: %s\n",dlerr);
exit(-1);
sun01% more liblib2.cpp
#include <stdio.h>
extern "C" void lib2doit()
fprintf(stderr,"HELLO from lib2\n");
sun01% javac Jmaster.java
sun01% javah -jni Jmaster
sun01% CC -G liblib1.cpp -o liblib1.so -xildoff -library=Cstd -features=no%strictdestrorder -ldl -I/usr/j2sdk1.4.2/include -I/usr/j2sdk1.4.2/include/solaris
sun01% CC -G liblib2.cpp -o liblib2.so -xildoff -library=Cstd -features=no%strictdestrorder
sun01%
sun01% java Jmaster
Loaded liblib1.so from Java, about to dlopen liblib2.so
ERROR! dlopen of liblib2 failed: ld.so.1: java: fatal: JNI_OnLoad: can't find symbol
sun01%

"Johannes Hönig" wrote:
>
Hi
The specification said:
"The enterprise bean must not attempt to load a native library. This funciton is
reserved for the EJB container. Allowing the enterprise bean to load native code
would create a securtiy hole."
Is there a way that the container loads the library. So that I can access it by JNDI
or something simular?
Or do I blind trust the native code that he works fine?The standard approach is to have an RMI server object load the native
library and expose its interface (as a subinterface of Remote,
naturally). Your beans can then call this server via RMI and if they're
in the same container (a given, usually) then you will not incur any RMI
overhead (marshalling, serialization, etc).
Cheers,
Alexander Petrushko
mailto:[email protected]
Consulting Services available
Freemarker vs JSP:
http://javaworld.com/javaworld/jw-01-2001/jw-0119-freemarker.html

Similar Messages

  • Urgent: Selection-screen within Form routines

    Hi Experts,
        Within Form routines can i declare selection-screen statements. If no how should i declare my objects on selection screen within form routines bcoz when i declared with selection screen statements within form routines iam getting the error as "Within FORM routines and function modules, the SELECTION-SCREEN statement is not allowed".          
    Regards.
    AADI.

    Hi Aditya,
    U cannot use the Selection-screen in Forms and Function Modules.
    Try to use it in an include program and call it from ur program.
    Reward if Helpful,
    Jagadish.

  • How to clear the fields within copy routines in the copy contorl

    HI Gurus,
    I need to clear  the fields VBP-VBELV and VBAP-PSSNV within the copy routines 303 in the copy control between quote item and sales order item. I am not sure how to do that... Can some body please help.
    This is required because we had sales order and quote using the same requirement type which controls the special stock indicator. This leads to the stock getting update in quotation instead of the sales order, because the quotation is initiating document (collecting all cost etc).Now i know requirement should only be passed to production from sales order and not from quotation so i changed the config but there are some existing documents using same requirement type on both quotation and sales order and to correct those i need to clear fields VBP-VBELV and VBAP-PSSNV within the copy routines 303.
    Please help!
    Regards,
    Sam

    Hi ,
    just use this code in ur save button action handler , this will clear the field after entered in to the database and will ready for the next set of data.
    String password=wdContext.currentContextElement().getpwd();
    try{
         InitialContext ctx=new InitialContext();
         DataSource ds=(DataSource)ctx.lookup("jdbc/SAPJ2EDB");
         Connection con=ds.getConnection();
         con.setAutoCommit(false);
         Statement stmt=con.createStatement();
         int retIns = stmt.executeUpdate("insert into TMP_NEWUSERDETAIL(PASSWORD) values("password")");
         con.commit();
         con.setAutoCommit(true);
         wdContext.currentContextElement().setpwd(null);
    or use a seperate button to clear the field.
    wdContext.currentContextElement().set<Attributename>(null);
    Regards
    Vijayakhanna Raman

  • Dlopen and JNI

    Hi all,
    im trying to make a code, that looks like this:
    - javaInterface dynamic library: a library that serves as an interface to some java functions
    - caller: a library that uses the java interface above and call functions
    - executable: calls dlopen to open caller and its functions
    JNI crashes while starting the JVM. The interesting thing is, if instead of using dlopen I compile executable linking with caller, it works. I heard there was an incompatibility with Thread Local Storage and dlopen, and the libc RH EL uses has TLS. Can anyone shed a light here?
    Thanks
    Matheus

    It is quite old, yes. We have to stick to version 1.3, the actual version is
    1.3.1_04 IIRC, because of something coded against specific swing
    peculiarities.
    Of course threads are more efficient, that's their reason to exist.
    However, I haven't been able to find any doc about that, except a single
    sentence mentioning that on Solaris the implementation was not using
    native threads. BTW, I haven't been able to find the source code for
    Linux libjvm either.
    Our C application continuously calls into the JVM to get user's input.
    Should it use mutexes? Catch signals? I cannot work it out without some
    detailed description. Isn't that relevant for programmers? Or is just me
    looking in the wrong places?

  • Developing JNI routines for Windows - want your suggestions

    Everyone:
    After seeing several questions over and over again about how to do certain things that can only be done (or at least best be done using JNI), I am taking the time to develop some java/c code to access native Windows functions from Java.
    Please make suggestions as to functions you wish you had through java but do not. Common requests are: reading environment variables, setting system time, date, getting mac address, etc. The more you ask for, the more the library will be able to do. Once it's working, I'll post the code here for anyone who wants it.
    Thanks.

    Updated list of jni functions now supported (descriptions are self explanatory):
    JNIEXPORT jstring JNICALL Java_Win32Native_sayHello (JNIEnv *env, jobject);
    JNIEXPORT void JNICALL Java_Win32Native_setSystemTime (JNIEnv *env, jobject obj, jshort hour, jshort minutes);
    JNIEXPORT jstring JNICALL Java_Win32Native_getMACAddress (JNIEnv *env, jobject obj);
    JNIEXPORT jlong JNICALL Java_Win32Native_createMutex (JNIEnv *env, jobject obj, jstring strMutexName);
    JNIEXPORT jlong JNICALL Java_Win32Native_getLastError (JNIEnv *env, jobject obj);
    JNIEXPORT jlong JNICALL Java_Win32Native_getErrorCode (JNIEnv *env, jobject obj);
    JNIEXPORT jboolean JNICALL Java_Win32Native_isRunning (JNIEnv *env, jobject obj, jstring strMutexName);
    JNIEXPORT jstring JNICALL Java_Win32Native_getWindowsDirectory (JNIEnv *env, jobject obj);
    JNIEXPORT jstring JNICALL Java_Win32Native_getSystemDirectory (JNIEnv *env, jobject obj);
    JNIEXPORT jstring JNICALL Java_Win32Native_expandEnvironmentStrings (JNIEnv *env, jobject obj,jstring strSource);
    JNIEXPORT void JNICALL Java_Win32Native_lockWorkstation (JNIEnv *env, jobject obj);
    JNIEXPORT jstring JNICALL Java_Win32Native_getFileTime (JNIEnv *env, jobject obj, jstring strFileName);
    JNIEXPORT jlong JNICALL Java_Win32Native_getTickCount (JNIEnv *env, jobject obj);
    JNIEXPORT jdouble JNICALL Java_Win32Native_queryPerformanceFrequency (JNIEnv *env, jobject obj);
    JNIEXPORT jdouble JNICALL Java_Win32Native_queryPerformanceCounter (JNIEnv *env, jobject obj);
    JNIEXPORT jint JNICALL Java_Win32Native_getHwnd(JNIEnv *env, jobject obj, jstring title);
    JNIEXPORT void JNICALL Java_Win32Native_setWindowAlwaysOnTop(JNIEnv *env, jclass obj, jint hwnd, jboolean flag);
    JNIEXPORT jstring JNICALL Java_Win32Native_getDriveType(JNIEnv *env, jclass obj, jstring strPath);
    JNIEXPORT jlong JNICALL Java_Win32Native_getDiskFreeSpace(JNIEnv *env, jclass obj, jstring strPath);
    JNIEXPORT jstring JNICALL Java_Win32Native_getEnvironmentVariable(JNIEnv *env, jclass obj, jstring strVariable);
    JNIEXPORT jboolean JNICALL Java_Win32Native_setEnvironmentVariable(JNIEnv *env, jclass obj, jstring strVariable, jstring strValue);
    JNIEXPORT void JNICALL Java_Win32Native_rebootPC (JNIEnv *env, jobject obj);
    JNIEXPORT jboolean JNICALL Java_Win32Native_moveFile(JNIEnv *env, jclass obj, jstring strSource, jstring strDestination);
    JNIEXPORT jboolean JNICALL Java_Win32Native_installFilters(JNIEnv *env, jclass obj, jint hInstance, jstring strTitle, jlong tmNow);
    JNIEXPORT jboolean JNICALL Java_Win32Native_killFilters(JNIEnv *env, jclass obj);
    JNIEXPORT jlong JNICALL Java_Win32Native_getCurrentTime(JNIEnv *env, jobject obj);
    JNIEXPORT jlong JNICALL Java_Win32Native_getHinstance(JNIEnv *env, jobject obj, jstring title);
    JNIEXPORT jint JNICALL Java_Win32Native_createProcess(JNIEnv *env, jobject obj, jint nMode, jstring cmdproc, jstring buff );
    JNIEXPORT jint JNICALL Java_Win32Native_createLink(JNIEnv *env, jobject obj, jstring strPathObj, jstring strPathLink, jstring strDesc );
    JNIEXPORT void JNICALL Java_Win32Native_launchDefaultBrowser(JNIEnv *env, jobject obj, jstring strURL );
    JNIEXPORT jboolean JNICALL Java_Win32Native_emptyBrowserCache(JNIEnv *env, jobject obj );
    JNIEXPORT jboolean JNICALL Java_Win32Native_sendFileToRecycleBin(JNIEnv *env, jobject obj, jstring strFilePath);
    Thanks to those who made suggestions. Certainly open to more ideas.

  • Calling a function module from within a transformation routine

    I created a routine within a transformation and experience the following weird behavior now:
    When I call a function module within that routine, the load fails with the following error message:
    Exceptions in Substep: Rules
    When I click on the button next to this text, it point me to my function module call.
    What I do not understand is, that the following two scenarios work fine:
    - Having the same function call (with fake values) in a plain ABAP program works beautilfully
    - If I copy the content of my function module directly into my transformation routine, everything works fine as well
    I am now wondering whether the routine does not "see" the function module I am calling. The module resides in a different package. Is that a problem? Do I have to include something first?
    Here is the code that calls my FM (
    CALL FUNCTION 'Z_CA_CONVERT_US_COST'
         EXPORTING
            PSOURCEVAL                      = SOURCE_FIELDS-/BIC/USFRZMFC
            PSOURCEUOM                      = SOURCE_FIELDS-BASE_UOM
            PUSITM                          = SOURCE_FIELDS-/BIC/USITM
            PTARGETUOM                      = PRODUCTION_UOM
         IMPORTING
            PTARGETVAL                = RESULT
         EXCEPTIONS
           CONVERSION_NOT_MAINTAINED = 1
           PARTNO_NOT_FOUND          = 2
           OTHERS                    = 3.
    Thanks a lot for your help. Points will be assigned.
    Dennis

    Good catch, BI Learner. This was exactly it: when assigning the values from SOURCEFIELDS directly to the import/export parameters, you have to make sure that the types are EXACTLY the same, otherwise it will not work (the routine stops with an error when calling the FM, but there is no dump).
    Therefore, to solve my problem, I created the declarations precisely as expected by the FM and assigned the values to these fields:
    DATA:
          SOURCEVAL TYPE  /BIC/OIINVQTY,
          SOURCEUOM TYPE  /BIC/OIUSUOM,
          USITM TYPE  /BIC/OIUSITM,
          TARGETUOM TYPE  /BIC/OIUSUOM,
          CONVERTED_COST TYPE  /BIC/OIINVQTY.
    DATA PRODUCTION_UOM TYPE /BIC/OIUSUOM.
    " get the Production UOM
        SELECT SINGLE I~/BIC/USPRDUOM
          FROM /BIC/PUSITM AS I
          INTO PRODUCTION_UOM
          WHERE I~/BIC/USITM = SOURCE_FIELDS-/BIC/USITM AND I~OBJVERS = 'A'.
        IF ( SY-SUBRC = 4 ). " no records found
          "RAISE PARTNO_NOT_FOUND.
          RAISE EXCEPTION TYPE CX_RSROUT_SKIP_RECORD.
        ENDIF.
    " load the parameters
        SOURCEVAL = SOURCE_FIELDS-/BIC/USFRZMFC.
        SOURCEUOM = SOURCE_FIELDS-BASE_UOM.
        USITM = SOURCE_FIELDS-/BIC/USITM.
    " then you can call the FM
        CALL FUNCTION 'Z_CA_CONVERT_US_COST'
          EXPORTING
            PSOURCEVAL                = SOURCEVAL
            PSOURCEUOM                = SOURCEUOM
            PUSITM                    = USITM
            PTARGETUOM                = PRODUCTION_UOM
          IMPORTING
            PTARGETVAL                = CONVERTED_COST
          EXCEPTIONS
            CONVERSION_NOT_MAINTAINED = 1
            PARTNO_NOT_FOUND          = 2
            OTHERS                    = 3.
    " ... [do the rest]
    Thanks for your help,
    Dennis

  • Test for Permitted Characters in Transformation Routine

    Hello,
    Background: There is a data quality issue when loading 3rd party data to BW, which cannot be solved at source. Therefore, initial transformation rules when loading to data warehouse level DSO, should identify and deal with error values.
    Possible Solution: Test validity of value within transformation routine via a custom function module.
    Execution: Function module would require to check lowercase character handling of target InfoObject (RSDCHABAS-LOWERCASE) and scan source value against permitted character set (RSKC).
    Questions: How can the permitted list of characters be returned within transformation routine? Is there an available delivered function module to handle accessing permitted character set?
    I would appreciate any answers to the above questions or alternative suggestions to the above strategy.
    Thanks -
    Brendan.

    There is a function module "RSKC_ALLOWED_CHAR_GET". Use SE37 to check it out.

  • Is it possible to call a class in a jar file from JNI environment?

    Hi
    Is it possible to call a class in a jar file from JNI environment?
    Thanks in advance.

    Could you explain a bit more what you are trying to do? (In other words, your question is vague.)
    o If your main program is written in C, you can use JNI to start a JVM, load classes from the jar of your choice, and call constructors and methods of the objects defined in the jar.
    o If your main program is java, and has been laoded from a jar, a JNI routine can call back into java to use the constructors and methods of classes defined in the jar(s).

  • Error in IT0764 Poortwachter - form routine check_generate

    When trying to create a record in infotype 0764 Poortwachter (parallel to an illness record in 2001), we get an error message when trying to save:
    “Other exception within form routine CHECK_GENERATE” Message no. 5N016
    Does anyone have ideas what could be causing this error?
    (release 7.0.)
    Thanks in advance for your reply!
    Regards, Nanja

    Solved
    Message was edited by:
            Nanja Schouten

  • Problem calling C# dll using JNI

    Hi,
    I'm trying to call C# functions from a JNI interface. I built a C++ DLL to link the Java and C# calls together, but I am always getting the same error. Calling the C# DLL directly from the C++ code (compiled as an application) does not cause this error. I have to be able to connect our java application with a third party C# DLL, so I cannot just right the DLL directly in C++... Here is my code:
    //C# Class Library::
    namespace ClassLibrary2
         /// <summary>
         /// Summary description for Class1.
         /// </summary>
         public class Class1     
              public Class1()
                   // TODO: Add constructor logic here
              public void Bidon1()
         MessageBox.Show("Affiche", "Toi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
    //C++ DLL::
    #using "ClassLibrary2.dll"
    BOOL APIENTRY DLLMain(HANDLE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved) {
      return TRUE;
    JNIEXPORT void JNICALL Java_com_blablabla_CommJNIDLL_Init
    (JNIEnv * enivronmt, jobject obj)
         new ClassLibrary2::Class1();
         (new ClassLibrary2::Class1())->Bidon1();
    Olivier dit :
    //Java JNI Calls::
    //From CommJNIDLL::
         static {
              System.loadLibrary("MyCDLL");
         public native void Init();     If I comment the calls within the C++ DLL, they get fired, and no exception is raised. What am I doing wrong?
    Thanks, bumpert

    Hi,
    I am currently also trying to call some C# code within JNI. So far I have managed to call some simple C# code in Java through JNI based on the example on codeproject. However, now my problem is that instead of doing JNI-->C++->M C++->C#, I need to include one more reference to some other DLLs in the C# code. Therefore I need to do JNI-->C++-->M C++-->C#-->DLL. So is there a way to do this? I can compile all the code sucessfully in C++, but when I try to execute the .netmodule (for C#) and DLL for C++ through JNI in Java, it gives me an error. I have tried to put all the relevant DLLs in the same directory, but it still does not work. So is there someway to combine the .netmodule of C# with the DLLs it references to? Perhaps that could solve the problem? I am new to C# and C++, really appreciate if someone can give some advices since there's nothing much on the net.
    thanks,
    Lee

  • WinMain events in JNI

    I am currently working on an application that uses DirectSound (JavaSound does not have the capabilities that I need). In order for the DirectSound buffer
    to be filled at specified play blocks, I have to pass it the handle for my application. So far this is fine...I can get my java window handle easily enough from my JNI code and pass it to the DirectSound buffer.
    Now comes the trouble...the callbacks that DirectSound makes are to WinMain. I cannot set a custom callback, I only give it the handle to my application. So I see two options
    1. create an invisible window that exists for the purpose of these callbacks
    - this will not work becase I cannot call my own JNI callback method for
    refilling the buffer from a separate application (at least not without great
    difficulty and the callback needs to be fast)
    2. Somehow regsiter a callback within JNI with the JVM so that I will be notfieid if the JVM (which has the WinMain for the application) catches my events
    Any ideas as to how to do the second or possibly another way to catch the WinMain events in my java app (within my JNI dll)?

    there wont be events for session method, but u have to use these function modules
    BDC_OPEN_GROUP
    BDC_INSERT
    BDC_CLOSE_GROUP
    Regards
    - Gopi

  • Filter in DTP load from DSO to cube by Forecast version not working ?

    Hi All
    Can any help on the below code I did to filter data update from DSO to Cube in DTP - to filter by  next period forecast version. This code is not working it is loading data pf present forecast version also  Can any one help please
    data: l_idx like sy-tabix.
    data: L_date type sy-datum,
          t_gjahr  type t009b-bdatj,
          t_buper  type t009b-poper,
          1_period(6) type c.
              read table l_t_range with key
                   fieldname = 'ZFCSTVERS'.
              l_idx = sy-tabix.
       clear: t_buper, t_gjahr.
        L_date = sy-datum.
        call function 'DATE_TO_PERIOD_CONVERT'
          EXPORTING
            i_date  = L_date
            i_periv = 'Z1'
          IMPORTING
            e_buper = t_buper
            e_gjahr = t_gjahr.
    *---> Check if the period is 012, then increase the year by 1 and set
    *period to 001.
        if t_buper = '012'.
          t_gjahr = t_gjahr + 1.
          t_buper = '001'.
        else.
    *---> Increase just the period by 1.
          t_buper = t_buper + 1.
        endif.
        concatenate t_gjahr t_buper+1(2)  into 1_period.
        l_t_range-fieldname = 'ZFCSTVERS'.
        l_t_range-low = 1_period.
        l_t_range-sign = 'I'.
        l_t_range-option = 'EQ'.
           append l_t_range.
              p_subrc = 0.
    sk
    Edited by: SK Varma Penmatsa on Jan 23, 2012 2:30 PM

    Hi Praveen/Raj,
    Basically PCS_PER_PACK is a KF i have in the DSO, which i use to calculate the total number of pieces which i store in a KF in the cube. The transformation rule to calculate TOTAL_PCS is a routine.
    within this routine i multiply PACKS * PCS_PER_PACK to calculate the figure. I do not store PCS_PER_PACK in the cube.
    is it this rule that you want me to check whether aggregation is set to SUM or overwrite? Also this rule should add up the total pcs. if I say overwrite then it might not give me the desired result?
    Thing which i cannot figure out is since the transformation rules go record by record why would it add up the PCS_PER_PACK figure before calculating?
    I cannot access the system at the moment. as soon as i can i will check on it and get back to you.
    thanks once again for you're quick response to my need.
    regards
    dilanke

  • Amount of Days

    Hello,
    i have two characteristics (start-date & end-date) defined as date and i have to calculate a new characteristic, called "amount of days" by a routine. exists a function module which i can call within a routine to get the amount of days?
    Start-Date      End-Date     Amount of Days
    01.01.2005     31.12.2005  365
    12.03.2002     26.04.2005  116

    Hi
    What is your issue..subtraction of date works fine in BW
    Days = DAT1 - DAT2
    Thanks
    Tripple k

  • Thanks bschauwe, but more questions on your post...

    You said in a helpful reply to my post:
    public class TestDataObject {
    public void setX(int val) {
    this.x = val;
    public int getX() {
    return this.x;
    }Your native methods take one of these objects as a parameter, or return one of these objects.
    public class Test {
    public native void setTestData(TestDataObject obj);
    public native TestDataObject getTestData();
    }The TestDataObject constructor, getter, and setter methods can all be invoked with JNI (C)
    code. In other words, to return the test data, you
    o use JNI to call the TestDataObject constructor.
    o Use JNI to call the setters to fill in the data.
    o Return the reference to the TestDataObject.
    I was curious bout the use JNI to call the TestDataObject constructor. Im not sure what u meant, I know there was a JNI call that could be done from C that was titled: Invoking a Java Method. IS that what you meant? like Native access to an objects own methods?
    If so I can check that chapter out in the book, if not then im still lost (as most this new JNI stuff is all greek to me)
    This is what i was starting to write before I realized I might be wrong in interpreting what you said:
    JNIEXPORT void JNICALL Java_AbfaRegion_setJSource
      (JNIEnv *env, jobject thisObj, jobject actualObj)
         jclass clazz = env->GetObjectClass(actualObj);
         jfieldID fid= env->GetFieldID(clazz, "height", "I");
         env->SetIntField(actualObj, fid, myValFromStruct);
    }Here i was explciting trying to set private members of the JSource class, thats not what u meant really is it?
    Thanks for any help again,
    Shane

    Let's assume you create a java class called TestDataObject. You define a constructor, a couple of getters, and a couple of setters.
    Using TestDataObject content in a JNI routine: You pass a TestDataObject to your native routine as a parameter. In the C code, you use JNI functions to invoke the (java) methods on the java object, getting back data types like jint, jlong, jstring, ....
    Using TestDataObject to pass back results from a JNI routine: In the C code, you use JNI functions to invoke the (java) methods of a TestDataObject. But wait! First you use JNI functions to create a new TestDataObject! In other words, JNI helps you invoke the constructor method.
    A C function can invoke java methods using JNI calls in roughly the following sequence:
    o Call a JNI function to get a reference to the class - a kind of "type" record. FindClass or GetObjectClass.
    o Call a JNI function to get the ID of the method you want to invoke: GetMethodID (class is a parameter)
    o Call a JNI function to invoke the method. CallxxxMethod (class and method ID are parameters to this function. If you are not calling a constructor or a static method, then instead of the class, pass an object pointer.)
    Finally: You can do what your code shows - shove data right into private data members of java classes. I choose instead to invoke getters and setters.

  • How to use selection-screen in function module?

    Hello
    I've created a function module and i have to create within the function module a selection-screen(with select-options for entering data) but i get an error that within form routines and function modules this statement is not allowed.
    Can anybody help?
    thanx

    Hi,
       YOu cannot create a selection screen withing a function module.
    What you can do is to call a screen , say '0100'.
    Create a screen '0100' and then include a selection -screen as a subscreen in that screen.
    Regards,
    Ravi

Maybe you are looking for

  • News on Reserved iPhone 4?

    I reserved a 16 GB iPhone 4 exactly a week ago and the Apple Store person said I would get an email in a week or two for when the phone will be in the store when I put my name down. Anyone have any news about when there should be iPhones available in

  • Error: java.lang.NoClassDefFoundError: org/jdom/JDOMException

    Dear Sir/Madam, I have installed Library software “NewGenLib” which support Java. The software is running well in the server as well as some other client pc. When I am trying to install in some other client following error is coming and unable to run

  • Downloaded firefox 4.0.1 on a dell with windows vista says "unable to connect" why?

    all I did was download the new version of ifrefox 4.0.1 and when it went to start up it would not connect. internet explore is fine and I have a connection. not a problem with my LAN.

  • Creating a scenario

    Hello all, I want to set up the following situation in SAP. There are several businesses  - each with no more than 30 employees. Each of these employees must be tracked (HR). Time information would be collected for each employee. The thought was to g

  • Convert BAPI Return to Faults?

    Hi, For the development of Web Services, the use of Fault messages is preferred to report errors.  Proxies (Java and ABAP) can return Fault messages, that in turn can be returned through the Web Services. However, BAPI's are not able to return Fault