Repor problem

hello, i have a report where in selection screen i am using profit center hierarchy and then in rows i am using cost center hierarchy. is it okay to do it this way? thanks.

Hi,
Forms information:
FRM-41214:  Unable to run report.
Cause:     The report server was unable to run the specified report.
Action:     Check the Report server and make sure it is up and running.
Level:     20
Type:     Error Check the report services are running in your OAS.
Hope it helps.

Similar Messages

  • Installation Problem in windows XP

    Hello,
    I install oracle 8i on windows XP, then I install Forms 6i successfully, But when I go to install Repors 6i, the installations termenates, Now I dont Know whats the problem, If anyone know something about this problem then please guide me in this regard...
    Thanks in advance

    Don't restart your PC after installing Forms6i. Then try to install Reports6i. In first try u would get an error but the second attempt should be successful.
    Take care

  • Macbook Pro Early 2011 Startup Problems

    Hi everyone. I have been having issues with my Macbook Pro starting up since about mid-December. Initially, I had this problem every few weeks, but recently it's been happening about once a week or more.
    Some details:
    My Macbook Pro is early 2011, 15", and is running Mac OS X Lion 10.7.5.
    Processor is 2 GHz Intel Core i7
    Memory: 4 GB 1333 MHz DDR3
    Storage Capacity: 50GB SATA Disk
    Intel HD Graphics 3000 384 MB graphics
    There have been multiple issues, but I think they're all related. The laptop works just fine while it's turned on and the screen is working.
    The main issue I've had is that I used to always just close the lid when I was finished using the laptop. The first issue is that every once in a while, when I opened the lid, the screen wouldn't turn on. More recently, the screen is getting light, but it's just a blank black screen and I can't do anything; there's no mouse onscreen and none of the keyboard buttons do anything. When this happens I need to use the power button to turn off the Macbook and once I hear it turn off I try to use the power button to turn it back on again. Usually if I hold the power button long enough (about 10 seconds) I hear the startup sound start, but I never get the final chime. I can hear the fans going so I know the laptop isn't dead, but nothing is responsive and nothing comes up on the screen. Sometimes if I leave the Macbook this way the fans start getting really loud like they're working harder than usual. I'm not entirely sure how and why the Macbook finally starts up normally again eventually; I'm starting to think that it's just a matter of waiting and when I come back to it after 5/10 minutes it will eventually startup normally. Once or twice when I had the problem I unplugged the laptop from the power source and flipped the closed laptop so the lid was facing down and the bottom up and left it that way for at least a minute. Everything started up fine when I tried again. However this hasn't worked the last several times I've tried. Overall, the power button just seems really unresponsive when this happens since I need to hold it for longer than usual to even hear any sort of startup noise.
    Every time this happens now I try holding down the power button to turn it on, hear it make some noises, but not the startup chime, hold the power button down to turn it off, hear it click off, and try the same thing again. During this I try various things like PRAM and SMC resets and holding down various buttons, but eventually, usually after taking at least a 2 to 3 minute break from this, the laptop finally starts up again like normal and I have no idea how it's working again.
    For a while I thought that the SMC reset might have fixed the problem, but it's still happening. I've already taken the Macbook in to the Apple Store twice. The first time they ran all the hardware tests, but everything seemed to be working fine. The second time they reinstalled the software and I was hoping that would fix the problem, but the problem has persisted since the reinstall so I know this probably isn't a software issue. This also isn't caused by the laptop being moved or dropped or anything since often it will work fine, but when I come back to it without moving it an inch, the screen won't turn on again.
    For a few days this problem was a daily thing. Every single time I opened the lid the screen wouldn't turn on. Eventually I learned that this was probably because the laptop wasn't registering that the lid had been opened and so it didn't know to turn back on from sleep mode. After reading some articles online I decided to start putting my laptop to sleep by using the shutdown dialogue before closing the lid and this seemed to work for a while, but it no longer seems to be the solution. This doesn't happen every time I open the lid, but it happens enough that it's wasting a lot of my time and energy in trying to get it to work and trying to figure out the problem every time it happens.
    There has been a second problem as well and I'm not sure if it's related, but I want to mention it in case it is or in case someone at least has a solution to this problem. The laptop, while on, works just fine. But every once in a while when I'm using regular programs on the laptop, out of nowhere, the screen will suddenly become just a black or gray screen or a white/beige screen with vertical lines and sometimes a buzzing noise to accompany this. When this happens all I can do is restart the laptop with the power button. This has not happened too often to be that much of a hindrance, but it still worries me. (Early on, before the screens with vertical lines, about two or three times the laptop would just shut off by itself without any warning while I was in the middle of something.) I doubt that it's related to a specific program. It's happened while I've used programs I always use. Once when I was using Skype, once for Google Chrome, once for Photoshop. Recently there was also a time when I was playing music on iTunes and doing things on Google Chrome and suddenly the music stopped and the mouse was frozen in place. The force quit keys didn't work so I needed to power down and restart
    I've read several online discussions and articles and I think there may be a problem with my video cable, video chip, display driver, or logic board (or logic board battery). I'm nervous about opening up my laptop myself since I'm worried about causing any damage in the process of attempting to fix hardware. I also worry that if I bring it into the Apple Store again it will pass all the hardware tests so I won't be able to get anything fixed.
    Does anyone have any suggestions for what steps I can try to fix this? Should I go back to the Apple Store? Is there something specific I should tell them?
    Sorry for such a long post. I just wanted to thoroughly explain my problem.

    Hi,
    There have been many reports of graphics problems with early 2011 Macbook Pros. There is a long-running thread on this forum about it but instead of wading through that -- it's miles long -- take a look at this article, which sums it up, more or less.
    http://appleinsider.com/articles/14/01/16/owners-of-late-2011-macbook-pros-repor t-critical-gpu-failures-system-crashes
    You may have already done this, but try starting up in Recovery mode by holding down Command and R keys together, and in the window that appears, select Disk Utility and Continue. Then select your startup disk -- usually called Macintosh HD -- and in First Aid click on Repair Disk.
    This will let you know if your disk has any problems.
    Also try Safe mode by starting up while holding down the Shift key.
    If you go back to the Apple store try to find out if yours is one of the problem computers from early 2011.
    P.S. Your disk is probably 500 GB.

  • Report Generation Toolkit Print HTML Problem

    Hi,
    i have a problem printing a html Page at a Costumers PC with the Report Generation Toolkit.
    I use LV 2012 and the Report Generation Toolkit in 32Bit Mode.
    The Target is a Win7 64Bit Machine with IE10 of our Customer with very strong security rules.
    Our Programm generates a HTML Repor which is saved without any problem.
    When i then try to print it with Print Report.vi it doesent work and i get error1 out of the SubVi NI_ReportGenerationCore.lvlibrint HTML Report using IE.vi.
    This Sub.vi simply cant open the HTML Page with the IE.
    I think its the costumers Security Rules that cause the Problem.
    I saw a very strange behavior of the IE.
    When i double click the .html file the IE gets opened and displays the file properly.
    When i then hit the reload button it also gets reloaded.
    When i click in the browsers adress bar and hit enter (Which normaly does a reload) i get an error "Adress Bar, Adresse, access denied".
    And i think that happens in the Sub.vi.
    I talked to some friends an they sad it could be that double clicking and reloding is done with the local user an the clicking and hitting enter reload is maybe the systemuser.
    So i asume that the Sub.vi is also using the systemuser.
    How can i determin which user is used to execute a vi?
    Can i influence the user?
    Has anybody a solution and seen this problem?
    Regards,
    westgate

    If I understand your situation correctly, you are able to use the LabVIEW Report Generation Toolkit to create an HTML report, which you save as an HTML file.  Can you open it in a browser and print it using the browser's Print button?  I've use LabVIEW to generate HTML reports, but have never tried to print the Reports in LabVIEW -- I've always used the "browser route", myself.

  • Problem calling a report from a form

    Hello,
    i thought about 5 hours what causes this. but i didn't found a solution..
    [http://img188.imageshack.us/i/67205607.jpg/]
    in when-button-pressed i have:
    DECLARE
    report_id REPORT_OBJECT;
    report_job_id VARCHAR2(200);
    rep_status VARCHAR2(200);
    JOB_NUMBER number;
    server_name VARCHAR2(200) := 'roger';
    BEGIN
    /* Check to see if forms application is WEB deployed */
    IF get_application_property(user_interface) = 'WEB' THEN
         report_id:= FIND_REPORT_OBJECT('report104');
         /* Set Report parameters given WEB deployment */
         SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER , server_name);
         SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,CACHE);
         /* DESFORMAT could be HTML, HTMLCSS or PDF here*/
         SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESFORMAT,'PDF');
         /* Run the report */
         report_job_id := RUN_REPORT_OBJECT(report_id);
         /* Check the report status */
         rep_status:=REPORT_OBJECT_STATUS(report_job_id);
         WHILE rep_status IN ('RUNNING','OPENING_REPORT','ENQUEUED')
         LOOP
         rep_status := report_object_status(report_job_id);
         END LOOP;
         IF rep_status='FINISHED' THEN
         message('REPORT WAS CORRECTLY RUN');
         /* Display the report output in the client browser */
         JOB_NUMBER := length(server_name) + 2;
         WEB.SHOW_DOCUMENT ('/reports/rwservlet/getjobid'||substr(report_job_id,JOB_NUMBER)||'?server=' || server_name ||'&param_cls='||to_number(:control.lst_clase));
         /* If report has failed display message to user */
         ELSE
              message('REPORT FAILED WITH STATUS: '||rep_status, no_acknowledge);
         END IF;
    ELSE
         /* Else if forms application is Client-Server deployed */
         /* Set Report parameters given Client-Server deployment */
         report_id:= FIND_REPORT_OBJECT('report104');
         SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER ,'');
         /* Report to be executed via Reports Background Engine, not the 'new' Reports Multi-Tier Server */
         /* Destype SCREEN or PREVIEW can be used here */
         SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,SCREEN);
         /* Run the report */
         report_job_id := RUN_REPORT_OBJECT(report_id);
    END IF;
    END;report104 is the name of the repord added in the Reports node (in Forms).
    in the left window from the image, i checked for the value of parameter param_cls, and it's ok (16).
    when i run the report from the Reports, i see all the repors (that table), but when i run from forms, i got just the headers of the table, the rest is invisible. i don't know why happens this..
    :control.lst_clase returns a char, so i convert that char to a number, and that's the parameter passed from Forms.
    Please help me..
    edit: i saw in Reports that there are two buttons: Run Web Layout and Run Paper Layout. from the Forms, i wanna run the web layout
    Thanks
    Edited by: Roger22 on 22.06.2009 18:24

    finally solved. there was a problem at passing parameters
    this is the code
    DECLARE
    report_id REPORT_OBJECT;
    report_job_id VARCHAR2(200);
    rep_status VARCHAR2(200);
    JOB_NUMBER number;
    server_name VARCHAR2(200) := 'roger';
    rep_url varchar2(500);
    BEGIN
    /* Check to see if forms application is WEB deployed */
    IF get_application_property(user_interface) = 'WEB' THEN
         report_id:= FIND_REPORT_OBJECT('report107');
         /* Set Report parameters given WEB deployment */
         SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER , server_name);
         SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,CACHE);
         /* DESFORMAT could be HTML, HTMLCSS or PDF here*/
         SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESFORMAT,'HTML');
         /* Run the report */
         report_job_id := RUN_REPORT_OBJECT(report_id);
         /* Check the report status */
         rep_status:=REPORT_OBJECT_STATUS(report_job_id);
         WHILE rep_status IN ('RUNNING','OPENING_REPORT','ENQUEUED')
         LOOP
         rep_status := report_object_status(report_job_id);
         END LOOP;
         IF rep_status='FINISHED' THEN
         message('REPORT WAS CORRECTLY RUN');
         /* Display the report output in the client browser */
         JOB_NUMBER := length(server_name) + 2;
         rep_url:='/reports/rwservlet?report=D:\Oracle\product\10.2.0\DevSuiteHome_1\reports\ORAR.jsp'
         ||'&userid='||get_application_property(username)||'/'||get_application_property(password)||'@'||get_application_property(connect_string)
         ||'&desformat=htmlcss'
         ||'&destype=cache'
         ||'&paramform=yes'
         ||'&getjobid'||substr(report_job_id,JOB_NUMBER)
         ||'&param_cls='||to_char(:control.lst_clase)
         ||'&param_ansc='||to_char(:control.lst_an)
         ||'&param_sem='||to_char(:control.text_item26);
         WEB.SHOW_DOCUMENT (rep_url,'_blank');
         /* If report has failed display message to user */
         ELSE
              message('REPORT FAILED WITH STATUS: '||rep_status, no_acknowledge);
         END IF;
    ELSE
         /* Else if forms application is Client-Server deployed */
         /* Set Report parameters given Client-Server deployment */
         report_id:= FIND_REPORT_OBJECT('report107');
         SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER ,'');
         /* Report to be executed via Reports Background Engine, not the 'new' Reports Multi-Tier Server */
         /* Destype SCREEN or PREVIEW can be used here */
         SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,SCREEN);
         /* Run the report */
         report_job_id := RUN_REPORT_OBJECT(report_id);
    END IF;
    END;but the report is running in Paper Layout. i wanna run in Web Layout (in Reports Builder there are two buttons, Paper Layout and Web Layout). from forms how can i run the report in Web Layout?
    Regards,

  • Sales order cannot be rejected -problem log status item status is incorrect

    Hi,
    I need to reject this particular sales order, but when i try to reject it says to check the problem log which states that the item status is incorrect. It says subsequent documents exists for some lines even though no documenst are attached.
    There were a delivery attached to this order earlier but that has been archived. I ran repors SDVBUK00 etc but nothin seem to sort this issue..
    I just need to reject the whole sales order. does anyone know any reports or somethin to rectify this issue.
    Thanks
    Keshini

    Dear Keshini,
    Could you please update with the process of Delivery Document Archieved?
    I mean, had you reversed the delivery (T. Code: VL09) and then deleted the items from reversed Delivery Doc (T. Code: VL02N), before deleteing the Delivery Doc?
    Was there any subsequent document for Delivery Doc.?
    Best Regards,
    Amit
    Note: Also, check with Copy-Control settings for Order-to-Delivery (T. Code: VTLA)
    1. Field: Update Document Flow is marked ticked at
    Item (Dialog Structure) --> Item Category --> Control data
    2. Field: Pos./neg. quantity with entry "+"

  • Problem with two databases

    Hi, In a single application i have two databases.I am building & loading Database1 at the same time From Analyser (reporting tool) when i try to access data from database2 i am getting login errors. once the database1 loading and building is complete then i dont have any problem logging to the reporing tool.Any help is appreciated!Thanks.

    It sounds as if you are doing a build on a dense dimension. A dense build triggers a dense restructure. A dense restructure will cause Essbase to refuse to accept commands from all users for the duration of the restructure. I don't think copying Database 2 to a different Application would help, but I could be wrong. Can somebody comment?Verify on what dimension type the build is taking place. If it is not a dense dimension, I'm not sure what the problem would be.Tim

  • Parroll report problem for court table.

    Hi all,
         I have problem for payroll report that to court table .i new to working in payroll repors.here i given my criteria what i want output field.
    I am taking fields from pa0070.
    in this infotype i am taken thisd fields.
          PERNR LIKE PA0070-PERNR,
          CRTTY LIKE PA0070-CRTTY,
          CAPSF LIKE PA0070-CAPSF,
          OBJPS LIKE PA0070-OBJPS,
          IDATE LIKE PA0070-IDATE,
          CTREF LIKE PA0070-CTREF,
          REFNO LIKE PA0070-REFNO,
          TOTSM LIKE PA0070-TOTSM,
          STDPY LIKE PA0070-STDPY,
          PROTE LIKE PA0070-PROTE,
          EMFSL LIKE PA0070-EMFSL, and
    court table ARRDN,ARRPE,TOTDN condition is " Not Council tax - CRTTY = EWT" this how to bild the code .
    Regards,
    Kris.

    Refer this
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2165e990-0201-0010-5cbb-b5c2ad436140
    http://www.sapdevelopment.co.uk/dialog/tabcontrol/tchome.htm

  • Problema para conectar MacBook Pro a proyector

    Tengo una macbook pro late 2011, la quice conectar a varios proyectores y pantallas a travez de un adaptador Mini Display Port a VGA pero la pantalla se pone azul por unos momentos unicamente y no da señal de video, ¿que problema podría ser?, ¿El adaptador?, ¿Mi MacBook pro?
    Cabe mencionar que ya intente cambiar la resolución en gran cantidad de ocasiones y no funciona, ayuda, porque necesito mucho ultimamente y es muy engorroso tener que estar pasando la informacion a una PC con Windows.

    Olá Maria do Carmo,
    Recomendo que vá até às Definições/Ajustes do seu iPhone e selecione "Geral". Depois, no final encontrará "Repor"/"Redefinir". Redifina as configurações de rede.
    Aguarde que o seu iPhone reinicie e insira a senha da rede Wi-Fi da sua casa novamente.
    Peço desculpa por só responder agora e por mencionar alguns dos menus acima em Português de Portugal. Caso eu não tenha conseguido ajudá-la clique em "Reply", para que eu possa voltar a responder à sua questão.
    Cumprimentos.

  • Re Nokia E5 Issues and Problems

    Hai 
    I am using nokia E5 it have recently got updated
    since then i am facing lot of problems and issues
    1. it was showing phone memory full but nothing is visible in phone memory
    2. when ever i open youtube and mp3 in other window volume key doesnt work in mp3
    3.very recently ovi site is getting too worse when i ask topsearch top free is shows alll paid 
    but suprisingly it says you are logged in and every thing but i cannot download
    4.when ever i made my contacts backup in memory card i loose defaults ring tones
    5. i couldnt configure my in.com mail on new mail upgrade.
    and also previously when i ever i am composing mail and typing address at sender ( To , BCC ,or Cc) my mail contacts appeared but now it was showing my phone contacts whoes mail id are in thais
    6. sending sms to group while sending a group sms to may in a mean while if at all we receive call of kept in charging all messages simply stays at OUT BOX as Defered and again for each i have to sent individually
    7.when i kept delivery repors yes, when ever i receive message delivered rather than text appearing it just give me tone what i have kept for the meassage incoming ring tone.
    8.when i strictly selecting SMS wht was the reasont to display email id in every contact if i accidently selected it it was converting sms to MMS and subscriber is killing my balance in an instance.
    please help me to come out of this problems
    thanks regards yor valuable customer

    Firstly, this is a user to user support forum, so w are all Nokia users here.
    I find issues starting following an updatecan usually be resolvd a hard reset. I suggest backing up your data only and not the settings. Then reset the phone using the *#7370# reset. Once done, check that the issues are resolved before restoring your data and reinstalling apps.

  • Please suggest solution to this printing problem

    Hi,
    I did a small project using forms and reports 6i. Now i prepared a repor that will calucalate the sum(expenditure)per report level. Now the problem is i want to print the sum which is in number form , in words. That is if the sum is 50000 then i want to print "fifty thousand". For this conversion from number to figure i wrote a small programme , which successfully compiled and created a function.
    Now I want to create a field in the report and in which I want to call this plsql function and perform the number conversion of sum(expenditure)per report field. Please describe in detail how to make reference between these two fields i.e sum(expenditure)per report and field in which I want to run plsql code and thereby converting the sum into figures.
    Thanks in advance
    Prasanth a.s.

    hi,
    use this code
    it works !!
    regards
    sandy
    CREATE OR REPLACE FUNCTION NUMBER_CONVERSION(NUM NUMBER) RETURN VARCHAR2
    IS
    A VARCHAR2(1000);
    B VARCHAR2(20);
    X NUMBER;
    Y NUMBER := 1;
    Z NUMBER;
    LSIGN NUMBER;
    NO NUMBER;
    BEGIN
    X:= INSTR(NUM, '.');
    LSIGN := SIGN(NUM);
    NO := ABS(NUM);     
    IF X = 0 THEN
    SELECT      TO_CHAR(TO_DATE(NO, 'J'), 'JSP') INTO A FROM DUAL;
    ELSE
    SELECT      to_char(to_date(SUBSTR(NO, 1,
              NVL(INSTR(NO, '.')-1, LENGTH(NO))),
                   'J'), 'JSP') INTO A FROM DUAL;
    SELECT     LENGTH(SUBSTR(NO, INSTR(NO, '.')+1)) INTO Z FROM DUAL;
    A := A ||' POINT ';
    WHILE Y< Z+1 LOOP
         SELECT TO_CHAR(TO_DATE(SUBSTR(NO, (INSTR(NO, '.')+Y), 1), 'J'), 'JSP')
         INTO B FROM DUAL;
              A := A || B ||' ';
              y :=y+1;
    END LOOP;
    END IF;

  • Please suggest solution to this report printing problem

    Hi,
    I did a small project using forms and reports 6i. Now i prepared a repor that will calucalate the sum(expenditure)per report level. Now the problem is i want to print the sum which is in number form , in words. That is if the sum is 50000 then i want to print "fifty thousand". For this conversion from number to figure i wrote a small programme , which successfully compiled and created a function.
    Now I want to create a field in the report and in which I want to call this plsql function and perform the number conversion of sum(expenditure)per report field. Please describe in detail how to make reference between these two fields i.e sum(expenditure)per report and field in which I want to run plsql code and thereby converting the sum into figures.
    Thanks in advance
    Prasanth a.s.

    Create a formula column that calls your procedure to get the value in words. Create a field based on this formula column.

  • A problem with threads

    I am trying to implement some kind of a server listening for requests. The listener part of the app, is a daemon thread that listens for connections and instantiates a handling daemon thread once it gets some. However, my problem is that i must be able to kill the listening thread at the user's will (say via a sto button). I have done this via the Sun's proposed way, by testing a boolean flag in the loop, which is set to false when i wish to kill the thread. The problem with this thing is the following...
    Once the thread starts excecuting, it will test the flag, find it true and enter the loop. At some point it will LOCK on the server socket waiting for connection. Unless some client actually connects, it will keep on listening indefinatelly whithought ever bothering to check for the flag again (no matter how many times you set the damn thing to false).
    My question is this: Is there any real, non-theoretical, applied way to stop thread in java safely?
    Thank you in advance,
    Lefty

    This was one solution from the socket programming forum, have you tried this??
    public Thread MyThread extends Thread{
         boolean active = true;          
         public void run(){
              ss.setSoTimeout(90);               
              while (active){                   
                   try{                       
                        serverSocket = ss.accept();
                   catch (SocketTimeoutException ste){
                   // do nothing                   
         // interrupt thread           
         public void deactivate(){               
              active = false;
              // you gotta sleep for a time longer than the               
              // accept() timeout to make sure that timeout is finished.               
              try{
                   sleep(91);               
              }catch (InterruptedException ie){            
              interrupt();
    }

  • A problem with Threads and MMapi

    I am tring to execute a class based on Game canvas.
    The problem begin when I try to Play both a MIDI tone and to run an infinit Thread loop.
    The MIDI tone "Stammers".
    How to over come the problem?
    Thanks in advance
    Kobi
    See Code example below:
    import java.io.IOException;
    import java.io.InputStream;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.lcdui.Image;
    import javax.microedition.lcdui.game.GameCanvas;
    import javax.microedition.media.Manager;
    import javax.microedition.media.MediaException;
    import javax.microedition.media.Player;
    public class MainScreenCanvas extends GameCanvas implements Runnable {
         private MainMIDlet parent;
         private boolean mTrucking = false;
         Image imgBackgound = null;
         int imgBackgoundX = 0, imgBackgoundY = 0;
         Player player;
         public MainScreenCanvas(MainMIDlet parent)
              super(true);
              this.parent = parent;
              try
                   imgBackgound = Image.createImage("/images/area03_bkg0.png");
                   imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
                   imgBackgoundY = this.getHeight() - imgBackgound.getHeight();
              catch(Exception e)
                   System.out.println(e.getMessage());
          * starts thread
         public void start()
              mTrucking = true;
              Thread t = new Thread(this);
              t.start();
          * stops thread
         public void stop()
              mTrucking = false;
         public void play()
              try
                   InputStream is = getClass().getResourceAsStream("/sounds/scale.mid");
                   player = Manager.createPlayer(is, "audio/midi");
                   player.setLoopCount(-1);
                   player.prefetch();
                   player.start();
              catch(Exception e)
                   System.out.println(e.getMessage());
         public void run()
              Graphics g = getGraphics();
              play();
              while (true)
                   tick();
                   input();
                   render(g);
          * responsible for object movements
         private void tick()
          * response to key input
         private void input()
              int keyStates = getKeyStates();
              if ((keyStates & LEFT_PRESSED) != 0)
                   imgBackgoundX++;
                   if (imgBackgoundX > 0)
                        imgBackgoundX = 0;
              if ((keyStates & RIGHT_PRESSED) != 0)
                   imgBackgoundX--;
                   if (imgBackgoundX < this.getWidth() - imgBackgound.getWidth())
                        imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
          * Responsible for the drawing
          * @param g
         private void render(Graphics g)
              g.drawImage(imgBackgound, imgBackgoundX, imgBackgoundY, Graphics.TOP | Graphics.LEFT);
              this.flushGraphics();
    }

    You can also try to provide a greater Priority to your player thread so that it gains the CPU time when ever it needs it and don't harm the playback.
    However a loop in a Thread and that to an infinite loop is one kind of very bad programming, 'cuz the loop eats up most of your CPU time which in turn adds up more delays of the execution of other tasks (just as in your case it is the playback). By witting codes bit efficiently and planning out the architectural execution flow of the app before start writing the code helps solve these kind of issues.
    You can go through [this simple tutorial|http://oreilly.com/catalog/expjava/excerpt/index.html] about Basics of Java and Threads to know more about threads.
    Regds,
    SD
    N.B. And yes there are more articles and tutorials available but much of them targets the Java SE / EE, but if you want to read them here is [another great one straight from SUN|http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html] .
    Edited by: find_suvro@SDN on 7 Nov, 2008 12:00 PM

  • J2ME problem with threads

    Hi all,
    I would like to ask you for a help. I need to write a small program at my university. I started to write a midlet which function would be to countdown time for sports activities. I woul like to start a new thread - the one that counts down - and at the same time make the main thread sleep. After the "countdown" thread finishes, the main thread wakes up and waits for user input. The problem is that when the "countdown" thread finishes his work, I've got Uncaught exception java/lang/NullPointerException. error and the midlet halts.
    Below you can find the code
    import java.lang.*;
    import java.util.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    public class intervals extends MIDlet implements CommandListener
    public Display ekran;
    private SweepCanvas sweeper;
    private Form rundy;
    private TextField round0, round1, round2, round3, round4, round5, round6, round7, round8;
    private long czas,x;
    private Command exitCommand;
    private Command addRound;
    private Command delRound;
    private Command start;
    private TextField repeat;
    private Form odliczanie;
    private Alert ostrz;
    Licznik thread;
    String test;
    StringItem test1;
    int parz,i,j,k;
    static int l;
    int ilrund;
    int ilpowt;
    Item sec;
    long sec1;
    public intervals()
        rundy = new Form("Interwa&#322;y sportowe");
        exitCommand = new Command("Wyj&#347;cie", Command.EXIT, 2);
        addRound = new Command("Dodaj","Dodaj rund&#281;", Command.ITEM,1);
        delRound = new Command("Usu&#324;","Usu&#324; ostatni&#261; rund&#281;", Command.ITEM,1);
        start = new Command("Start", Command.ITEM,1);
        odliczanie = new Form("Odliczanie");
        TextField dodaj(TextField kolej)
            kolej=new TextField("Podaj czas (s) rundy "+parz,null, 4, TextField.NUMERIC);//stworzenie nowej instancji do wybierania czasu trwania rundy
            if(rundy.size()==0)
                rundy.insert(rundy.size(),kolej);
                else
                    rundy.insert(rundy.size()-1, kolej);
            return kolej;
        void odliczanie(TextField round)
            monitor m=new monitor();
            k=Integer.parseInt(round.getString());
            ekran.setCurrent(odliczanie);
            thread=new Licznik(k,odliczanie);
            thread.start();
            ekran.setCurrent(rundy);
    public void startApp()// throws MIDletStateChangeException
        rundy.deleteAll();
        repeat = new TextField("Podaj ilo&#347;&#263; powtórze&#324;",null,1,TextField.NUMERIC);
        rundy.addCommand(addRound);
        rundy.addCommand(exitCommand);
        rundy.setCommandListener(this);
        Canvas obrazek = new MyCanvas();
        ekran = Display.getDisplay(this);
        ekran.setCurrent(obrazek);
        czas=System.currentTimeMillis();
        while (System.currentTimeMillis()<czas+1000)
            continue;
        ekran.setCurrent(rundy);
    public void pauseApp()
    public void destroyApp(boolean unconditional)
        notifyDestroyed();
    public void commandAction(Command c, Displayable s)
        if (c == exitCommand)
            destroyApp(false);
            notifyDestroyed();
        else if(c==addRound)
            if(rundy.size()==0)//Sprawdzenie ilo&#347;ci elementów w celu poprawnego wy&#347;wietlania liczby rund w formie
                parz=1;
                else
                parz=rundy.size();
            switch(parz)
                case 1:
                    round0=dodaj(round0);break;
                case 2:
                    round1=dodaj(round1);break;
                case 3:
                   round2= dodaj(round2);break;
                case 4:
                    round3=dodaj(round3);break;
                case 5:
                    round4=dodaj(round4);break;
                default:
                    ostrz=new Alert("Uwaga","Maksymalna liczba rund wynosi 9", null, AlertType.INFO);
                    ostrz.setTimeout(3000);
                    ekran.setCurrent(ostrz);
            if(rundy.size()==1)
                rundy.append(repeat);
                rundy.addCommand(start);
            rundy.addCommand(delRound);
        else if(c==delRound)
            if(rundy.size()!=0)
                rundy.delete(rundy.size()-2);
                if (rundy.size()==1)
                    rundy.deleteAll();
                if(rundy.size()==0)
                    rundy.removeCommand(delRound);
                    rundy.removeCommand(start);
        else if(c==start)
            ilrund=rundy.size()-1;
            if(this.repeat.size()>0)
                ilpowt=Integer.parseInt(this.repeat.getString());
            ekran = Display.getDisplay(this);
            for (i=1; i<=ilpowt;i++)
                odliczanie= new Form("Odliczanie");
                 for (j=0;j<ilrund;j++)
                    switch(j)
                         case 0:
                             odliczanie(round0);
                             break;
                         case 1:
                             odliczanie(round1);
                             break;
                         case 2:
                             odliczanie(round2);
                             break;
                         case 3:
                             odliczanie(round3);
                             break;
                         case 4:
                             odliczanie(round4);
                             break;
                         case 5:
                             odliczanie(round5);
                             break;
                         case 6:
                             odliczanie(round6);
                             break;
                         case 7:
                             odliczanie(round7);
                             break;
                         case 8:
                             odliczanie(round8);
                             break;
    class Licznik extends Thread
        int czas1,k;
        Form forma;
        monitor m;
        public Licznik(int k,Form formap)
            czas1=k;
            forma=formap;
        public synchronized void run()
            while(czas1>0)
                forma.deleteAll();
                forma.append("Czas pozosta&#322;y (s): "+czas1);
                try{Thread.sleep(1000);} catch(InterruptedException e){e.printStackTrace();}
                czas1--;
            if(czas1<=0)
                m.put();
        }and monitor class
    public class monitor
    boolean busy=false;
    synchronized void get()
        if(!busy)
            try
                wait();
            }catch(InterruptedException e){e.printStackTrace();}
        notify();
    synchronized void put()
        if(busy)
            try
            wait();
            }catch(InterruptedException e){e.printStackTrace();}
        busy=true;
        notify();
    }Can anybody help me with this?

    Groovemaker,
    Your Licznik class has a member m of type monitor, which has not been instantiated (in other words is null) hence, when calling m.put() you get NullPointerException. Please also mind, that using Thread.sleep(1000) is not an accurate way of measuring time.
    If I may, please use recommended for Java class naming conventions - some of your names use lower case, while other don't which is confusing to the reader.
    Daniel

Maybe you are looking for

  • Exception in Integration Configuration

    Hello, we get an exception in the Integration Directory when we create an Integration Configuration. When saving the changes we get the following error message: Internal error: Link from Integrated Configuration | bs_cbp_c | http://BusinessPartner/as

  • Error while Configuring IT0008 in PA 30

    Dear Gurus, I'm running Hiring Action through PA40 in IDES Server and i configured infogroup in this particular order. i.e 0000, 0002, 0001, 0006, 0007, 0008. Issue:- 1. After saving IT0002 my session is jumping to user login page and after providing

  • How to create an array of a cluster?

    Hello! Now we need some help or tip again :-) We have an array of strings coming out from a for-loop. We want to pick this array in peaces and get the string-elements out. These elements we want to get into a cluster together with boolean constant. O

  • User status change in inspection lot

    sir, when i am doing  ud in qa11 that there is compulsary a USER STAUS must be QAA Aprroval by QA manager if user staus is QCNA not approvewd by QA manager then it gives error for user status changes must be compulsary.     so where we can change tha

  • Some question about windows 7 and mini laptop

    hi i glad that i found this forum, i have the mini HP laptop 110 and i have some question (i have intel atom 1.66 , 2G memory and windows 7 starter) 1. if i'll instal the windows 7 pro - is my performance will be smaller ? 2. what is the most light a