Note that there are some explanatory texts on larger screens.

plurals
  1. PODate/DateTime object type in AmbientDataFramework
    primarykey
    data
    text
    <p>I'm having a bit of an issue with the Date (java) / DateTime (.net) type when using the Ambient Data Framework in SDL Tridion 2009.</p> <p>I'm setting a claim value in java like this:</p> <pre><code>Date myDate = rs.getDate("DATE_FIELD_IN_DB"); store.put(CLAIM_URI_DATE, myDate); </code></pre> <p>This is great and life is fantastic :)</p> <p>In my web application (which is .net) I need to get this value from the claim store, when I try to do so, it fails:</p> <p>My code is:</p> <pre><code>if (_store.Contains(new Uri("taf:claim:company:date"))) { DateTime claimdata = _store.Get&lt;DateTime&gt;("taf:claim:company:date"); Response.Write(claimdata.ToString()); } </code></pre> <p>And the error message is:</p> <blockquote> <p>[RuntimeException] Codemesh.JuggerNET.NTypeValue.Throw(Int64 inst) +373 Codemesh.JuggerNET.JavaClass.ThrowTypedException(Int64 inst) +1365 Codemesh.JuggerNET.JavaMethod.CallInt(JavaProxy jpo) +233 Tridion.ContentDelivery.AmbientData.JuggerNetTypeHelper.FromProxyObject(Object proxyObject) +738<br> Tridion.ContentDelivery.AmbientData.ClaimStore.Get(Uri claimUri) +109</p> </blockquote> <p>I've also tried obtaining as an object, which i then cast to DateTime. I'm obviously making a really basic error here, any help would be greatly appreciated.</p> <p>I have also read the SDL documentation here : <a href="http://sdllivecontent.sdl.com/LiveContent/content/en-US/SDL_Tridion_2011_SPONE/concept_26FDE76C277D43F893175E512EFDF09A">http://sdllivecontent.sdl.com/LiveContent/content/en-US/SDL_Tridion_2011_SPONE/concept_26FDE76C277D43F893175E512EFDF09A</a> which shows the java Data object is converted to the .net DateTime.</p> <p>Thanks</p> <p>John</p> <p><strong>UPDATE</strong></p> <p>As per the suggestions of Peter, i've check and ensured the correct jar files are in place.</p> <p>It might be worth mentioning that the date is stored in a SQL database as a 'Date' type, a typical value doesn't include a timestamp, for example '2011-09-03'. Still this all functions great in Java and I can work with the value as a date. Still when getting the value in .Net the typed exception is thrown.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload