Oracle Fusion HCM Analytics

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

In xsl template getting error like: sun.util.calendar.ZoneInfo cannot be cast to java.util.SimpleTim

Received Response
161
Views
1
Comments
MaheshRayudu7
MaheshRayudu7 Rank 1 - Community Starter

Hi Team,

Hope everyone is doing good!

We have an requirement, where we have to use Current date condition in xsl template as mentioned below, but we are getting error like: "sun.util.calendar.ZoneInfo cannot be cast to java.util.SimpleTimeZone"


<xsl:value-of select="current-dateTime()"/>


If any one knows about the issue, please let us know.

Thanks you so much,

Mahesh

Answers

  • ArunaMalla
    ArunaMalla Rank 3 - Community Apprentice

    well! for starters, you can use explicit Java timezone in the xsl. below is the sample xsl template, to do so:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:java="http://xml.apache.org/xslt/java"
        exclude-result-prefixes="java">
    
        <!-- Declare the timezone variable -->
        <xsl:variable name="timezone" select="java:java.util.TimeZone.getTimeZone('GMT')" />
    
        <!-- Use the timezone in current-dateTime() -->
        <xsl:value-of select="java:format(java:java.text.SimpleDateFormat.new('yyyy-MM-dd'), java:java.util.Date.new(), $timezone)" />
    </xsl:stylesheet>
    

    Oracle BI tools are ambiguous, these works based on the environment (Cloud, on-premise, private, multi-cloud, ..) they are being operated. please let me know, where you are executing your bi reports. based on your query it looks like you are running this BI query on Oracle HCM Cloud.

    It would be helpful, if you can provide the .xsl template you created. I can fix the issue faster, locally in my system using the query and .xsl template.