You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Richard Sand <rs...@idfconnect.com> on 2016/03/30 06:23:34 UTC

GeneralizedTime attribute

Hi all - using the latest SDK and Apache Directory, I'm having trouble 
populating a GeneralizedTime attribute. Any help appreciated, thanks!

My code:

GeneralizedTime gt = new GeneralizedTime(new 
SimpleDateFormat(BasicChecker.DATEFORMAT).parse(license.getExpiration()));
entry.add(AdminService.LS_ATTR_START, gt.toGeneralizedTime());

When I run this, I get an exception:

016-03-30 00:06:14.407 [main] DEBUG 
org.glassfish.jersey.server.ServerRuntime$Responder - An exception 
mapping did not successfully produce and processed a response. Logging 
the exception propagated to the container.
org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException: 
INVALID_ATTRIBUTE_SYNTAX: failed for MessageType : ADD_REQUEST
Message ID : 21
     Add Request :
Entry
     dn[n]: cn=10001,ou=Licenses,dc=ls,dc=sand,dc=idfconnect,dc=lan
     objectclass: lsLicense
     member:
     postalCode: 19803
     lsNotices: Copyright IDF Connect, Inc.
     lsLicensee: IDF Connect, Inc.
     c: US
     lsStartTimestamp: 20131231050000.000Z
     lsStartTimestamp: 20160101050000.000Z
     lsType: Development
     street: 2207 Concord Ave. #359
     l: Wilmington
     st: Delaware
     lsBinding: 127.0.0.1
: ERR_04447_CANNOT_NORMALIZE_VALUE Cannot normalize the wrapped value 
ERR_04473_NOT_VALID_VALUE Not a valid value '20131231050000.000Z' for 
the AttributeType 'attributetype ( 1.3.6.1.4.1.2552.3.5 NAME 
'lsStartTimestamp'
     DESC 'the start timestamp of the license'
     EQUALITY generalizedTimeMatch
     ORDERING generalizedTimeOrderingMatch
     SYNTAX 1.3.6.1.4.1.1466.115.121.1.53
     USAGE userApplications )'
     at 
org.apache.directory.api.ldap.model.message.ResultCodeEnum.processResponse(ResultCodeEnum.java:2130)
     at 
org.apache.directory.ldap.client.api.LdapNetworkConnection.add(LdapNetworkConnection.java:838)
     at 
com.idfconnect.license.server.core.IssuedLicense.create(IssuedLicense.java:255)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAcces

Re: GeneralizedTime attribute

Posted by Kiran Ayyagari <ka...@apache.org>.
On Wed, Mar 30, 2016 at 9:53 AM, Richard Sand <rs...@idfconnect.com> wrote:

> Hi all - using the latest SDK and Apache Directory, I'm having trouble
> populating a GeneralizedTime attribute. Any help appreciated, thanks!
>
> My code:
>
> GeneralizedTime gt = new GeneralizedTime(new
> SimpleDateFormat(BasicChecker.DATEFORMAT).parse(license.getExpiration()));
> entry.add(AdminService.LS_ATTR_START, gt.toGeneralizedTime());
>
> When I run this, I get an exception:
>
> 016-03-30 00:06:14.407 [main] DEBUG
> org.glassfish.jersey.server.ServerRuntime$Responder - An exception mapping
> did not successfully produce and processed a response. Logging the
> exception propagated to the container.
> org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException:
> INVALID_ATTRIBUTE_SYNTAX: failed for MessageType : ADD_REQUEST
> Message ID : 21
>     Add Request :
> Entry
>     dn[n]: cn=10001,ou=Licenses,dc=ls,dc=sand,dc=idfconnect,dc=lan
>     objectclass: lsLicense
>     member:
>     postalCode: 19803
>     lsNotices: Copyright IDF Connect, Inc.
>     lsLicensee: IDF Connect, Inc.
>     c: US
>     lsStartTimestamp: 20131231050000.000Z
>     lsStartTimestamp: 20160101050000.000Z
>     lsType: Development
>     street: 2207 Concord Ave. #359
>     l: Wilmington
>     st: Delaware
>     lsBinding: 127.0.0.1
> : ERR_04447_CANNOT_NORMALIZE_VALUE Cannot normalize the wrapped value
> ERR_04473_NOT_VALID_VALUE Not a valid value '20131231050000.000Z' for the
> AttributeType 'attributetype ( 1.3.6.1.4.1.2552.3.5 NAME 'lsStartTimestamp'
>     DESC 'the start timestamp of the license'
>     EQUALITY generalizedTimeMatch
>     ORDERING generalizedTimeOrderingMatch
>     SYNTAX 1.3.6.1.4.1.1466.115.121.1.53
>
the syntax must be 1.3.6.1.4.1.1466.115.121.1.24 (the syntax present in
your schema is of UTC time)

>     USAGE userApplications )'
>     at
> org.apache.directory.api.ldap.model.message.ResultCodeEnum.processResponse(ResultCodeEnum.java:2130)
>     at
> org.apache.directory.ldap.client.api.LdapNetworkConnection.add(LdapNetworkConnection.java:838)
>     at
> com.idfconnect.license.server.core.IssuedLicense.create(IssuedLicense.java:255)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAcces
>
Kiran Ayyagari
http://keydap.com