Calling Customer code in java application

Hi,
in my java application running on WAS 6.40 I want to call some customer code.
Basically I create a data structure (DOM XML tree) and want to pass this to customer code to be able to modify it as needed.
My idea would be to define an interface which would than be implemented by customer java classes. But how do I load these classes?
In theory I would create a configuration table in my app where the customer would specify the classname of his classes implementing this interface and I would do a Class.forName("...")
But those classes will be unknown to my application'S classloader, right? Because they won't be deployed with my application and I can't have references as I do not know if and what the customer will deploy. What's the best approach to this? WOuld EJBs help better?
Thanks
Bruno

Hi Bruno,
We did this for our application.  We needed a weak reference from our deployable DC to a specific DC (e.g. DC\customerExit)  The customer then creates this DC and adds their classes to it.  Since it is a weak reference,  it does not need to exist for your application to work. You can use the customizing to be able to lookup the specific class name that they created. 
hope this helps,
Rich

Similar Messages

  • Example-- Call RFC from external Java Application

    Update: I need code example to call RFC from External Java application. Can onybody help me?                                                      
    RGDS
    RP
    hi all.
    i want to create my own log for each interface.
    i saw this blog:
    /people/michal.krawczyk2/blog/2006/09/20/xi-abap-mapping-logs--more-standard-better-visibility
    my doubt is how to catch the error that i see in SXI_MONITOR y put it in a Sub-Objetc.
    For example: in sxi_monitor i get the error for my interface NMUCustomer: "No receiver could not be found" or "Error Mapping Traformation".
    I created an Object called ZNMUCUSTOMER and a Sub-Objetc called ZERROR.
    what i must do to get the error I see in monitor and assign it to Sub-Object??
    Rgds.
    Message was edited by:
            Rodrigo Pertierra
    Message was edited by:
            Rodrigo Pertierra
    Message was edited by:
            Rodrigo Pertierra

    Hi,
    Oh, you are using ABAP mapping ......
    then use the following in ABAP mapping ..
    TRACE1,TRACE2,TRACE3.... for trace level 1,2,3......
    http://help.sap.com/saphelp_nw04/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/content.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/866ce290-0201-0010-338f-b8c3553aaa0f
    Regards
    Chilla

  • Profile native code that JAVA application runs

    our application is suffers from a severe memory leak. the application runs on Weblogic that uses the severe container and access Oracle DB.
    the JAVA heap was monitored for several weeks (using the verbose gc flag) and no leak was discovered. we monitored the native heap (by using the pmap command) and we saw that the heap size increasing. therefor we think the problem is in the native code that runs in this process (the major suspect is the OCI, Oracle client).
    after reading the man page of collect and your Article (Profiling Java Appl with Sun Studio 11) I'm confused. I would like to monitor the native heap (with -H option) but in the man page it's written that "Heap profiling is not supported for java programs" so i wheni set the flag -j off i got a warning that this process is java and i might use the -j on.
    please advice what are the values of the flags -j an -H in case of i need to monitor the native code of java application.
    thanks
    yahav

    thanks again for the additional article about the Weblogic.
    in the startManaged script I added the following prefix:
    collect -H on -j off -d /tmp/ java...
    when i typed leaks on er_print, i got a list of possible leaks and allocs.
    some activities were made on the application so i assume that data should be collected. as the size of the experiment folder slightly increased.
    so far we can assume that the data that is relegated to the non java process was collected.
    when i typed leaks again within the er_print tool i got the same results.
    it means that no native heap activities was made.
    is it correct analysis?
    regards the leak that was discovered above, how one can identify the function that cause this leak. i can see calls like:
    malloc, ReadKnownVMs, CreateExecutionEnvironment. this functions relate to the JVM. i would expect to see some trace (allocs) regards the other native code that runs such as the Oracle OCI client.
    I'm suspecting i'm collecting this info.
    is there any other flags to set for such collection? or any other commands in the analysis command

  • Can u tell some  source codes of java application

    can u tell some source codes of java application?
    i want to get some source codes .such as a proxy source code .
    any help will be appreciated.

    hi
    check www.rgagnon.com for more source code in java.
    regards
    Pradheep

  • Calling c code from java

    hello everyone
    I have question
    I need to call c program from java
    I don't have problem with application or exe file in c it is working but when I call it from java it doesn't work there is no error but it doesn't work because when I execute the c program the black screen must be appeared so that I can enter the input file and then it produces the output file but in java I cann't see the black screen so please can you tell me the problem
    I have used the following code to call c from java:
    String line;  
                   String output1 = "";  
                         Process p = Runtime.getRuntime().exec("cpp.exe");  
                         BufferedReader input = new BufferedReader  
                               (new InputStreamReader(p.getInputStream()));  
                         while ((line = input.readLine()) != null) {  
                               output1 += (line + '\n');  
                         input.close();

    Hi,
    Try this in your code
    p.waitFor();It is for waiting of the process till the completion of the I/O.
    Regards

  • Calling Stored Procedures from JAVA Application

    Hi all,
    i am using JDeveloper 3.2.2 for creating a DB Application that
    uses Oracle8i as DB Server.
    One approach of the application is to only use PL/SQL Stored
    Procedures to write Data back to the DB.
    Some of the stored procedures expect more than 20 parameters.
    I want to know if there is a better way to call such a stored
    procedure from Java than using a CallableStatement and setting
    its 20 parameters.
    Another reason why the way above isnt possible for me is that
    i need a dynamic way to set the parameters of the stored
    procedure.
    A solution for that dynamic way i could think of is to get
    the information of the stored procedure by using some functions
    of DatabaseMetaData and than use this information to map the
    parameters with their respective variables in the java
    application.
    The best argument against this way is that it would be time and
    performance consuming.
    So could anybody tell me a solution to call PL/SQL stored
    procedures from java which is better than doing something like:
    String calString = "{Call myStoredProc(";
    while(counter < 22) {
    params += "?";
    if(counter<21) params += ",";
    counter++;
    calString += params + ")}";
    try {
    CallableStatement cs = session.prepareCall(calString);
    } catch(SQLException ex) { ... }
    cs.setString(1, var1);
    cs.setString(1, var2);
    And that for every Stored Procedure i want to call ?!?
    Any help or direction-leading would be really appreciated.
    Tank you much.
    MfG,
    Oliver Bankel

    Hi Oliver,
    If you your Stored Procedures were in Java and seamlessly
    integrated with your Java application would that make your life
    easier?
    I don't know if this is a practical or acceptable solution in
    your environment but it would certainly solve all of your issues
    and provide your with a couple of nice advantages. Scalability
    and platform independence are just a couple I could think of.
    There is a tool called in2j (see http://www.in2j.com) which will
    automatically migrate your PL/SQL Stored Procedures into Java.
    You can download a copy of the tool and migrate your PL/SQL to
    Java with no upfront costs. If you're happy with the generated
    Java and want to deploy it, the migration fee falls due - simple.
    Hope this helps.
    Elton

  • How to call c++ code from java

    i have a third party dll written in c++. I want to call its methods in java. I searched web and found that I have to use JNI for this. I have seen examples on web writing c++ code and then using it from java through JNI, but can anybody please point to me the example where i have a predefined library or dll in c++ and i have to call it in java. I think that I may have to declare methods in library as native in java and then write a wrapper implementation (dll) in c++ which actually calls the library or dll functions. But, then how will I call methods of dll from my wrapper code.
    Any examples, please point
    Regards,
    Farooq

    There's a JNI forum here that may be a better place for this question; though given the general nature of the question, I suspect that they'll refer you to a tutorial. good luck.

  • How to call a stand alone java application from ADF BC JSP, struts or JSF

    Hi,
    My requirement is that there are utilities or stand alone java applications that I want to call from our existing applications.
    We have two seperate applications one ADF BC Struts application we developed using JDeveloper 10.1.2 and another ADF BC JSF application we developed using JDeveloper 10.1.3.2.
    We want to integrate applications like JTwain and others to help us in scanning. The application will be placed on the same server as our application. How can I do this without loosing all the current session information.
    Please help.
    Thanks and regards,

    There are two possible solutions.
    First, if the tool or application you want to integrate, has an Java-API you can use this api and integrate the tool in your application (using one or more jars you add to the classpath).
    Second, if the tool has no java api, you can call the tool via runtime.exec(...) as a shell process. This way you open a command shell in you application and execute the tool like you do on a normal command shell.
    For tide integration and control I recommend the first approach. The second one is only for those tools which don't offer a java api.
    Timo

  • How to call other execs from java application

    What is the best way to make a call to execute an external executable written in another language (i.e. c++ or ada95) from within a java application?

    Hi,
    Runtime.getRuntime().exec(new String[]{"C:\\Office\\winword.exe"});
    you should catch IOException as well.
    Phil

  • Pass return code from Java application to a .bat file.

    I have a .bat file which will execute a Java application. I want to pass the return code from the java application to the ".bat" file.
    Could you please let me know, how can I accomplish this.

    I tried that, but it doesn't return the value...
    In my Java app, I had System.exit(returnCode) and in the '.bat' file
    I have
    @echo off
    java <myApp>
    set returnCd=%?%
    echo %returnCd
    and it didn't return any value. What should I specify in set returnCd=%?% instead of ?

  • Calling oracle reports from java applications

    Hi:
    I was wondering if anyone can tell me how to invoke an oracle report from a java application.

    yes it is possible. There is a cgi script called viewreport.cgi. Have the jsp page call it (GET or POST method) and place the user parameters inside the form.

  • HTTP Unauthorized 401 Error when calling custom code Workflow-Activity (SharePoint 2013)

    Hi,
    from one day to the other the custom code activity within a SP2013 workflow gives me the following error:
    Activity in progress  Retrying last request.
    Next attempt scheduled in less than one minute.
    Details of last request:
    HTTP Unauthorized to
    http://server/subsite/_vti_bin/client.svc/sp.utilities.utility.ResolvePrincipalInCurrentcontext(input=@ParamUser,scopes='15',sources='15',inputIsEmailOnly='false',addToUserInfoList='False')?%40ParamUser='i%3A0%23.w%7Csp2013-dev%5Cadministrator'
    Correlation Id: 9d507c00-1e24-af73-fcea-faa4a0a61ae1
    Instance Id: 5c91916e-918b-453a-bf48-e61649afa3d0
    After some time the workflow gets cancelled automatically. The custom code activity ran many times before without any errors.
    Thanks a lot in advance!

    Hello,
    this KB could help also:
    HTTP Unauthorized to /_vti_bin/client.svc/sp.utilities.utility.SendEmail
    Regards,
    Alex
    Alex Pitulice, MICROSOFT 
    Bitte haben Sie Verständnis dafür, dass im Rahmen dieses Forums, welches auf dem Community-Prinzip
    „IT-Pros helfen IT-Pros“ beruht, kein technischer Support geleistet werden kann
    oder sonst welche garantierten Maßnahmen seitens Microsoft zugesichert werden können.

  • Adding and Calling custom method to the application module or view object

    My project uses jheadstart 10.1.2.
    I want to run "oracle reports" from my uix page. I have coded a method which takes "VOParameter view object" as a parameter to run report.
    I have generated the input page (parameter page) which based on VOParameter view object, by using jheadstart for using jheadstart lov, date etc. advantages. But I dont know how can I add custom method on application module or view object implementation class and custom button on uix page to call from uix page.
    THANKS for your help

    Yes, method binding has been added to the page UI model.
    I have find some clue that When I darg and drop metod as a submitButton, the code "
    <SubmitButton text="runReport" model="${bindings.runReport}" id="runReport0" event="action" />"
    is added to the uix page code. I change this code like this;
    <button text="runReport" model="${bindings.runReport}" id="runReport0" event="action" onClick="submitForm('dataForm',1,{'event':'action','source':'runReport0'});return false"/>
    by adding onClick method and changed submitButton to button tag..
    Then button action is triggered. But I can not pass to the design part of the uix page. It gives me the message like that "The document is not a valid state" But it works. I dont know why?

  • Maintaining custom Web Dynpro Java applications

    We are a relatively new Web Dynpro Java shop, and I hope to propose a standard for code modification documentation to my organization. I have a few questions for WDJ maintenance developers:
    When documenting creation and modification activities, what is the benefit of using the javadoc comment convention?
    In the controller implementation tab, when I use the Source --> Add JavaDoc Comment tool, the comment block is always inserted into the
    //@@begin imports
    tag. Is the automatically generated tag
    //@@begin documentation
    in the controller implementation tab useful? Should summary information and ongoing modification comments for the controller be stored here?
    Does anyone require full javadoc comments on every new method? @param, @return, @exception?
    Do the NWDS/Eclipse Tasks and/or Bookmarks provide any real value? I have observed that bookmarks are useless for flagging code changes because they are dropped whenever edits are saved. I'd like to leverage Tasks, are there any examples of using them successfully that can be shared with me?

    The Java source in Web Dynpro is generated from the meta-data. Manual changes must be done exclusively inside the so-called user coding areas marked by comments //@@begin ID ... //@@end. That has the consequence that many of the Eclipse source code and refactoring functionality does not work anymore resp. is overwritten by the code generation step. Please be careful.
    Armin

  • How to Insert and call custom Code in CaptivateMainTimeine.as?

    I have been trying to get my head around this, using various blog postings by Jim Leichliter as my guide. However, so far I have been defeated.
    This is what I attempted (in Captivate 5):
    1) I inserted the following code into CaptivateMaintimeline.as, just above the private function AddEICallbacks() section:
    public function helloWorld(){
      alert('hello world');
    2) Just above the EICallbacksAdded = true; line, I inserted
    ExternalInterface.addCallback("helloWorld", helloWorld);
    3) I created a one-slide Captivate 5 presentation with a button whose "On Success" action is set to "Execute Javascript".
    4) In the "Execute Javascript" Script_Window, I entered this code:
    Captivate.helloWorld();
    5) I published the presentation and viewed it in Chrome, Firefox and IE 9, which all reported an error, as follows:
    (Chrome) "Uncaught TypeError: Object #<HTMLEmbedElement> has no method 'helloWorld'"
    (Firefox) "Captivate is not defined"
    (IE 9) "Object doesn't support property or method 'helloWorld'"
    6) I changed the script window code to
    document.Captivate.helloWorld();
    and published and viewded in Chrome in Firefox, with the following results:
    (Chrome) "Uncaught TypeError: Object #<HTMLEmbedElement> has no method 'helloWorld'"
    (Firefox) "document.Captivate.helloWorld is not a function"
    7) I also tried
    document.getElementById('Captivate').helloWorld();
    and published and viewed in IE 9, getting the same error as previously,
    "Object doesn't support property or method 'helloWorld'"
    Can anyone see what I am missing here?

    Thanks, Jim. Your example got my "proof-of-concept" working.
    I had jumped to the unwarranted conclusion that core JavaScript functions were directly accessible from ActionScript. Investigating further as a result of your comment, I discovered the ExternalInterface.call technique for using JavaScript functions in ActionScript when I actually need to. (Ref. http://codingrecipes.com/calling-a-javascript-function-from-actionscript-3-flash and http://www.actionscript.org/resources/articles/745/1/JavaScript-and-VBScript-Injection-in- ActionScript-3/).
    Some background: I wrote my first program in Fortran in 1966 and having been coding ever since. For most of the last two decades, most of what I have written has been in the VB, VB.NET, and ASP.NET worlds, but now I am going through a steep Captivate + ActionScript + JavaScript learning curve as I use Captivate to create course materials for the learning institution where I work. It would be simpler if the materials were only ever going to be run from our web server, but as well as on-campus students we have distance students across the country. We provide the distance students with a computer preloaded with the materials, but not all students have an Internet connection, so I am trying to create materials that can be run stand-alone from the computer's file system or served from a web server with equal facility.
    Add in the complication that there are many keyboard shortcuts that Internet Explorer doesn't pass through to Flash, therefore hobbling some of the training and assessment simulations, and you can see that the Captivate presentations have to have sufficient logic built in to detect the environment in which they are running and adjust accordingly. As I will be calling upon this logic over and over again, I would like it to be in one place and access it by a simple JavaScript call from the opening slide of every presentation, thus populating a number of Captivate variables with the environmental information which can then be used to branch the presentation to alternative slides wherever necessary. Therefore, embedding the logic into a customized version of CaptivateMainTimeLine.as seemed the way to go, but if anyone can suggest a better strategy, I am open to all ideas!
    Trevor

Maybe you are looking for

  • Music appears in iTunes, but not on ipod touch itself

    Hi. My son got a new ipod touch about 2 weeks ago. We've set it up to automatically sync a particular folder (so he doesn't have to get ALL the music on our iTunes). Tonight we added a few songs to his folder in iTunes and synced the ipod. In iTunes,

  • How do I get rid of the characters dialog box?

    Concise problem statement: Clicking "Special Characters..." in the Edit menu does nothing at the time of click, but now the "Characters" dialog, with nothing in it, will not go away! Steps to reproduce problem: 1.Open Adobe Reader 2.Click "Edit" 3.Cl

  • Report FBL3N is not tally with GLPCT

    Dear expert. I'm using SAP ECC6 and find out some weird case. When i run FBL3N,the data that is suppose to store in GLPCT is not in GLPCT. I never face this problem before. Usually if i run FBL3N report, the data with profit center i can compare the

  • SD Debit note process

    Hi Gurus, My Issue is User has created a debit note and created billing, At Sales Order level he has maintained plant so by default the same plant has to be trigger in billing but in billing plant is missing, I have checked in copy controls also ever

  • Automatic Start Up of Mac

    Every so often I shut down by Mac. On a few occasions the Mac started up automatically at approx 5AM in the morning. Is there a setting I must change to stop this from happening?