• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reading NFC Tag using JAVA Smart Card API not working on MAC OS

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am developing an application to read a NFC Tag UID from NFC Reader (ACR122U-A9) device.
I used JAVA and javax.smartcardio API to detect the NFC Reader and Reading NFC Tag.

The functionality of the application is to display notification when the NFC Reader device is connect or disconnect from PC. Then if the device is connected and NFC Tag is presented then display the notification that NFC Tag is presented.
I tried to find the Event based api to implement above functionality but I cannot found so I used Java Timer and Polling for the NFC Reader Device and NFC Tag.

Following is my sample JAVA code that used for Polling for NFC device and Tag.






Above code is working fine in Windows OS but when I run it on MAC OS then application runs for 5-10 seconds perfectly but then it suddenly crash with the following memory error.

java(921,0x10b0c3000) malloc: *** mmap(size=140350941302784) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Java Result: 139


I searched on internet and cannot find anything regarding above memory error. When I contact ACS for same then they told me that the error message is not related to reader or card connection. It has something to do with memory management.

I already wrote the code for memory management to release the object when it is used in timer by assigning NULL value to it.

I used http://ludovicrousseau.blogspot.com/2010/06/pcsc-sample-in-java.html for reference
 
And then the flying monkeys attacked. My only defense was this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic