Community Forums
Page 1 of 3 123 LastLast
Results 1 to 5 of 15

Thread: License.getFeature() returning null

  1. #1
    Join Date
    Jul 2010
    Posts
    10

    License.getFeature() returning null

    Using the 10.8 Java toolkit, I am loading a License object. However, when I try to get the feature information (ie: expiration date, VENDOR_STRING, NOTICE, etc.) License.getFeature() returns null.

    Here's my license (sensitive information removed):
    Code:
    myVendor
    FEATURE myfeatureName myVendor 1.0 29-jul-2011 uncounted \
        VENDOR_STRING=myVendorString
        NOTICE="myNotice" SIGN=...
    I am loading the license as follows:

    Code:
    FeatureSpecifier feature = new FeatureSpecifier("myFeatureName", "1.0");
    VendorInfo vendoInfo = new myVendorInfo();
    
    String licenseSource = "@localhost@" + licenseFileStr;
    License flexLicense = new License(feature, licenseSource, vendorInfo, null);
    
    // this is null
    Feature f = flexLicense.getFeature();
    
    // this is not null but doesn't have the info i need
    FeatureSpecifier fs = flexLicense.getFeatureSpecifier();
    Why is the Feature object null?

  2. #2
    Join Date
    Oct 2001
    Location
    Here and there
    Posts
    16,243
    Does anything change if you check out the license between creating the License object and before calling getFeature?
    Code:
    License flexLicense = new License(feature, licenseSource, vendorInfo, null);
    
    flexLicense.checkout(1); // add this
    
    Feature f = flexLicense.getFeature( );

  3. #3
    Join Date
    Jul 2010
    Posts
    10
    Hmmm... adding flexLicense.checkout(1) throws this exception:

    FlexlmException: Can't Connect to License Server (-15,3002) (localhost@[MY LICENSE FILE LOCATION])
    Note that [MY LICENSE FILE LOCATION] is the "licenseFileStr" value concatenated to the licenseSource variable in my previous code snippet.

    Also, I've noticed that I can tamper with the license file and it doesn't complain about it. Is the signature only validated on checkout?

    EDIT: Thanks for the quick reply RobertDickau!
    Last edited by Temujin_12; 08-11-2010 at 12:55 PM.

  4. #4
    Join Date
    Oct 2001
    Location
    Here and there
    Posts
    16,243
    That excerpt you posted is for an unserved license because of the "uncounted" keyword, so perhaps put a count (of 1 or something) in that field and add the SERVER and VENDOR lines if necessary, and then re-sign the license and restart the server?
    Code:
    SERVER this_host ANY
    VENDOR myVendor
    INCREMENT myfeatureName myVendor 1.0 29-jul-2011 1 \
        VENDOR_STRING=myVendorString \
        NOTICE="myNotice" SIGN=...
    The license server should complain if a license it's meant to serve has a bad signature, but for an uncounted license the client API is the first thing that notices.

    P.S. For a server, which licenses to serve from is specified when you launch lmgrd or lmadmin. In the Java code, just use "@server" without the file name in the license source...

  5. #5
    Join Date
    Jul 2010
    Posts
    10
    I'm trying to do this all without any license server at all. All I want to do is 1) load the information contained in the license and 2) validate the signature.

    In reading the documentation, I got the impression that that can all be done "offline" (so to speak) using uncounted licenses stored locally on disk.

    Am I confusing how to do this perhaps (assuming it is possible)?

    PS: Thanks again for working through this with me.

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •