×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    13

    Question help me with this error

    Helo,

    i have pated a j2me videoplayer code but when i am trying to exexute it i am getting an error.
    saying no source??? i dnt understand
    Please help me to figure it out!!!

    Code:
    Creating project "Vp"
    Place Java source files in "C:\WTK25\apps\Vp\src"
    Place application resource files in "C:\WTK25\apps\Vp\res"
    Place application library files in "C:\WTK25\apps\Vp\lib"
    Settings updated
    Project settings saved
    Project settings saved
    Building "Vp"
    No sources to compile
    Build failed

    Thanks in advance

  2. #2
    Registered User
    Join Date
    Mar 2010
    Posts
    13

    Question No Source to compile

    hi!

    i am geting this error when i pasted the code for videoplayer in the src folder i hv gvin the SAME NAME TO THE MIDLETCLASS BUT STILL I GET THE FOLLOWING ERROR PLZ HELP ME TO UNDERSTAND THIS N TELL ME WHAT SHOULD I DO TO GET THE CODE RUNNING PROPERLY!!!

    i am getng the following error:

    Creating project "Vp"
    Place Java source files in "C:\WTK25\apps\Vp\src"
    Place application resource files in "C:\WTK25\apps\Vp\res"
    Place application library files in "C:\WTK25\apps\Vp\lib"
    Settings updated
    Project settings saved
    Project settings saved
    Building "Vp"
    No sources to compile
    Build failed

    Thanks in Advance

  3. #3
    Registered User
    Join Date
    Mar 2010
    Posts
    13

    error in building

    Creating project "Vp"
    Place Java source files in "C:\WTK25\apps\Vp\src"
    Place application resource files in "C:\WTK25\apps\Vp\res"
    Place application library files in "C:\WTK25\apps\Vp\lib"
    Settings updated
    Project settings saved
    Project settings saved
    Building "Vp"
    No sources to compile
    Build failed

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: error in building

    I've merged these together, so we don't end up with three separate conversations.

    What are you using to build?

    Did you put the source code in the "src" folder?

    Graham.

  5. #5
    Super Contributor
    Join Date
    May 2008
    Location
    Helsinki, Finland
    Posts
    1,100

    Re: help me with this error

    Quote Originally Posted by Jibrael View Post
    Helo,

    i have pated a j2me videoplayer code but when i am trying to exexute it i am getting an error.
    saying no source??? i dnt understand
    Please help me to figure it out!!!

    Code:
    Creating project "Vp"
    Place Java source files in "C:\WTK25\apps\Vp\src"
    Place application resource files in "C:\WTK25\apps\Vp\res"
    Place application library files in "C:\WTK25\apps\Vp\lib"
    Settings updated
    Project settings saved
    Project settings saved
    Building "Vp"
    No sources to compile
    Build failed

    Thanks in advance

    Hello Jibrael!

    Looks very much like the Sun Java Wireless Toolkit wants some source code to work with.

    Tested it with my WTK and got "No sources to compile" if I did not have code (.java) in my same
    "C:\WTK25\apps\Vp\src" directory.

    You should put your code you want to build into that directory.

    Let's do a test:

    1. Create a new Project : "File"->"New Project"

    2. In the window that opens:
    - into the "Project name" field enter "Testing".
    - into the "MIDlet Class Name" field enter "HelloWorld"

    3. Hit the button "Create project"

    4. In the "API selection" window that opens, leave the "Target Platform" to default "MSA" and hit the OK button.

    5. Onscreen, these messages will tell all went ok:

    "Settings updated
    Project settings saved"

    6. Copy paste the following code in any text editor and save it in your "C:\WTK25\apps\Vp\src" directory as "HelloWorld.java".

    7. Hit the "Build" button in the WTK and check if you got rid of the "Build fails" message.


    Code:
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    
    public class HelloWorld extends MIDlet implements CommandListener {
        private Command exitCommand;
        private TextBox tbox;
    
        public HelloWorld() {
            exitCommand = new Command("Exit", Command.EXIT, 1);
            tbox = new TextBox("Hello world MIDlet", "Hello World!", 25, 0);
            tbox.addCommand(exitCommand);
            tbox.setCommandListener(this);
        }
    
        protected void startApp() {
            Display.getDisplay(this).setCurrent(tbox);
        }
    
        protected void pauseApp() {}
        protected void destroyApp(boolean bool) {}
    
        public void commandAction(Command cmd, Displayable disp) {
            if (cmd == exitCommand) {
                destroyApp(false);
                notifyDestroyed();
            }
        }
    }
    Let me know what happened and if you were able to proceed, ok?


    Best Regards,
    [FONT="Comic Sans MS"][COLOR="Blue"][/COLOR][I]Marko Lumivuori
    Technical Support
    +358 40 8019330
    [email]marko.lumivuori@nokia.com[/email][/I][/FONT]

  6. #6
    Registered User
    Join Date
    Mar 2010
    Posts
    13

    Thumbs up Re: help me with this error

    Thanks Marvec n Graham a lot for you reply!!!

    yes its wrking well with your hello world code!!
    i got it now!!
    can u give me sum link to download and play video files ??
    this my code

    Code:
    import java.io.*;
    import java.util.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    import javax.microedition.media.*;
    import javax.microedition.media.control.*;
    
    public class VideoPlayer extends MIDlet implements CommandListener, 
                 PlayerListener {  
      private Display display;
      private List itemList;
      private Form form;
      private Command stop, pause, start;
      private Hashtable items, itemsInfo;
      private Player player;
    
      public VideoPlayer() {
        display = Display.getDisplay(this);
        itemList = new List("Select an item to play", List.IMPLICIT);
        stop = new Command("Stop", Command.STOP, 1);
        pause = new Command("Pause", Command.ITEM, 1);
        start = new Command("Start", Command.ITEM, 1);
        form = new Form("Playing video");
        form.addCommand(stop);
        form.addCommand(pause);
        form.setCommandListener(this);
        items = new Hashtable();
        itemsInfo = new Hashtable();
    
        items.put("SpringWaterFall...", "file://SpringWaterFall.mpg");
        itemsInfo.put("SpringWaterFall...", "video/mpeg");
        
        items.put("helloboy...", "file://helloboy.mpg");
        itemsInfo.put("helloboy...", "video/mpeg");
    
        items.put("pilgrim...", "file://pilgrim.mpg");
        itemsInfo.put("pilgrim...", "video/mpeg");
    
        items.put("pirates...", "file://pirates.mpg");
        itemsInfo.put("pirates...", "video/mpeg");
    
        items.put("pythag1...", "file://pythag1.mpg");
        itemsInfo.put("pythag1...", "video/mpeg");
        
        items.put("CarelessEnglish...", "file://CarelessEnglish.mpg");
        itemsInfo.put("CarelessEnglish...", "video/mpeg");
      }
    
      public void startApp() {
        for(Enumeration en = items.keys(); en.hasMoreElements();) {
          itemList.append((String)en.nextElement(), null);
        }
        itemList.setCommandListener(this);
        display.setCurrent(itemList);
      }
    
      public void pauseApp() {
        try {
          if(player != null) player.stop();
        } catch(Exception e) {}
      }
    
      public void destroyApp(boolean unconditional) {
        if(player != null) player.close();
      }
    
      public void commandAction(Command c, Displayable d){
        if(d instanceof List) {
          List list = ((List)d);      
          String key = list.getString(list.getSelectedIndex());
          try {
            playAudio((String)items.get(key), key);
          } catch (Exception e) {
            System.err.println("Unable to play: " + e);
            e.printStackTrace();
          }
        } else if(d instanceof Form){
          try {
            if(c == stop){
              player.close();
              display.setCurrent(itemList);
              form.removeCommand(start);
              form.addCommand(pause);
            } else if(c == pause){
              player.stop();
              form.removeCommand(pause);
              form.addCommand(start);
            } else if(c == start){
              player.start();
              form.removeCommand(start);
              form.addCommand(pause);
            }
          } catch(Exception e) {
            System.err.println(e);
          }
        }
      }
    
      private void playAudio(String locator, String key) throws Exception {
        String file = locator.substring(locator.indexOf("file://") + 6,locator.length());
        player = Manager.createPlayer(getClass().getResourceAsStream(file), 
                 (String)itemsInfo.get(key));
        player.addPlayerListener(this);
        player.setLoopCount(-1);
        player.prefetch();
        player.realize();
        player.start();
      }
    
      public void playerUpdate(Player player, String event, Object eventData) {
        if(event.equals(PlayerListener.STARTED) && new Long(0L).equals((Long)
           eventData)) {
          VideoControl vc = null;
          if((vc = (VideoControl)player.getControl("VideoControl")) != null) {
            Item videoDisp = (Item)vc.initDisplayMode(vc.USE_GUI_PRIMITIVE, null);
            form.append(videoDisp);
          }
          display.setCurrent(form);
        } else if(event.equals(PlayerListener.CLOSED)) {
          form.deleteAll();
        }
      }
    }

    i get this error wen i try to execute
    Code:
    Project settings saved
    Building "Vp"
    Build complete
    Running with storage root DefaultColorPhone
    Running with locale: English_United States.1252
    Unable to play: java.lang.IllegalArgumentException
    java.lang.IllegalArgumentException
    	at javax.microedition.media.Manager.createPlayer(+11)
    	at VideoPlayer.playAudio(+41)
    	at VideoPlayer.commandAction(+40)
    	at javax.microedition.lcdui.List.callKeyPressed(+80)
    	at javax.microedition.lcdui.Display$DisplayAccessor.keyEvent(+198)
    	at javax.microedition.lcdui.Display$DisplayManagerImpl.keyEvent(+11)
    	at com.sun.midp.lcdui.DefaultEventHandler.keyEvent(+127)
    	at com.sun.midp.lcdui.AutomatedEventHandler.keyEvent(+210)
    	at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.handleVmEvent(+122)
    	at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.run(+51)
    Execution completed.
    3455899 bytecodes executed
    780 thread switches
    1647 classes in the system (including system classes)
    18052 dynamic objects allocated (544900 bytes)
    3 garbage collections (459536 bytes collected)
    i am wrking on WTK2.5 N JDK1.4.2 what could be the reason for this????
    does my code or system does not support mpg files???

    Thank a lot in Advance

  7. #7
    Registered User
    Join Date
    Mar 2010
    Posts
    13

    Question Re: help me with this error

    helo,

    i need to create a media player for that i hav created three midlet files one which maints the history of navigation the other is simple player n the third is the video player but when executing i get the error as:

    Unable to create MIDlet SimplePlayer
    java.lang.ClassNotFoundException: SimplePlayer
    at com.sun.midp.midlet.MIDletState.createMIDlet(+29)
    at com.sun.midp.midlet.Selector.run(+22)
    Unable to create MIDlet VideoTest
    java.lang.ClassNotFoundException: VideoTest
    at com.sun.midp.midlet.MIDletState.createMIDlet(+29)
    at com.sun.midp.midlet.Selector.run(+22)
    Execution completed.
    3490898 bytecodes executed
    813 thread switches
    1648 classes in the system (including system classes)
    17990 dynamic objects allocated (543348 bytes)
    2 garbage collections (463284 bytes collected)



    pleas tell me what could be the possible mistake??
    how can i do the midlet setting if so required??

    Thanks in advance

Similar Threads

  1. XMl Parser Implementation for Symbian
    By ittiam in forum Symbian
    Replies: 26
    Last Post: 2009-09-16, 05:26
  2. to get ssid
    By d.devendran in forum Symbian
    Replies: 4
    Last Post: 2009-07-15, 09:42
  3. playing aduio file when call is rejected.
    By santosh_sangewar in forum Symbian
    Replies: 6
    Last Post: 2009-06-12, 11:35
  4. i cant build helloworld project
    By akhin in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 2
    Last Post: 2008-12-22, 12:38
  5. My BuilderX (with S60 SDK 2.1.NET MS version) cannot build ARMI UREL
    By danielvidonyi@hotmail.com in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2006-05-04, 21:30

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×