New to JavaFX--Calling Java objects from JavaFX

Hello,
I am a Java developer who is new to JavaFX. I am having no luck in finding a tutorial that exhibits more than just fun effects. I need to be able to call existing classes from a JavaFX GUI. Can anyone offer any assistance on this? It's very frustrating because this should be a simple task. If we are faced with having to rewrite existing code, we will probably be forced to abandon JavaFX. I hope this is not the case.
Thanks!

The answer is yes. The impementation is -
If you have classes that you keep as library classes that you intend for use irrespective of the platform, then I suspect that you have already written them with no view content. For those, including them in your JavaFX is not really different to using them in Java. I am just learning JavaFX too and the most important lesson for us to learn is that 'JavaFX is Java with FX on the end of it'. I know the strickly come dancing set will say 'oh but what about types'. Well I have found no trouble at all with types, basic or my own, we are in object world so long as the compiler has the class object and we have all stuck to the rules then it has all it needs to act on your objects.
So your non-View classes can be used as you always use them -
import mylib'
var somethingFromMyLibOfClasses = new mylib.ClassThatDoesSomethingVeryClever();
It is then just a matter of arranging a FX trigger of some kind (trigger/event/timer/bind) to call the function in your library.
Which triggers and when are the part I am still finding difficult. The basic GUI events are fine (onMouseClick etc), it is 'bind' that is troublesome.
Binding something in your code to a 'property' of the display element is easy enough, but binding where you have no external variable that relates to 'Property' value is less clear. For example you may have to change a form contents due to a trigger sent from a remote database.
You have some in the forum talking of 'resize your window a few pixels to force a redraw so that your code can be retriggered'. Others are using timers at high tick frequency to for an update. such as changing a property that you can't see.
That is utter nonsense, if you look up the proper description of bind then it becomes obvious. Bind can be a two way thing, you can change a value in your element from outside, but you can also change a value outside of your element from within your element.
Equally that trigger can be your own code. There is no need of trickery to update Scenes, the writters of JavaFX already have it sussed.
The Sun web site has some great tutirials, but as a personal favourite that cleared up som of the junk about JavaFX that was building up in my mind I reccommend you spend a bit of time here [JavaFX Refference|http://openjfx.java.sun.com/current-build/doc/reference/JavaFXReference.html]
Not the best layout you will ever see, but it is the best source I have found, then if you use that along side [Master Index|http://java.sun.com/javafx/1.2/docs/api/javafx.stage/javafx.stage.Stage.html] hopefully you will find, as I did, that you do not have to think differently to make use of the FX on the end of Java.

Similar Messages

  • How to call Java Objects from ESB?

    I don't know whether its possible but if there is a way please let me know I'd really appreciate.
    I'm sending message to the JMS queue and I've created JMS adapter that I expect to be triggered when message gets into the queue. The message is an xml file that I read and look up some values that are Java classes and methods that I want to call. So how do I configure ESB to call Java Classes. I tried to look at the routing rules.
    Regards

    You could create the wsdl yourself and instead of the soap:binding use the java:binding
    not sure if this works...just a guess.

  • Calling a java object from a store procedure

    I have written a translation object in java that takes a $en_var in and returns its path.
    What I need to do is call that object from a PL/SQL store procedure. All the examples I have seen treat the store procedure as a wrapper around the java object.
    But in my store procedure calling the object is only one part of the procedures role:
    The store procedure code is :
    CREATE OR REPLACE PROCEDURE WRITE_TO_FILE(in_file_name IN VARCHAR, in_en_var IN VARCHAR)
    file_handle UTL_FILE.FILE_TYPE;
    file_location VARCHAR2(50)
    BEGIN
    I need to be able to call the javaobject translation here
    file_location = translation.translatePath(in_en_var)
    file_handle := UTL_FILE.FOPEN(file_location, in_file_name, 'w');
    dbms_output.put_line ('input file name opened file name' ||in_file_name ||'-->' ||in_file_location);
    UTL_FILE.put_line(file_handle,'Hello Tony);
    UTL_FILE.FCLOSE(file_handle);
    END WRITE_TO_FILE;
    I call the java class method translatePath with a string the en_var which returns the path as a string which is then passed as a parameter to UTL_FILE.FOPEN.
    Thanks for any help
    Tony

    No Longer the problem

  • How to reference multiple instances of the same Java object from PL/SQL?

    Dear all,
    I'm experimenting with calling Java from PL/SQL.
    My simple attempts work, which is calling public static [java] methods through PL/SQL wrappers from SQL (and PL/SQL). (See my example code below).
    However it is the limitation of the public static methods that puzzels me.
    I would like to do the following:
    - from PL/SQL (in essence it needs to become a forms app) create one or more objects in the java realm
    - from PL/SQL alter properties of a java object
    - from PL/SQL call methods on a java object
    However I fail to see how I can create multiple instances of an object and reference one particular object in the java realm through public static methods.
    My current solution is the singleton pattern: of said java object I have only 1 copy, so I do not need to know a reference to it.
    I can just assume that there will only ever be 1 of said object.
    But I should be able to make more then 1 instance of an object.
    To make it more specific:
    - suppose I have the object car in the java realm
    - from PL/SQL I want to create a car in the java realm
    - from PL/SQL I need to give it license plates
    - I need to start the engine of a scpecific car
    However if I want more then 1 car then I need to be able to refrence them. How is this done?
    Somehow I need to be able to execute the following in PL/SQL:
    DECLARE
    vMyCar_Porsche CAR;
    vMyCar_Fiat CAR;
    BEGIN
    vMyCar_Porsche = new CAR();
    vMyCar_Fiat = new CAR();
    vMyCar_Porsche.setLicensePlates('FAST');
    vMyCar_Porsche.startEngine();
    vMyCar_Fiat.killEngine();
    END;
    Thanks in advance.
    Best Regards,
    Ruben
    My current example code is the following:
    JAVA:
    ===
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED CODAROUL."RMG/BO/RMG_OBJECT" as package RMG.BO;
    public class RMG_OBJECT {
    private static RMG_OBJECT instance = new RMGOBJECT();
    private String rmgObjectNaam;
    private RMG_OBJECT(){
    this.rmgObjectNaam = "NonDetermined";
    public static String GET_RMGOBJECT_NAAM () {
    String toestand = null;
    if (_instance == null) {toestand = "DOES NOT EXIST";} else { toestand = "EXISTS";};
    System.out.println("instance : " + toestand);
    System.out.println("object name is : " + _instance.rmgObjectNaam);
    return _instance.rmgObjectNaam;
    public static Integer SET_RMGOBJECT_NAAM (String IN)
    try
    _instance.rmgObjectNaam = IN;
    return 1;
    catch (Exception e)//catch
    System.out.println("Other Exception: " + e.toString());
    e.printStackTrace();
    return 5;
    } //catch
    PL/SQL Wrapper:
    ==========
    CREATE OR REPLACE FUNCTION CODAROUL.SET_RMGOBJECT_NAAM(NAAM IN VARCHAR2) return NUMBER AS
    LANGUAGE JAVA NAME 'RMG.BO.RMG_OBJECT.SET_RMGOBJECT_NAAM (java.lang.String) return java.lang.Integer';
    Calling from SQL:
    ==========
    CALL dbms_java.set_output(2000);
    select CODAROUL.GET_RMGOBJECT_NAAM() from dual;
    Edited by: RubenS_BE on Apr 6, 2012 5:35 AM
    Edited by: 925945 on Apr 6, 2012 5:41 AM

    You can do this by manually creating a new iterator binding in your binding tab.
    So instead of dragging the VO directly to the page, go to the binding tab, add a new executable iterator binding, and point to that one from your ELs in the page itself.

  • Cannot instantiate java object from c funtion

    Hi guys,
    I need some help on the following problem :
    i want to call java method from c funtion using jni. My java method should instantiate another class on java side. Here's an example.
    public class KMS {
        public int problemMethod() {
               System.out.println("We are in 1"); // This is written on the screen
               Parser parser = new Parser();
              System.out.println("We are in 2"); // This is not, but no problem on java side
             return 1;
    public class Parser {
       // This class parse an XML document
    }And Here's my c code :
    void main(int argc, char *argv[])
         // create JVM with success
    jclass cls =(jclass) env->NewGlobalRef (env->FindClass ("KMS"));
         if (cls == 0)
                              printf("cannot find cls \n");
         jmethodID mid = (env)->GetMethodID(cls, "<init>", "()V");
         if (mid == 0)
              printf("cannot find initialization\n");
         jobject jobj = (env)->NewObject(cls, mid);
         if (jobj == 0)
              printf("cannot find object\n");
         jmethodID mymid = (env)->GetMethodID(cls, "problemMethod", "()I");
         if(mymid == 0)
              printf("cannot find problemMethod\n");
         jint result = (env)->CallIntMethod(jobj, mymid);
         printf("result %d\n", result);
    }I get the following when I run c program :
    We are in 1
    I get no error msg, and the return value is 0. It seems that the JVM cannot instantiate class Parser. But the problem is when I run java code only, from a java main, it works fine. Do I need to implement another things in c side in order to be able to instanciate class Parser.
    Thanks a lot for your help,
    javaFriendly

    1. You have left out some important facts (like where
    is your java code establishing the native method?
    The native method and java codes can communicate. I can see the first System.out.println result when calling native method. My problem is for the second one. Class Parser cannot be instantiate. (But the java code is correct, I try it when I use only java).
    2. Since your native code returns nothing, why would
    you expect ANY particular value to be returned?
    I was talking about return in java side. My java code should return me 1, but in native method a see a 0. This shows that there's an error when calling java.
    3. I would not count on the printf statements. You
    probably - sometime - should see some output, but if
    you don't do a "flush" after ech one, then there is a
    good chance it will not appear where you expect it.Can you tell me how to use "flush" in order to see all results,
    Best regards
    Java friendly

  • Calling Java API from ABAP using JCo

    I need to call Java API from ABAP & BSP also. For this I have got useful information related to JCo from following blog:
    /people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection
    But, I am facing one problem. On executing Java program myExample5.java (recommended by Gregor Wolf) from command line I get following error message:
    Server JCOSERVER01 changed state from [ STOPPED ] to [ STARTED ]
    Exception in server JCOSERVER01:
    com.sap.mw.jco.JCO$Exception: (129) JCO_ERROR_SERVER_STARTUP: Server startup failed at Thu Apr 26 13:46:32 IST 2007.
    This is caused by either a) erroneous server settings, b) the backend system has
    been shutdown, c) network problems. Will try next startup in 1 seconds.
    Connect to SAP gateway failed
    Connect_PM  TPNAME=JCOSERVER01, GWHOST=gateway, GWSERV=3300
    LOCATION    CPIC (TCP/IP) on local host
    ERROR       hostname 'gateway' unknown
    TIME        Thu Apr 26 13:46:32 2007
    RELEASE     640
    COMPONENT   NI (network interface)
    VERSION     37
    RC          -2
    MODULE      ninti.c
    LINE        336
    DETAIL      NiPGetHostByName2: hostname 'gateway' not found
    SYSTEM CALL gethostbyname_r
    COUNTER     1.
    Can anyone please help me out. Do I need to do any setting?
    I'll surely reward points.
    Thanks & Regards,
    Nilesh Kumar

    Hi Nilesh,
    From the error i think that the error is with the hostname.
    Please enter the the Application Server IP/Hostname.
    If you are loggin to SAP System "XX1" from SAP GUI. Then click the change Item tab and see Application server name/IP let say "XX2" for hostname or "xx.xx.xx.xx" for IP.
    Replace <i>srv[0] = new Server("gateway","sapgw00","JCOSERVER01",repository);</i>
    with <i>srv[0] = new Server("XX2","sapgw00","JCOSERVER01",repository);</i>
    If App Server is IP then replace with
    <i>srv[0] = new Server("xx.xx.xx.xx","sapgw00","JCOSERVER01",repository);</i>
    Let me know if it is throwing any error.
    Thanks,
    Prashil

  • How to call java method from workflow script?

    Hi
    I have a requirement of updating field value 'Document Status' based on review/approve of content from Workflow and hence need to update the version number. For that I need to call my java method from workflow during submit of review/approve condition. Please let me know how to call java method from workflow?
    Is there any alternative better way to achive this requirement from workflow? Please suggest.
    Thanks,
    Sarang

    OK. So, I think we can all conclude that you don't need to call any Java method, can't we? And, that wfUpdateMetadata is the command that will update your metadata.
    Now, the question is what are its arguments. It has two - the first is the name of a custom metadata field to be updated (let's suppose that one field is called xMinorVersion, and the other xMajorVersion), the other is the new value, e.g. <$wfUpdateMetaData("xMinorVersion", "New value.")$>As for new value - do you insist on using strings? Since you want to increase the value, it would be more convenient to work with numbers. For instance, with integers you could go with <$wfUpdateMetaData("xMinorVersion", xMinorVersion + 1)$>With strings you will need to convert it to numbers and back to strings. Besides, what happens if you have more than 100 minor versions? (you mentioned you want to add 0.01, but that would finally increase the major version, wouldn't it?) So, I think these two numbers are independent (perhaps, with exception that increase on the major version set the minor version to .00).
    If you want to present it, you can use profiles that will construct for you the representation 2.304 out of MajorVersion = 2, MinorVersion = 304
    Solved?

  • How can i return an object isn't java object from webservice????

    Hi !
    I have a problem in my Project. When i call method return a java object from webservice , it 's too easy. But when i create my own object (ex:ClientRequest.class) , it doesn't work exactly T_T . When i return that object (on client, doesn't have ClientRequest.class) , i cann't access its static variables.
    How can i do it ??
    Please help me !
    Thanks a lot !!!!!
    class ClientRequest {
    public static int i;
    public static String s;
    public ClientRequest() {
    }

    You can use REFCURSOR type for this. In java SQL TYPES this is available too. In your PLSQL use REFCURSOR for that array and then take the same from java code. Look in the servelet programming book for this SQLTYPE and see PLSQL for handling refcursors. We have done this way and it works.

  • Access Java object from Javascript

    Hi
    I'm trying to invoke a Java object from Javascript (scriptengine and all that).
    I want to add scripting features to a GeneXus Java generated app... and I have very basic skills on java too. Sorry for that ;o).
    This is the java code to pass "params" to the scriptengine:
    engine.put("remoteHandle",remoteHandle);
    engine.put("context", context); The remoteHandle (int) and context (com.genexus.ModelContext) pass trough all the gx-java generated programs.
    This javascript works fine:
    importClass(Packages.uftestjs);
    new uftestjs(remoteHandle).execute( ) ;The remoteHandle conversion is ok (javascript-number to int). The context is optional.
    But if I want to pass context:
    importClass(Packages.uftestjs);
    new uftestjs(remoteHandle, context).execute( ) ;Fails with this:
    "javax.script.ScriptException: sun.org.mozilla.javascript.internal.EvaluatorException: Java constructor for 'uftestjs' with arguments 'number,javax.script.SimpleScriptContext' not found."
    Obviously, no conversion is possible with context (javax.script.SimpleScriptContext to com.genexus.ModelContext).
    There is some way to reference de original context, by the object Id??? or something like that???
    Thanks in advance for any replies!!!
    Greetings from Chile. (I hope you can understand my english!)

    Hi
    Well, since this topic is about java programming I think the place is right here.
    (I use some tricks to embed java statements in genexus objects...)
    I will try to get some help at Artech (GX) on how to build something... to get the conversion needed.
    But they are not focussed on support this kind of questions.
    Anyway, I want to know: do I can to reference an object by the objId?
    I want to code something like this:
    com.genexus.ModelContext context =
                     (com.genexus.ModelContex)getTheObjectFromTheJVM(theObjectId);(powered by google translator, ha!)

  • 32-bit JVM receiving Java objects from 64-bit JVM

    Hi folks,
    Question is: will there be problems for 32-bit JVM receiving Java objects from 64-bit JVM? and vice versa.
    Our application client is running on 32-bit JVM, our server is running on 64-bit JVM. Client will send Java objects to server, and vice versa.
    My past experience suggested when sending Java objects between client and server, both client and server needs to be compiled under the same JVM version. Any advice?
    Christy

    My past experience suggested when sending Java
    objects between client and server, both client and
    server needs to be compiled under the same JVM
    version. Any advice?This is only a case if you omit explicit serialVersionUID. My advice is to ALWAYS specify it for classes you want to serialize over the wire or put into persistent storage. It is way too tricky to rely on default one to fail half a year later when some new programmer adds one new public method to a class.
    Unless you need to deserialize already existing resources, there is no need to put any magic number in serialVersionUID - just put 1 for every class you create and possibly increase it by 1 every time you want to make incompatible version (which is not happening so often, as in real world you often try to stay as compatible as possible)

  • How to call java method from C ?

    Hello,
    I try to call a native method from java which calls java method from the same class. Exception (noSuchMethodError) is thrown. Any ideas?
    Thanx in advance !
    here is the source of the native method :
    JNIEXPORT jint JNICALL Java_TestDll_Proc_1Mul_1Int_1Var_1Var_1Stdcall (JNIEnv * env, jclass jcl, jint jarg1, jint jarg2) {
    int arg1;
    int arg2;
    int arg3;
    jint res;
    char * ch = "test";
    jfieldID fid;
    jmethodID mid;
    int (* procedure) (int *, int * ,int *);
    int mch;
    arg1 = (int )jarg1;
    arg2 = (int )jarg2;
    procedure = GetProcAddress(libraryHandle,"Proc_Mul_Int_Var_Var_Stdcall");
    procedure(&arg1,&arg2,&arg3);
    res = (jint) arg3;
    printf("(*env)->GetMethodID(env, jcl, \"test\", \"()V\");\n");
    mid = (*env)->GetMethodID(env, jcl, "test", "()V");
    printf("(*env)->CallVoidMethod(env, jcl, mid);\n");
    (*env)->CallVoidMethod(env, jcl, mid);
    return res;
    here is the source of the java file:
    public class TestDll {
    static {
    System.loadLibrary("testdllwrap");
    System.out.println("java: Library testdllwrap.dll loaded");
    public TestDll() {
    public native int Proc_Mul_Int_Var_Var_Stdcall(int jarg1, int jarg2);
    public void test() {
    System.out.println("java: test()");
    public static void main(String[] args) {
    TestDll access = new TestDll();
    int a = 5;
    int b = 6;
    int c = 0;
    System.out.println("Calling Proc_Mul_Int_Var_Var_Stdcall");
    c = access.Proc_Mul_Int_Var_Var_Stdcall(a,b);
    System.out.println("Java Result = " + c);

    Something is wrong with the code you posted here.
    Since your native method is not static, it should have the jobject instance as a parameter in the function prototype, not a jclass. Also, you should be calling CallObjectMethod with a jobject, not jclass.
    Check out Jace at http://jace.reyelts.com/jace.
    To call the java method you would do:
    JNIEXPORT jint JNICALL Java_TestDll_Proc_1Mul_1Int_1Var_1Var_1Stdcall
    (JNIEnv * env, jobject jTestDll, jint jarg1, jint jarg2) {
      TestDll testDll( jTestDll );
      testDll.test();
    }God bless,
    -Toby Reyelts

  • Instantiate Java objects from C++ and the ability for callbacks

    I've been reading up on JNI and I've been able to
    1) load a C++ DLL and call C++ functions from Java and
    2) call Java functions from a C++ DLL.
    However, I haven't been able to find a way to pass a C++ interface class to a Java method (from a C++ DLL), where the Java method will call functions in that interface. (That is; I need to initiate the C++ DLL before any Java code is called.) I'll illustrate below if I'm unclear.
    // Java
    public class javaClass
         public void doStuff(WrapperInterface wi)
              wi.foobar();
    // C++
    class WrapperInterface
         virtual void foobar() = 0;
    class cppClass : public WrapperInterface
         virtual void foobar()
              printf("helloworld");
    int main()
         // initiate JVM, environment etc
         javaClass javaInstance;
         WrapperInterface* cppInstance = new cppClass();
         javaInstance.doStuff(cppInstance);
    }How can I accomplish this?
    I can't seem to instantiate a class in C++, that have been compiled as C++ with the javah command, so I can't instantiate it and set its initial values. (The functions are not declared as static in my Java class at least...) I can on the other hand instantiate it as a Java class. However, nothing happens when I call (from C++) the functions of the instantiated Java class.
    Also, it seems according to my tests and the documentation that I could find that you are required to use a System.LoadLibrary() from Java. Will not that make the DLL it loads load again, thus creating two instantiations of that DLL?
    As a final thought, if this is not possible with SUN's JNI, will it be possible to do with other native interfaces for Java?

    You can pass a pointer back to java by using a java long data type. You can pass that to other java native (JNI) methods and write code that casts the long back to the C++ class and then calls a class method for that class.

  • Calling java functions from c++

    I want to start my program from visual c++ then, call java functions and then calling c++ function. How can i do this?

    Yet another cross-poster: [Calling java functions from c++|http://www.java-forums.org/new-java/12597-calling-java-functions-c.html]

  • Calling Java Methods from Stored Procedures

    Can I call Java Methods from Oracle Stored Procedures? I have a Java framework that logs events and would like to reuse it for logging events that occur in stored procedures.
    null

    You need to publish java class methods to plsql.
    Attached below is some information.
    Although both PL/SQL modules and Java classes are stored in the database
    and are managed by many of the same mechanisms, each of them resides in
    its own namespace. Therefore, Java methods are not accessible from SQL
    and PL/SQL by default. In order to expose Java methods to the SQL and
    PL/SQL engines, first publish that Java method to the SQL namespace using
    a 'Call Spec'.
    Note: A 'Call Spec' does not create an additional layer of
    execution so there is no performance penalty incurred.
    A 'Call Spec' is simply a syntactical mechanism used to
    make a method known in the SQL namespace.
    The SQL name established by the 'Call Spec' can be top-level or packaged.
    The syntax differs only slightly and is consistent with that used for
    PL/SQL procedures and packages. For more information on the exact
    syntax, see the references listed in 'Related Topics'.
    In general, a top-level procedure 'Call Spec' takes the form:
    CREATE OR REPLACE PROCEDURE procname ( pname mode ptype, ... )
    AS LANGUAGE JAVA NAME 'javaname ( javatype, ... )';
    Where: procname is the SQL name you wish to publish
    pname is the name for a parameter to procname
    mode is the parameter mode (i.e. IN, OUT, IN OUT)
    ptype is a valid SQL type (e.g. NUMBER, CHAR, etc.)
    javaname is the fully qualified name of the Java method
    javatype is a Java type for the corresponding parameter
    Likewise, a top-level function 'Call Spec' takes the form:
    CREATE OR REPLACE FUNCTION fname ( pname mode ptype, ... ) RETURN rtype
    AS LANGUAGE JAVA NAME 'javaname ( javatype, ... ) return javatype';
    Where: fname is the SQL name you wish to publish
    rtype is the SQL return type of the function
    Note: Within the NAME clause, everything within quotes is case
    sensitive. For example, if the keyword 'return' is in all
    CAPS, this Call Spec will not compile.
    Other optional parts of this syntax have been omitted here for simplicity.
    Additional examples in subsequent sections illustrate some of these options.
    eg
    CREATE PROCEDURE MyProc (rowcnt IN NUMBER, numrows OUT NUMBER)
    AS LANGUAGE JAVA NAME 'MyClass.MyMethod(int, int[])';
    There are several important things to note here:
    1.) The 'Call Spec' for a JSP must be created in the same schema as the
    corresponding Java class that implements that method.
    2.) IN parameters are passed by value. This is the only parameter mode
    available in Java. OUT parameters, therefore, must be passed as single
    element arrays in order to emulate pass by reference.
    3.) Parameter names do not need to match, but the number and types of
    the parameters must match (with just one exception - see item 5 below).
    Oracle 8i supports conversions between an assortment of SQL and Java.
    See the references listed in 'Related Topics' for additional information.
    4.) Primitive types (e.g. int, float, etc.) are not required to be fully
    qualified with any package name. However, standard Java object types
    (e.g. String, Integer, etc.) as well as any user defined object types
    (e.g. like those generated by JPublisher) must be prefixed with a
    corresponding package name (e.g. java.lang) if applicable.
    5.) The 'main' method which takes a single String[] parameter can be
    mapped to any PL/SQL procedure or function which takes some number
    of VARCHAR2 or CHAR type IN parameters. For example, the java method:
    public static void main ( String[] args ) { ... }
    can be mapped to each of the following:
    PROCEDURE MyProc2 ( arg1 IN CHAR ) ...
    PROCEDURE MyProc3 ( arg1 IN CHAR, arg2 IN VARCHAR2 ) ...
    PROCEDURE MyProc4 ( arg1 IN VARCHAR2, arg2 IN VARCHAR2 ) ...
    and so forth. Parameters map to the corresponding element of the String
    array (e.g. arg1 -> args[0], arg2 -> args[1], etc.).
    null

  • Error while calling java program from ABAP

    Hi Experts,
    We are trying for RFC inbound scenario.
    We followed the below blog
    /people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection
    We are working with SAP JCO 3.0.2
    We are getting the error : 'STFC_CONNECTION' could not be found in the server repository.
    After I run the Java server program if I execute the RFC destination directly from SM 59 it is showing successful messages.
    If I stop the java program then this RFC is failing. Based on this we concluded that RFC to Java connection is working fine.
    But as mentioned in blog if we call the RFC Destination from ABAP program it is giving the below error,
    'STFC_CONNECTION' could not be found in the server repository.
    If we test the RFC destination using RFC_TRUSTED_CHECK standard FM we are getting the below error.
    'RFCPING' could not be found in the server repository.
    We create the RFC destination of Type : TCP/IP as exactly mention in the blog.
    Please help us in resolving this issue.
    Thanks
    Prince

    Pabi,
    Using the RFC connection,we can establish a link between Java and SAP.
    Afterwards,hope we can call Java program from ABAP.
    Below is the sample piece of code to establish RFC connection(link) between Java and SAP.
    DATA: REQUTEXT LIKE SY-LISEL,
          RESPTEXT LIKE SY-LISEL,
          ECHOTEXT LIKE SY-LISEL.
    DATA: RFCDEST like rfcdes-rfcdest VALUE 'NONE'.
    DATA: RFC_MESS(128).
    REQUTEXT = 'HELLO WORLD'.
    RFCDEST = 'JCOSERVER01'. "corresponds to the destination name defined in the SM59
    CALL FUNCTION 'STFC_CONNECTION'
       DESTINATION RFCDEST
       EXPORTING
         REQUTEXT = REQUTEXT
       IMPORTING
         RESPTEXT = RESPTEXT
         ECHOTEXT = ECHOTEXT
       EXCEPTIONS
         SYSTEM_FAILURE        = 1 MESSAGE RFC_MESS
         COMMUNICATION_FAILURE = 2 MESSAGE RFC_MESS.
    IF SY-SUBRC NE 0.
        WRITE: / 'Call STFC_CONNECTION         SY-SUBRC = ', SY-SUBRC.
        WRITE: / RFC_MESS.
    ENDIF.
    Regards,
    Sree

Maybe you are looking for

  • Table Archiving in Oracle 10g database

    Hi Friends, We are facing performance problem and large size of tables like FAGLFLEXA, BALDAT etc. Now we want to archive the tables, please help us and if any one has done this activity please share it. In particular we want to archive tables ACCTIT

  • Screen (iMac) resets to brightest on reboot

    I noticed on two iMacs (an 2006 white iMac and a more recent aluminum/glass) that when the screen brightness is set to 0 (dimmest), it reverts to the brightest level after turning it off and then back on. I do not believe this was a problem until the

  • WHERE TO DOWNLOAD 9.0

    Hi- We need 9.0 to use legacy software. I can't find where to download it. Otherwise, how can 9.0 be obtained? Thanks

  • Flash alternative

    What is the alternative to flash player on iPhone? A lot of websites in NZ use this platform but it is not compatible with iPhone. Even my work website uses flash player to allow people to listen to our online radio streaming, but You cannot access t

  • Cnetralization of Jabber Logs

    We just rolled out Jabber at our company and our compliance came back to us saying that we need to have a way of able to archive the Jabber logs at a centralized location and be able to retrieve it for compliance purposes. I did a lot of research and