Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User mpharsha's Avatar
    Join Date
    Jul 2010
    Posts
    7
    Hi,
    Im using Series 40 Nokia 6212 emulator and I was able to read Embedded UID sometime back using the below code....
    Code:
    	protected void startApp() throws MIDletStateChangeException {
    		Display.getDisplay(this).setCurrent(form);
     
    		MFStandardConnection myTag = null;
    		try 
    		{
    			System.out.println("Start application\n");
    			myTag = (MFStandardConnection) Connector.open(System.getProperty("internal.mf.url"));
    			System.out.println("Connection opened\n");
    			form.append("My UID: " + decodeUID(myTag.getManufacturerBlock().getUID()));
    		}
    		catch (Exception e) 
    		{
    			System.out.println("Connection failed\n");
    			form.append(e.toString());
    		} 
    		finally 
    		{
    			if (myTag != null) 
    			{
    				try 
    				{
    					myTag.close();
    				}
    				catch (IOException e) 
    				{
    					form.append(e.toString());
    				}
    			}
    		}
    	}
    The above code was working fine... After some days when I checked suddenly its giving java.lang.SecurityException... Absolutely there is no change in the code.. Im new to this J2ME.. Please let me know what might be the problem...

    Thanks in Advance

    With Regards
    Harsha

  2. #2
    Registered User mroland's Avatar
    Join Date
    Feb 2009
    Location
    Hagenberg, Austria
    Posts
    121
    Hallo Harsha,

    accessing the secure element/MIFARE area, i.e.
    Code:
    Connector.open(System.getProperty("internal.mf.url"))
    and
    Code:
    Connector.open(System.getProperty("internal.se.url"))
    requires the MIDlet to be trusted by the phone.

    On a real phone (Nokia 6131 NFC and Nokia 6212) the only way to get your application trusted is by signing it with a valid Java code signing certificate. This can be bought for instance from Thawte.

    On the emulator you can bypass this limitiation by changing the trust level in the emulator's settings. In the emulator window select the menu Tools -> Preferences... On the MIDP tab there is a setting called "Security domain". If you set this value to either "trusted" or "maximum" your application should work again.

    br,
    Michael

  3. #3
    Registered User mpharsha's Avatar
    Join Date
    Jul 2010
    Posts
    7
    Hi,

    Thank you very much... Its working now... I changed Security domain setting to "Maximum"...

    With regards,
    Harsha

Similar Threads

  1. Security Exception
    By HasithaRandika in forum Mobile Java Networking & Messaging & Security
    Replies: 6
    Last Post: 2012-05-04, 20:40
  2. Security exception when trying to use OBEX
    By leg0 in forum Bluetooth Technology
    Replies: 0
    Last Post: 2009-08-16, 15:11
  3. ISO14443Connection Security Exception
    By Alex_Polt in forum Near Field Communication
    Replies: 37
    Last Post: 2009-07-21, 09:08
  4. Security exception
    By manojkumar.m in forum Mobile Java General
    Replies: 1
    Last Post: 2008-06-17, 10:33
  5. i got the Security Exception when i call the
    By madnan_java in forum Mobile Java General
    Replies: 1
    Last Post: 2004-10-06, 12:13

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved