Java method call from c passing string more info

I am trying to call a java method from c passing a String as an argument.
my C code is as follows.
//Initalise jstring and class (to recieve String)
jstring textp;
jclass texts = (*env)->GetObjectClass(env, obj);
jmethodID text = (*env)->GetMethodID(env, texts, "texture", "([Ljava/lang/String;)V");
//Create a new jstring from the char* texturePath (in textures)
//call the java method with the jstring
textp = (*env)->NewStringUTF(env,ret.textures->texturePath);
(*env)->CallVoidMethod(env, obj, text,textp);
//java code
// texture which recieves a string
public void texture(String texturePath){
The error I get is as follows:
SIGSEGV 11 segmentation violation
si_signo [11]: SEGV
si_errno [0]:
si_code [1]: SEGV_MAPERR [addr: 0xc]
stackpointer=FFBED790
"Screen Updater" (TID:0x4f9060, sys_thread_t:0x4f8f98, state:CW, thread_t: t@11, threadID:0xf2d31d78, stack_bottom:0xf2d32000, stack_size:0x20000) prio=4
[1] java.lang.Object.wait(Object.java:424)
[2] sun.awt.ScreenUpdater.nextEntry(ScreenUpdater.java:78)
[3] sun.awt.ScreenUpdater.run(ScreenUpdater.java:98)
"AWT-Motif" (TID:0x40be50, sys_thread_t:0x40bd88, state:R, thread_t: t@10, threadID:0xf2d71d78, stack_bottom:0xf2d72000, stack_size:0x20000) prio=5
[1] sun.awt.motif.MToolkit.run(Native Method)
[2] java.lang.Thread.run(Thread.java:479)
"SunToolkit.PostEventQueue-0" (TID:0x431950, sys_thread_t:0x431888, state:CW, thread_t: t@9, threadID:0xf2e71d78, stack_bottom:0xf2e72000, stack_size:0x20000) prio=5
[1] java.lang.Object.wait(Object.java:424)
[2] sun.awt.PostEventQueue.run(SunToolkit.java:407)
"AWT-EventQueue-0" (TID:0x430ea8, sys_thread_t:0x430de0, state:CW, thread_t: t@8, threadID:0xf3071d78, stack_bottom:0xf3072000, stack_size:0x20000) prio=6
[1] java.lang.Object.wait(Object.java:424)
[2] java.awt.EventQueue.getNextEvent(EventQueue.java:212)
[3] java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:100)
[4] java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:91)
[5] java.awt.EventDispatchThread.run(EventDispatchThread.java:83)
Exiting Thread (sys_thread_t:0xff343db0) : no stack
"Finalizer" (TID:0x154e98, sys_thread_t:0x154dd0, state:CW, thread_t: t@6, threadID:0xfe391d78, stack_bottom:0xfe392000, stack_size:0x20000) prio=8
[1] java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:146)
[2] java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:168)
[3] java.lang.ref.Finalizer$FinalizerWorker$FinalizerThread.run(Finalizer.java:124)
"Reference Handler" (TID:0x1506a0, sys_thread_t:0x1505d8, state:CW, thread_t: t@5, threadID:0xfe3c1d78, stack_bottom:0xfe3c2000, stack_size:0x20000) prio=10
[1] java.lang.Object.wait(Object.java:424)
[2] java.lang.ref.Reference$ReferenceHandler.run(Reference.java:130)
"Signal dispatcher" (TID:0x13d180, sys_thread_t:0x13d0b8, state:MW, thread_t: t@4, threadID:0xfe3f1d78, stack_bottom:0xfe3f2000, stack_size:0x20000) prio=10
"main" (TID:0x38918, sys_thread_t:0x38850, state:R, thread_t: t@1, threadID:0x25228, stack_bottom:0xffbf0000, stack_size:0x800000) prio=5 *current thread*
[1] loader.Callbacks.nativeMethod(Native Method)
[2] loader.Callbacks.main(Callbacks.java:184)
[3] graphics.GR_MakeTrack.init(GR_MakeTrack.java:60)
[4] graphics.GR_MakeTrack.main2(GR_MakeTrack.java:49)
[5] graphics.GR_MakeTrack.main(GR_MakeTrack.java:41)
[6] control.GE_main.GE_main1(GE_main.java:87)
[7] control.GE_main.main(GE_main.java:66)
gmake: *** [run] Abort (core dumped)

I am trying to call a java method from c passing a
String as an argument.
my C code is as follows.
//Initalise jstring and class (to recieve String)
jstring textp;
jclass texts = (*env)->GetObjectClass(env, obj);
jmethodID text = (*env)->GetMethodID(env, texts,
"texture", "([Ljava/lang/String;)V");
Hi Pete,
your problem is that the method texture you are trying to find does not exist. If you look carefully at your declaration of the method signature in the GetMethodID call you will see "([Ljava/lang/String;)V" which is trying to find a method that accepts a String array as its parameter. Remove the [ from the method signature and it should work ok. You might want to test text (jmethodID) for NULL or 0 before trying to call it as well.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Java method call from c passing string

    I have a c program which gets a char* myVar and I want to pass it to a java method which takes in a string but what ever I try I just get errors. This seems like a simple thing to do but I keep getting stuck so any help would be much appreciated. Thanks

    I think you need to expalin your problem in more detail, or better still, post some code. Then we'll be able to help.

  • DB Call from Oracle Business Rule +Java Method call from OBR

    Hi,
    1.We have a requirement in project where we need to make DB Call from Business rule.
    We are using ORACLE SOA11g.
    Is this possible.Any pointers on this will be helpfull.
    2.Can we call java method from Oracle Business Rule.If so pls suggest how it can be done.
    Thanks In Advance,
    Oracle SOA User

    You can implement java class to make database updates using JDBC. You can add Java class as fact in business rules and invoke methods as actions of the business rules.
    Hope this will help.
    Jayesh Patel
    http://jayesh-patel.blogspot.com/
    http://www.yagnasys.com/

  • Java method call from Oracle?

    is it possible to calll on a running java Class's method from Oracle Stored procedure or something?
    here is the real problem...
    let's take a example of a simple ChatServer...
    let 's say we have two or more chatserver running on the same machine and users are connected to both server. Now one user from one machine send some message to another user whois on machine two. let's for a moment assume that all message have to go through the oracle database. We know at the databse level who is connect on what server. So server1 inserts the message into the databse and trigger should send message to server1 some kind of method, which then looks up the user's thread and send the message to the user.
    any clue?

    Oracle does support Java stored procs. You could have an Oracle java proc put a message on a network connection to do this. Honestly, however, it sounds to me like you need to revisit your design. A database really isn't the place to do this. If you need to keep the two servers in synch, consider a messaging solution like JMS

  • Java function call from Trigger in Oracle

    Moderator edit:
    This post was branched from an eleven-year-old long dead thread
    Java function call from Trigger in Oracle
    @ user 861498,
    For the future, if a forum discussion is more than (let's say) a month old, NEVER resurrect it to append your new issue. Always start a new thread. Feel free to include a link to that old discussion if you think it might be relevant.
    Also, ALWAYS use code tags as is described in the forum FAQ that is linked at the upper corner of e\very page. Your formulae will be so very much more readable.
    {end of edit, what follows is their posting}
    I am attempting to do a similar function, however everything is loaded, written, compiled and resolved correct, however, nothing is happening. No errors or anything. Would I have a permission issue or something?
    My code is the following, (the last four lines of java code is meant to do activate a particular badge which will later be dynamic)
    Trigger:
    CREATE OR REPLACE PROCEDURE java_contact_t4 (member_id_in NUMBER)
    IS LANGUAGE JAVA
    NAME 'ThrowAnError.contactTrigger(java.lang.Integer)';
    Java:
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "ThrowAnError" AS
    // Required class libraries.
    import java.sql.*;
    import oracle.jdbc.driver.*;
    import com.ekahau.common.sdk.*;
    import com.ekahau.engine.sdk.*;
    // Define class.
    public class ThrowAnError {
    // Connect and verify new insert would be a duplicate.
    public static void contactTrigger(Integer memberID) throws Exception {
    String badgeId;
    // Create a Java 5 and Oracle 11g connection.
    Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    // Create a prepared statement that accepts binding a number.
    PreparedStatement ps = conn.prepareStatement("SELECT \"Note\" " +
    "FROM Users " +
    "WHERE \"User\" = ? ");
    // Bind the local variable to the statement placeholder.
    ps.setInt(1, memberID);
    // Execute query and check if there is a second value.
    ResultSet rs = ps.executeQuery();
    while (rs.next()) {
    badgeId = rs.getString("Note");
    // Clean up resources.
    rs.close();
    ps.close();
    conn.close();
    // davids badge is 105463705637
    EConnection mEngineConnection = new econnection("10.25.10.5",8550);
    mEngineConnection.setUserCredentials("choff", "badge00");
    mEngineConnection.call("/epe/cfg/tagcommandadd?tagid=105463705637&cmd=mmt%203");
    mEngineConnection.call("/epe/msg/tagsendmsg?tagid=105463705637&messagetype=instant&message=Hello%20World%20from%20Axium-Oracle");
    Edited by: rukbat on May 31, 2011 1:12 PM

    To followup on the posting:
    Okay, being a oracle noob, I didn't know I needed to tell anything to get the java error messages out to the console
    Having figured that out on my own, I minified my code to just run the one line of code:
    // Required class libraries.
      import java.sql.*;
      import oracle.jdbc.driver.*;
      import com.ekahau.common.sdk.*;
      import com.ekahau.engine.sdk.*;
      // Define class.
      public class ThrowAnError {
         public static void testEkahau(Integer memberID) throws Exception {
         try {
              EConnection mEngineConnection = new EConnection("10.25.10.5",8550);
         } catch (Throwable e) {
              System.out.println("got an error");
              e.printStackTrace();
    }So, after the following:
    SQL> {as sysdba on another command prompt} exec dbms_java.grant_permission('AXIUM',"SYS:java.util.PropertyPermission','javax.security.auth.usersubjectCredsOnly','write');
    and the following as the user
    SQL> set serveroutput on
    SQL> exec dbms_java.set_output(10000);
    I run the procedure and receive the following message.
    SQL> call java_contact_t4(801);
    got an error
    java.lang.NoClassDefFoundError
         at ThrowAnError.testEkahau(ThrowAnError:13)
    Call completed.
    NoClassDefFoundError tells me that it can't find the jar file to run my call to EConnection.
    Now, I've notice when I loaded the sdk jar file, it skipped some classes it contained:
    c:\Users\me\Documents>loadjava -r -f -v -r "axium/-----@axaxiumtrain" ekahau-engine-sdk.jar
    arguments: '-u' 'axium/***@axaxiumtrain' '-r' '-f' '-v' 'ekahau-engine-sdk.jar'
    creating : resource META-INF/MANIFEST.MF
    loading : resource META-INF/MANIFEST.MF
    creating : class com/ekahau/common/sdk/EConnection
    loading : class com/ekahau/common/sdk/EConnection
    creating : class com/ekahau/common/sdk/EErrorCodes
    loading : class com/ekahau/common/sdk/EErrorCodes
    skipping : resource META-INF/MANIFEST.MF
    resolving: class com/ekahau/common/sdk/EConnection
    skipping : class com/ekahau/common/sdk/EErrorCodes
    skipping : class com/ekahau/common/sdk/EException
    skipping : class com/ekahau/common/sdk/EMsg$EMSGIterator
    skipping : class com/ekahau/common/sdk/EMsg
    skipping : class com/ekahau/common/sdk/EMsgEncoder
    skipping : class com/ekahau/common/sdk/EMsgKeyValueParser
    skipping : class com/ekahau/common/sdk/EMsgProperty
    resolving: class com/ekahau/engine/sdk/impl/LocationImpl
    skipping : class com/ekahau/engine/sdk/status/IStatusListener
    skipping : class com/ekahau/engine/sdk/status/StatusChangeEntry
    Classes Loaded: 114
    Resources Loaded: 1
    Sources Loaded: 0
    Published Interfaces: 0
    Classes generated: 0
    Classes skipped: 0
    Synonyms Created: 0
    Errors: 0
    .... with no explanation.
    Can anyone tell me why it would skip resolving a class? Especially after I use the -r flag to have loadjava resolve it upon loading.
    How do i get it to resolve the entire jar file?
    Edited by: themadprogrammer on Aug 5, 2011 7:15 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:21 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:22 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:23 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:26 AM

  • Debug java class called from CF?

    I'm experiencing different behaviour with a Java class called from a CF page to the same class called directly from Java code.
    Is it possible for me to step into the Java class and debug it in CF builder if I attach the correct Java source?
    Pressing F5 (step-in) on the line that the method is called just skips straight over.
    Regards,
    Andy

    P5music wrote:
    I would like to be able to make a java application that has a GUI that is a rich web page.That's what applets are for.
    In this case, this page exists on my system and I can open it with my browser.
    This page does many things that are typical of a web page like displaying information and presenting rich and graphical controls
    but some of this controls are connected to a java application, launched from the web page or viceversa.I don't get this "launched from the web page" business. Is that a requirement or are you describing an existing system? Or are you describing somebody else's system whose architecture you want to imitate? Or are you using the word "launched" simply to describe the action of starting an applet?
    It still isn't clear to me what you are trying to describe. But at any rate if you want a Java program to run in your browser, that's an applet. Note that applets can interact with Javascript code in the page they are embedded in. Or if you want to download a Java application which acts as a separate application, i.e. it still runs when the browser is closed, you can use Web Start for that.

  • How to call a java method so I can pass a file into the method

    I want to pass a file into a java method method from the main method. Can anyone give me some help as to how I pass the file into the method - do I pass the file name ? are there any special points I need to put in the methods signature etc ?
    FileReader file = new FileReader("Scores");
    BufferedReader infile = new BufferedReader(file);
    Where am I supposed to put the above text - in the main method or the one I want to pass the file into to?
    Thanks

    It's a matter of personal preference really. I would encapsulate all of the file-parsing logic in a separate class that implements an interface so that if in the future you want to start taking the integers from another source, e.g. a db, you wouldn't need to drastically alter your main application code. Probably something like this, (with an assumption that the numbers are delimited by a comma and a realisation that my file-handling routine sucks):
    public class MyApp{
    public static void main(String[] args){
    IntegerGather g = new FileIntegerGatherer();
    Integer[] result = g.getIntegers(args[0]);
    public interface IntegerGatherer{
    public Integer[] getIntegers(String location);
    import java.io.*;
    public class FileIntegerGatherer implements IntegerGatherer{
    public Integer[] getIntegers(String location){
    FileInputStream fs=null;
    try{
    File f = new File(location);
    fs = new FileInputStream(f);
    byte[] in = new byte[1024];
    StringBuffer sb = new StringBuffer();
    while((fs.read(in))!=-1){
    sb.append(new String(in));
    StringTokenizer st = new StringTokenizer(sb.toString(),",");
    Integer[] result = new Integer[st.countTokens()];
    int count = 0;
    while(st.hasMoreTokens()){
    result[count]=Integer.valueOf(st.nextToken());
    count++;
    catch(IOException e){
    //something sensible here
    finally{
    if(fs!=null){
    try{
    fs.close();
    catch(IOException f){
    return result;
    Once compiled you could invoke it as java MyApp c:\myInts.txt
    Sorry if there are typos in there, I don't have an ide open ;->

  • Facing problem in JavaStoredProc being called from plsql pass JPublisher

    I'm facing problems in calling java stored procedure from a plsql procedure.
    1) I have a plsql types
    create or replace type wwpro_api_portlet_instance
    as object
    portlet_inst_guid varchar2(60),
    provider_id number(38),
    portlet_id number(38),
    ref_path varchar2(100)
    create or replace type wwpro_api_portlet_instances
    as table of wwpro_api_portlet_instance
    2)I create java classes from JPublisher for these types as attached with this mail.
    3) There is a sql procedure where I create a instance of wwpro_api_portlet_instances with values populated in it.
    and then pass it to another procedure which is a CallSPec for the java class.
    Call Spec
    procedure export_data_internal
    p_http_url in varchar2,
    p_timeout in number,
    p_service_id in varchar2,
    p_proxy_host in varchar2,
    p_proxy_port in number,
    p_proxy_username in varchar2,
    p_proxy_password in varchar2,
    p_portal_version in varchar2,
    p_encryption_key in varchar2,
    p_message_lang in varchar2,
    p_export_id in varchar2,
    p_provider_id in varchar2,
    p_debug_level in number,
    p_portlet_instances in wwpro_api_portlet_instances
    )as language java
    name 'oracle.webdb.provider.web.ExportImportClient.exportData(
    java.lang.String,
    int,
    java.lang.String,
    java.lang.String,
    int,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.Integer,
    oracle.webdb.provider.web.PortletInstanceArray
    Procedure calling Call Spec
    procedure export_data
    p_export_id in varchar2,
    p_provider_id in number,
    p_portlet_instances in wwpro_api_provider.portlet_instance_table
    ) is
    begin
    --calling Call Spec
    export_data_internal
    p_http_url => l_provider.http_url,
    p_timeout => l_provider.timeout,
    p_service_id => l_provider.service_id,
    p_proxy_host => l_provider.dbtier_proxy_hostname,
    p_proxy_port => l_provider.dbtier_proxy_portnumber,
    p_proxy_username => l_proxy_info.username,
    p_proxy_password => l_proxy_info.password,
    p_portal_version => wwctx_api.get_product_version(),
    p_encryption_key => wwpro_util.get_encryption_key(p_provider_id, TRUE),
    p_message_lang => l_provider.language,
    p_export_id => p_export_id,
    p_provider_id => p_provider_id,
    p_debug_level => wwpro_util.get_debug_level,
    p_portlet_instances => l_portlet_instances <== Populated as I'm sure about it.
    //this gets 'EXP :ORA-29532: Java call terminated by uncaught Java exception: java.sql.SQLExc
    eption: Closed Connection'
    end export_data;
    4)Inside the Java class 'oracle.webdb.provider.web.ExportImportClient'.
    public static void exportData
    String url,
    int timeout,
    String serviceId,
    String proxyHost,
    int proxyPort,
    String proxyUser,
    String proxyPass,
    String portalVersion,
    String sharedKey,
    String messageLocale,
    String exportId,
    String providerId,
    Integer portalDebugLevel,
    PortletInstanceArray instances
    )throws Exception
    oracle.webdb.provider.v2.adapter.soapV1.SOAPException
    try
    conn = DriverManager.getConnection("jdbc:default:connection:");
    stmt = conn.createStatement();
    stmt.execute ("INSERT INTO d VALUES ('into ExportImportClient.exportData ')");
    stmt.execute ("INSERT INTO d VALUES ('FROM ExportImportClient.exportData url :: " + url +"')");
    stmt.execute ("INSERT INTO d VALUES ('FROM ExportImportClient.exportData instances:: " + instances +"')");
    // Prints this ==> FROM ExportImportClient.exportData instances:: oracle.webdb.provider.web.PortletInstanceArray@78e2087c
    stmt.execute ("INSERT INTO d VALUES ('FROM ExportImportClient.exportData debugLevel:: " + portalDebugLevel +"')");
    stmt.execute ("INSERT INTO d VALUES ('FROM ExportImportClient.exportData instances:: " + instances.length() +"')");
    //This Operation is giving the problem as any operation performed on this is clsing the Connection and comming out.
    //This has worked once but did not work after that, I tried this in the 10g as well as 901
    conn.commit();
    }catch(SQLException sqe){
    stmt.execute ("INSERT INTO d VALUES ('FROM ExportImportClient.exportData sqe error :: " + sqe.getMessage() +"')");
    conn.commit();
    throw sqe;
    catch(Exception e)
    stmt.execute ("INSERT INTO d VALUES ('FROM ExportImportClient.exportData exception error :: " + e.getMessage() +"')");
    stmt.execute ("INSERT INTO d VALUES ('FROM ExportImportClient.exportData exception error :: " + e.getClass() +"')");
    conn.commit();
    throw e;
    Any reason what may be happening ? I have done the loadJava of the Jpublisher classes once in the database. After that I never made any changes to
    them, I just modify and upload the oracle.webdb.provider.web.ExportImportClient class.
    What Shold I try to over come this ?
    Also
    thanks
    rahul

    I'm facing problems in calling java stored procedure from a plsql procedure.
    1) I have a plsql types
    create or replace type wwpro_api_portlet_instance
    as object
    portlet_inst_guid varchar2(60),
    provider_id number(38),
    portlet_id number(38),
    ref_path varchar2(100)
    create or replace type wwpro_api_portlet_instances
    as table of wwpro_api_portlet_instance
    2)I create java classes from JPublisher for these types as attached with this mail.
    3) There is a sql procedure where I create a instance of wwpro_api_portlet_instances with values populated in it.
    and then pass it to another procedure which is a CallSPec for the java class.
    Call Spec
    procedure export_data_internal
    p_http_url in varchar2,
    p_timeout in number,
    p_service_id in varchar2,
    p_proxy_host in varchar2,
    p_proxy_port in number,
    p_proxy_username in varchar2,
    p_proxy_password in varchar2,
    p_portal_version in varchar2,
    p_encryption_key in varchar2,
    p_message_lang in varchar2,
    p_export_id in varchar2,
    p_provider_id in varchar2,
    p_debug_level in number,
    p_portlet_instances in wwpro_api_portlet_instances
    )as language java
    name 'oracle.webdb.provider.web.ExportImportClient.exportData(
    java.lang.String,
    int,
    java.lang.String,
    java.lang.String,
    int,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.String,
    java.lang.Integer,
    oracle.webdb.provider.web.PortletInstanceArray
    Procedure calling Call Spec
    procedure export_data
    p_export_id in varchar2,
    p_provider_id in number,
    p_portlet_instances in wwpro_api_provider.portlet_instance_table
    ) is
    begin
    --calling Call Spec
    export_data_internal
    p_http_url => l_provider.http_url,
    p_timeout => l_provider.timeout,
    p_service_id => l_provider.service_id,
    p_proxy_host => l_provider.dbtier_proxy_hostname,
    p_proxy_port => l_provider.dbtier_proxy_portnumber,
    p_proxy_username => l_proxy_info.username,
    p_proxy_password => l_proxy_info.password,
    p_portal_version => wwctx_api.get_product_version(),
    p_encryption_key => wwpro_util.get_encryption_key(p_provider_id, TRUE),
    p_message_lang => l_provider.language,
    p_export_id => p_export_id,
    p_provider_id => p_provider_id,
    p_debug_level => wwpro_util.get_debug_level,
    p_portlet_instances => l_portlet_instances <== Populated as I'm sure about it.
    //this gets 'EXP :ORA-29532: Java call terminated by uncaught Java exception: java.sql.SQLExc
    eption: Closed Connection'
    end export_data;
    4)Inside the Java class 'oracle.webdb.provider.web.ExportImportClient'.
    public static void exportData
    String url,
    int timeout,
    String serviceId,
    String proxyHost,
    int proxyPort,
    String proxyUser,
    String proxyPass,
    String portalVersion,
    String sharedKey,
    String messageLocale,
    String exportId,
    String providerId,
    Integer portalDebugLevel,
    PortletInstanceArray instances
    )throws Exception
    oracle.webdb.provider.v2.adapter.soapV1.SOAPException
    try
    conn = DriverManager.getConnection("jdbc:default:connection:");
    stmt = conn.createStatement();
    stmt.execute ("INSERT INTO d VALUES ('into ExportImportClient.exportData ')");
    stmt.execute ("INSERT INTO d VALUES ('FROM ExportImportClient.exportData url :: " + url +"')");
    stmt.execute ("INSERT INTO d VALUES ('FROM ExportImportClient.exportData instances:: " + instances +"')");
    // Prints this ==> FROM ExportImportClient.exportData instances:: oracle.webdb.provider.web.PortletInstanceArray@78e2087c
    stmt.execute ("INSERT INTO d VALUES ('FROM ExportImportClient.exportData debugLevel:: " + portalDebugLevel +"')");
    stmt.execute ("INSERT INTO d VALUES ('FROM ExportImportClient.exportData instances:: " + instances.length() +"')");
    //This Operation is giving the problem as any operation performed on this is clsing the Connection and comming out.
    //This has worked once but did not work after that, I tried this in the 10g as well as 901
    conn.commit();
    }catch(SQLException sqe){
    stmt.execute ("INSERT INTO d VALUES ('FROM ExportImportClient.exportData sqe error :: " + sqe.getMessage() +"')");
    conn.commit();
    throw sqe;
    catch(Exception e)
    stmt.execute ("INSERT INTO d VALUES ('FROM ExportImportClient.exportData exception error :: " + e.getMessage() +"')");
    stmt.execute ("INSERT INTO d VALUES ('FROM ExportImportClient.exportData exception error :: " + e.getClass() +"')");
    conn.commit();
    throw e;
    Any reason what may be happening ? I have done the loadJava of the Jpublisher classes once in the database. After that I never made any changes to
    them, I just modify and upload the oracle.webdb.provider.web.ExportImportClient class.
    What Shold I try to over come this ?
    Also
    thanks
    rahul

  • Custom Java method call

    I created a new service which should call a java method. It is called from the confirm htm page after check in of a new content item.
    Serice Name INVOKE_ESB_CLIENT
    DIR - custom/component/classes/invokeESBClient
    Class - InvokeESBClient
    method - invokeESBclient
    ServiceHandlers serviceName - DocService
    handler - invokeESBClient.InvokeESBClient
    This is all done in a component which has a service handler to point it the proper directory and class. But I get the following error. Your help is appreciated.
    Unable to execute service INVOKE_ESB_CLIENT and function invokeESBclient.
    (System Error: The service method 'invokeESBclient' is not defined.) The service method 'invokeESBclient' is not defined.
    An error has occurred. The stack trace below shows more information.
    !csServiceDataException,INVOKE_ESB_CLIENT,invokeESBclient!$!csSystemError,\!csMethodNotDefined\,invokeESBclient!csMethodNotDefined,invokeESBclient
    intradoc.common.ServiceException: !csServiceDataException,INVOKE_ESB_CLIENT,invokeESBclient!$!csSystemError,\!csMethodNotDefined\,invokeESBclient
         at intradoc.server.ServiceRequestImplementor.buildServiceException(ServiceRequestImplementor.java:1742)
         at intradoc.server.Service.buildServiceException(Service.java:1997)
         at intradoc.server.Service.createServiceExceptionEx(Service.java:1991)
         at intradoc.server.Service.createServiceException(Service.java:1986)
         at intradoc.server.ServiceRequestImplementor.handleActionException(ServiceRequestImplementor.java:1453)
         at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1420)
         at intradoc.server.Service.doAction(Service.java:452)
         at intradoc.server.ServiceRequestImplementor.doActions(ServiceRequestImplementor.java:1194)
         at intradoc.server.Service.doActions(Service.java:447)
         at intradoc.server.ServiceRequestImplementor.executeActions(ServiceRequestImplementor.java:1114)
         at intradoc.server.Service.executeActions(Service.java:433)
         at intradoc.server.ServiceRequestImplementor.doRequest(ServiceRequestImplementor.java:635)
         at intradoc.server.Service.doRequest(Service.java:1707)
         at intradoc.server.ServiceManager.processCommand(ServiceManager.java:359)
         at intradoc.server.IdcServerThread.run(IdcServerThread.java:197)
    Caused by: intradoc.data.DataException: !csMethodNotDefined,invokeESBclient
         at intradoc.server.Service.doCodeEx(Service.java:518)
         at intradoc.server.Service.doCode(Service.java:472)
         at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1353)
         ... 9 more

    Answers to your questions:
    1. Yes i have compiled the java files, more than once again just to confirm. I unit tested the class by running as a java application before using it in the component.
    2. No, but I did do it after you suggested it. I still get the same error.
    3. Yes classes directory has been added to y components custom classpath.
    4. No, i have not sacified 5.25 in floppy but at this point is I am willing to sacrifice my whole laptop.
    Within the component I have directory named classes and directory name invokeESBClient and then
    component
    ..........classes
    .................invokeESBClient
    .........................InvokeESBClient.class
    .........................InvokeESBClient.java
    This is the contents of resource table
    Resource Tables
    Merge To: ServiceHandlers
    <@table Java_Method_Call@>
    <table border=1><caption><strong>
    <tr>
    <td>serviceName</td><td>handler</td> <td>searchOrder</td>
    </tr>
    <tr>
    <td>DocService</td> <td>invoiceESBClient.InvokeESBClient</td> <td>5</td>
    </tr>
    <@end@>
    I hope this provides enough information.

  • Native - Java Method Call problem - "Wrong Method ID..."

    I am writing a 3d game engine using c++, with all the game logic code in Java, for the purpose of making the thing extendible, easily modifyable, etc...
    I am using J2SE JDK 1.2.2.
    Most things work fine (engine-wise), but i have a few questions about problems i am having getting the JNI to work correctly with calls to Java Methods.
    1. If I use FindClass() to get a jclass reference to a named class, I get one number back. If I then instantiate this class, and then call GetObjectClass() with the instance, I get another number, **which doesnt appear to work for anything**. What is going on here? Can the JVM give different jclass numbers for the same class? Is GetObjectClass() supposed to work?
    2. Is AllocObject() alright for instantiating Java objects? It does seem to allocate memory, and method calls work to the new object. I am aware that it doesn't call a constructor, but I like that, seeing as the initialization is handled through a different [network-synchronized] means.
    3. Using a jclass retrieved using FindClass(), which I store in a global variable, I am able to call methods on an instance that I created in a certain function. I then make sure (?) that the GC can't reclaim the class or object memory by getting a NewGlobalReference to both of them [just to be safe]. However, in a later function, I am unable to call methods using my stored method IDs, ["Wrong Method ID....JVM has been asked to shut down this application in an unusual manner..."]. I am also unable to acquire new methodIDs, as the system returns 0xCCCCCCCC for all method ID queries. Obviously, attempting to use those bogus method IDs results in a JVM crash, in a segment called [2 deep in the untraceable depths of JVM.dll] from the JNI CallVoidMethodV() function. Why is this happening? Is the GC getting in there despite my best efforts? Is it illegal to cache methodIDs, jclass references or jobject references? aaarrggh! :)
    Thanks
    Chris Forbes
    Lead Programmer
    Sprocket Interactive
    [email protected]

    Hi Chris,
    I hit the same sort of problem, when writing a JVMDI ( VM debugger hook ), in C++.
    My question remained unanswered too
    http://forum.java.sun.com/thread.jsp?forum=47&thread=461503&tstart=30&trange=30
    I didn't try a call to NewGlobalRef, as you did... but it sounds like it could be what I was missing.
    I've a couple of ideas, but nothing definite for you.
    1) maybe there's more than one classloader, so that multiple copies of the class are loaded
    2) ensure you're compiling your DLL with "quad-word" ( 8 byte ) alignment.
    Otherwise all your JNI references will be misaligned !
    Since the JNI reference maps to a C++ pointer, it's possible that you can't cache any JNI references.
    That's my vague feeling on the subject.
    As a workaround, you may have to keep requesting any JNI references, eg. jclass & jmethod's, as you need them.
    regards,
    Owen

  • Clarification on application method calls from backing bean.

    Hi Experts ,
    In our application we are using two different ways to call application module methods from backing bean.
    allication module method name : addRowValidUnitInfo
    it has 2 parameters serialNumber,modelNumber
    1.
    BindingContainer bindings1 =
    BindingContext.getCurrent().getCurrentBindingsEntry();
    OperationBinding serialModelDetails =
    bindings1.getOperationBinding("addRowValidUnitInfo");
    serialModelDetails.getParamsMap().put("serialNumber",
    serialNumber.getValue().toString());
    serialModelDetails.getParamsMap().put("modelNumber",
    modelNumber.getValue().toString());
    serialModelDetails.execute();
    String result =serialModelDetails.getResult().toString();
    2.
    EWarrantyAdminModule appModule =(EWarrantyAdminModule)
    Configuration.createRootApplicationModule(amDef,config);
    try {
    String result = appModule.addRowValidUnitInfo(serialNumber.getValue().toString(), modelNumber.getValue().toString());
    } catch (Exception e) {
    finally {
    Configuration.releaseRootApplicationModule(appModule,true);
    Can any one tell me which one gives best performance and which one should be used in which situations.
    For me both are working fine but just want to know whcih is the best practice and which gives best performance.
    Regards
    Gayaz

    The approach 1 is the right way.
    Reasons:
    1) With Approach 2 - you are creating new ApplicationModule on the fly and release it at the end of the request. If you are invoking multiple method calls, you need to the same for each & every call.
    This is not reusing the existing application module.
    2) If the use cases which does calls for maintaining state across requests from the same client - across the application flow, Approach 2 cannot be used.
    Read this blog post from Jobinesh (which indirectly distinguishes both these approaches).
    http://jobinesh.blogspot.com/2010/04/invoking-applicationmodule-from-servlet.html
    Thanks,
    Navaneeth

  • Read method calls from a file.

    I am working on an event driven program that has various events listed in a file that are supposed to be read in and used. I can go through the pain staking process of using StringTokenizer and .substring to figure which event is which, but I want to know if there would be an easier process of reading in the events. (Can't Cast them)
    Any suggestions?
    Shawn

    Hi Again
    U can go for StreamTokenizer in java.io
    this is useful for tokenizing a Stream based on delimiters
    It has Two Cons for both Type of Streams either Char or Bin
    public java.io.StreamTokenizer(java.io.InputStream);
    public java.io.StreamTokenizer(java.io.Reader);
    The StreamTokenizer class takes an input stream and parses it into "tokens", allowing the tokens to be read one at a time. The parsing process is controlled by a table and a number of flags that can be set to various states. The stream tokenizer can recognize identifiers, numbers, quoted strings, and various comment styles.
    U hav to invoke a method called nextToken Form which u will get a token which can be compared to find wether it is a word or character ....using the constanrs avlbl in StreamTokenizer class
    TT_WORD indicates that the token is a word.
    TT_NUMBER indicates that the token is a number.
    TT_EOL indicates that the end of line has been read. The field can only have this value if the eolIsSignificant method has been called with the argument true.
    TT_EOF indicates that the end of the input stream has been reached
    Alll the Very Best
    Rgds
    Sriram

  • BackingBean Method call from Task flow isnot getting  the Binding Container

    Hi All,
    I am trying to call a backing bean method from a task flow using method call activity, where my page belongs to.
    In this method I am trying to get the binding container,
          DCBindingContainer dcbindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
          OperationBinding operationCreate = dcbindings.getOperationBinding("CreateInsert"); but it is evaluating to null and throwing null pointer exception.
    javax.el.ELException: java.lang.NullPointerException
         at com.sun.el.parser.AstValue.invoke(AstValue.java:161)
         at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         at oracle.adf.controller.internal.util.ELInterfaceImpl.invokeMethod(ELInterfaceImpl.java:168)
         at oracle.adfinternal.controller.activity.MethodCallActivityLogic.execute(MethodCallActivityLogic.java:161)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.executeActivity(ControlFlowEngine.java:989)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:878)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:777)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.routeFromActivity(ControlFlowEngine.java:551)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.performControlFlow(ControlFlowEngine.java:147)
         at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleAdfcNavigation(NavigationHandlerImpl.java:109)
         at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:78)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:130)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)I guess, I miss something in this process, but no idea what it is ...!!!!
    Any help will be appreciated.
    I am using Studio Edition Version 11.1.1.3.0
    Ranjith

    Hi Arun,
    In my task flow i am calling a jspx page as a popup,
    through my jspx page I can do all these operations,
    but the problem is when I am trying to call a method written in the Backing bean of that page, at that time only the method is not getting the bindings.
    Create insert operation is there in the bindings....
    Ranjith

  • Java functions call from C++ App

    Hi,
    I'm new to Java, One of our client have generic APIs for there business logic, those are written in JAVA, now we want to use some of these APIs in C++ application. Can any one suggest/address me the better way to do this?
    Thanks in advance.
    Thanks,
    --Ravi Kiran.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    To call Java functions from C++ you need a VM running in your process, and JNI is the interface you need to use in the C++ code.
    One of the interfaces in JNI lets you create a VM. You generally only want one VM, so if the application started out in Java, you have a VM already and you don't need to create one.
    Note that JNI is really a C <-> Java interface, and usually any C++ code called from Java is C++ 'extern "C"' functions. Java won't know anything about C++ objects. And you use JNI to get C++ to understand Java objects.
    Hope this was helpful.

  • Java function call from C++ Application

    I'm new to Java, One of our client have generic APIs for there business logic, those are written in JAVA, now we want to use some of these APIs in C++ application. Can any one suggest/address me the better way to do this?
    Thanks in advance.
    Thanks
    --Ravi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hi,
    There is an API you can use: JNI, the Java Native Interface. It makes it possible to make method calls Java - C/C++ and vice versa.
    There are some good books, and a good online tutorial, that can help you get along using JNI.
    You'll find the tutorial at: http://java.sun.com/docs/books/tutorial/native1.1/index.html
    I recommend you to get a copy each of:
    "Core Java2: Volume 1 - fundamentals"
    "Core Java2:Volume 2 - advanced features"
    ... as they cover all basic concepts of Java up to the point of using JNI(!). Try to get the seventh edition as it covers the latest release, JDK 1.5. Both volumes has Hortsmann and Cornell as authors.
    "Essential JNI" by Rob Gordon is also a good book, a bit old by now though, but full of good examples.
    Hope this helps

Maybe you are looking for

  • Wireless connection to IPad 1

    I am unable to connect to the internet.  Was working fine but now keeps cutting out even though internet signal is strong.  I have tried rebooting, turning wifi off and on, forgeting network and resetting it.  All work for about 2 minutes and then it

  • Undo copy can't redo. and I can't post in the Mac OS 10.4-10.6

    Is there a way to delete posts? Cause Now I'm stuck with it on this board. -_- Message was edited by: ThatChineesYouth

  • Help needed to setup wireless printing

    I have less than a month's experience of using a Mac but am really enjoying my purchase so far. The one issue that I have not been able to solve is printing. I have a HP Photosmart P1000 which I can successfully print to via USB but I have had no suc

  • How do I retrieve mails from a time machine backup of a different computer?

    I had to reformat my computer because of a trojan file I couldn't eradicate, and I didn't want to restore files from a time machine backup for fear of reinstalling the trojan. After reinstalling OS Maverick, my MacBook Pro from early 2009 is now back

  • BOM Explosion in CRM5.0 sales contracts. Is it possible?

    Hello CRM Gurus We have a situation where we have downloaded sales boms from ECC6.0 to CRM5.0 as structured products... Now I want to use this product on sales contract and based upon item category determination and other setting on item category suc