BAPI function call in Java

Hi,
I am trying to make BAPI function call in JAVA. I am using the following libraries for IBM AIX version and the sapjco.jar
1) librfccm.o
2) libsapjcorfc.so
The above 2 libraries are in my java lib path.
But I get a exception and it is referring to sapjcorfc.dll (which is a windows version) instead of referring to libsapjcorfc.so
What should I do so that it refers to libsapjcorfc.so and not sapjcorfc.dll
Error Details:   java.lang.ExceptionInInitializerError: JCO.classInitialize():
Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc
[sapjcorfc (A file or directory in the path name does not exist.)]. java.library.path
[/usr/java14_64/jre/bin:/usr/java14_64/jre/bin:/usr/java14_64/jre/bin/classic:/usr/java14_64/jre/bin:
/usr/sap/DP0/DVEBMGS42/exe:/usr/sap/DP0/DVEBMGS42/exe:/usr/sap/DP0/DVEBMGS42/exe:
/tmp/sapinst_exe.1081378.1199455057:/usr/sap/DP0/SYS/exe/run:/home/db2inst1/sqllib/lib64:
/usr/sap/DP0/DVEBMGS42/exe::/usr/lib:/usr/sap/DP0/DVEBMGS42/j2ee/os_libs:/usr/sap/DP0/DVEBMGS42/exe:
/usr/sap/DP0/DVEBMGS42/exe:/usr/sap/DP0/DVEBMGS42/exe:/usr/lib:/lib:/usr/sap/DP0/SYS/exe/run:
/home/db2inst1/sqllib/lib64]

Hi Jawed,
when  I try it as a stand alone java code on IBM AIX version BAPI connection works and it fetches the roles listed for an user from the ACTIVITYGROUP table.
The same piece of code bundled in an ear and when deployed in SAP netweaver portal gives different errors. My sapjco.jar is in application lib folder and it is referred in classpath
first time when i access the application url it gives me
Error Details: java.lang.ExceptionInInitializerError: JCO.classInitialize():
Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc
http://sapjcorfc (A file or directory in the path name does not exist.). java.library.path
[/usr/java14_64/jre/bin:/usr/java14_64/jre/bin:/usr/java14_64/jre/bin/classic:/usr/java14_64/jre/bin:
/usr/sap/DP0/DVEBMGS42/exe:/usr/sap/DP0/DVEBMGS42/exe:/usr/sap/DP0/DVEBMGS42/exe:
/tmp/sapinst_exe.1081378.1199455057:/usr/sap/DP0/SYS/exe/run:/home/db2inst1/sqllib/lib64:
/usr/sap/DP0/DVEBMGS42/exe::/usr/lib:/usr/sap/DP0/DVEBMGS42/j2ee/os_libs:/usr/sap/DP0/DVEBMGS42/exe:
/usr/sap/DP0/DVEBMGS42/exe:/usr/sap/DP0/DVEBMGS42/exe:/usr/lib:/lib:/usr/sap/DP0/SYS/exe/run:
/home/db2inst1/sqllib/lib64]
when i acess the application url next time it gives me
Application error occurred during request processing.
  Details:   java.lang.NoClassDefFoundError: com.sap.mw.jco.JCO (initialization failure)
Exception id: [00145EB7604700720000000F000C20FE00047CA4F0EF0615]
Below is my my javacode - I am calling the method getUserRoles
package com.mysap.sso;
import com.sap.mw.jco.*;
import java.util.ArrayList;
import java.util.List;
public class BapiConnection {
     private static JCO.Client mConnection;
     private static JCO.Repository mRepository;
     private static JCO.Function createFunction(String functionName)
               throws Exception {
          try {
               IFunctionTemplate ft = mRepository.getFunctionTemplate(functionName
                         .toUpperCase());
               if (ft == null) {
                    return null;
               } else {
                    return ft.getFunction();
          } catch (Exception ex) {
               throw ex;
     public List getUserRoles(String user) {
          JCO.Function function = null;
          JCO.Table activitygroups = null;
          List rolesList = null;
          mConnection = null;
          mRepository = null;
          mConnection = JCO.createClient("300", "INVTRY_SEGMT", "Welcome%1",
                    null, "ade00fe", "22");
          try {
               //Connect to the WebAS ABAP with the parameters above
               mConnection.connect();
               //Create a function repository to be able to build a function
               mRepository = new JCO.Repository("INVTRY_SEGMT", mConnection);
               //Get the function
               function = createFunction("BAPI_USER_GET_DETAIL");
               //Set the only import parameter
               function.getImportParameterList().setValue(user, "USERNAME");
               //Execute the function
               mConnection.execute(function);
               //Get the 'ADDRESS' return structure
               activitygroups = function.getTableParameterList().getTable(
                         "ACTIVITYGROUPS");
               rolesList = new ArrayList();
               for (int i = 0; i < activitygroups.getNumRows(); i++, activitygroups
                         .nextRow()) {
                    System.out.println(activitygroups.getString("AGR_NAME"));
                    logger.debug(activitygroups.getString("AGR_NAME"));
                    rolesList.add(activitygroups.getString("AGR_NAME"));
               mConnection.disconnect();
          } catch (Exception ex) {
               System.err.println(ex.toString());
          return rolesList;

Similar Messages

  • How to call a C function calling a Java Method from another C function ?

    Hi everyone,
    I'm just starting to learn JNI and my problem is that I don't know if it is possible to call a C function calling a Java Method (or doing anything else with JNI) from another C function.
    In fact, after receiving datas in a socket made by a C function, I would like to create a class instance (and I don't know how to do it too ; ) ) and init this instance with the strings I received in the socket.
    Is all that possible ?
    Thank you very much for your help !

    Hard to understand the question, but by most interpretations the answer is going to be yes.
    You do of course understand that JNI is the "API" that sits between Java and C and that every call between the two must go through that. You can't call it directly.

  • Bapi Function call from Crystal reports 2008. import parameters syntax.

    Dear,
    I have an issue with calling a function directly from Crystal reports (2008) in the R3 system.
    (if this belongs in another thread , please add the link if moved !)
    I try to get data through function "BAPI_CLASS_GET_CLASSIFICATIONS".
    Till now all possible input parameters have no data-result.
    I already read other threads stating that 'for example' the Language key needs to be provided in a single character. 'E' in stead of 'EN'.
    I also already created a Z-wrap-function that fills out all input parameters 'hardcoded'. This works.
    clearly there are som syntax changes in passing the values to R3 when called from Crystal Reports.
    Can someone state which syntax has to be followed for numeric fields, for datefields etc. (so when i make these dynamical, I know which syntax should be the outcome of the formula)
    in my function that doesn't work I use these selections:
    (this function is called in a standard report only calling this function)
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.I_LANGU_ISO} = "E" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.I_LANGU_INT} = "E" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.T_CLASS_OBJECTS.OBJECT_TYPE} = "MARA" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.T_CLASS_OBJECTS.OBJECT_KEY} = "000000000000000085" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.I_CLASSNUM} = "DSWTEST" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.I_CLASSTYPE} = "001" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.I_KEY_DATE} = Date (2011, 08, 05)
    I already tried other languages or the 'EN' as input.
    (I would like to know how the date is passed exaclty to R3.)
    The function is of course RFC enabled.
    when I call the my Z-function with predefined inputparameters in R3 it does give the wanted result.
    FUNCTION ZBAPI_CLASS_GET_CLASSIFICATION.
    ""Local Interface:
    *"  TABLES
    *"      OBJECT_CLASSIFICATION STRUCTURE  BAPI_OBJECT_VALUES
    *"      CLASS_OBJECTS STRUCTURE  BAPI_CLASS_OBJECTS
    data ZOBJECT_CLASSIFICATION type TABLE OF BAPI_OBJECT_VALUES.
    data ZCLASS_OBJECTS  type TABLE OF BAPI_CLASS_OBJECTS WITH HEADER LINE.
    ZCLASS_OBJECTS-OBJECT_KEY = '000000000000000085'.
    ZCLASS_OBJECTS-OBJECT_TYPE = 'MARA'.
    Append ZCLASS_OBJECTS.
    CALL FUNCTION 'BAPI_CLASS_GET_CLASSIFICATIONS'
      EXPORTING
        CLASSTYPE                    = '001'
        CLASSNUM                     = 'DSWTEST'
    *   KEY_DATE                     = SY-DATUM
    *   LANGU_ISO                    =
    *   LANGU_INT                    =
    *   CHARACTS_OF_CLASS_ONLY       =
    * IMPORTING
    *   RETURN                       =
      TABLES
        OBJECT_CLASSIFICATION        = ZOBJECT_CLASSIFICATION
        CLASS_OBJECTS                = ZCLASS_OBJECTS
    OBJECT_CLASSIFICATION[] = ZOBJECT_CLASSIFICATION[].
    ENDFUNCTION.
    please advise.
    once again if this should be moved to another forum , add the link please!

    Dear,
    I just debugged my Z-function, after adding all input parameters as in the standard BAPI function.
    All parameters seems to be passed correctly except from the table parameters from
    CLASS_OBJECTS
    So all I_parameters are passed :
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_LANGU_INT} = "EN" and
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_LANGU_ISO} = "EN" and
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_KEY_DATE} = Date (2011, 08, 05) and
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_CLASSNUM} = "DSWTEST" and
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_CLASSTYPE} = "001" and
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_CHARACTS_OF_CLASS_ONLY.BAPIFLAG} = ""
    but the table parameters aren't coming through:
    {ZBAPI_CLASS_GET_CLASSIFICATION.T_CLASS_OBJECTS.OBJECT_TYPE} = "MARA" and
    {ZBAPI_CLASS_GET_CLASSIFICATION.T_CLASS_OBJECTS.OBJECT_KEY} = "000000000000000085" and
    these are 'blanco' in the function.
    also after the function is executed and all data is retrieved, when passing the data back to Crystal reports, once again, the table result isn't passed to Crystal Reports.
    please advise

  • Duration of an Abap Function call from Java using Jco3

    Hi guys!
    I would like to use this discussion to get some refernces of the duration Timespan of an RFC call from Java to SAP. At the moment, i need at last about 200ms to call the Abap function. I'm just using one simple import and export parameter (so no deep structures). I think that the reason for my poor performance is, that the Java Tool and the SAP instance are not in the same network. So, i hope some of you have some data, how fast an RFC call from Java using Jco can be executed.
    greetings, Hannes

    Hi Hannes,
    I think you have already got the answer to your question - the network set-up you have is probably the bottleneck.  Whenever I've worked with Java <-> ABAP and they are in the same network, I've had no performance problems at all.
    Does your RFC contain any complex logic or business processes?  Are you able to try and call something that does nothing, say it just accepts an input string and returns it straight away as an export.  Do you have any scope for testing with your Java tool on the same network as the SAP system?
    Cheers,
    G.

  • Function calling the java code

    I have a java code that returns the size of the file name. I have created a pl/sql function that calls the method in the java class.
    The problem I face is , when I try to call the function using the command "CALL f_size('C:\Batch\Query.sql')into :leng " , the error comes reporting that
    "No method func in class fSize ".
    I have given both the java& pl/sql code. Can anyone help me out?
    import java.io.*;
    public class fSize {
    public static long func(String s)
    File file = new File(s);
    long length = file.length();
    return length;
    create or replace function f_size(path varchar2) return number
    as language java
    name 'fSize.func(String) return java.lang.Long';

    What version of the database are you runnning?
    If Oracle 9.2 or later, no need for java code. Use UTL_FILE.FGETATTR procedure.
    FGETATTR Procedure
    This procedure reads and returns the attributes of a disk file.
    Syntax
    UTL_FILE.FGETATTR(
       location    IN VARCHAR2,
       filename    IN VARCHAR2,
       exists      OUT BOOLEAN,
       file_length OUT NUMBER,
       blocksize   OUT NUMBER);
    Parameters
    Table 95-24 FGETATTR Procedure Parameters
    Parameters Description
    location
    Directory location of the source file, a DIRECTORY_NAME from the ALL_DIRECTORIES view (case sensitive)
    filename
    The name of the source file to be copied
    exists
    A BOOLEAN for whether or not the file exists
    file_length
    The length of the file in bytes. NULL if file does not exist.
    blocksize
    The file system block size in bytes. NULL if the file does not exist.
    SQL> create or replace and compile java source named "fSize" as
      2  import java.io.*;
      3  public class fSize {
      4      public static long func(java.lang.String s)
      5      {
      6          File file = new File(s);
      7          long length = file.length();
      8          return length;
      9      }
    10  };
    11  /
    Java created.
    SQL> show errors
    No errors.
    SQL> create or replace function f_size(path varchar2) return number
      2  as language java
      3  name 'fSize.func(java.lang.String) return java.lang.Long';
      4  /
    Function created.
    SQL>
    SQL> select f_size('C:\sqlnet.log') from dual ;
    F_SIZE('C:\SQLNET.LOG')
                        762
    1 row selected.
    SQL>
    SQL>
    SQL> disconnect
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.3.0 - Production
    SQL>

  • Asynchronous function calls in Java?

    I need to write a class whose functions i could call asynchronously. How do we do this? Is this part of the Java API or do i need something else?
    Thank you in advance.

    I am actually very surprised that this is not part of
    the regular API. I always thought this would be built
    into the languageLet's see...
    C, Objective-C, C++, C#, Perl, Basic, Pascal, Fortran, Cobol, Forth, Algol, Snobol, Lisp, Smalltalk, SQL, JavaScript, VBScript, PerlScript, Plato(sp?), a number of script languages on different OSes and a number of mini-languages as well...
    And not a single one that provides anything for doing asynchronous method calls.
    So it doesn't surprise me that Java doesn't have it.
    Now there might be some experimental language that does this but main stream languages do not.
    Of course most of those languages do provide a way to start a thread and add processing logic to it. Although some of the ones I used did not even do that.

  • Java.lang.VerifyError - Incompatible object argument for function call

    Hi all,
    I'm developing a JSP application (powered by Tomcat 4.0.1 in JDK 1.3, in Eclipse 3.3). Among other stuff I have 3 classes interacting with an Oracle database, covering 3 use cases - renaming, adding and deleting an database object. The renaming class simply updates the database with a String variable it receives from the request object, whereas the other two classes perform some calculations with the request data and update the database accordingly.
    When the adding or deleting classes are executed, by performing the appropriate actions through the web application, Tomcat throws the following:
    java.lang.VerifyError: (class: action/GliederungNewAction, method: insertNewNode signature: (Loracle/jdbc/driver/OracleConnection;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V) Incompatible object argument for function call
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:120)
         at action.ActionMapping.perform(ActionMapping.java:53)
         at ControllerServlet.doResponse(ControllerServlet.java:92)
         at ControllerServlet.doPost(ControllerServlet.java:50)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    ...The renaming works fine though. I have checked mailing lists and forums as well as contacted the company's java support but everything I have tried out so far, from exchanging the xerces.jar files found in JDOM and Tomcat to rebuidling the project didn't help.
    I just can't explain to myself why this error occurs and I don't see how some additional Java code in the other 2 classes could cause it?
    I realize that the Tomcat and JDK versions I'm using are totally out of date, but that's company's current standard and I can't really change that.
    Here's the source code. I moved parts of the business logic from Java to Oracle recently but I left the SQL statements that the Oracle stored procedures are executing if it helps someone.
    package action;
    import java.sql.CallableStatement;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.StringTokenizer;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import oracle.jdbc.driver.OracleConnection;
    * This class enables the creation and insertion of a new catalogue node. A new node
    * is always inserted as the last child of the selected parent node.
    public class GliederungNewAction implements Action {
         public String perform(ActionMapping mapping, HttpServletRequest request,
                   HttpServletResponse response) {
              // fetch the necessary parameters from the JSP site
              // the parent attribute is the selected attribute!
              String parent_attribute = request.getParameter("attr");
              String catalogue = request.getParameter("catalogue");
              int parent_sequenceNr = Integer.parseInt(request.getParameter("sort_sequence"));
              // connect to database    
              HttpSession session = request.getSession();   
              db.SessionConnection sessConn = (db.SessionConnection) session.getAttribute("connection");
              if (sessConn != null) {
                   try {
                        sessConn.setAutoCommit(false);
                        OracleConnection connection = (OracleConnection)sessConn.getConnection();
                        int lastPosition = getLastNodePosition( getLastChildAttribute(connection, catalogue, parent_attribute) );
                        String newNodeAttribute = createNewNodeAttribute(parent_attribute, lastPosition);
                        // calculate the sequence number
                        int precedingSequenceNumber = getPrecedingSequenceNumber(connection, catalogue, parent_attribute);
                        if ( precedingSequenceNumber == -1 ) {
                             precedingSequenceNumber = parent_sequenceNr;
                        int sortSequence = precedingSequenceNumber + 1;
                        setSequenceNumbers(connection, catalogue, sortSequence);
                        // insert the new node into DB
                        insertNewNode(connection, catalogue, newNodeAttribute, parent_attribute, "Neuer Punkt", sortSequence);
                        connection.commit();
                   } catch(SQLException ex) {
                        ex.printStackTrace();
              return mapping.getForward();
          * Creates, fills and executes a prepared statement to insert a new entry into the specified table, representing
          * a new node in the catalogue.
         private void insertNewNode(OracleConnection connection, String catalogue, String attribute, String parent_attribute, String description, int sortSequence) {
              try {
                   String callAddNode = "{ call fasi_lob.pack_gliederung.addNode(:1, :2, :3, :4, :5) }";
                   CallableStatement cst;
                   cst = connection.prepareCall(callAddNode);
                   cst.setString(1, catalogue);
                   cst.setString(2, attribute);
                   cst.setString(3, parent_attribute);
                   cst.setString(4, description);
                   cst.setInt(5, sortSequence);
                   cst.execute();
                   cst.close();
              } catch (SQLException e1) {
                   // TODO Auto-generated catch block
                   e1.printStackTrace();
    //          String insertNewNode = "INSERT INTO vstd_media_cat_attributes " +
    //                    "(catalogue, attribute, parent_attr, description, sort_sequence) VALUES(:1, :2, :3, :4, :5)";
    //          PreparedStatement insertStmt;
    //          try {
    //               insertStmt = connection.prepareStatement(insertNewNode);
    //               insertStmt.setString(1, catalogue);
    //               insertStmt.setString(2, attribute);
    //               insertStmt.setString(3, parent_attribute);
    //               insertStmt.setString(4, description);
    //               insertStmt.setInt(5, sortSequence);
    //               insertStmt.execute();
    //               insertStmt.close();
    //          } catch (SQLException e) {
    //               e.printStackTrace();
          * This method returns the attribute value of the last child of the parent under which
          * we want to insert a new node. The result set is sorted in descending order and only the
          * first result (that is, the last child under this parent) is fetched.
          * If the parent node has no children, "parent_attr.0" is returned. 
          * @param connection
          * @param catalogue
          * @param parent_attribute
          * @return attribute of the last child under this parent, or "parent_attr.0" if parent has no children
         private String getLastChildAttribute(OracleConnection connection, String catalogue, String parent_attribute) {
              String queryLastChild = "SELECT attribute FROM vstd_media_cat_attributes " +
                                            "WHERE catalogue=:1 AND parent_attr=:2 ORDER BY sort_sequence DESC";
              String lastChildAttribute;
              PreparedStatement ps;
              try {
                   ps = connection.prepareStatement(queryLastChild);
                   ps.setString(1, catalogue);
                   ps.setString(2, parent_attribute);
                   ResultSet rs = ps.executeQuery();
                   /* If a result is returned, the selected parent already has children.
                    * If not set the lastChildAttribute to parent_attr.0
                   if (rs.next()) {
                        lastChildAttribute = rs.getString("attribute");
                   } else {
                        lastChildAttribute = parent_attribute.concat(".0");
                   rs.close();
                   return lastChildAttribute;
              } catch (SQLException e) {
                   e.printStackTrace();
                   return null;
          * This helper method determines the position of the last node in the attribute.
          * i.e for 3.5.2 it returns 2, for 2.1 it returns 1 etc.
          * @param attribute
          * @return position of last node in this attribute
         private int getLastNodePosition(String attribute) {
              StringTokenizer tokenizer = new StringTokenizer(attribute, ".");
              String lastNodePosition = "0";
              while( tokenizer.hasMoreTokens() ) {
                   lastNodePosition = tokenizer.nextToken();
              return Integer.parseInt(lastNodePosition);
          * This method calculates the attribute of a node being inserted
          * by incrementing the last child position by 1 and attaching the
          * incremented position to the parent.
          * @param parent_attr
          * @param lastPosition
          * @return attribute of the new node
         private String createNewNodeAttribute(String parent_attr, int lastPosition) {
              String newPosition = new Integer(lastPosition + 1).toString();
              return parent_attr.concat("." + newPosition);
          * This method checks if the required sequence number for a new node is already in use and
          * handles the sequence numbers accordingly.
          * If the sequence number for a new node is NOT IN USE, the method doesn't do anything.
          * If the sequence number for a new node is IN USE, the method searches for the next free
          * sequence number by incrementing the number by one and repeating the query until no result
          * is found. Then all the sequence numbers between the required number (including, >= relation)
          * and the nearest found free number (not including, < relation) are incremented by 1, as to
          * make space for the new node.
          * @param connection
          * @param catalogue
          * @param newNodeSequenceNumber required sequence number for the new node
         private void setSequenceNumbers(OracleConnection connection, String catalogue, int newNodeSequenceNumber) {
              // 1. check if the new sequence number exists - if no do nothing
              // if yes - increment by one and see if exists
              //           repeat until free sequence number exists
              // when found increment all sequence numbers freeSeqNr > seqNr >= newSeqNr
              String query = "SELECT sort_sequence FROM vstd_media_cat_attributes " +
                        "WHERE catalogue=:1 AND sort_sequence=:2";
              PreparedStatement ps;
              try {
                   ps = connection.prepareStatement(query);
                   ps.setString(1, catalogue);
                   ps.setInt(2, newNodeSequenceNumber);               
                   ResultSet rs = ps.executeQuery();
                   // if no result, the required sequence number is free - nothing to do
                   if( rs.next() ) {
                        int freeSequenceNumber = newNodeSequenceNumber;
                        do {
                             ps.setString(1, catalogue);
                             ps.setInt(2, freeSequenceNumber++);
                             rs = ps.executeQuery();
                        } while( rs.next() );
                        // increment sequence numbers - call stored procedure
                        String callUpdateSeqeunceNrs = "{ call fasi_lob.pack_gliederung.updateSeqNumbers(:1, :2, :3) }";
                        CallableStatement cst = connection.prepareCall(callUpdateSeqeunceNrs);
                        cst.setString(1, catalogue);
                        cst.setInt(2, newNodeSequenceNumber);
                        cst.setInt(3, freeSequenceNumber);
                        cst.execute();
                        cst.close();
    //                    String query2 = "UPDATE vstd_media_cat_attributes " +
    //                                      "SET sort_sequence = (sort_sequence + 1 ) " +
    //                                      "WHERE catalogue=:1 sort_sequnce >=:2 AND sort_sequence <:3";
    //                    PreparedStatement ps2;
    //                    ps2 = connection.prepareStatement(query2);
    //                    ps2.setString(1, catalogue);
    //                    ps2.setInt(2, newNodeSequenceNumber);
    //                    ps2.setInt(3, freeSequenceNumber);
    //                    ps.executeUpdate();
    //                    ps.close();
                   } // end of if block
                   rs.close();
              } catch (SQLException e) {
                   e.printStackTrace();
          * This method finds the last sequence number preceding the sequence number of a node
          * that is going to be inserted. The preceding sequence number is required to calculate
          * the sequence number of the new node.
          * We perform a hierarchical query starting from the parent node: if a result is returned,
          * we assign the parent's farthest descendant's node sequence number; if no result
          * is returned, we assign the parent's sequence number.
          * @param connection
          * @param catalogue
          * @param parent_attr parent attribute of the new node
          * @return
         private int getPrecedingSequenceNumber(OracleConnection connection, String catalogue, String parent_attr) {
              int sequenceNumber = 0;
              String query = "SELECT sort_sequence FROM vstd_media_cat_attributes " +
                                "WHERE catalogue=:1 " +
                                "CONNECT BY PRIOR attribute = parent_attr START WITH parent_attr=:2 " +
                                "ORDER BY sort_sequence DESC";
              try {
                   PreparedStatement ps = connection.prepareStatement(query);
                   ps.setString(1, catalogue);
                   ps.setString(2, parent_attr);
                   ResultSet rs = ps.executeQuery();
                   if ( rs.next() ) {
                        sequenceNumber = rs.getInt("sort_sequence");
                   } else {
                        // TODO: ggf fetch from request!
                        sequenceNumber = -1;
                   rs.close();
                   ps.close();
              } catch (SQLException e) {
                   e.printStackTrace();
              return sequenceNumber;
    }

    After further googling I figured out what was causing the problem: in eclipse I was referring to external libraries located in eclipse/plugins directory, whereas Tomcat was referring to the same libraries (possibly older versions) in it's common/lib directory.

  • Illegal use of nonvirtual function call

    I'm trying to run this program....
    import java.io.*;
    import java.util.*;
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.*;
    import sun.net.nntp.*;
    import lotus.domino.*;
    public class WriteNewsFile implements Constants{
         private Store store;
         private Database db;
    public Store createNNTPConnection(String host, String protocol) throws Exception{
    // Create empty properties
    Properties props = new Properties();
    // Get session
    javax.mail.Session session = javax.mail.Session.getInstance(props, null);
    // Get the store
    Store store = session.getStore(protocol);
    store.connect(host, null, null);
    return store;
    public Vector getForumNames(String root) throws Exception {
    Vector result = new Vector();
    NntpClient nc = new NntpClient(NNTP_HOST);
    String line;
    nc.serverOutput.println(NNTP_COMMAND_LIST_ACTIVE);
    BufferedReader br = new BufferedReader(new InputStreamReader(nc.serverInput));
    while ((line = br.readLine()) != null) {
    if (line.equals("."))
    break;
    if (line.startsWith(root)) {
    result.add(line.substring(0, line.indexOf(" ")));
    nc.closeServer();
    return result;
    private void init(String root) throws Exception {
    Vector forums = getForumNames(root);
    for (Enumeration e = forums.elements(); e.hasMoreElements();) {
         System.out.println(readWriteNewsgroup((String)e.nextElement()));
         System.gc();
    public static void main(String args[]) {
         WriteNewsFile wns = new WriteNewsFile();
         try{
              wns.db = wns.openNotesDB(DOMINO_HOST, DOMINO_USER, DOMINO_PASSWD,
    DOMINO_DB);
              wns.store = wns.createNNTPConnection(NNTP_HOST, NNTP);     
              //wns.init("forums.software.");
              wns.init("forums.hardware.");
              //wns.init("forums.services.");
              wns.store.close();
         }catch(Exception e){
              e.printStackTrace();
    * Insert the method's description here.
    * Creation date: (12/10/2001 9:51:20 AM)
    * @param s java.lang.String
    public Database openNotesDB(String host, String user, String passwd, String dbName) throws
    NotesException {
    lotus.domino.Session session =
    NotesFactory.createSession(host, user, passwd);
    db = session.getDatabase(session.getServerName(), dbName);
    if (db == null)
         throw new NotesException();
    else
         return db;
    public String readWriteNewsgroup(String newsgroup) throws Exception {
    // Get folder
    Folder folder = store.getFolder(newsgroup);
    folder.open(Folder.READ_ONLY);
    // Get directory
    Message messages[] = folder.getMessages();
    for (int i = 0, n = messages.length; i < n; i++) {
    //System.out.println( i + ": " + messages.getFrom()[0] + "\t" +
    messages[i].getSubject());
    Document doc = db.createDocument();
    doc.replaceItemValue(MESSAGE_NUMBER,new Integer(messages[i].getMessageNumber()));
    doc.replaceItemValue(MESSAGE_ID, messages[i].getHeader(MESSAGE_ID)[0]);
    doc.replaceItemValue(DATE, messages[i].getReceivedDate());
    doc.replaceItemValue(FROM, messages[i].getFrom()[0].toString());
    doc.replaceItemValue(SUBJECT, messages[i].getSubject());
    doc.replaceItemValue(NEWSGROUPS, messages[i].getHeader(NEWSGROUPS)[0]);
    doc.replaceItemValue(ORGANIZATION, messages[i].getHeader(ORGANIZATION)[0]);
    RichTextItem rtitem = doc.createRichTextItem(BODY);
    try{
         rtitem.appendText(messages[i].getContent().toString());
    }catch(UnsupportedEncodingException e){
                   System.out.println("Could not convert body to String");
    //rtitem.recycle();                                   
    if (!doc.save())
    System.out.println("Did not save the document");      
    // Close connections and files
    folder.close(false);
    return newsgroup;
    but getting this runtime error.....
    C:\$user\java>java WriteNewsFile
    Exception in thread "main" java.lang.VerifyError: (class: com/ibm/CORBA/iiop/Gen
    ericServerSC, method: dispatch signature: (Lcom/ibm/CORBA/iiop/IIOPInputStream;L
    com/ibm/CORBA/iiop/IIOPOutputStream;)V) Illegal use of nonvirtual function call
    at java.lang.Class.forName1(Native Method)
    at java.lang.Class.forName(Class.java:134)
    at com.ibm.CORBA.iiop.ORB.registerSubcontracts(ORB.java)
    at com.ibm.CORBA.iiop.ORB.<init>(ORB.java)
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:254)
    at org.omg.CORBA.ORB.create_impl(ORB.java:306)
    at org.omg.CORBA.ORB.init(ORB.java:355)
    at lotus.domino.cso.Session.OREFtoSession(Session.java:703)
    at lotus.domino.cso.Session.<init>(Session.java:57)
    at lotus.domino.cso.Session.createSession(Session.java:36)
    at lotus.domino.NotesFactory.createSession(NotesFactory.java:67)
    at WriteNewsFile.openNotesDB(WriteNewsFile.java:88)
    at WriteNewsFile.main(WriteNewsFile.java:66)
    and don't understand the nature of the error...... Can anyone help or direct me to some information that might help me understand?
    Thanks,
    Heather

    you have used a method that was implemented in JRE1.2 -- IE's native JVM 1.1.4 or 1.1.5 . You can do one of two things:
    1) convert your html file to make it use a new Java plug-in, or
    2) change your code to call a comparble method that is available before 1.2
    V.V.

  • Upload and Download file through RFC called by java

    We are trying to download/upload file through rfc function called by java(JCO),In the rfc function,we use WS_DOWNLOAD,but it does not work.
    Any one know about this,Please help ,thanks very much.
    Message was edited by: gw gw

    Hi gw,
    This question looks a little confusing to me.
    WS_DOWNLOAD is used to download files from SAP to the presentation server (your PC).  It will not work through RFC.
    BUT, also if you want to access a function module via RFC is must be RFC enabled (as Anand pointed out).
    AND WS_DOWNLOAD uses a PUSH approach.  It pushes a file to the PC from ABAP.  So even if the two points above weren't a problem it still would not be suitable for what you are doing.
    Perhaps you could explain a little what you are trying to achieve.
    Cheers,
    Brad

  • Error in function call BAPI_0050_CREATE. Create FM Budgeting Entry document

    Hi guys,
    I've got runtime error in BAPI-function call BAPI_0050_CREATE for create\release budgeting entry document:
    "Number range 01 not found for object BULI_DOCNR in fiscal year 2007"
    Function parameters below:
    CALL FUNCTION 'BAPI_0050_CREATE'
    EXPORTING
    header_data = l_wa_header
    testrun = ' '
    TABLES
    item_data = g_it_item_data
    return = g_it_return.
    l_wa_header-FM_AREA = '2500'
    l_wa_header-VERSION = '000'.
    l_wa_header-DOCSTATE = '1'.
    l_wa_header-PROCESS = 'ENTR'.
    l_wa_header-DOCTYPE = '0001'.
    l_wa_item_data-BUDTYPE = 'DEBL'.
    l_wa_item_data-BUDCAT = '9F'.
    l_wa_item_data-ITEM_NUM = '01'.
    l_wa_item_data-FISC_YEAR = 2007.
    l_wa_item_data-FUNDS_CTR = '2000'.
    l_wa_item_data-CMMT_ITEM = 'R10101010'.
    l_wa_item_data-TOTAL_AMOUNT = 20000.
    l_wa_item_data-DISTKEY = '0'.
    l_wa_item_data-TRANS_CURR = 'RUB'.
    l_wa_item_data-VALTYPE = 'R1'.
    Interval 01 was already created in SPRO-tran for customizing option for FM module (Budgeting)
    (000000001 &#1076;&#1086; 99999999) - Create Number Range Interval for Entry Document
    Does anybody know correct parameters for BAPI-call or customizing option for Budjeting (FM) ?
    ps Sorry, I am not expert in FI-FM-module
    Thnx in advance,
    Dmitry

    It works !
    I've performed  this function in workbench and got additional help guide for error resolving.
    You're right - i've missed initial interval 05 for number ranges 5000000000 to 599999999 for budjeting docs.
    But i've got new error message
    'Release and budget amounts are inconsistent'

  • UnsatisfiedLinkError with function call

    Hi,
    I am using JNI to make native function calls from Java.
    I use
    System.loadLibrary("myLibName");
    to load my library, and that works without a problem.
    I can use this library without any problems from a simple test app I wrote. However, I get an UnsatisfiedLinkError when I try and integrate with the rest of my applicaton. I am 100% certain that function is defined correctly in both Java and C++.
    The only difference I can think of between my real application (which does not work) and my test application (which does work) is that in my real application, the object that makes use of the class that contains all my native methods is cloned before it makes any calls to my native code.
    What can cause an UnsatisfiedLinkError if my System.loadLibrary() is correct, and my function definitions are also correct?
    Thanks!
    Eliott
    Edited by: EliottH on Mar 1, 2010 12:17 PM

    In case my post needs any clarification, here is some sample code that demonstrates what I am doing:
    //An instance of this class gets cloned before any native function calls are made!
    public class SomeClass implements Cloneable {
        JniClass jniclass;
        SomeClass() {
               jniclass = new JniClass();
        //This returns an UnsatisfiedLinkError when called
        public void func() {
                jniclass.nativeFunc1();
        public void clone() {
              //Something....
    public class JniClass {
        public native void nativeFunc1();
        static {
             System.loadLibrary("myLibName");
    }Edited by: EliottH on Mar 1, 2010 1:00 PM

  • [Tomcat] Incompatible object argument for function call

    Hello,
    I've got a jsp which use a DOM parser to read XML. This jsp works good on my station :
    Tomcat 4.1.24
    JDK 1.3.1_07
    Windows XP
    I put my webapp on another station :
    Tomcat 4.1.24 (the same)
    JDK 1.3.1_12
    Windows NT
    but there, my jsp return an error :
    java.lang.VerifyError: (class: org/apache/jsp/doFncaBourse_jsp, method: _jspService signature: (Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V) Incompatible object argument for function call
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:232)
    at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:151)
    at org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:440)
    at org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:390)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:471)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
    at java.lang.Thread.run(Thread.java:479)
    I don't understand where it comes from so if somebody can help me, it will be wonderful.
    Thanks et good afternoon and sorry for my english.

    Is it enough to write
    set JAVA_OPT= "-noverify"
    before
    set EXECJAVA=%RUNJAVA%
    set MAINCLASS=org.apache.catalina.startup.Bootstrap
    set ACTION=start
    set SECURITY_POLICY_FILE=
    set DEBUG_OPTS=
    set JPDA=
    ?

  • QTP Integration - eCATT FUNction call

    Hello folks,
    I am pretty fit in eCATT, but I am fairly new to QTP. I setup an integration in a demo environment and QTP only let's me "open" eCATT Scripts that were recorded with QTP. If I am recording eCATT with QTP i am limited to UI Recording via SAPGui Scripting.
    Is there a way to call other eCATT's from QTP, to use more powerful eCATT options, like BAPI & FUNction calls? Or to directly call BAPIs / Function modules from within QTP?
    Thanks!

    hi,
    "QTP only let's me "open" eCATT Scripts that were recorded with QTP"
    QTP will open only those scripts which it has created.
    it will not open an ecatt script which ecatt has created.
    also we generally use qtp scripts to record and automate and then call the qtp scripts in ecatt.this way helps us use the features of both qtp and ecatt.
    please revert back for any clarifications.
    regards,
    Rakesh..

  • Webdynpro java  calling bapi function module

    Hi all,
         I am webdynpro java developer, In my application i created model using bapi function module and fetch those values using iviews mapping to custom controller . While running that application i got an error as shown below
    **Application error occurred during request processing.**
      Details:   com.sap.tc.webdynpro.services.sal.core.DispatcherException: The requested deployable object 'ram.com/getdata' and application 'Searchapp' are not deployed on the server. Please check the used URL for typos.
    Exception id: [BCAEC58D04E400870000019500000DF80004B20FE3921612]
    Please help me anyone
    Thanks in advance.

    Hi,
    Have you deployed your application?because it is mentioned that the "Searchapp"(which i suppose is your application) is not deployed.
    Take the "Deploy and Run" option by right clicking the application(i mn Seachapp). It will prompt you to enter the SDM password. Give the pwd and it will open the explorer and will show you the output.
    Hope this helps you.
    Regards,
    Jithin

  • Type Mismatch error while calling a Java Function from Visual Basic 6.0...

    Hi,
    I'm having a problem in calling the Java Applet's Function from Visual Basic. First, I'm getting the handle of the Java Applet and components of it using "Document.Applets(n)" which is a HTML function. I'm calling this function from Visual Basic. My code is something like this...
    ' // Web1 is IE Browser in my Form.
    Dim Ap,Comp
    Dim Bol as Boolean
    Bol = true
    Ap = Web1.Document.Applets(0).getWindow() ' \\ Gets the Parent Window.
    Ap.setTitle("My Java Applet") ' \\ Sets the Title of the window.
    msgbox Ap.getVisibility() ' \\ This will return a Java boolean ( true or false )
    Ap.setVisibility(Bol) ' \\ Function Syntax is : void setVisibility(boolean b)
    Here in my code , i'm able to call any function that which accepts Integer or String but not boolean. So, i m facing problem with Ap.setVisibility() function. It gives me a "Type mismatch error" while executing it. Can you please tell me a way to do this from Visual Basic !
    I'm using Visual Basic 6.0, Windows 2000 , J2SDK 1.4.2_05.
    Please help me Friends.
    Thanks and Regards,
    Srinivas Annam.

    Hi
    I am not sure about this solution. try this
    Declare a variable as variant and store the boolean value in that variable and then use in ur method.
    Post ur reply in this forum.
    bye for now
    sat

Maybe you are looking for

  • ITunes Downloading Issue for iPhone Update 4.3

    Hey, I have an iPhone 4, and I'm running a MacBook Pro on Snow Leopard. For the past three hours, I've been trying to update my iPhone 4 to 4.3, and halfway through each update, iTunes disconnects the download, and I try to resume the download, but i

  • Page not found ERR-1016 - Page 101 not found

    Hi, I created a second tabset and a few associated pages (100-102). Later I decided to remove the second tabset and associated pages. Following this ,, this error 1016 keeps appearing.. I was not able to view any of the other pages.. I can almost com

  • Write/read file in OOP

    Hello, I have to make class that reads/creates tdms file I know OOP concepts from C++ and I ve seen write and safe class to file example  in labview but I have no idea haw to make it and what are benefits of using OOP in this case.. I thought about c

  • Procedure to remove dublicate composite ID's with values

    i have tables in datawarehouse with four columns (XPK_ROW ,FK_ROW,ID,VALUE) Tables have multible records i need help to make procedure to remove dubicate records Data Example XPK_ROW FK_ROW ID VALUE 23 324 FT09005001002525 FIELD NOT MAPPED FOR TAG -2

  • Error in conversion-applet class is not defined!

    Hello everybody.I have created my own applet and I try to test it in a simulation world ,using the Java Card Toolkit 2.1.1. I have declared AID of my applet in the jcwde.app file as following: ///The code in the jcwde.app file com.sun.javacard.sample