Running Java example project

Hello, I found that in my software the following always returns status Genuine, but this license is expired. TurboActivate.IsGenuine(2, 2, true, false);

I tried to use the Java example project, but it doesn't work. It crashes on the following line: // load TurboActivate.dll/.so/.dylib TurboActivateNative INSTANCE = (TurboActivateNative) Native.loadLibrary(TurboActivate.GetLibraryLocation(), TurboActivateNative.class);

Please advice

TurboActivate.IsGenuine(2, 2, true, false);

Was the initial activation an offline activation? See the 3rd parameter you're passing in. You're saying "skipOffline = true".

I tried to use the Java example project, but it doesn't work. It crashes on the following line:// load TurboActivate.dll/.so/.dylibTurboActivateNative INSTANCE = (TurboActivateNative) Native.loadLibrary(TurboActivate.GetLibraryLocation(), TurboActivateNative.class);

We need the full exception to help you. Saying it crashes is not enough information.

My guess from the limited information you've provided: you're using an old TurboActivate.dll with th new TurboActivate.java files.

Hello,I think your guess is correct. Can you please describe what and where should I put in order to run the example project?Here is the full error stack:

Exception in thread "AWT-EventQueue-0" java.lang.Error: The system cannot find the path specified.

at com.sun.jna.Native.open(Native Method) at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:171) at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398) at com.sun.jna.Library$Handler.<init>(Library.java:147) at com.sun.jna.Native.loadLibrary(Native.java:412) at com.sun.jna.Native.loadLibrary(Native.java:391) at turboactivate.TurboActivateNative.<clinit>(TurboActivate.java:1082) at turboactivate.TurboActivate.SetPDetsLocation(TurboActivate.java:932) at documenteditor.DocumentEditorView.<init>(DocumentEditorView.java:28) at documenteditor.DocumentEditorApp.startup(DocumentEditorApp.java:14) at org.jdesktop.application.Application$1.run(Application.java:171) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:666) at java.awt.EventQueue.access$400(EventQueue.java:81) at java.awt.EventQueue$2.run(EventQueue.java:627) at java.awt.EventQueue$2.run(EventQueue.java:625) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.awt.EventQueue.dispatchEvent(EventQueue.java:636) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

The activation in the actual program wasn't offline. And this license has expired two months ago (we use daysBetweenChecks = 3).

I set daysBetweenChecks=0, graceDaysOnInetErr=0, and tried all combinations of the two booleans, but it didn't help.

Please note, that if I press "revoke" the license on the Lime-LM site, then everything works as desired. Also, after the trial period ends, it works as desired. But there is a problem with expired licenses.

Is it possible to make a skype call with screensharing to help us resolve this very urgent problem?

Hello Wyatt,Here is my simplified function. It always returns true despite that the license is expired.

public static boolean is_activated() { boolean status = false; try { TurboActivate.VersionGUID = VERSION_GUID; TurboActivate.SetPDetsLocation(); IsGenuineResult res = TurboActivate.IsGenuine(0, 0, false, true); status = res == Genuine; } catch (Exception exception) { } return status; }

It always returns true despite that the license is expired

What do you mean by "the license is expired"? Do you mean a custom license field?

I mean that this license must not work on my PC. On the Lime-LM website it says:

License fieldsThe license fields were last changed on January 30, 2014 9:18 am.expires 2014-02-28 22:21:00

But I still receive IsGenuineResult as Genuine. What is wrong with my function?

Ok, that's a custom license field. That information is treated separately from the activation data. So you need to do 2 things:

  1. Verify the activation is valid (you're already doing this)
  2. Also, verify the custom license field is not expired (use the GetFeatureValue("expired") and IsDateValid() funcitons).

Does that make sense?

IsDateValid("2014-04-21 01:00:00") returns true.

GetFeatureValue("expired") throws an error:

turboactivate.TurboActivateException: Failed to get feature value. The feature doesn't exist. at turboactivate.TurboActivate.GetFeatureValue(TurboActivate.java:380)

How to detect that this license is expired? Please help.

Sorry, the feature value you're using is "expires" not "expired". Obviously you need to pass the license field name you're using (in this case "expires").

Read more about custom license fields here.

Tell me if that helps.

Yes, I've just realized that myself, but thanks. This returned the field's value This license system was developed by a contractor, who doesn't work with us anymore.

Now I have more questions. Do I need to check both IsGenuine() and then compare the result of GetFeatureValue("expires") to current time? Is it the only way? Obviously, this approach relies on user's PC clock, which is not a reliable approach. Is it possible check expiration on your side?

Sorry, I found the answer myself.