Performance of a java program.

Dear team,
how I can know when a java application is 'faster'?
I mean, is better to use arrays or not? Is better to use bytes than integers?etc etc...
Do you know any software that it can show me when my program uses low memory, or something that can help me??
Best wishes!

Antony13 wrote:
Dear team,
how I can know when a java application is 'faster'?By measuring it.
I mean, is better to use arrays or not? Is better to use bytes than integers?etc etc...Don't worry about these microoptimizations unless and until you profile and find a bottleneck that could reasonably be caused by one of them. Use the proper data structures and algorithms (which is a CS principle that has nothing to do with Java) and write "dumb" code that's easy to follow and that clearly expresses your design.
Do you know any software that it can show me when my program uses low memory, or something that can help me??Google for java profiler.

Similar Messages

  • Slow performance of Java program with Oracle db on Solaris

    Hi all,
    I'm developing a Java program to read a large no. of records (arnd 40,000) from a file and populate into an Oracle database on a Solaris system. I'm using a thin JDBC driver. The problem is that the program runs very slow on Solaris.
    When I run the Java program on a Windows machine (and connect to the Solaris machine) the program runs quickly. However when I run the program on the Solaris machine itself, it runs around 20 times slower. I need the program to run faster in the Solaris environment. Can anyone help?
    The SPARC system used is SunOS 5.8, 4GB memory, 2*750MHz processors
    Thanks a lot
    ers

    The set of RDBMS DVD's can be downloaded from SAP Marketplace. Oracle 9.2 Installation zip file which contains Disk1 Disk2 and Disk3.
    Which Version of Solaris are you running?
    Is it 64 or 32 Bit?
    Regards,
    Damien

  • High CPU usage while running a java program

    Hi All,
    Need some input regarding one issue I am facing.
    I have written a simple JAVA program that lists down all the files and directories under one root directory and then copies/replicates them to another location. I am using java.nio package for copying the files. When I am running the program, everything is working fine. But the process is eating up all the memories and the CPU usage is reaching upto 95-100%. So the whole system is getting slowed down.
    Is there any way I can control the CPU usage? I want this program to run silently without affecting the system or its performance.

    Hi,
    Below is the code snippets I am using,
    For listing down files/directories:
            static void Process(File aFile, File aFile2) {
              spc_count++;
              String spcs = "";
              for (int i = 0; i < spc_count; i++)
              spcs += "-";
              if(aFile.isFile()) {
                   System.out.println(spcs + "[FILE] " + aFile2.toURI().relativize(aFile.toURI()).getPath());
                   String newFile = dest + aFile2.toURI().relativize(aFile.toURI()).getPath();
                   File nf = new File(newFile);
                   try {
                        FileCopy.copyFile(aFile ,nf);
                   } catch (IOException ex) {
                        Logger.getLogger(ContentList.class.getName()).log(Level.SEVERE, null, ex);
              } else if (aFile.isDirectory()) {
                   //System.out.println(spcs + "[DIR] " + aFile2.toURI().relativize(aFile.toURI()).getPath());
                   String newDir = dest + aFile2.toURI().relativize(aFile.toURI()).getPath();
                   File nd = new File(newDir);
                   nd.mkdir();
                   File[] listOfFiles = aFile.listFiles();
                   if(listOfFiles!=null) {
                        for (int i = 0; i < listOfFiles.length; i++)
                             Process(listOfFiles, aFile2);
                   } else {
                        System.out.println(spcs + " [ACCESS DENIED]");
              spc_count--;
    for copying files/directories:public static void copyFile(File in, File out)
    throws IOException {
    FileChannel inChannel = new
    FileInputStream(in).getChannel();
    FileChannel outChannel = new
    FileOutputStream(out).getChannel();
    try {
    inChannel.transferTo(0, inChannel.size(),
    outChannel);
    catch (IOException e) {
    throw e;
    finally {
    if (inChannel != null) inChannel.close();
    if (outChannel != null) outChannel.close();
    Please let me know if any better approach is there. But as I already said, currently it's eating up the whole memory.
    Thanks in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Java stored procedure vs. PL-SQL vs. external java program

    Hi,
    I'm using a stored procedure for running a query and a few consequent updates. Currently I'm using Java stored procedure for that, which was my choice for simplicity on one hand, and running with the DB on the other.
    In my tests, strangely enough it came out that running as java stored procedure was 3-4 times slower than running as a java program outside the database. I don't know how to explain this, and I wonder if switching to PL/SQL will improve the performance of the code.
    Any experiences? recommendations?
    Thanks,
    Dawg

    In my tests, strangely enough it came out that running as java stored procedure was 3-4 times slower than running as a java program outside the database. I don't know how to explain this, and I wonder if switching to PL/SQL will improve the performance of the code.This isn't strange at all. See: Oracle's JVM (Aurora) is an independent Java Virtual Machine implementation, in accordance to specification. It implements all necessary parts of it (I think so). When you use an external JVM (I assume it's Sun's HotSpot JVM) you use completely different product. It is implemented in different way, it has many different code parts.
    One of the biggest differences between Oracle's JVM and Sun's JVM is [Just-in-Time compiler|http://en.wikipedia.org/wiki/Just-in-time_compilation]. Oracle has implemented it only in the 11g version of database, i.e. 2 years ago, while Sun performed it back in 2000 and continues to improve it for the last 9 years. That would explain obvious differences between Java program inside and outside the DB: they are executed in absolutely different worlds. Diffs could be up to 10x times or more - that's not unusual.
    If you are on 10g and want to compare performance of stored Java procedure vs external program, then you might use additional command-line instruction for external program to disable JIT:
    -XintPS. I wouldn't use Java for your task - that's a total overkill. Use simple SP instead.

  • Running a process within a java program

    Hi
    I have code that runs a process for performance monitoring on an installed system. When I run the code standalone as below, it runs fine. If I include the code below inside another java program, the process fails to execute and the status returned is non-zero (failed to execute).
    The process requires the PATH and LD_LIBRARY_PATH to be set which seem to be set correctly when i print them out. So, I am not sure why the process doesnot run when included within another running java program.
    Can someone please point out what I maybe missing?
    Thanks!!
    public class RunPerf
      private static final String CLASS_NAME = "RunPerf"; private static Process proc = null;
    public static void main(String[] args)
        String INSTALLPERF_SAW_UNIX_COMMAND = "sawexe" + " " + "-perf";
             StringBuffer path1 = new StringBuffer(30);StringBuffer ldlibpath1 = new StringBuffer(30);
        System.setProperty("user.home", "/home/user");
        StringBuilder commandToExecute = new StringBuilder();
       commandToExecute.append(System.getProperty("user.home"));
       commandToExecute.append(File.separator);
       commandToExecute.append("web");
       commandToExecute.append(File.separator);
       commandToExecute.append("bin");
       commandToExecute.append(File.separator);
         String path = System.getProperty("user.home")+"/server/bin/" + File.pathSeparator + System.getProperty("user.home")+ "/web/bin";
           path1.append( path );
           path1.append( File.separator );
           path1.append( System.getProperty("java.library.path") );
           path1.append( File.separator );
          String env_value = null;
         String[] ldargs = {"LD_LIBRARY_PATH"};
         for (String env: ldargs) {
                env_value = System.getenv(env);
             System.out.println("LD_LIBRARY_PATH value before setting property= " + env_value);
                if (env_value != null) {
               String newldlibpath = System.getProperty("user.home")+ "/server/bin/" + File.pathSeparator + System.getProperty("user.homee")+ "/web/bin" ;
                ldlibpath1.append(newldlibpath);
                ldlibpath1.append(File.separator);
                   ldlibpath1.append(env_value);
                   ldlibpath1.append( File.separator);
                    System.out.format("%s=%s%n", env,ldlibpath1.toString());
                } else {
                    System.out.format("%s is not assigned.%n", env);
                 commandToExecute.append(INSTALLPERF_SAW_UNIX_COMMAND);
                   String[] envp =   { "USER_HOME =" + "/home/user",          "PATH=" + path1.toString(), "LD_LIBRARY_PATH=" + ldlibpath1.toString() };
               int status = executeCommand1(commandToExecute.toString(), envp,null);
                   if(status != 0){
                          System.out.println("Unable to run perf Unix") ;
         public static int executeCommand1(String command,String[] envp, Logger logger) {
            String METHOD_NAME = "executeCommand1";
            if (logger == null) { logger = Logger.getAnonymousLogger();}
            logger.entering(CLASS_NAME, METHOD_NAME, new Object[] { command, envp});
            Runtime runtime = Runtime.getRuntime();
            runtime.addShutdownHook(new Thread() {
                        public void run() {
                            if (proc != null) {     try {  proc.destroy();  if (proc != null) { proc.destroy();  }
                                } catch (Exception e) {
                                    e.printStackTrace(); }      }      }     });               
                           int retVal = 0;
          File cwd = new File(System.getProperty("user.home")+ "/web/bin/");               
                           try {
                               if (envp != null) {   proc = runtime.exec(command, envp,cwd); }
                                       else {  proc = runtime.exec(command); }
                               Thread t_err =        new Thread(new StreamReader(proc.getErrorStream()));
                               t_err.start();
                               Thread t_in =     new Thread(new StreamReader(proc.getInputStream()));
                               t_in.start();
                               retVal = proc.waitFor(); } catch (IOException e) {        retVal = -1;   logger.severe("IOException");      }
                                     catch (Exception e) { retVal = -1;        logger.severe("Exception");                  }
                     logger.exiting(CLASS_NAME, METHOD_NAME, retVal);
                     return retVal;
    static class StreamReader implements Runnable {
            InputStream in;
            public StreamReader(InputStream genericStream) {   in = genericStream;   }
            public void run() {
                try {
                    String strTemp = null;
                    BufferedReader buffReader = new BufferedReader(new InputStreamReader(in));
                    while ((strTemp = buffReader.readLine()) != null) {
                        System.out.println(strTemp);                }
                } catch (Exception e) {               e.printStackTrace();            }        }    }}

    Either set up a script before the program runs or have the
    program write a script file which contains the statements
    that need to be executed. Then you will be able to
    execute the script with a call to
    Runtime.getRuntime().exec()Mark

  • New TO JAVA Programming

    Dear Forummembers,
    I am student doing postgraduate studies in IT.i have some queries related to one of my programming staff.i am very much new into Java programming and i am finding it a bit difficult to handle this program.The synopsis of the program is given below -
    You are required to design and code an object-oriented java program to process bookings for a theatre perfomance.
    Your program will read from a data file containing specifications of the performance,including the names of the theatre, the play and its author and the layout of the theatre consisting of the number of seats in each row.
    It will then run a menu driven operation to accept theatre bookings or display the current
    status of seating in the theatre.
    The name of the file containing the details of the performance and the theatre should be
    provided at the command line, eg by running the program with the command:
    java Booking Theatre.txt
    where Theare.txt represents an example of the data file.
    A possible data file is:
    Opera
    U and Me
    Jennifer Aniston
    5 10 10 11 12 13 14
    The data provided is as follows
    Line 1
    Name of the Theatre
    Line 2
    Name of the play being performed
    Line 3
    Name of the author of the play being performed
    Line 4
    A list of the lengths (number of seats) of each row in the theatre, from front to
    back.
    The program must start by reading this file, storing all the appropriate parameters and
    establishing an object to accept bookings for this performance with all details for the theatre
    and performance.
    The program should then start a loop in which a menu is presented to the user, eg:
    Select from the following:
    B - Book seats
    T - Display Theatre bookings
    Q - Quit from the program
    Enter your choice:
    And keep performing selected operations until the user�s selects the quit option, when the
    program should terminate.
    T - Display Theatre bookings
    The Display Theatre Bookings option should display a plan of the theatre. Every available
    seat should be displayed containing its identification, while reserved seats should contain an
    Rows in each theatre are indicated by letters starting from �A� at the front. Seats are
    numbered from left to right starting from 1. A typical seat in the theatre might be designated
    D12, representing seat 12 in row D.
    B - Book seats
    The booking of seats is to offer a number of different options.
    First the customer must be asked how many adjacent seats are
    required. Then start a loop offering a further menu of choices:
    Enter one of the following:
    The first seat of a selected series, eg D12
    A preferred row letter, eg F
    A ? to have the first available sequence selected for you
    A # to see a display of all available seats
    A 0 to cancel your attempt to book seats
    Enter your selection:
    1. If the user enters a seat indentifier such B6, The program should attempt to
    reserve the required seats starting from that seat. For example if 4 seats are
    required from B6, seats B6, B7, B8 and B9 should be reserved for the customer,
    with a message confirming the reservation and specifying the seats reserved..
    Before this booking can take place, some testing is required. Firstly, the row
    letter must be a valid row. Then the seat number must be within the seats in the
    row and such that the 4 seats would not go beyond the end of the row. The
    program must then check that none of the required seats is already reserved.
    If the seats are invalid or already reserved, no reservation should be made and the
    booking menu should be repeated to give the customer a further chance to book
    seats.
    If the reservation is successful, return to the main menu.
    2. The user can also simply enter a row letter, eg B.IN this case, the program should
    first check that the letter is a valid row and then offer the user in turn each
    adjacent block of the required size in the specified row and for each ask whether
    the customer wants to take them. Using the partly booked theatre layout above, if
    the customer wanted 2 seats from row B, the customer should be offered first:
    Seats B5 to B6
    then if the customer does not want them:
    Seats B10 to B11
    and finally
    Seats B11 to B12
    If the customer selects a block of seats, then return to the main menu. If none are
    selected, or there is no block of the required size available in the row, then report
    that no further blocks of the required size are available in the row and repeat the
    booking menu.
    3. If the user enters a ? the program should offer the customer every block of seats
    of the required size in the whole theatre. This process should start from the first
    row and proceed back a row at a time. For example, again using the partially
    booked theatre shown above, if the user requested 9 seats, the program should
    offer in turn:
    Seats A1 to A9
    Seats C1 to C9
    Seats C2 to C10
    Seats E3 to E11
    Seats E4 to E12
    If the customer selects a block of seats, then return to the main menu. If none are
    selected, or there is no block of the required size available in the whole theatre,
    then report that no further blocks of the required size are available and repeat the
    booking menu.
    4. If the user enters a # the program should display the current status of the seating
    in the theatre, exactly the same as for the T option from the main menu and then
    repeat the booking menu.
    5. If the user enters a 0 (zero), the program should exit from the booking menu back
    to the main menu. If for example the user wanted 9 seats and no block of 9 was
    left in the theatre, he would need to make two separate smaller bookings.
    The program should perform limited data validation in the booking process. If a single
    character other than 0, ? and # is entered, it should be treated as a row letter and then tested
    for falling within the range of valid rows, eg A to H in the example above. Any invalid row
    letters should be rejected.
    If more than one character is entered, the first character should be tested as a valid row letter,
    and the numeric part should be tested for falling within the given row. You are NOT
    required to test for valid numeric input as this would require the use of Exception handling.
    You are provided with a class file:
    Pad.java
    containing methods that can be used for neat alignment of the seat identifiers in the theatre
    plan.
    File Processing
    The file to be read must be opened within the program and if the named file does not exist, a
    FileNotFoundException will be generated. It is desirable that this Exception be caught and
    a corrected file name should be asked for.
    This is not required for this assignment, as Exception handling has not been covered in this
    Unit. It will be acceptable if the method simply throws IOException in its heading.
    The only checking that is required is to make sure that the user does supply a file on the
    command line, containing details of the performance. This can be tested for by checking the
    length of the parameter array args. The array length should be 1. If not, display an error
    message telling the user the correct way to run the program and then terminate the program
    System.exit(0);
    The file should be closed after reading is completed.
    Program Requirements
    You are expected to create at least three classes in developing a solution to this problem.
    There should be an outer driving class, a class to represent the theatre performance and its
    bookings and a class to represent a single row within the theatre.
    You will also need to use arrays at two levels. You will need an array of Rows in the Theatre
    class.
    Each Row object will need an array of seats to keep track of which seats have been reserved.
    Your outer driving class should be called BookingOffice and should be submitted in a file named BookingOffice.java
    Your second, third and any additional classes, should be submitted in separate files, each
    class in a .java file named with the same name as the class
    I am also very sorry to give such a long description.but i mainly want to know how to approach for this program.
    also how to designate each row about it's column while it is being read from the text file, how to store it, how to denote first row as row A(second row as row B and so on) and WHICH CLASS WILL PERFORM WHICH OPERATIONS.
    pls do give a rough guideline about designing each class and it's reponsibilty.
    thanking u and looking forward for your help,
    sincerely
    RK

    yes i do know that........but can u ppl pls mention
    atleast what classes shud i consider and what will be
    the functions of each class?No, sorry. Maybe somebody else will, but in general, this is not a good question for this forum. It's too broad, and the question you're asking is an overall problem solving approach that you should be familiar with at this point.
    These forums are best suited to more specific questions. "How do I approach this homework?" is not something that most people are willing or able to answer in a forum like this.

  • Helps!:How to start multi process in a single java program?

    I wanna to test the querying performance of a Database
    connection poll,and here,not only multi threads,but also multi process I need to start in the same java program cause i have only one PC available.....
    Does that possible?

    In pure java this is not possible.
    A java program with all its thread run in a single
    jvm,
    which is just one process.However, you can have multiple instances of the jvm, I've done it w/ I needed to test some row locking in my database app. If you are in windows and want 3 copies of you program just make a bat file that looks likejavaw.exe -classpath "classesGoHere" MainClass
    javaw.exe -classpath "classesGoHere" MainClass
    javaw.exe -classpath "classesGoHere" MainClassThat will create 3 instances of the jvm and thus three instances of your application. I'm sure the same can be done on multiple platforms.
    Peter

  • Store details in a java program

    Hi,
    This is a sample scenario
    I am taking interviews daily, I need to store candidate name, gender, dob, phone number in a java program
    I do not want to store it at any other secondary storage like db, flat file etc.. As soon as i switch off the system the data should be lost
    What is the best method that i can store it in a java program...
    I came across this question where someone asked me and i replied that i will store it in arrays, but here for array i have to define size.. so may be on a day there are only one to two entries so un-necessarily i do not want to waste the memory is there any other better way where i can store and performance also doesn't get impacted
    Thanks,

    user10873676 wrote:
    Hi,
    This is a sample scenario
    I am taking interviews daily, I need to store candidate name, gender, dob, phone number in a java program
    I do not want to store it at any other secondary storage like db, flat file etc.. As soon as i switch off the system the data should be lost
    What is the best method that i can store it in a java program...
    I came across this question where someone asked me and i replied that i will store it in arrays, but here for array i have to define size.. so may be on a day there are only one to two entries so un-necessarily i do not want to waste the memory is there any other better way where i can store and performance also doesn't get impacted
    Thanks,Search for in memory databases for java. HSQLDB is a good one to start with.

  • MSE is unreachable on WCS until Java program is killed

    Hi
    I have a problem with my 2700 series Wireless Location Appliance. It works for about a week, then suddenly WCS shows the device as unreachable. If I kill the Java program and then perform a shutdown, it works for about a week before the same fault occurs.
    Has anyone experienced this before?
    Thanks
    TT

    JMR1: MSE becomes unreachable from periodically.
    CSCtk82237
    Description
    Symptom:
    MSE becomes unreachable from WCS periodically.
    Conditions:
    MSE 7.0.105.0, WCS 7.0.164.0.
    CSCsy13994
    Description
    Symptom:
    MSE shows as unreachable in WCS. The MSE service is up and running and credentials used are correct too.
    Conditions:
    N/A
    Workaround:
    Restart WCS services or reboot the WCS server.
    Further Problem Description:
    There is a problem with the HTTPS session being established between the WCS and the MSE which causes this issue.

  • How to terminate and restart a java program from a controling java program?

    I have a situation where my program needs to run exactly once each one
    hour. This is a huge program that creates a lot of threads and opens
    lot of resources. After one hour has lapsed, I want to terminate this
    program (as if Exit(0) was performed on it or as if Ctrl C was pressed
    from the command line to terminate a running program) and then run it again and so on repeat the cycle each hour. This will guarantee that
    all the resouces taken by the programs are freed or if some threads were still blocked on i/o, are indeed terminated each hour.
    The java program does not have any user interface and it is run from the
    command line.

    if you can change the program to be controlled, you could make it listen for commands on some networkport for shutting it down.
    If this is not an option you could start OS programs to kill the first program. On Unix System kill will do, but you need the process id so you'd need another os call ...
    You could do the os calls in two ways
    a) execute shell commands (search the forum on how to do that
    b) write a little C wrapper for the os call so you can call them from JNI (Java Native Interface)
    I do not know of any way do this kind of thing directly
    regards
    Spieler

  • Java program not running by the Ant

    i have a small java program.
    its a classpath problem.
    cant figure out where is the problem.
    i am running the code via Ant.
    build.xml
    <?xml version="1.0"?>
    <project name="myproject" basedir="." default="all">
        <property name="src.dir"     value="src"/>
         <property name="classes.dir" value="classes"/>
         <property name="lib.dir"     value="C:/tomcat/webapps/axis/WEB-INF/lib"/>
         <property name="runclass" value="TestClient"/>
         <target name="all" depends="clean,compile"/>
         <target name="clean">
            <delete dir="${classes.dir}"/>
        </target>
        <path id="classpath">
            <fileset dir="${lib.dir}" includes="**/*.jar"/>
        </path>
        <target name="compile">
            <mkdir dir="${classes.dir}"/>
         <javac srcdir="${src.dir}"
          destdir="${classes.dir}"
          deprecation="on"
          debug="on">
       <classpath><path refid="classpath"/></classpath>
      </javac>
         </target>
         <target name="run" depends="compile">
       <!-- run the class -->
       <java classname="${runclass}">
            <classpath>
              <pathelement path="${classpath}"/>
              <fileset dir="${lib.dir}">
                <include name="**/*.jar"/>
            </fileset>
              </classpath>
           </java>
      </target>
         </project>i invoked
    ant runand got this
    Buildfile: build.xml
    compile:
    run:
         [java] Could not find TestClient. Make sure you have it in your classpath
         [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava
    .java:170)
         [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:710)
         [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:178)
         [java]     at org.apache.tools.ant.taskdefs.Java.execute(Java.java:84)
         [java]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
    va:275)
         [java]     at org.apache.tools.ant.Task.perform(Task.java:364)
         [java]     at org.apache.tools.ant.Target.execute(Target.java:341)
         [java]     at org.apache.tools.ant.Target.performTasks(Target.java:369)
         [java]     at org.apache.tools.ant.Project.executeSortedTargets(Project.jav
    a:1216)
         [java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
         [java]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(De
    faultExecutor.java:40)
         [java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1068
         [java]     at org.apache.tools.ant.Main.runBuild(Main.java:668)
         [java]     at org.apache.tools.ant.Main.startAnt(Main.java:187)
         [java]     at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
         [java]     at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
    BUILD SUCCESSFUL
    Total time: 2 secondsso, code is not running......its dfinitely a classpath problem , because error message says "Could not find TestClient. Make sure you have it in your classpat".
    TestClient is the name of main class file.
    not sure whats wrong with this build.xml ? whats wrong in it ?
    one thing , i guess, i did not mention "." , current directory in the build.xml ......is it because of that ?
    i browsed apache manual......To Run a Java program.....first, they are making a JAR file ...and then they are executing the JAR.
    i really, dont need the JAR file......i just want to run it.....thats enough.
    somewhere, i have to do some modification in this buld.xml.......do you have any idea ?
    thank you

    TestClient folder has
    1)src
    2)classes
    3)build.xml
    i have posted the build.xml already.
    now, src folder has TestClient.java
    TestClient.java
    ==================
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import javax.xml.namespace.QName;
    public class TestClient {
       public static void main(String [] args) {
         try {
           String endpoint =
               "http://ws.apache.org:5049/axis/services/echo";
           Service  service = new Service();
           Call     call    = (Call) service.createCall();
           call.setTargetEndpointAddress( new java.net.URL(endpoint) );
           call.setOperationName(new QName("http://soapinterop.org/","echoString"));
           String ret = (String) call.invoke( new Object[] { "Hello!" } );
           System.out.println("Sent 'Hello!', got '" + ret + "'");
         } catch (Exception e) {
           System.err.println(e.toString());
    }and i did
    ant runand i got those errors.
    clearly, its not able to run it.
    looked the manual....did not find anything special about java task....still not working.

  • Mass processing - Error when processing Java programs / VMC out of memory

    When running a mass update background process that updates the status of a service order in CRM the job fails due to error 'Error when processing Java programs'. I checked the VMC (SM52) and noticed that there is an error about the VMC running out of memory.
    The background program can either be a PPF Action or a Z-ABAP program that performs the update. Both programs are performing a CRM_ORDER_INITIALIZE but it seems that the VMC is not releasing the memory fast enough.
    Is there anyway we can force the VMC to release the memory after processing of each individual order?
    Thanks!

    I got  similar issue and it got resolved by useing CRM_ORDER_INITILAIZE. Initalization should happen after every Order processing and see that only one header guid is passed to the the FM. May not be good option ,but just try by putting wait for 5secs after CRM_ORDER_INITILAIZE.

  • Call Java program in APEX

    Hi, I am an APEX newbie... I need to call a Java program (.JAR file) from a PL/SQL script inside an APEX application. My question is, does the JAR file need to be in a particular place (and if so, what's the best way to get it there)?
    - somewhere in the APEX database?
    - somewhere in the production database (9i)?
    - could it be called if it resides on a shared network drive?
    Any help would be appreciated... everything I've found thus far tells me to use the loadjava tool to get it onto the prod. database, but I want to make sure that there isn't an easier option as I've had some trouble with that.
    Thanks in advance...
    Kenny

    Hi,
    If you want to call the method of the java class that is stored in the jar you have to make this jar file accessible to the client.
    1/ The jar file can be stored in the database by using loadjava utility
    E.g. loadjava -u scott/tiger -resolve yourjavapackage.jar
    More details on http://www.oracleutilities.com/OSUtil/loadjava.html
    and http://www.csee.umbc.edu/help/oracle8/java.815/a64683/tools1.htm
    1.1/ Once the jar file is in the database you can access it's object methods by defining the pl/sql function that is able to call particular java method
    E.g.
    FUNCTION jCreateDir (dir varchar2, checkExistsOnly number, grantRootDir varchar2)
    RETURN NUMBER as LANGUAGE java
    NAME 'mypkg.Utils.createDirectory(java.lang.String, int, java.lang.String) return int';
    Above function then calls the java method defined in the class included in the jar file (jar file is just an archive of the java classes - to bundle several classes, images... in one file)
    The example contents of the java class
    package mypkg;
    import java.io.File;
    public class Utils {
    public static int createDirectory(String dir, int checkExistsOnly, String grantScriptDir)
    ///some code here
    1.3/ So if you know what method to call, what are the input parameters and return value you can create your calling procedure/function in pl/sql
    I am not very sure if you can load jar files containing the classes that render some user interface items(buttons,panels etc - items from awt or swing package) so basicaly load just the code that performs actions like computation/ xml transformation/ file I/O so anything that does not require GUI items.
    2/ If your jar file contains the objects that display some user interface control or you need to call the java from the javascript then you need to embed your jar file in the html code by using <OBJECT > or <APPLET> tag
    Re: Open program in FF
    Rado

  • Performance comparision between java and c++ in games (openGL)

    Hi everyone,
    I was working on java 3D and JOGL as part of my graphics openGL homework. Most of my classmates stuck to GLUT in c,c++ for programming stating that java is slow. I did attend a few seminars on java, java swing etc, they stated that java is faster now. I was wondering if there is a tool of some sort to compare performance, frame rate , time to compile etc. The closest I could find was a java memory leak finding tool used to detect memory leaks in java programs.
    Thanks,
    A

    compilation time is irrelevant in measuring program performance.
    There have been numerous "benchmarks" comparing C++ with other languages (including Java), usually by people who have an agenda and need data to "prove" their position to the world.
    The best you can do is get experts in each language and toolkit to write programs that do the same and are optimised to the same degree, then run those programs side by side on identical hardware for a period of time and see for yourself.
    Remember of course that JVM startup time is longer than startup time for native compiled C++ applications, so you need to run the program for a good period to get reliable figures (hours to be entirely sure).
    Do that for each part of the toolkit you're interested in using separately and make your own decisions based on the results.
    I know this is time consuming and hard to set up, which is precisely why it's probably not been done reliably (people who care to prove that something is faster than something else don't bother to be impartial, those that don't care don't bother to go to the trouble to do something they don't care about).

  • Java Programming @ SAP - the poor cousin?

    Hi!
    Recently I' ve started a kind of poll in the Java forums asking if someone knew any enhancement possibilities for java-side development at SAP mentioning the ABAP customer exits, BADIs, customer includes and enhancement spots as example.
    Guess how many answer I received - from WDJ, Java Programming, NWDI and NW Java from: None! All the gurus who usually bubble over with wisdom remained wondrous silent. I also run over help pages searching for some hints regarding this - in my opinion fundamental - questions, with the same result.
    Has really nobody at SAP spent a thought about one of the most precious features SAP offers its customers - the possibility to enhance delivered standard-programs and thereby adapt them to their needs without modification?
    How are we as Java programmers then supposed to stand the mistrustful glances of our ABAP collegues who wonder why there has been so much noise about this Java thing in the recent years. Thinking about the disadvantages a developer working with Java at SAP has to bear compared to his ABAP collegue - no direct data access, no comfortable debugging possibilities, lots of standalone tools with strange UIs (SDM Remote GUI, Visual Admin - only to name the least glorious ones - he to manage and - last, not least - no chance to enhance SAP Standard programs modification free I have to agree upon one ABAPers opinion on Java: "The hype is over!".
    Regards from a very pessimistic Java Developer
    Thomas
    PS: Does anybody know a way to unbureaucraticly swap a Java certification against an ABAP one?

    I get the question - should I do my development in ABAP or Java - quite often. My answer has become "It Depends."  I getting pretty good at those ambiguous consulting answers, aren't I.
    In all seriousness I really do think the answer depends upon several things.  As a company or development group you should analyze the skills that you already have in house.  As you have seen the two development environments are quite close.  The advantages of one over the other will continue to vary over time.  ABAP will add nice features from Java and vise versa.  In the end it is more important that companies leverage their skill sets and existing infrastructure (Software Lifecycle Landscape) to their maximum. 
    If you are already a java shop then it makes sense to continue down that development path because your developers will still be very efficient even if they have to access ERP and other SAP application logic and data via RFC or Web Services. 
    On the other hand, ABAP certainly isn't as dead as some people claimed it would be by now. Thanks to Web Services ABAP has more flexibility than ever before.  It isn't nearly the closed box that it used to be.  Also the workbench team isn't going to stop innovating either. 
    The next question I get is what does SAP do internally when deciding on a language to use.  To a large extent they use the same criteria - what existing skill sets do I have to work with.  They also look at where the data is located. 
    That means products like Portal aren't about to change from Java to ABAP.  On the other hand ERP suite development is still heavily ABAP.  The new UIs coming from ERP will primarily be done in Web Dynpro ABAP. 
    Even in some newer products that haven't been released yet - the UI was done in Java or Visual Composer and the backend business logic was done in ABAP. It is all about taking advantage of the unique strengths of each environment and the skill sets you have in each.
    In the end I don't think Java is the poor cousin any more than ABAP is going to die.  Look at NetWeaver CE and the huge investment SAP has made on top of Java Development there.  At the same time our investment in Java has not come at the cost of the ABAP environment.  Innovations will continue to take place there as well.  I can assure you that within SAP it is the hope and goal to have two top notch development environments within NetWeaver.
    Now let me share a little story with you.  My background is obviously ABAP and I doubt I will ever lose my particular passion for the environment.  At the same time I have done a fair bit of NetWeaver Java development in the last year and half or so.  I'm not a super deep expert, but I can hold my own. 
    I recently had a requirement to build an MDM Application.  I only had two days in which to build it.  My choices were to use the Java API or the ABAP API.  They are quite similar and both meet all my interface requirements.  I was building a Web Dynpro UI, so the end user wouldn't be able to tell the difference.  Interfacing capabilities being the same and UI output being identical - my decision came down to the environment where I personally could be most efficient.  I could have completed the project in either environment.  But because I knew the ABAP Programming Environment (you know the stuff that goes beyond the basic syntax - the real knowledge that lets you squeeze every last drop of performance out of an application) so well I personally could build the best application in the shorter time in ABAP. 
    Now someone with a different background might well have taken the Java path and done just as well.  This is the advantage that SAP provides by continuing to support both ABAP and Java development.  Does every feature and function of both environements line up exactly - of course not.  I'm sure they never will.  But do these differences keep experts in either environment from being able to make any application do amazing things - certainly not.  Personally I feel less constrained in either ABAP or Java today than I have ever felt programming before.

Maybe you are looking for