NoClassDefFoundError in JSR-179 code

Hello. I am testing some GPS capabilities on my 7100i Sprint/Nextel. Everytime I try to run my midlet on the device, I get the "NoClassDefFoundError". The 7100i is listed as implementing the JSR-179 spec, so I am at a loss.
I have tried getting the result of the System.getProperty("microedition.location.version") and it returns "1.0" as it should according to the spec. I have explicitly enabled permissions in the midlet for the .Location class.
The code I am using it coming directly from an example posted on BlackBerry's site ... http://www.blackberry.com/developers/journal/jan_2006/blackberry_gps.shtml?CPID=OTC-devfeb17
Can anyone provide help on getting past this error?

I kept poking around on this and found that the .jar file did not include the .class files from the JSR-179 implementation. I manually added these to the preverification and recompiled and re ran on the device. Now I am getting "...attempts to access a secure API". It seems from that now I have to use the Blackberry/RIM digital signing process to gain access to this. Any additional comments on these topics are very welcome!

Similar Messages

  • Use Location API (JSR 179)

    Hello everybody!
    I'm studying JavaME and its APIs, especially the API JSR 179 (Location). Until I found tutorials on the Internet, though, as I am beginner, I can not locate me in code.
    The code was to take pictures, and imbuing it the geographical location of latitude and longitude, and write to a specific folder. However, only that the program captures the Latitude, Longitude and Altitude, and throw in the display.
    I ask your help to solve this problem.
    Thanks
    PS = To determine the speed, the API Mobility would be better, right?

    following tutorial will help you.
    http://wiki.forum.nokia.com/index.php/Mini_App_With_Location_API_and_Google_Maps_in_Java_ME
    Edited by: 795848 on Nov 20, 2010 1:15 AM

  • Is there any j2me phone in india which supports jsr 179

    Hi everyone,
    Is there any j2me phone in india which supports jsr 179 ? I want to test gps application in India. If not supported the is there any other way to test GPS application in india ?
    Thanx in Advance
    Krishan

    hi
    just do visit
    http://www.nokia.co.in for phones available in india
    and for specification see
    http://forum.nokia.com
    hope information may help you
    regards & all the best,
    Vasco

  • Anyone with JSR-179 phone needed!

    Could anyone please try the example below on one of the phones listed here:
    http://developers.sun.com/techtopics/mobility/device/pub/device/list.do?page=2&apiId=125
    The example is pretty straightforward:
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.location.*;
    public class LocationMidlet extends MIDlet implements CommandListener {
        Command Exit = new Command("Exit",Command.EXIT,0);
        public LocationMidlet() {}
        public void startApp() {
            Form f=new Form("Waiting...");
            f.append("Finding for location...");
            f.addCommand(Exit);
            f.setCommandListener(this);
            Display.getDisplay(this).setCurrent(f);
            try {
                Criteria c=new Criteria();
                c.setHorizontalAccuracy(1000);
                c.setVerticalAccuracy(1000);
                c.setPreferredPowerConsumption(Criteria.POWER_USAGE_LOW);
                LocationProvider lp=LocationProvider.getInstance(c);
                Location loc=lp.getLocation(60);
                QualifiedCoordinates qc=loc.getQualifiedCoordinates();
                f.append("Alt: "+qc.getAltitude());
                f.append("Lat: "+qc.getLatitude());
                f.append("Long: "+qc.getLongitude());
            } catch(Exception e) {
                f.append("Exception: "+e);
        public void pauseApp() {}
        public void destroyApp(boolean destroy) {}
        public void commandAction(Command c, Displayable s) {
            if (c == Exit) {
                destroyApp(true);
                notifyDestroyed();
    }This example is from: http://www.java-tips.org/java-me-tips/midp/location-based-services-on-j2me-devices.html
    You would need the wireless toolkit 2.5
    It seems to be working in emulator but I don't have access to the proper device to test it and I have read that the mobile operator has to support this as well in order to work.
    Any help would be appreciated. Thanks to all.
    I just want ot check if using location API with jsr-179 enabled phones is possible and with which mobile operator have you tested it. Thanks!
    Message was edited by:
    kris_java

    <snip>
    Waiting...
    Finding for location...
    Exception: javax.microedition.location.LocationException: getLocation() method cannot be called from event thread
    </snip>
    That's what my BlackBerry 8800 says.
    martin[at]teambender.de

  • JSR-179 GPS

    Hi,
    I want to have a custom Location object with my custom lat/lon.
    How can I do this? is it possible?
    Thank you for your replies if any :)

    I got this email from Kevin Sally:
    Hi Shahar,
    The JSR179 spec/API is meant to be used on Mobile devices with an embedded GPS receiver. However, having said that, if you include the JSR 179 package in your JSE application for a PC, you can use the distance measurements etc that are packaged with the JSR179 package. It seems like overkill though, I am sure there are other open source packages out there that will provide the capability to measure distances between points, etc.
    Basically, you will have to use streaming NMEA data on your serial port to aquire the GPS coordinates as the JSR179 spec is not meant to aquire GPS coordinates from a serial port.
    I hope this helps.
    Regards,
    Kevin
    Kevin Sally, P.Eng
    Certified Senior IT Architect, IBM WebSphere Services
    03/RKN/8200/MKM
    email: [email protected]
    (905)413-5613
    t/l:969-5613

  • JSR 179 and GSM

    Can we get the co-ordinates using JSR 179 in a mobile device(With out using GPS)? I mean using cell-ID?
    If so which are the phones supporting this feature.

    lalvs wrote:
    Can we get the co-ordinates using JSR 179 in a mobile device(With out using GPS)? I mean using cell-ID?http://developers.sun.com/mobility/apis/articles/location/
    spatial location can be expressed in the widely used latitude-longitude-altitude coordinate system. Latitude is expressed as 0-90 degrees north or south of the equator, and longitude as 0-180 degrees east or west of the prime meridian, which passes through Greenwich, England. Altitude is expressed in meters above sea level.
    If so which are the phones supporting this feature.+JSR 179 requires the Connected Device Configuration (CDC) or version 1.1 of the Connected Limited Device Configuration (CLDC). CLDC 1.0 isn't adequate because it doesn't support floating-point numbers, which the API uses to represent coordinates and other measurements. The Location API doesn't depend on any particular profile -- it can be used with MIDP or the Personal Profile.
    The hardware platform determines which location methods are supported. If it doesn't support at least one location provider, LBS won't be possible. Applications can request providers with particular characteristics, such as a minimum degree of accuracy. Some location methods may be free; others may entail service fees. The application should warn the user before any charges are incurred. +

  • JSR 179 - GPS access - webApp?

    If you have an GPS-phone with JSR-179 you can easily get the coordinates of where you are.
    But if you dont want to get the coords when using a web-browser where you would like to input them, can you even do that?
    (I am in control of the web page)

    lalvs wrote:
    Can we get the co-ordinates using JSR 179 in a mobile device(With out using GPS)? I mean using cell-ID?http://developers.sun.com/mobility/apis/articles/location/
    spatial location can be expressed in the widely used latitude-longitude-altitude coordinate system. Latitude is expressed as 0-90 degrees north or south of the equator, and longitude as 0-180 degrees east or west of the prime meridian, which passes through Greenwich, England. Altitude is expressed in meters above sea level.
    If so which are the phones supporting this feature.+JSR 179 requires the Connected Device Configuration (CDC) or version 1.1 of the Connected Limited Device Configuration (CLDC). CLDC 1.0 isn't adequate because it doesn't support floating-point numbers, which the API uses to represent coordinates and other measurements. The Location API doesn't depend on any particular profile -- it can be used with MIDP or the Personal Profile.
    The hardware platform determines which location methods are supported. If it doesn't support at least one location provider, LBS won't be possible. Applications can request providers with particular characteristics, such as a minimum degree of accuracy. Some location methods may be free; others may entail service fees. The application should warn the user before any charges are incurred. +

  • LocationProvider (JSR 179) implementation for GPS on PC

    Hello all,
    Can any one direct me please to a LocationProvider implementation for windows of the JSR-179 location api.
    it seems that each mobile device should have it's own implementation of the LocationProvider. what happens if my mobile device is an ordinary PC running Windows?
    for that matter in need also an implementation for linux...
    It seems so trivial, I just need an implementation that knows to read NMEA protocol out of a COM port....
    it should be simple I feel that I'm missing something... I'm trying to find something for that last 24h and come in vain.
    please help,
    tnx in advanced,
    Shahar Daniel

    I got this email from Kevin Sally:
    Hi Shahar,
    The JSR179 spec/API is meant to be used on Mobile devices with an embedded GPS receiver. However, having said that, if you include the JSR 179 package in your JSE application for a PC, you can use the distance measurements etc that are packaged with the JSR179 package. It seems like overkill though, I am sure there are other open source packages out there that will provide the capability to measure distances between points, etc.
    Basically, you will have to use streaming NMEA data on your serial port to aquire the GPS coordinates as the JSR179 spec is not meant to aquire GPS coordinates from a serial port.
    I hope this helps.
    Regards,
    Kevin
    Kevin Sally, P.Eng
    Certified Senior IT Architect, IBM WebSphere Services
    03/RKN/8200/MKM
    email: [email protected]
    (905)413-5613
    t/l:969-5613

  • JSR-179 and Mobile Operators

    Hello!
    Anybody knows of a Mobile Operator that currently supports the J2ME Location API (JSR-179)?
    I havent managed to find anyone so far.
    Any Kind of Info will be greatly appreciated
    regards
    Thanos

    It is very frustrating. From the info I have found so far, many operators do offer various APIs to get location information, but this works from a server application (passing the MSISDN to the network operator's location server), and not from the device itself. These require that you have some business relationship with that operator. For example, Orange provide a location API (http://www.orange.co.uk/thirdparty/location.html") , but you have to be an "Orange Partner premium member" and Orange have to approve your application. No word on whether they will migrate this service to support JSR-179.

  • Java.lang.NoClassDefFoundError when executing JAVA code

    Hy everyone,
    Trying to execute some java code through forms I got this error when running my program : java.lang.NoClassDefFoundError : simple (where simple is a java class I developped).
    These are the steps I followed:
    1- Devopping a simple JAVA class (simple.java) and compiling in JDK 1.4 (for compatibilty with forms 10.1.2.0.2)
    2- Creating the JAR file
    3- Copying the JAR file in <ORACLE_HOME>\forms\java
    4- Adding the adress of the JAR file in CLASSPATH (environment variable of the server)
    5- Adding the adress of the JAR file in CLASSPATH (environmental file of OAS default.env)
    6- Importing the JAVA class trought forms builder (program>>import java class)
    7- Invoking the JAVA class via the PL/SQL packages created by forms builder
    8- Running the program
    Thanks for your help.
    Regards.

    In most cases, you should not have to stop and restart OC4J_BI_FORMS to pick such changes. However, since you are having problems, I would ensure that all frmweb processes have been stopped, then stop and restart OC4J_BI_FORMS and retest. If that doesn't work, you should review how you imported the java into your app. Look closely at the Importer options you used and ensure that you have not change the file name at any point. Because you are working with Java, case sensitivity is critical.
    Also, where are you seeing the error message? Client java console or in a server side log? If server side, exactly which log file is reporting the problem? I would suggest you post the first 4 ro 5 lines of the error and not just the NoClassDefFound part.

  • Location service fees (JSR-179)

    How do we determine costs associated with using the LocationProvider class? I'd like to have an idea during the design phase at the very least, and at most, be able to know at runtime so I can throttle requests based on costs of a particular user's service plan.
    Anyone?

    How do we determine costs associated with using the LocationProvider class? I'd like to have an idea during the design phase at the very least, and at most, be able to know at runtime so I can throttle requests based on costs of a particular user's service plan.
    Anyone?

  • EJB lookup via JNDI results in java.lang.NoClassDefFoundError

    Hello,
    I have created and deployed an EJB to the WebAS (ver 6.40).  There is no problem looking up the bean via JNDI and calling its methods from a J2EE application - I successfully did this via a servlet.
    However, a JNDI lookup from a Web Dynpro application - on the same server - results in a java.lang.NoClassDefFoundError error.
    The code for the JNDI lookup is identical in either case.
    Any thoughts?

    Hello,
    I am calling ejb from .jsp use following code
    Properties props = new Properties();
    InitialContext ctx = new InitialContext();
    Object ob = ctx.lookup("java:comp/env/ejb/CalculatorBean");
    CalculatorHome home = (CalculatorHome) PortableRemoteObject.narrow(ob, CalculatorHome.class);
    calc = home.create();
    I have a error:
    java.lang.ClassNotFoundException: class com.sap.examples.calculator.beans.CalcProxy : com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at calculator, the whole lookup name is java:comp/env/ejb/CalculatorBean
    My ejb-jar.xml is:
    <display-name>
         CalculatorEjb</display-name>
         <enterprise-beans>
              <session>
                   <icon/>
                   <ejb-name>Calculator</ejb-name>
                   <home>com.sap.examples.calculator.CalculatorHome</home>
                   <remote>com.sap.examples.calculator.CalculatorRemote</remote>
                   <local-home>com.sap.examples.calculator.CalculatorLocalHome</local-home>
                   <local>com.sap.examples.calculator.CalculatorLocal</local>
                   <service-endpoint>com.sap.examples.calculator.CalculatorServiceEndpoint</service-endpoint>
                   <ejb-class>com.sap.examples.calculator.CalculatorBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <ejb-ref>
                        <ejb-ref-name>ejb/CalculatorBean</ejb-ref-name>
                        <ejb-ref-type>Session</ejb-ref-type>
                        <home>com.sap.examples.calculator.CalculatorHome</home>
                        <remote>com.sap.examples.calculator.CalculatorRemote</remote>
                        <ejb-link>Calculator</ejb-link>
                   </ejb-ref>
                   <ejb-local-ref>
                        <description/>
                        <ejb-ref-name>ejb/CalculatorBean</ejb-ref-name>
                        <ejb-ref-type>Session</ejb-ref-type>
                        <local-home>com.sap.examples.calculator.CalculatorLocalHome</local-home>
                        <local>com.sap.examples.calculator.CalculatorLocal</local>
                        <ejb-link>Calculator</ejb-link>
                   </ejb-local-ref>
              </session>
         </enterprise-beans>
    my ejb-j2ee-engine.xml is:
    <?xml version="1.0" encoding="UTF-8"?>
    <ejb-j2ee-engine
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="ejb-j2ee-engine.xsd">
         <enterprise-beans>
              <enterprise-bean>
                   <ejb-name>Calculator</ejb-name>
                   <ejb-ref>
                        <ejb-ref-name>ejb/CalculatorBean</ejb-ref-name>
                        <jndi-name>ejb/CalculatorBean</jndi-name>
                   </ejb-ref>
                   <ejb-local-ref>
                        <ejb-ref-name>ejb/CalculatorBean</ejb-ref-name>
                        <jndi-name>ejb/CalculatorBean</jndi-name>
                   </ejb-local-ref>
              </enterprise-bean>
         </enterprise-beans>
    </ejb-j2ee-engine>

  • Deploy optional JSR

    Admittedly I'm new to J2ME so please bear with me.
    We're building a prototype of an app built around the Location API JSR 179. There are many physical devices that have the basic J2ME environment (MIDP 2.0 and CLDC 1.1) required to use this JSR. There are even a few devices (i.e. the Motorola i605 and i860) that have JSR 179 installed. However, there are many devices that do not have this JSR installed but that seem like the device would support it (i.e. Motorola i275, i730, i830).
    The question is...for those devices that do not "come from the factory" with JSR 179 installed, how can that JSR be installed? Can my application install that package if necessary? How do you go about doing this?
    I'd appreciate any help you can give!
    --steve                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Thanks for the info!
    Just to make sure I understand.....if a phone is not preinstalled with a JSR, then it can not be installed later by the user?
    When you said "network operator needs to support it"....what exactly does that mean?
    --steve                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Exception in thread "main" java.lang.NoClassDefFoundError: JdbcExample1/

    Dear all ,I am getting the following eror message while using JDBC to connect to MYSQL
    Exception in thread "main" java.lang.NoClassDefFoundError: JdbcExample1/class
    The code comiles fine but when i run it the error comes.
    The java code used is as follows and it is in the directory c:\com\stardeveloper\example
    The classpath is set as
    classpath= .;c:\jdk1.3\lib\tools.jar;c:\jdk1.3\jre\lib\ext\mysql-connector-java-3.1.12-bin.jar;C:\com\stardeveloper\example\mysql-connector-java-3.1.12-bin.jar
    JAVA_HOME= C:\jdk1.3
    Java is installed in : C:\jdk1.3
    The mysql-connector-java-3.1.12-bin.jar is in the folder wher the code is i.e. C:\com\stardeveloper\example
    THE CODE IS AS FOLLOWS:
    package com.stardeveloper.example;
    import java.sql.*;
    public class JdbcExample1 {
    public static void main(String args[]) {
    Connection con = null;
    try {
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    con = DriverManager.getConnection("jdbc:mysql:///test", "root", "desertgot123");
    if(!con.isClosed())
    System.out.println("Successfully connected to MySQL server...");
    } catch(Exception e) {
    System.err.println("Exception: " + e.getMessage());
    } finally {
    try {
    if(con != null)
    con.close();
    } catch(SQLException e) {}
    Please help
    Thanks in advance
    Regards
    Abhijeet

    Classpath is C:\com\stardeveloper\example;C:\Documents and Settings\abhijeet\Desktop;c:\jdk1.3\bin;c:\jdk1.3\lib\tools.jar;c:\jdk1.3\jre\lib\ext\mysql-connector-java-3.1.12-bin.jar;C:\com\stardeveloper\example\JdbcExample2\mysql-connector-java-3.1.12-bin.jar;c:\jdk1.3\bin;c:program files\java\j2re1.4.2_11\bin\;C:\jdk1.3\jre\bin;%CLASSPATH%;
    the program is getting compiled fine . After that I am giving hte command
    java JdbcExample1
    The error messge that comes is :
    Exception in thread "main" java.lang.NoClassDefFoundError: JdbcExample1 (wrong n
    ame: com/stardeveloper/example/JdbcExample1)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)

  • JSR 169 - Location API

    Hello,
    Would Nokia series 40 supports JSR 169?

    u should see mobile phone's configuration of jsr before using jsr 179 i.e location api..
    s40 is not concerned but mobiles supporting jsr file is of main concern.
    well jsr 179 used for location based services. so u mite b working for lbs..
    i m also analyzing for lbs application.. if u have any updates then feel free.

Maybe you are looking for