Calling Java Class from  C++

Hi,
I am trying to call a Java Class from a C++ program without using GNI.
will that be possible?
If Yes,how colud it be done.
Thanks in Advance.
Vimal

Could you please put me in detail.
I need to send a string from C++ as a parameter to a class in Java where the parameter is being processed.
So please throw light on this question.
Thanks,
Vimal

Similar Messages

  • Calling java class from jsp page

    Dear Friends.
    I wrote jsp page and java class.
    Am calling java class from jsp page. after processing result,
    I have to refresh jsp page from java class.
    processing time may take 5 minutes or 1 minute etc. that depends on user.
    Can It be possible ? if possible , How ?

    Ok, I get a very strange error now:
    org.apache.jasper.JasperException: Unable to compile class for JSPerror: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
    What is this??? Anyone?

  • Calling java class from abap function moduile

    Is it possible to call java class from function module.
    i am a java guy. my need is to call a java class from a  function module in the backend. which in turn performs certain functions.
    i would be highly obliged if someone could let me know if this is possible.
    regards
    Srikumar V

    Hi Srikumar ,
    you can call a java webservice in ABAP .
    u can call the webservice and via that u can trigger the java class..
    Regards
    Renu

  • Calling java classes from plsql procedures

    I'm attempting to call java classes from plsql procedures which will create cmsdk users, folders, groups etc, however when I attempt to load a java class into the oracle schema using the command:
    loadjava -user user/password@database -resolve classname.class
    It generates error messages to the effect that classes (cmsdk classes) required by the class cannot be found. The class is loaded and marked with the status "invalid". Is it therefore necessary for me to load the cmsdk packages into the schema?
    Cheers
    David

    Using CMSDK Java API within the database has never been supported
    (see Problems loading IFS's java class into database
    When we needed to invoke CMSDK code from our PL/SQL code, we used one of two approaches:
    (1) use advanced queues to send requests to an external Java program (the CMSDK code, running outside the database) and receive the results back (asynchronous choice); or
    (2) make an HTTP request to a Java servlet (the CMSDK code, running in some Java web container like iAS) and get the response back in some custom format (XML or something) (synchronous choice).
    It seems to me that the CMSDK Java API was designed to be used only in middle-tier, not in database tier.
    Regards,
    Daniel.

  • Can we call Java class from LiveCycle Process?

    hi..
    I have a general query, is it possible to call customeized java class from Workbench Process?
    I found dat we can invoke a web service... is there some operation like that for calling a java class...
    Thanks and Regards,
    Ambika

    Yes.
    You can use the Script service and put your Java code in there
    Or build your own component, which is really a Java pojo, and deploy it to LiveCycle. See http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/000934.html.
    Jasmin

  • How to call java classes from javascript?

    i have a button which calls javascript i need to access a class to update the values in the database.. how do you call the java code from within the javascript?
    the class is stored under tomcats classes directory and is accessed:
    com.Database.Employee
    the method is called : UpdateEmployeeDetails
    the button
    <input type="button" value="Save" onclick="submitForm('save')" />the javascript
    <script language="javascript">
            function submitForm(process){    
                document.myForm.action="update.jsp";
                document.myForm.submit();
    </script>

    is it not possible?
    do i have to refresh the page and read in the values like...
    <%
    String ename = request.getParameter( "EmployeeName");
         session.setAttribute( "ename", ename);
    %>and then call the class from here?
    looking around ive come across ajax but i dont know how to use it and what you need to install and if its compatable with tomcat and jsp?
    is ajax better or not really worth it?
    i have anything up to 100 fields that need saving at one save click

  • How to call Java class from Forms 6i?

    Hi friends,
    I need to call a Java class from my Forms 6i application.
    (It runs under WIndows XP. It's a client/server application and I have only the client and the Form builder installed on my PC)
    I don't know almost anything about Java's world so your help would be very useful for me.
    Could you tell me exactly what i have to do?
    I've read in metalink several Notes, but they supposed that the Java architecture is already installed in the computer.... I only have the default installation of Developer 6i... so I would need to know:
    - How to install/configure the neccesary to execute Java classes without problem
    - How to invoke the .class from Forms 6i.
    Thanks a lot
    Jose.

    And also this one:
    Problem Description
    Installed Forms 6i Rel 2 on a MS Windows machine. When trying to Import the Java
    Classes getting the errors
    PDE-UJI0001 Failed to create the JVM
    Solution Description
    You need to to install JDK 1.2.2 to run the Java Importer. And set the PATH's
    and classpath's correctly.
    Explanation
    1. Download and install the JDK 1.2.2.
    Possibly available at: http://java.sun.com/products/archive/
    2. Assuming the JDK 1.2.2 is installed in c:\jdk1.2.2 directory and the JRE in
    C:\PROGRA~1\JAVASOFT\JRE\1.2 directory; ORACLE_HOME=C:\Dev6iR2.
    Set the PATH to
    set PATH=c:\jdk1.2.2\bin;C:\PROGRA~1\JAVASOFT\JRE\1.2\bin;C:\PROGRA~1\JAVASOFT\JRE\1.2\bin\classic;%PATH%
    ( If you are using ias9i then the JDK 1.2.2 comes with the ias installtion ,
    in this case please set the PATH to
    D:\ias9i\Apache\jdk\bin;D:\ias9i\Apache\jdk\jre\bin;D:\ias9i\Apache\jdk\jre\bin\classic;%PATH% )
    3. Set the CLASSPATH to set CLASSPATH=%CLASSPATH%;C:\Dev6iR2\TOOLS\COMMON60\JAVA\IMPORTER.JAR;.
    (If you do not set the CLASSPATH correctly you will get the error
    PDE-UJI002 Unable to find the required java importer classes)
    4. Now run the Forms Builder by using the command.
    C:\Dev6iR2\bin\ifbld60.exe
    Now the Java Importer Should Run fine.
    Francois

  • Call java class from xquery

    Hi All,
    I'm working on osb 11.1.1.5 version.As per my requirement i want to call the external java class from the Xquery (version 1.0).Anybody can u please provide me any links or examples?
    Thanks in Advance!
    Radhika.

    Hi Prabu Thx for ur reply....without custom functions is there any possibilities to do this from xquery?

  • How to call java class from pl/sql procedure ?

    Hello everyone,
    My query is..
    There is one pl/sql stored procedure which is doing some business logic and storing data in some columns of one table, suppose the table name is 'ABC' .. and the rest of columns of table ABC are getting updated using java class. Now my problem is whenever I insert data in ABC using store proc.. i have to call that java class so that it will update the rest columns ( why java class for updating the columns in ABC is ..because that logic cant be done from pl/sql proc.. it has to be done using java )
    and the other thing is.. oracle is in one machine and java is in another .. :(
    hope ..u can help me out !!
    Thank in advance !!

    but that updation have to be done from java code only.. we are using GIS tools .. have to create some shape files and update the column with that shape file.. so creation of shape file has to be done from java code only..
    so how to call java class file which is on another machine and oracle in another..

  • Calling java class from SLSB

    I am trying to call a java class from SLSB . There are external jars which are imported in my java class . When i try to instatiate the java class in SLSB. It ia not able to access the external jars. It gives the following exception :
    0000002e ExceptionUtil E CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "applyRules" on bean "BeanId(MDB_SLSBEAR#MDB_SLSB.jar#msgProcess, null)". Exception data: java.lang.NoClassDefFoundError: org.springframework.context.ApplicationContext
    My code is as follows :
    SLSB:
    package com.vsnl.ejbs;
    import com.vsnl.pricing.bizObjects.CustomizedRateRequest;
    import com.vsnl.pricing.bizObjects.RateRequest;
    import com.vsnl.pricing.dao.ARR.AutoprocsMain;
    import org.springframework.context.ApplicationContext;
    * Bean implementation class for Enterprise Bean: msgProcess
    public class msgProcessBean implements javax.ejb.SessionBean {
    static final long serialVersionUID = 3206093459760846163L;
    private javax.ejb.SessionContext mySessionCtx;
    * getSessionContext
    public javax.ejb.SessionContext getSessionContext() {
    return mySessionCtx;
    * setSessionContext
    public void setSessionContext(javax.ejb.SessionContext ctx) {
    mySessionCtx = ctx;
    * ejbCreate
    public void ejbCreate() throws javax.ejb.CreateException {
    * ejbActivate
    public void ejbActivate() {
    * ejbPassivate
    public void ejbPassivate() {
    * ejbRemove
    public void ejbRemove() {
    public void applyRules(CustomizedRateRequest customizedRateRequest){
    System.out.println("RR ID in SLSB***"+customizedRateRequest.getProductCustomerId());
    System.out.println("RR ID in SLSB$$$"+customizedRateRequest.getIsDestFlag());
    try{
    System.out.println(" before the callng of commented function ");
    AutoprocsMain autoprocsMain = new AutoprocsMain();
    System.out.println(" after making instance ");
    //autoprocsMain.applyRules(customizedRateRequest);
    catch(Exception e){
    e.printStackTrace();
    My Java Class:
    package com.vsnl.pricing.dao.ARR;
    import java.io.InputStreamReader;
    import java.io.Reader;
    import java.util.ArrayList;
    import java.util.List;
    import com.vsnl.pricing.dao.ARR.Base;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.apache.log4j.Logger;
    import org.drools.FactHandle;
    import org.drools.RuleBase;
    import org.drools.RuleBaseFactory;
    import org.drools.WorkingMemory;
    import org.drools.compiler.PackageBuilder;
    import org.drools.rule.Package;
    import org.springframework.context.ApplicationContext;
    import com.vsnl.pricing.bizObjects.Customer;
    import com.vsnl.pricing.bizObjects.RateRequest;
    import com.vsnl.pricing.interfaces.ARR.IARRDAO;
    import com.vsnl.util.VSNLLogger;
    import com.vsnl.pricing.bizObjects.InnerObject;
    import com.vsnl.pricing.bizObjects.CustomizedRateRequest;
    public class AutoprocsMain extends Base{
    private static Log log=LogFactory.getLog(AutoprocsMain.class);
    private static Logger logger = Logger.getLogger(Invoker.class);
    ApplicationContext ctx;
    //ApplicationContext ctx;//=configure();
    IARRDAO autoprocsDAO;//=(IAutoprocsDAO)ctx.getBean("autoProcDAOTarget");
    public AutoprocsMain() {
    System.out.println(" inside the Autoproc constructor");
    //VSNLLogger.debug(logger, "before creatiom of CTX");
    //System.out.println(" before creation of CTX ");
    try{
    //System.out.println(" inside the Autoproc constructor");
    ApplicationContext ctx=configure();
    autoprocsDAO=(IARRDAO)ctx.getBean("arrTarget");
    catch(Exception e)
    //VSNLLogger.error(logger, e.getMessage());
    //VSNLLogger.debug(logger, "after creation of CTX");
    //System.out.println(" after creation of CTX ");
    public void applyRules(CustomizedRateRequest customizedRateRequest)throws Exception{
    RateRequest rateRequest=new RateRequest();
    List rateRequestObjs= new ArrayList();
    List<CustomizedRateRequest> CustomizedRateRequestObjs=new ArrayList<CustomizedRateRequest>();
    try{
    //rateRequest= autoprocsDAO.getRecord();
    rateRequestObjs=autoprocsDAO.getAllRateRequests();
    //VSNLLogger.debug(logger, " AFTER THE CALL OF getAllRateRequests() function ");
    CustomizedRateRequestObjs=autoprocsDAO.getCustomizedObjects(rateRequestObjs);
    catch(Exception e)
    //VSNLLogger.error(logger, e.getMessage());
    RuleBase ruleBase=readRule();
    WorkingMemory workingMemory = ruleBase.newStatefulSession();
    FactHandle handle =workingMemory.insert(customizedRateRequest);
    //customizedRateRequest.setContinueRule("1");
    workingMemory.fireAllRules();
    if(CustomizedRateRequestObjs.size()>0)
    FactHandle handle =workingMemory.insert(CustomizedRateRequestObjs.get(0));
    for(int i=0;i<CustomizedRateRequestObjs.size();i++)
    CustomizedRateRequest customizedRateRequest=CustomizedRateRequestObjs.get(i);
    customizedRateRequest.setContinueRule("1");
    workingMemory.modifyInsert(handle,customizedRateRequest );
    workingMemory.fireAllRules();
    System.out.println(" after the firing of all rules ");
    public static void main (String args[])
    AutoprocsMain procsMain = new AutoprocsMain();
    try{
    procsMain.applyRules();
    catch(Exception e)
    e.printStackTrace();
    private static RuleBase readRule() throws Exception {
    System.out.println(" ****** inside readrule &&&& ");
    //read in the source
    Reader source = new InputStreamReader( AutoprocsMain.class.getResourceAsStream( "/Sample.drl" ) );
    // Reader source1 = new InputStreamReader( AutoprocsMain.class.getResourceAsStream( "/com/vsnl/resources/Sample2.drl" ) );
    //Reader source = new InputStreamReader( AutoprocsMain.class.getResourceAsStream( "/com/vsnl/resources/CustomerDiscount.drl" ) );
    //optionally read in the DSL (if you are using it).
    //Reader dsl = new InputStreamReader( DroolsTest.class.getResourceAsStream( "/mylang.dsl" ) );
    //Use package builder to build up a rule package.
    //An alternative lower level class called "DrlParser" can also be used...
    System.out.println(" after package builder ");
    PackageBuilder builder = new PackageBuilder();
    System.out.println(" after package builder ");
    //this wil parse and compile in one step
    //NOTE: There are 2 methods here, the one argument one is for normal DRL.
    builder.addPackageFromDrl( source );
    System.out.println(" after add package source");
    //builder.addPackageFromDrl(source1);
    System.out.println(" after add package source1");
    //Use the following instead of above if you are using a DSL:
    //builder.addPackageFromDrl( source, dsl );
    //get the compiled package (which is serializable)
    Package pkg = builder.getPackage();
    System.out.println(" after get package ");
    //add the package to a rulebase (deploy the rule package).
    RuleBase ruleBase = RuleBaseFactory.newRuleBase();
    ruleBase.addPackage( pkg );
    System.out.println(" end of read rule function");
    return ruleBase;
    public IARRDAO retBean()
    return null;
    }

    Hi i am new to EJB .
    please explain me the problem ..and kindly tell me to how to add this in classpath. I am using webSphere application server.
    I added this in the classpath in the startup script.
    I also added all the required jars in the EAR libraries ( I am using the RAD IDE).
    Please help.

  • Calling java-class from c++ misses

    Hello,
    if I call a java-class from c++-code and the java-class imports a package (not java packages, but writen by myself), then the calling misses :-(
    If I call this class without the imports - it works!
    C++-Code:
        jclass cls = env->FindClass(javaClassname.c_str());
        if (cls == 0) {
              //error     - cls is 0 if the java-class has imports  
        }Java-Includes:
    import mypackage.Conn;
    import mypackage.Para; I set the classpath to the .jar-files. Did I forget anything else?
    Thx...

    Hello,
    if I call a java-class from c++-code and the
    java-class imports a package (not java packages, but
    writen by myself), then the calling misses :-(
    If I call this class without the imports - it works!
    C++-Code:
    jclass cls =
    env->FindClass(javaClassname.c_str());
    if (cls == 0) {
    /error     - cls is 0 if the java-class has imports
    code]
    Java-Includes:import mypackage.Conn;
    import mypackage.Para;
    I set the classpath to the .jar-files. Did I forget
    anything else?
    Thx...
    From the JNI Specification: http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/jniTOC.html
    =======
    FindClass
    jclass FindClass(JNIEnv *env, const char *name);
    This function loads a locally-defined class. It searches the directories and zip files specified by the CLASSPATH environment
    variable for the class with the specified name.
    LINKAGE:
    Index 6 in the JNIEnv interface function table.
    PARAMETERS:
    env: the JNI interface pointer.
    name: a fully-qualified class name (that is, a package name, delimited by �/�, followed by the class name).
    If the name begins with �[� (the array signature character), it returns an array class.
    The string is encoded in modified UTF-8. ==============================
    So, to find the Conn class, you need to use:
    env->FindClass("mypackage/Conn");

  • Error while trying to call Java Class from Peoplecode

    Gurus,
    I am trying to read a property file from peoplecode using standard java classes. However, I am getting this error more than one overload matches
    Below are 2 ways in which I tried doing this and both ended up in the same error
    Code 1>_
         Local JavaObject &file = CreateJavaObject("java.io.File", "D:\\psft.properties");
         Local JavaObject &properties = CreateJavaObject("java.util.Properties");
         Local JavaObject &reader = CreateJavaObject("java.io.FileReader", &file);
         &properties.load(); Error thrown : "Calling Java java.io.FileReader.<init>: more than one overload matches"
    Code 2>_
         Local JavaObject &file = CreateJavaObject("java.io.File", "D:\\psft.properties");
         Local JavaObject &properties = CreateJavaObject("java.util.Properties");
         Local JavaObject &properyFile = CreateJavaObject("java.io.FileInputStream", &file);
         &properties.load();
    Error thrown : "Calling Java java.io.FileInputStream.<init>: more than one overload matches."
    The above error is thrown on the 3rd line when I try to invoke the FileInputStream or FileReader class/constructor.
    In fact both the above code pieces work absolutely fine when I write them into a java class and run them on a java runtime. Any inputs would be of great help !! Alternatively, I will have to use peoplecode file.readline(), etc to read the property file. Since java has this smarter way to reading a property file, I thought of giving it a try ..
    -Sudripta

    I tested this on one of my windows servers using PT 8.50:
    Local JavaObject &joCurrFile = CreateJavaObject("java.io.File", "c:/temp/test-date.txt");
    Local JavaObject &jlongtime = CreateJavaObject("java.util.Date");
    Local number &modifytime = &jlongtime.getTime();
    MessageBox(0, "", 0, 0, "original time: " | &joCurrFile.lastModified());
    Local boolean &filemodified = &joCurrFile.setLastModified(&modifytime);
    MessageBox(0, "", 0, 0, "&modifytime: " | &modifytime, "");
    MessageBox(0, "", 0, 0, "&filemodified: " | &filemodified, "");
    MessageBox(0, "", 0, 0, "new time: " | &joCurrFile.lastModified());Here are the results:
    PeopleTools 8.50.05 - Application Engine
    Copyright (c) 1988-2010 PeopleSoft, Inc.
    All Rights Reserved
    original time: 1287677026144 (0,0)
    Message Set Number: 0
    Message Number: 0
    Message Reason: original time: 1287677026144 (0,0) (0,0)
    &modifytime: 1287677277845 (0,0)
    Message Set Number: 0
    Message Number: 0
    Message Reason: &modifytime: 1287677277845 (0,0) (0,0)
    &filemodified: True (0,0)
    Message Set Number: 0
    Message Number: 0
    Message Reason: &filemodified: True (0,0) (0,0)
    new time: 1287677277845 (0,0)
    Message Set Number: 0
    Message Number: 0
    Message Reason: new time: 1287677277845 (0,0) (0,0)
    Application Engine program DSS_TEST_IO ended normallyDoes your app server have permissions to modify the files you are trying to modify? Also, how did you verify the date/time of the files? Were you using Windows Explorer? Did you refresh the view first? Or did you use the console dir/ls? I seriously doubt there is a security manager in place that would restrict what you can do with Java. Security managers are common in applets/browser context, but not in apps.

  • Call java class from VB

    Hi all experts,
    I want to package the java class as dll so that I could call them from VB in an server without java installed. Is it possible ?
    I have search a lot of information but all of them require the deploy server java installed such as javareg/packager.
    If you have above experience, nice to share. Thx.

    In fact, it is easier to deploy the java application so that we don't need to install JVM on every client and servers.Why not set up a server which runs your java program and then "call" this from your VB client? This you only need one install of java.

  • Calling java class from PLSQL  that returns date/time a file was saved

    Does anybody know, is there a java class I can compile into Oracle DB, and call from PLSQL that returns me the date/time a file was saved.
    As far as I'm aware this cannot be achieved using UTL_FILE.
    Please advise
    Thanks
    Warren

    I found this thread from before that might be helpful
    how to connect to UNIX OS from oracle stored procedure

  • Calling Java Classes from Forms 6.0

    Can this be done?
    How can it be done?
    And, I don't mean JavaBeans... I don't want to embed a control
    on my form... I want to call a standard java class routine.
    Any help or laughter would be appreciated...
    Thanks,
    Pat Caldwell
    [email protected]
    null

    You have to write a wrapper classes so forms can call your java,
    if you've got any yet.
    Then use the Bean Area tool to draw the area your applet will
    display in (if you don't want to display anything then don't
    display anything in you java).
    Its not really JavaBeans more like oracleBeans.
    I've had to re-write functionality for the web such as
    displaying open/save file dialogs.
    If your interested and you've installed dev60, the example:
    C:\orant\FORMS60
    \java\oracle\forms\DEMOS\SOURCE\ProgressBarPJC.java and
    ProgressBar.java got me started with alot of reading from
    http://java.sun.com/products/jdk/1.1/docs.html
    Patrick Caldwell (guest) wrote:
    : Can this be done?
    : How can it be done?
    : And, I don't mean JavaBeans... I don't want to embed a control
    : on my form... I want to call a standard java class routine.
    : Any help or laughter would be appreciated...
    : Thanks,
    : Pat Caldwell
    : [email protected]
    null

Maybe you are looking for

  • Why won't my Mac Pro read a burnt copy of Photoshop CS5?

    I just got myself a Mac Pro. From upgrading my old G4. My Mac Pro is a 2 Dual-Core Intel Xeon 2.66 ghz Version 10.6.8. With a SONY DVD RW DW-D150A Drive and a NVIDIA GeForce 7300 GT graphics/display. So I have plenty of requirements to run CS5..I thi

  • I can't install yosemite, got the error message, that i have to use App Store to download it

    I have been reinstalling OSX, but now i can't update to yosemite or install iMovie and iphoto again. I just get the message, that I have to use app store t download the programs, but i'm already using app store, any one who knows what to do? I alread

  • SQL SUM and Group By Function Wrong Result

    Hi All, I have a SQL view with all the payment transaction for a property per month and trying to sum all the transactions per month per property. For some months the total is not correct. For example for property 3856, in Jan 2014, the total should

  • WAVES plug ins not in mixdown- please, please help me!!!!

    Hi. Im an experienced adobe user (been using it since it was cool edit). Im now using the latest Adobe for Mac on my MacBook. Heres the deal: When I go to export a mixdown, any plug in that didn't come with Adobe (such as WAVES) DOES NOT SHOW UP ON T

  • Concerned with security....

    Hello Everyone, I am not sure exactly where to post this.  I have unfortunately been through the wringer the past few weeks.  I believe someone or something (program/malware) gained access to my computers and possibly my lan.  I have never had proble