Error in simple oops program

Hi experts,
When executing a simple oops program ..i got the following error. Please correct the code.
"VAR" is not type-compatible with formal parameter "I_DATA".          
      CLASS main DEFINITION
CLASS main DEFINITION.
  PUBLIC SECTION.
    "// Instance Methods ( Note we use the statement 'METHODS'
    "// to define an instance method )
    METHODS set_data IMPORTING i_data TYPE string.
    METHODS get_data RETURNING value(r_data) TYPE string.
    METHODS print_attribute IMPORTING i_data TYPE string.
    "// Instance Methods ( Note we use the statement 'CLASS-METHODS'
    "// to define a static method )
    CLASS-METHODS set_classdata IMPORTING i_data TYPE string.
    CLASS-METHODS get_classdata RETURNING value(r_data) TYPE string.
    CLASS-METHODS print_classattribute IMPORTING i_data TYPE string.
  PROTECTED SECTION.
    "// Instance Attribute ( Note we use the statement 'DATA'
    "// to define an instance attribute )
    DATA attribute TYPE string.
    "// Static Attribute ( Note we use the statement 'CLASS-DATA'
    "// to define a static attribute )
    CLASS-DATA classattribute TYPE string.
  PRIVATE SECTION.
    "// Instace event ( Note we use the statement 'EVENTS'
    "// to define aN instance event )
    EVENTS event EXPORTING value(e_data) TYPE string.
    "// Instace event ( Note we use the statement 'CLASS-EVENTS'
    "// to define a static event )
    CLASS-EVENTS classevent EXPORTING value(e_data) TYPE string.
    "// For more informations about events see the following example:
    "// ABAP Objects - Creating your First Local Class - Using Events
ENDCLASS.                    "main DEFINITION
      CLASS main IMPLEMENTATION
CLASS main IMPLEMENTATION.
  METHOD set_data.
    CONCATENATE 'Instance Attribute value' i_data
                               INTO attribute SEPARATED BY space.
  ENDMETHOD.                    "set_data
  METHOD get_data.
    MOVE attribute TO r_data.
  ENDMETHOD.                    "get_data
  METHOD set_classdata.
    CONCATENATE 'Static Attribute value' i_data
                               INTO classattribute SEPARATED BY space.
  ENDMETHOD.                    "set_classdata
  METHOD get_classdata.
    MOVE main=>classattribute TO r_data.
  ENDMETHOD.                    "get_classdata
  METHOD print_attribute.
    WRITE: i_data, /.
  ENDMETHOD.                    "print_attribute
  METHOD print_classattribute.
    WRITE: i_data, /.
  ENDMETHOD.                    "print_classattribute
ENDCLASS.                    "main IMPLEMENTATION
DATA: var type char20.
START-OF-SELECTION.
  "// Calling a Static method (note we don't have a object )
  "// instead we use the <class name>=><method name>.
  main=>set_classdata( 'SDN' ).
  var = main=>get_classdata( ).
  "// Print the var value
  main=>print_classattribute( var ).
  DATA: object_reference TYPE REF TO main.
  CREATE OBJECT object_reference.
  "// - Calling a Instance Method( Note we have to use a object to
  "// access the insntace components of class main )
  "// - Note we're using the statment "CALL METHOD", see looking for
  "// functional & General methods for more informations
  CALL METHOD object_reference->set_data( 'BPX' ).
  var = object_reference->get_data(  ).
  object_reference->print_attribute( var ).
Thanks in Advance.
Regards
Nani

Hi Nani,
try changing your data definition for var from CHAR20 to STRING.
regards,
Peter

Similar Messages

  • Applet - error in simple Ping program using Applet.Pls correct my error.

    Can anyone pls correct the error in the below code.
    Program : TestExec1
    Using : Applet
    Logic : Trying to display the continous pinging status in the textarea in applet, but it returns error...!
    CODING
    import java.awt.*;
    import java.lang.*;
    import java.io.*;
    import java.net.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.*;
    /*<applet code="TestExec1" width=380 height=150>
    </applet>
    public class TestExec1 extends Applet
    String line = null;
    TextArea outputArea;
    Process p;
    public void init()
    outputArea = new TextArea(20,20);
    public void start()
    try
    Process p= Runtime.getRuntime().exec("ping 192.168.100.192 -t");BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
    while ((line = in.readLine()) != null)
    outputArea.append("\n" + line);
    System.out.println(line);
    catch (IOException e)
    e.printStackTrace();
    Error : C:\Program Files\Java\jdk1.6.0_02\bin>appletviewer TestExec1.java
    java.security.AccessControlException: access denied (java.io.FilePermission <<AL
    L FILES>> execute)
    at java.security.AccessControlContext.checkPermission(AccessControlConte
    xt.java:323)
    at java.security.AccessController.checkPermission(AccessController.java:
    546)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
    at java.lang.SecurityManager.checkExec(SecurityManager.java:782)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:447)
    at java.lang.Runtime.exec(Runtime.java:593)
    at java.lang.Runtime.exec(Runtime.java:431)
    at java.lang.Runtime.exec(Runtime.java:328)
    at TestExec1.start(TestExec1.java:31)
    at sun.applet.AppletPanel.run(AppletPanel.java:458)
    at java.lang.Thread.run(Thread.java:619)
    Regards
    ESM

    Will you please tell the procedure of how to use jarsigner and make a sign in for my program.
    class Name : SamplePing.java
    Using : Applet
    Manifest file : manifest.txt
    Main Class : SamplePing
    I have created jar file using the following command -
    "jar cvfm Ping.jar manifest.txt Sa*.class "
    Let me know how can i proceed further to run exec command in applet.Pls give me series of steps.
    Thanks in advance.

  • HttpConnection error (-7334) - Simple Servlet program

    hi .. iam having this problem on my p990i . .. cannot resolve it "By adding these headers "
    My code is simple .. Its takes the server ip address and server returns a string(variable s) to the client
    Midlet :
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    import javax.microedition.io.*;
    import java.io.*;
    import java.util.Vector;
    public class MidletServlet extends MIDlet implements CommandListener {
    Display display = null;
    Form form = null;
    destroyApp(true);
    notifyDestroyed();
    } else if (c == backCommand) {
    display.setCurrent(form);
    } else if (c == submitCommand) {
    str = tb.getString();
    test = new Test(this,str);
    test.start();
    //test.getServlet(str);
    class Test implements Runnable {
    MidletServlet midlet;
    private Display display;
    String addr;
    public Test(MidletServlet midlet,String addr) {
    this.addr = addr;
    this.midlet = midlet;
    display = Display.getDisplay(midlet);
    public void start() {
    Thread t = new Thread(this);
    t.start();
    public void run() {
    // String Buffer
    StringBuffer sb ;
    try {
    String url = "http://"addr"/Servlets/servlet/getText";
    System.out.println(url);
    HttpConnection c = (HttpConnection) Connector.open(url,Connector.READ_WRITE);
    c.setRequestProperty("User-Agent","Profile/MIDP-2.0, Configuration/CLDC-1.1");
    c.setRequestProperty("Content-Language","en-US");
    c.setRequestMethod(HttpConnection.POST);
    // Get the response from the servlet page.
    DataInputStream is =(DataInputStream)c.openDataInputStream();
    //is = c.openInputStream();
    int ch;
    sb = new StringBuffer();
    while ((ch = is.read()) != -1) {
    sb.append((char)ch);
    showAlert(sb.toString());
    is.close();
    c.close();
    } catch (Exception e) {
    showAlert(e.getMessage());
    /* Display Error On screen*/
    private void showAlert(String err) {
    Alert a = new Alert("");
    a.setString("Error Occured :"+ err);
    a.setTimeout(Alert.FOREVER);
    display.setCurrent(a);
    Servlet
    import java.io.*;
    import java.text.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class getText extends HttpServlet {
    public void init() {
    public void doPost(HttpServletRequest request,
    HttpServletResponse response) throws ServletException,
    IOException {
    System.out.println("Connected with client: " + request.getRemoteAddr());
    String s = " This is gonna be legendary";
    response.setHeader("Content-Type", "text/plain");
    response.setHeader("Cache-Control","no-store");
    response.setHeader("Cache-Control", "no-cache");
    response.setHeader("Pragma","no-cache");
    response.setHeader("Cache-Control", "no-transform");
    response.setHeader("Connection", "Keep-Alive");
    response.setHeader("Proxy-Connection", "Keep-Alive");
    response.setContentType("text/plain");
    response.setContentLength(s.length());
    PrintWriter out = response.getWriter();
    out.println(s);
    System.out.println("Sent String : " +s);
    //in.close();
    out.close();
    out.flush();
    public void doGet(HttpServletRequest request,
    HttpServletResponse response) throws ServletException,
    IOException {
    doPost(request,response);
    i always get exception -7334 {Symbain OS error : contains header but no body in p990i}
    iam testing this on my personal Wifi network
    my server is :192.168.1.100
    my phone ip is : 192.168.1.105
    Iam trying to run this frompast 2 days .. no success .. :( PLzzzz help ..

    Hi,
    The J2EE Error code siply suggest that there is something wrong in your Deployment Descriptors...
    Can u please post the XML files available inside your "WEB-INF" directory?
    Thanks
    Jay SenSharma
    http://jaysensharma.wordpress.com (WebLogic Wonders Are Here)

  • Sytax error in simple oops concept

    Hi Experts,
    I am getting the following error
    " You can only omit the parameter name if the method has a single parameter. This must be an IMPORTING parameter."
    when executing the following code.
    DATA: acct1 type ref to zaccount01.
    DATA: bal type i.
    create object: acct1.
    selection-screen begin of block a.
    parameters: p_amnt type dmbtr,
                p_dpst type dmbtr,
                p_wdrw type dmbtr.
    selection-screen end of block a.
    start-of-selection.
    call method acct1->set_balance( p_amnt ).
    write:/ 'Set balance to ', p_amnt.
    bal = acct1->deposit( p_dpst ).
    write:/ 'Deposited ', p_dpst ,' bucks making balance to ', bal.
    bal = acct1->withdraw( p_wdrw ).
    write:/ 'Withdrew ', p_wdrw ,' bucks making balance to ', bal.
    Please say me where i have to change the code.
    Advance thanks.
    Regards,
    Nani

    Hi  Rainer Hübenthal,
    Error is displayed on p_wdrw in the following line.
    bal = acct1->withdraw( p_wdrw ).
    <removed_by_moderator>
    thanks,
    Nani
    Edited by: Julius Bussche on Sep 25, 2008 10:49 AM

  • Error in simple Generics program

    Why is this code not compiling? When I changed the <String> to <T> then it works.
    My question is why should the code listed below fail.
    Error: non-static class String cannot be referenced from a static context
    public class SimpleGenerics1<String> {
      String datum;
      void setdatum(String datum) {
        this.datum = datum;
      String getDatum() {
        return this.datum;
      public static void main(String[] args) {     //Error here
        SimpleGenerics1 sg = new SimpleGenerics1();
    }

    ---->Just try the following code,
    public class Example <String> {
         String datum;
         void setdatum(String datum) {
              this.datum = datum;
         String getDatum() {
              return this.datum;
         public static void main(String[] args) {   
    Example <String> sg = new Example();
    //while calling the class just try to add <String>     
         }

  • Weblogic error while deplying a simple servlet program

    Hi This is a very simple servlet program.
    I am trying to deploy it on the weblogic server but i get this error as follow
    Unable to access the selected application.
    *javax.enterprise.deploy.spi.exceptions.InvalidModuleException: [J2EE Deployment SPI:260105]Failed to create*
    DDBeanRoot for application, 'E:\AqanTech\WebApp1\myApp.war'.
    I have checked everything, right from my code to my web.xml file. I have used a build.bat file to build my war file.
    PLEASE HELP ME TO SOLVE THIS HUGE PROBLEM OF MINE ?
    Thanks,
    Shoeb

    Hi,
    The J2EE Error code siply suggest that there is something wrong in your Deployment Descriptors...
    Can u please post the XML files available inside your "WEB-INF" directory?
    Thanks
    Jay SenSharma
    http://jaysensharma.wordpress.com (WebLogic Wonders Are Here)

  • PARSE_APPLICATION_DATA Error during XML = ABAP conversion: Response Message; CX_ST_DESERIALIZATION_ERROR in /1SAI/SAS0446CC11CC6EC1AD4789 Line 24 An error occurred when deserializing in the simple transformation program /1SAI/SAS0446CC11CC6EC1AD4789

    Hi Experts ,
    i have a scenario proxy to soap  where i am getting error while getting the response .
    we are sending the request successfully and getting response .some times we are getting in proxy level error below
    PARSE_APPLICATION_DATA Error during XML => ABAP conversion: Response Message; CX_ST_DESERIALIZATION_ERROR in /1SAI/SAS0446CC11CC6EC1AD4789 Line 24 An error occurred when deserializing in the simple transformation program /1SAI/SAS0446CC11CC6EC1AD4789 (Cha
    Please help us to fix this bug in proxy response.
    Regards
    Ravi

    Hello Ravinder,
    Can you please post the complete stack trace, it seems to be some fields are getting truncated i,e data sent from the program to the proxy object might be violating some length restrictions.
    Please check your message interface field lengths and what is being passed to the proxy.
    Regards,
    Ravi.

  • "Assertion failed" error when executing a simple UCI program

    I am using a simple UCI program (tt1.c) with Xmath version 7.0.1 on Sloaris 2.8 that performs the followings:
    - Start Xmath701
    - Sleep 10 Seconds
    - Load a sysbuild model
    - Stop Xmath
    I am calling the uci executable using the following command:
    > /usr/local/apps/matrixx-7.0.1/bin/xmath -call tt1 &
    In this way everything works fine and the following printouts from the program are produced.
    --------- uci printout ----------
    ## Starting Xmath 701
    ## sleep 10 seconds
    ## load "case_h_cs_ds.xmd";
    ## Stopping Xmath 701
    All the processes (tt1, XMATH, xmath_mon, and sysbld) terminate correctly.
    The problem occurs if the 10 second wait after starting xmath is omitted:
    - Start Xmath701
    - Load a sysbuild model
    - Stop Xmath
    This results to the following printouts:
    --------- uci printout ----------
    ## Starting Xmath 701
    ## load "case_h_cs_ds.xmd";
    Assertion failed: file "/vob1/xm/ipc/ipc.cxx", line 420 errno 0.
    Note that the last line is not produced by the uci program and the tt1 did not
    finish (the printout before stopping xmath "## Stopping Xmath 701" was
    not produced).
    A call to the unix "ps -ef" utility shows that none of the related process has been terminated:
    fs085312 27631 20243 0 10:45:29 pts/27 0:00 tt1
    fs085312 27643 1 0 10:45:30 ? 0:00 /usr/local/apps/matrixx-7.0.1/solaris_mx_70.1/xmath/bin/xmath_mon /usr/local/app
    fs085312 27641 27631 0 10:45:30 ? 0:01 /usr/local/apps/matrixx-7.0.1/solaris_mx_70.1/xmath/bin/XMATH 142606339, 0x8800
    fs085312 25473 25446 0 10:45:33 ? 0:01 sysbld ++ 19 4 7 6 5 8 9 0 25446 ++
    The questions are as follows:
    1- What is "Assertion failed: file "/vob1/xm/ipc/ipc.cxx", line 420 errno 0" and why is that produced?
    2- Should the UCI program waits for end of sysbld initialization before issuing commands?
    3- If the answer to the above question is yes, is there a way to check the termination of sysbld initialization?
    Thanks in advance for you help.
    Attachments:
    tt1.c ‏1 KB

    I tracked down the problem and it is a race condition between the many processes being started up. A smaller delay should also solve the problem. Or, maybe do something else before the first 'load'. The 'load' command tries to launch systembuild and causes the race condition.

  • Error in running Java Program

    Hi,
    I have a problem in running my simple java program after the installing of the JSDK.
    I was able to compile my work but when I type java HelloWorld, the following error appears:
    Exception in thread "main" java.lang.NoClassDefFoundError:HelloWorld.
    The strange thing is I install the application in another machine and it works.
    Is there anyone that can help me with this problem.
    Thanks in advance.

    Yes I run the java program in the same folder where the class file is reside.
    I can confirm that there is no problem with the class file cause I had run it in another machine and it did work.
    Thanks.

  • Error while running Swing program on FreeBSD

    Hi,
    I am trying to run simple swing program "helloworld"
    but while executing it gives following error on FreeBSD
    Exception in thread "main" java.lang.UnsatisfiedLinkError:
    /usr/local/linux-sun-jdk1.4.2/jre/lib/i386/libawt.so: libXp.so.6:
    cannot open shared object file: No such file or directory
            at java.lang.ClassLoader$NativeLibrary.load(Native Method)
            at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560)
            at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477)
            at java.lang.Runtime.loadLibrary0(Runtime.java:788)
            at java.lang.System.loadLibrary(System.java:834)
            at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38)
            at sun.awt.DebugHelper.<clinit>(DebugHelper.java:29)
            at java.awt.EventQueue.<clinit>(EventQueue.java:80)
            at javax.swing.SwingUtilities.invokeLater(SwingUtilities.java:1170)
            at JPanels.main(JPanels.java:29)
    Should i install XFree86-libs package on FreeBsd
    configuration
    FreeBSD 4.10-BETA (GENERIC)
    I am using following packages
    linux-sun-jdk-1.4.2.04 Sun Java Development Kit 1.4 for Linux
    linux_base-8-8.0_4 Base set of packages needed in Linux mode (only for i386)
    linux_devtools-8.0_1 Packages needed for doing development in Linux mode
    libtool-1.3.5_1 Generic shared library support script
    gmake-3.80_1 GNU version of 'make' utility
    automake-1.4.5_9 GNU Standards-compliant Makefile generator (legacy version
    GCC 2.95.4
    gdb 4.18
    ld 2.12.1 supported emulation elf_i386
    regards
    Man479

    This is not really a Swing question. You should install the library which satisfies the lookup of libXp.so.6 .
    I quess the jre for this platform is compiled against this version. Looks to me like some X related library, maybe google can resolve a solution/package to install?
    Greetz

  • A way to display error messages from the program

    Dear all,
    I am looking forward to display a set of error messages(in a internal table) during the execution of the program to the user.
    I wanted to know the better way of displaying error messages from my program with more options.
    Well I tried out using displaying errors as ALV list/Grid or as simple list processing.
    But I found some  stanadard transactions (Like in MM and FI  where errors are shown in a better way, but failed to find out how they are done.
    Please guide me.
    Thanks in advance
    Aryan

    Try to use application logging it has a very good way to display a set of messages.
    [http://abap4.tripod.com/Using_Application_Logging.html|http://abap4.tripod.com/Using_Application_Logging.html]
    Run this report in se38 an example sap report to understand logging way to show a set of messages
    Report Name  :  SBAL_DEMO_01
    Edited by: Vighneswaran CE on Dec 19, 2010 3:01 PM
    Edited by: Vighneswaran CE on Dec 19, 2010 3:11 PM

  • I'm not able to run a simple Hello Program in java

    I have just now installed jdk 1.3.1_2.
    I have set the path and class path.
    I'm able to compile the class without any errors but am not able to run the program.
    when i say java Hello(after compiling Hello.java), i'm seeing the following error:
    Exception in thread "main" java.lang.NoclassDefFoundError:Hello
    Thanks in advance in this regard

    Hmm..
    Okay.. set aside any import or package stuffs.. lets say about a simple HelloWorld program which is called Hello.class. It resides in c:\, which means the full path is c:\Hello.class.
    Make sure you got one of your path as c:\jdk1.3\bin(assuming you are using jdk 1.3).
    If you are in the same directory as Hello.class, which is c:\>, you can execute the class file by typing:
    C:\>java Hello
    If you are not in the same directory and you wishes to run the class file, example you are in directory temp now:
    C:\Temp>java -cp C:\ Hello
    So the cp set will be just c:\. Hope that answers your question somehow.. well... if I never intepret it wrongly.

  • Problem while executing simple java program

    Hi
    while trying to execute a simple java program,i am getting the following exception...
    please help me in this
    java program :import java.util.*;
    import java.util.logging.*;
    public class Jump implements Runnable{
        Hashtable activeQueues = new Hashtable();
        String dbURL, dbuser, dbpasswd, loggerDir;   
        int idleSleep;
        static Logger logger = Logger.getAnonymousLogger();      
        Thread myThread = null;
        JumpQueueManager manager = null;
        private final static String VERSION = "2.92";
          public Jump(String jdbcURL, String user, String pwd, int idleSleep, String logDir) {
            dbURL = jdbcURL;
            dbuser = user;
            dbpasswd = pwd;
            this.idleSleep = idleSleep;
            manager = new JumpQueueManager(dbURL, dbuser, dbpasswd);
            loggerDir = logDir;
            //preparing logger
            prepareLogger();
          private void prepareLogger(){      
            Handler hndl = new pl.com.sony.utils.SimpleLoggerHandler();
            try{
                String logFilePattern = loggerDir + java.io.File.separator + "jumplog%g.log";
                Handler filehndl = new java.util.logging.FileHandler(logFilePattern, JumpConstants.MAX_LOG_SIZE, JumpConstants.MAX_LOG_FILE_NUM);
                filehndl.setEncoding("UTF-8");
                filehndl.setLevel(Level.INFO);
                logger.addHandler(filehndl);
            catch(Exception e){
            logger.setLevel(Level.ALL);
            logger.setUseParentHandlers(false);
            logger.addHandler(hndl);
            logger.setLevel(Level.FINE);
            logger.info("LOGGING FACILITY IS READY !");
          private void processTask(QueueTask task){
            JumpProcessor proc = JumpProcessorGenerator.getProcessor(task);       
            if(proc==null){
                logger.severe("Unknown task type: " + task.getType());           
                return;
            proc.setJumpThread(myThread);
            proc.setLogger(logger);       
            proc.setJumpRef(this);
            task.setProcStart(new java.util.Date());
            setExecution(task, true);       
            new Thread(proc).start();       
         private void processQueue(){       
            //Endles loop for processing tasks from queue       
            QueueTask task = null;
            while(true){
                    try{
                        //null argument means: take first free, no matters which queue
                        do{
                            task = manager.getTask(activeQueues);
                            if(task!=null)
                                processTask(task);               
                        while(task!=null);
                    catch(Exception e){
                        logger.severe(e.getMessage());
                logger.fine("-------->Sleeping for " + idleSleep + " minutes...hzzzzzz (Active queues:"+ activeQueues.size()+")");
                try{
                    if(!myThread.interrupted())
                        myThread.sleep(60*1000*idleSleep);
                catch(InterruptedException e){
                    logger.fine("-------->Wakeing up !!!");
            }//while       
        public void setMyThread(Thread t){
            myThread = t;
        /** This method is only used to start Jump as a separate thread this is
         *usefull to allow jump to access its own thread to sleep wait and synchronize
         *If you just start ProcessQueue from main method it is not possible to
         *use methods like Thread.sleep becouse object is not owner of current thread.
        public void run() {
            processQueue();
        /** This is just another facade to hide database access from another classes*/
        public void updateOraTaskStatus(QueueTask task, boolean success){
            try{         
                manager.updateOraTaskStatus(task, success);
            catch(Exception e){
                logger.severe("Cannot update status of task table for task:" + task.getID() +  "\nReason: " + e.getMessage());       
        /** This is facade to JumpQueueManager method with same name to hide
         *existance of database and SQLExceptions from processor classes
         *Processor class calls this method to execute stored proc and it doesn't
         *take care about any SQL related issues including exceptions
        public void executeStoredProc(String proc) throws Exception{
            try{
                manager.executeStoredProc(proc);
            catch(Exception e){
                //logger.severe("Cannot execute stored procedure:"+ proc + "\nReason: " + e.getMessage());       
                throw e;
         *This method is only to hide QueueManager object from access from JumpProcessors
         *It handles exceptions and datbase connecting/disconnecting and is called from
         *JumpProceesor thread.
        public  void updateTaskStatus(int taskID, int status){       
            try{
                manager.updateTaskStatus(taskID, status);
            catch(Exception e){
                logger.severe("Cannot update status of task: " + taskID + " to " + status + "\nReason: " + e.getMessage());
        public java.sql.Connection getDBConnection(){
            try{
                return manager.getNewConnection();
            catch(Exception e){
                logger.severe("Cannot acquire new database connection: " + e.getMessage());
                return null;
        protected synchronized void setExecution(QueueTask task, boolean active){
            if(active){
                activeQueues.put(new Integer(task.getQueueNum()), JumpConstants.TH_STAT_BUSY);
            else{
                activeQueues.remove(new Integer(task.getQueueNum()));
        public static void main(String[] args){
                 try{
             System.out.println("The length-->"+args.length);
            System.out.println("It's " + new java.util.Date() + " now, have a good time.");
            if(args.length<5){
                System.out.println("More parameters needed:");
                System.out.println("1 - JDBC strign, 2 - DB User, 3 - DB Password, 4 - sleeping time (minutes), 5 - log file dir");
                return;
            Jump jump = new Jump(args[0], args[1], args[2], Integer.parseInt(args[3]), args[4]);
            Thread t1= new Thread(jump);
            jump.setMyThread(t1);      
            t1.start();}
                 catch(Exception e){
                      e.printStackTrace();
    } The exception i am getting is
    java.lang.NoClassDefFoundError: jdbc:oracle:thin:@localhost:1521:xe
    Exception in thread "main" ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
    JDWP exit error AGENT_ERROR_NO_JNI_ENV(183):  [../../../src/share/back/util.c:820] Please help me.....
    Thanks in advance.....sathya

    I am not willing to wade through the code, but this portion makes me conjecture your using an Oracle connect string instead of a class name.
    java.lang.NoClassDefFoundError: jdbc:oracle:thin:@localhost:1521:xe

  • Closing error message when external program is called?

    Hello,
    I am developing a test for a c++ program i have made.
    My test program will be called a few thousand times with different input files.
    As I know it will crash in several cases I want to automatically close the error dialog.
    The error dialog is an application error dialog telling some debug info and says
    - Click OK to terminate
    - Click Cancel to debug
    For my test program developing I have created a c++ program that always crashes if it gets any input parameters.
    I have made a very simple JAVA program to call my c++ program.
    //StreamGobbler left out for shorter post
    import java.io.IOException;
    public class MainTester {
         public static void main(String[] args) {
              String[] testAndArgs = new String[2];
              testAndArgs[0] = "test.exe";
              testAndArgs[1] = "crash";
              Runtime rt = Runtime.getRuntime();
              Process proc = null;
              try {
                   proc = rt.exec(testAndArgs);
              } catch (IOException e) {
                   e.printStackTrace();
                   System.exit(1);
              try {
                   StreamGobbler errorGobbler = new StreamGobbler(proc
                             .getErrorStream(), "ERR");
                   StreamGobbler outputGobbler = new StreamGobbler(proc
                             .getInputStream(), "OUT");
                   errorGobbler.start();
                   outputGobbler.start();
              } catch (Throwable t) {
                   t.printStackTrace();
    }So I have tried proc.destroy() and if I look in process explorer test.exe is terminated.
    I also tried rt.exit(1) and then jawaw.exe is terminated but test.exe lives on under explorer.exe instead of javaw.exe.
    So if I first run proc.destroy() and then rt.exit(1) both javaw.exe and test.exe is terminated but the error dialog lives on.
    Any suggestions, are this a lost cause?

    I have also seen this once on my Windows machine but it disapeard without any efforts from my side.... I guess, it was due to bad state of my macine.
    Would love to know more about this problem..

  • Error in simple CQL

    I am trying to implement very simple CEP program.Cep is consist of the following component.
    1.Jms adapter named MarketEventInputadapter,which is reading map message data from a simple queue.
    2.one input channel named MarketEventInputchannel.
    3.one processor named MarketEventprocessor containing CQL " <![CDATA[select * from MarketEventInputchannel[now]]]> ".
    4.one output channel MarketEventOutputChannel.
    5.one event bean MarketEventBean
    while trying to deploy I am getting error as:
    <Error> <Deployment> <BEA-2045016> <The application context "My_CEP" could not be started. Could not initialize component "MarketEventprocessor": Event property [cTimeStamp] defined in query [ExampleQuery] must exist in event type [MarketEvent]. Consider using the expression 'cTimeStamp AS ...' in the query.
    I have use MarketEvent.java:
    package com.bea.wlevs.example.algotrading.event;
    public class MarketEvent {
         private Long TimeStamp;
         private String symbol;
         private Double price;
         private Long volume;
         private Long latencyTimestamp;
         * @return the latencyTimestamp
         public Long getLatencyTimestamp() {
              return latencyTimestamp;
         * @param latencyTimestamp the latencyTimestamp to set
         public void setLatencyTimestamp(Long latencyTimestamp) {
              this.latencyTimestamp = latencyTimestamp;
         * @return the timestamp
         public Long getTimestamp() {
              return TimeStamp;
         * @param timestamp the timestamp to set
         public void setTimestamp(Long TimeStamp) {
              this.TimeStamp = TimeStamp;
         * @return the symbol
         public String getSymbol() {
              return symbol;
         * @param symbol the symbol to set
         public void setSymbol(String symbol) {
              this.symbol = symbol;
         * @return the price
         public Double getPrice() {
              return price;
         * @param price the price to set
         public void setPrice(Double price) {
              this.price = price;
         * @return the volume
         public Long getVolume() {
              return volume;
         * @param volume the volume to set
         public void setVolume(Long volume) {
              this.volume = volume;
    I have also use MarketEventBean.java:
    package com.bea.wlevs.example.algotrading;
    import com.bea.wlevs.ede.api.StreamSink;
    import com.bea.wlevs.example.algotrading.event.MarketEvent;
    public class MarketEventBean implements StreamSink {
         public void onInsertEvent(Object event) {
              if (event instanceof MarketEvent) {
                   MarketEvent marketEvent = (MarketEvent) event;
                   System.out.println("Price: " + marketEvent.getPrice());
    Can anybody give an idea about the root cause of the error?

    The root cause of this issue is the event property named timestamp. Timestamp is a CQL keyword and there appears to be a bug in the way we handle event property names that are CQL keywords.
    One way to get around this is to use a different property name; for example, eventTimestamp. We will take a look at the bug and fix it. Could you open a service request so that it will be tracked? Thanks,
    Manju.

Maybe you are looking for