0

I am using System.load() on a self signed Java applet, the older version of the dll loads fine, but my new version (even though the dll builds fine) does not load, does not throw any exceptions, just stops the code in it's tracks.

Any ideas as to what may cause this?

This is the html that deploys the jar file:

<embed  id = "IB" 
type = "application/x-java-applet" 
width = "{$width}" 
height = "{$height}" 
code = "{$code}"
archive = "{$archive}"
username = "{$username}"
password = "{$password}"
account = "{$customer_ref}"
debug = "{$debug}"
baseweburl = "{$baseweburl}"
webserviceurl = "{$webserviceurl}"
/>

The C++ that I added to create the Dll file:

Header (javah created)

/*
 * Class:     i_jni_B
 * Method:    DeviceOnline
 * Signature: ()Z
 */
JNIEXPORT jboolean JNICALL Java_i_jni_B_DeviceOnline
  (JNIEnv *, jobject);

Cpp file

JNIEXPORT jboolean JNICALL Java_i_jni_B_DeviceOnline
  (JNIEnv *env, jobject)
{
    try
    {
        CDevice* clsDevice = new CDevice();
        clsDevice->Initialize();
        clsDevice->Release();
        return true;
    }
    catch (System::Exception^ ex)
    {
        return false;
    }
}
Corne
  • 496
  • 2
  • 8
  • 22
  • How is the applet being deployed? What is the HTML used to load it? – Andrew Thompson May 14 '13 at 06:53
  • 1
    Don't use the embed element! It was not valid HTML in ***any*** version of HTML as recognized by W3C. It would be better, safer and more reliable to deploy the applet using the [deployment toolkit script](http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/deployment_advice.html#deplToolkit). That might solve the problem. Try it & get back to me. – Andrew Thompson May 14 '13 at 07:15
  • @Andrew After adding the deployment toolkit script, I have the same result. The old dll file loads, the new one crashes the applet. – Corne May 14 '13 at 08:30
  • OK. You could try deploying it using JWS, but that only holds a small chance of making anything different. I don't know enough about C++ to tell if there is anything suspicious in that code. – Andrew Thompson May 14 '13 at 08:39

1 Answers1

0

You will never believe the sollution: I had Visual Studio in debug mode.. When set to release mode, everything functions perfectly! Maybe this save someone some time...

Corne
  • 496
  • 2
  • 8
  • 22