Problems with Java Card, PCSC lite, and Applet Playground - javacard

I've been trying to get started using Java Card. I downloaded and installed the repository at this link: https://github.com/martinpaljak/AppletPlayground/ with the hope of starting to develop and use applets, but as of yet I have had no success interacting with the card or reader in any way. Running
"java -jar lib/openkms-globalplatform.jar -info"
at the command line returns nothing - according the the GlobalPLatform site, https://github.com/martinpaljak/GlobalPlatform , it should return information about the card. Running "pcsctest" on the command line yields either
"Testing SCardEstablishContext : Service not available." or
"Testing SCardEstablishContext : Command successful.
Testing SCardGetStatusChange (and then doesn't do anything until I control Z)"
depending on how long it has been since I plugged in the reader. If I run any command when the pcsctest returns "service not available" I get the error
java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: PC/SC, provider: JNA2PCSC, class: jnasmartcardio.Smartcardio$JnaTerminalFactorySpi)....
Caused by: java.lang.IllegalStateException: jnasmartcardio.Smartcardio$JnaPCSCException: SCardEstablishContext got response 0x8010001d (SCARD_E_NO_SERVICE: The Smart card resource manager is not running.).
I'm using OS X. I've tried a couple different tools for interacting with Java Cards and I haven't got any of them to work. I would really appreciate it if somebody could show me what I might be doing wrong or suggest a better way to interact with Java Cards.

Related

DRM exception: processLicense - Roku Ultra

I have a Roku Channel and it has live as well as non-live content, content is playing well for most of the Roku Devices but on Roku Ultra it's failing.
I am experiencing the following error:
<Component: roAssociativeArray> =
{
code: -6
message: "buffer:loop:unset:DRM exception: processLicense: [sess.lic.rep] KeyAdd failed : 99999(Cdm::kUnexpectedError):extra:etype:buffer"
}
Can anyone help me on this issue?
I looked over the internet for many threads but non was helpful for my case.
I don't know whether this will be helpful to resolve the issue, but I experienced similar kind of issue once. As far as I know DRM libraries are downloaded separately after firmware update on Roku. So, in case you did a factory reset recently and running the side-loaded app now, there may be chances that libraries are not downloaded completely. You can try for manual system software update and see if this resolves the issue. This worked for me. Also, partner success suggested to install one channel having widevine integration and running that channel as one step to resolve the issue, although I didn't need it. You can try this step also along with system software update.

Cannot find assets when running libgdx app on android, works fine on desktop

After getting out of a mode of procastinating, I've finally gotten to the item on the projects todo-list that says "Run on virtual device to see why it crashes".
My project is a libgdx application that I plan on porting to various platforms, the two most important ones being desktop and android.
During development I've exclusively used the desktop launcher, as it's a lot easier to fire up when just checking minor things.
I did build an .apk at one point just to see if it'd run out of the box, but it didn't. Now that I've tried via the virtual device, this is what the log says:
com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: rifleman.png
The same goes for any other assets that my game uses. The files are all placed in projectname/android/assets, as I remember learning way back that this was the way to go.
The virtual device I tried with is the stock Nexus 5, but I tried running the .apk by uploading it to my actual phone with a crash right after start, and I assume the problem is the same and is therefore unrelated to the test-platform.
I am currently not using an assetmanager, as implementing this is scheduled for after getting the basic core mechanics up and running. In the mean time I'm loading them as such: new Pixmap(new FileHandle("rifleman.png"));
Using android-studio 2.2 on Linux Mint 17 Cinnamon.
Please comment if more info is needed.
Use Gdx.files.internal() instead of FileHandle().
From filehandle(string) method info
Creates a new absolute FileHandle for the file name. Use this for
tools on the desktop that don't need any of the backends.
Do not use this constructor in case you write something cross-platform.

IAPClientPaymentException: Application ID initialization fails j2me nokia

I just want to know, what can make the IAP prompt this kind of exception "com.nokia.mid.payment.IAPClientPaymentException: Application ID initialization fails" when you test it in the emulator.
Another related question: The documentation says to remove the TEST_MODE.TXT file when pointing it to live server. I removed the text but now I get Security Exception. Whats the workaround for this? I am using java sdk 2.0 and the emulator that came with it.

jar file from j2me won't instal on my phone. Any idea why?

Today, I tried to install my first j2me file (jar file) on my phone, but I am getting the error below. Can any of you kindly explain me why and how I can fix this network error or what else I need to instal on my mobile. Basically, it is a demo sms application I got it from netbeans. I wanted to install on my mobile to try it as I need to develop a similar thing for my coursework. Thank you guys.
ERROR MESSAGE: "application cannot be installed. requires the use of a particular network resource to listen for network information. This network resource it's not supported on this device."
I found the answer, maybe someone else need it. the problem is that the network provider on the phone restricts this type of communication, we needed to have the url of their port or number of the provider "stations" to be able to install and run on my mobile. As I don't have that, I can just build my application and run from netbeans to demonstrate how it works.

Java ME Application running fine in Emulator but crashing when deployed to N70. Any way to identify the reason for crashing?

I have developed a Java ME application for CLDC platform. It works fine when executed in an emulator. But when i deploy it to my N70 phone the application doesn't start at all in the phone. In my application there are some 14 classes and am creating an instance of each and putting them in the vector on application start. The classes just have one variable and 2 methods. Can this creating of lot of instances be the reason for its crashing?
Is there any way I can find out the reason why the application is not able to start in the phone?
Update:
Its running fine on emulator. And one more thing I would like to mention is that- The code stops executing only at the point where am creating those 14 instances and adding them to the vector. Till that point the code executes fine.
It might depend on where in the code you are creating those instances. If you are creating them in your MIDlet constructor or the startApp method try moving the initialization into the run method of your application.
One way of debugging J2ME applications that don't start on the phone is by adding "printf" style debug messages in your code to be written in the record store system and adding another MIDlet to your application to read from RMS and display those messages.
Or you could just comment bits of code and see if it works.
You can debug on device. If the emulator you are using is part of the Nokia SDK then there should be facilities elsewhere to carry out on-device testing and debugging. (I'd post more detail on this but I've only done this with Sony Ericsson phones recently.)
Another option is to use the Nokia tools that allow you to view the standard output and error for your application when it is running on your device (via Bluetooth for example).
The probability that your application is actually crashing the Java Virtual Machine bytecode interpreter thread and terminating the whole native process is very small.
It has happened before but you need to eliminate several other potential issues before being convinced of an actual crash.
It is more likely that either:
Your MIDlet is not created or not started because the MIDP runtime decides it is not correct.
or
Your MIDlet simply throws an exception that you don't catch, which can make it look like it was brutally terminated.
Since the MIDlet installer is supposed to prevent you from installing a bad MIDlet, the uncaught exception issue is more likely.
How to find an uncaught exception:
Start with the simplest HelloWorld MIDlet, using a Form so you can easily insert more StringItems at the top of the screen.
Create and start a new Thread in MIDlet.startApp()
In your override of Thread.run(), add a try{}catch(Throwable){} block.
Inside that block, do whatever your original MIDlet did.
Use the form as your standard output for debugging.
You can use Form logging to make sure you don't enter an infinite loop, to display exception classes and messages, to flag logical milestones, to display variable values...
That's the first step to figuring out what is going on.
I also faced a similar problem and when I recompiled my MIDLET as Midlet 1.0 then it worked fine. It seems like N70 is not able to run the new version of MIDLET. I think you downgrade and re-test your midlet.
Regards
Junaid

Resources