×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    9

    Unable to install jar over http

    Hi to everyboby. First of all sorry for my (bad) english.
    I'm new to j2me programming. I write a simple application to get a midlet from a remote site. The "most important" part of the code is

    Code:
    String url = "http://www.mywebsite.com/helloworld.jad";
    public Command getOkCommand() {
            if (okCommand == null) {                                 
                okCommand = new Command("Download", Command.OK, 0);
                        try {
                            platformRequest(url);                        
                        } catch (ConnectionNotFoundException ex) {
                            System.out.println("Non riesco a connettermi");
                            ex.printStackTrace();
                        } catch (NullPointerException npe){
                            System.out.println("Null pointer B");
                            npe.printStackTrace();
                        }
            }                         
            return okCommand;
        }
    I tried this application on my Nokia N70 (sending .jar via bluetooth).
    The phone started the installer, I said yes to every question but the installation fails. I don't know why. No helpful error/warning were displayed.

  2. #2
    Regular Contributor
    Join Date
    Jun 2008
    Location
    Singapore
    Posts
    167

    Re: Unable to install jar over http

    Hi,

    Did you do the test that you installed OTA the HelloWorld.jad first to see where the problem comes from?

    Rdgs

  3. #3
    Registered User
    Join Date
    Feb 2008
    Posts
    9

    Re: Unable to install jar over http

    HelloWorld.jar works if it is installed via bluetooth but I could not install it via OTA.
    It gaves me the same error: impossible to install. Like with platformRequest(url), it didn't show any useful information.

  4. #4
    Regular Contributor
    Join Date
    Jun 2008
    Location
    Singapore
    Posts
    167

    Re: Unable to install jar over http

    Hi,

    Can you give the content of jad file? Furthermore, you may need to confiure your server so that .jad, .jar type can be understood.

    For configure sever or other OTA issues, refer to:
    http://developers.sun.com/mobility/midp/articles/ota/

    rgds

    Hans

  5. #5
    Registered User
    Join Date
    Feb 2008
    Posts
    9

    Re: Unable to install jar over http

    I forgot to say that I've already add .htaccess file with (only) this strings:

    Code:
    AddType text/vnd.sun.j2me.app-descriptor .jad
    AddType application/java-archive .jar
    AddType application/octet-stream .bin
    and configured N70 to install software (in application manager menu). I disabled the online cert. validation.

  6. #6
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Unable to install jar over http

    Hi beppes,

    * is your midlet signed?
    * which operator are you using? (have you tried on same phone using a SIM from another operator?)

    Pit

  7. #7
    Nokia Developer Expert
    Join Date
    May 2007
    Location
    Mexico D.F
    Posts
    351

    Re: Unable to install jar over http

    Hello beepes,

    Please post the content of the jad file.
    Also check that the jar size matches exactly the property jar-size of the jad file.

    Which IDE are you using to pack your MIDLet: Netbeans, Eclipse, Wireless Toolkit?
    :Ruben

  8. #8
    Registered User
    Join Date
    Feb 2008
    Posts
    9

    Re: Unable to install jar over http

    Content of .jad

    Code:
    MIDlet-1: HelloMIDlet, , hello.HelloMIDlet
    
    MIDlet-Jar-Size: 2058
    
    MIDlet-Jar-URL: http://www.mywebsite.com/helloworld.jar
    
    MIDlet-Name: HelloWorld
    
    MIDlet-Vendor: Vendor
    
    MIDlet-Version: 1.0
    
    MicroEdition-Configuration: CLDC-1.1
    
    MicroEdition-Profile: MIDP-2.0

    Quote Originally Posted by rdrincon View Post
    Hello beepes,
    Which IDE are you using to pack your MIDLet: Netbeans, Eclipse, Wireless Toolkit?
    I use Netbeans 6.1 (downloaded from netbeans.org) on Ubuntu 8.04.1 and WTK 2.5.2 (the default wtk in Netbeans package).

    I tried with 2 different italian operators (TIM and Vodafone) but it is the same
    Last edited by beppes; 2008-07-08 at 17:08.

  9. #9
    Registered User
    Join Date
    Feb 2008
    Posts
    9

    Re: Unable to install jar over http

    I've also tried to download an HelloWorld with CLDC-1.0 but it is the same.
    I can't install the midlet

  10. #10
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Unable to install jar over http

    Let's start from the beginning.

    You have a MIDlet A which will try to install a MIDlet B on the phone, right?
    The code in the first message is from MIDlet A, right? (BTW, as you are showing only a fragment of code here, it is hard to say anything specific, but to me it looks like that you are using the commands in an incorrect way...) - I hope your MIDlet code has all the same elements as this example MIDlet in here http://wiki.forum.nokia.com/index.ph...rld_in_Java_ME

    Or am I getting lost in here?

    Can you install any MIDlet on your phone? Like compile the MIDlet from above and try to install that from the server or over the bluetooth...

    Hartti

  11. #11
    Registered User
    Join Date
    Feb 2008
    Posts
    9

    Re: Unable to install jar over http

    Ok. The situation is this. Midlet A (Downloader), when starts, call platformRequest method with the url of the Midlet B remote jad.
    If I try to install Midlet B with Bluetooth, it works.

    1. The phone ask to me if I wanto to install. I say yes.
    2. Next the phone shows a menu with some option (Continue, show certificate, show details). I select continue.
    3. Next the phone says to me that the application in unsigned and if I want to continue. I say Yes
    4. Next the phone asks if I want to substitute 1.00 with version 1.00 (probabily there is info of an old helloworld Midlet, I don't know ho to remove them). I say Yes
    5. Next the phone asks where I want to install the application. I select the flash memory.
    6. Next it asks if I want to to save the existing info of the application. I say No: I tried also saying no, but the error persists.
    7. Next it shows the error message "Impossible to install".

    Source code is:

    Midlet A: Downloader
    Code:
    import javax.microedition.io.ConnectionNotFoundException;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    
    public class Downloader extends MIDlet implements CommandListener {
    
        private boolean midletPaused = false;                    
        private Form form;
        private Command exitCommand;
        private Command okCommand;
    
        public Downloader() {
        }
    
        private void initialize() {                                         
        }                            
    
        public void startMIDlet() {                                      
            switchDisplayable(null, getForm());                                        
        }                             
    
        public void resumeMIDlet() {                                       
        }                              
    
        public void switchDisplayable(Alert alert, Displayable nextDisplayable) {                                            
            Display display = getDisplay();                                               
            if (alert == null) {
                display.setCurrent(nextDisplayable);
            } else {
                display.setCurrent(alert, nextDisplayable);
            }                                             
        }                                   
    
        public void commandAction(Command command, Displayable displayable) {                                               
            if (displayable == form) {                                           
                if (command == exitCommand) {                                         
                    exitMIDlet();                                           
                } else if (command == okCommand) {                                          
                }                                                  
            }                                                
        }                               
    
        public Form getForm() {
            if (form == null) {                                 
                form = new Form("form");                                    
                form.addCommand(getExitCommand());
                form.addCommand(getOkCommand());
                form.setCommandListener(this);                                  
            }                         
            return form;
        }
    
        public Command getExitCommand() {
            if (exitCommand == null) {                                 
                exitCommand = new Command("Exit", Command.EXIT, 0);                                   
            }                         
            return exitCommand;
        }
    
        public Command getOkCommand() {
            if (okCommand == null) {                                 
                okCommand = new Command("Ok", Command.OK, 0);                                   
                try {
                    platformRequest("http://www.mywebsite.com/Helloworld.jad");
                } catch (ConnectionNotFoundException ex) {
                    ex.printStackTrace();
                }
            }                         
            return okCommand;
        }
    
        public Display getDisplay () {
            return Display.getDisplay(this);
        }
    
    
        public void exitMIDlet() {
            switchDisplayable (null, null);
            destroyApp(true);
            notifyDestroyed();
        }
    
        public void startApp() {
            if (midletPaused) {
                resumeMIDlet ();
            } else {
                initialize ();
                startMIDlet ();
            }
            midletPaused = false;
        }
    
        public void pauseApp() {
            midletPaused = true;
        }
    
        public void destroyApp(boolean unconditional) {
        }
    }
    Midlet B: Helloworld
    Code:
    package hello;
    
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    
    public class HelloMIDlet extends MIDlet implements CommandListener {
        private boolean midletPaused = false;
        private Command exitCommand;
        private Form form;
        private StringItem stringItem;
    
        public HelloMIDlet() {
        }
    
        private void initialize() {                                         
        }                            
    
        public void startMIDlet() {                                      
            switchDisplayable(null, getForm());                                        
        }                             
    
        public void resumeMIDlet() {                                       
        }                              
    
        public void switchDisplayable(Alert alert, Displayable nextDisplayable) {                                            
            Display display = getDisplay();                                               
            if (alert == null) {
                display.setCurrent(nextDisplayable);
            } else {
                display.setCurrent(alert, nextDisplayable);
            }                                             
        }                                   
    
        public void commandAction(Command command, Displayable displayable) {                                               
            if (displayable == form) {                                           
                if (command == exitCommand) {                                         
                    exitMIDlet();                                           
                }                                                  
            }                                                
        }                               
    
        public Command getExitCommand() {
            if (exitCommand == null) {                                 
                exitCommand = new Command("Exit", Command.EXIT, 0);                                   
            }                         
            return exitCommand;
        }
    
        public Form getForm() {
            if (form == null) {                                 
                form = new Form("Welcome", new Item[] { getStringItem() });                                    
                form.addCommand(getExitCommand());
                form.setCommandListener(this);                                  
            }                         
            return form;
        }
    
        public StringItem getStringItem() {
            if (stringItem == null) {                                 
                stringItem = new StringItem("Hello", "Hello, World!");                                   
            }                         
            return stringItem;
        }
    
        public Display getDisplay () {
            return Display.getDisplay(this);
        }
    
        public void exitMIDlet() {
            switchDisplayable (null, null);
            destroyApp(true);
            notifyDestroyed();
        }
    
        public void startApp() {
            if (midletPaused) {
                resumeMIDlet ();
            } else {
                initialize ();
                startMIDlet ();
            }
            midletPaused = false;
        }
    
        public void pauseApp() {
            midletPaused = true;
        }
    
        public void destroyApp(boolean unconditional) {
        }
    }

  12. #12
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: Unable to install jar over http

    Just to try to understand if its a phone related problem: can you install, via OTA, at least one midlet from any other website (e.g.: getjar.com)?

    Pit

  13. #13
    Registered User
    Join Date
    Feb 2008
    Posts
    9

    Re: Unable to install jar over http

    Quote Originally Posted by jappit View Post
    Just to try to understand if its a phone related problem: can you install, via OTA, at least one midlet from any other website (e.g.: getjar.com)?
    Pit
    Ok it is a phone problem. I tried to download via wap JM2MP from getjar.com and the installation process fails with the same error.
    Now, what I have to do?

  14. #14
    Regular Contributor
    Join Date
    Jun 2008
    Location
    Singapore
    Posts
    167

    Re: Unable to install jar over http

    Hi,

    Maybe you could try to hard-reset your device. Btw, what is your phone model?

    Rgds

    Hans

  15. #15
    Registered User
    Join Date
    Feb 2008
    Posts
    9

    Re: Unable to install jar over http

    Quote Originally Posted by tieutue View Post
    Hi,
    Maybe you could try to hard-reset your device. Btw, what is your phone model?
    Hans
    I'll try with hard reset of the phone (Nokia N70).
    (Now the problem is to backup all data)

Similar Threads

  1. Unable To install!
    By tarunmehta in forum General Development Questions
    Replies: 7
    Last Post: 2011-03-28, 22:48
  2. Unable to install On Nokia 3250
    By Marteria in forum Mobile Java General
    Replies: 5
    Last Post: 2008-05-19, 16:04
  3. Unable install the applications in N72, getting error
    By sastryg in forum General Development Questions
    Replies: 1
    Last Post: 2008-01-16, 17:42
  4. Unable to install a signed Application on Nokia E61(issue with UIDs)
    By gmsk19 in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 8
    Last Post: 2007-01-31, 10:29

Posting Permissions

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