5000 Error invoking method 'get(java.lang.Integer)' in [Ljava.lang.String;

VKailash
Level 2

5000 Error invoking method 'get(java.lang.Integer)' in [Ljava.lang.String;

Hi 

I am getting an email soft bounce error for most of my emails  & below is the error comments

 

5000 Error invoking method 'get(java.lang.Integer)' in [Ljava.lang.String; at 398-ZKA-468:0: <p><span style="color: #000000;">*The 2020 America&rsquo;s Best RIA Firms Independent Advisory Firm Ranking issued by <em>Barron&rsquo;s</em> is qualitative and quantitative, including assets managed, technology spending, staff diversity, s[line 172, column 43]

 

Can you please advise on how do I resolve this?

 

Thx

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: 5000 Error invoking method 'get(java.lang.Integer)' in [Ljava.lang.String;

You have to show your Velocity code, since that's where the error is. Remember to use "Insert/Edit Code" to highlight it properly.
VKailash
Level 2

Re: 5000 Error invoking method 'get(java.lang.Integer)' in [Ljava.lang.String;

.

VKailash
Level 2

Re: 5000 Error invoking method 'get(java.lang.Integer)' in [Ljava.lang.String;

#set($x = $date.calendar)
##$x
##$x.time<br /><br />
##$Activity_Marketo__cList.size()
##$Activity_Marketo__cList <br /><br />
#set($isMeetingMatchFound = 0)
#foreach($Meeting in $sorter.sort($Activity_Marketo__cList, "StartDateTime__c:desc"))
##$Meeting.StartDateTime__c <br />
##Assign Variables
#set($Appointment_Start = $date.toDate("MM/dd/yyyy hh:mm:ss a", $Meeting.Appointment_Start_DateTime_Text__c))
#set($Appointment_StartDateTime = $date.toDate('MMM dd, yyyy hh:mm aa', ${convert.parseDate(${Meeting.StartDateTime__c}, 'yyyy-MM-dd HH:mm:ss')}))
##StarDateTime: $Appointment_StartDateTime <br /><br />
#set($is_upcoming = $date.difference($x.time,$Appointment_StartDateTime).hours)
#set($formattedDate = $date.toDate("hh:mm:ss", $x.time))
##$is_upcoming <br />
##set($splitData = $Meeting.Appointment_Start_DateTime_Text__c.split(" "))
#set($leadHeader = $display.list($Meeting.Appointment_Start_DateTime_Text__c.split(" "),"<br>"))
## +5 hours and -5 hours to increase the difference range due to daylight saving or any difference between time or TimeZone.
#if($is_upcoming <= 77 && $is_upcoming >= 43 && !$Meeting.StartDateTime__c.isEmpty() && $Meeting.Meeting_Sub_Type__c == "Initial" && $display.alt($Meeting.Meeting_Status__c,"").isEmpty() && !$Meeting.Meeting_Origin__c.isEmpty() && $Meeting.Event_Type__c == "Prospect Meeting" && $Meeting.IsChild__c == 0)
#set($dateFormatted = $date.format("EEEE, MMM. dd", $Appointment_Start))
#set($dateFormattedHours = $date.format("hh:mm a", $Appointment_Start))
##Removing 0 from date less than 10 start
#set($splitTime = $dateFormattedHours.split(":"))
#set($intString = $splitTime[0])
#set($Integer = 0)
#if($Integer.parseInt($splitTime[0]) < 10)
#set($dateHours1 = $splitTime[0].split('')[2])
#else
#set($dateHours1 = $splitTime[0])
#end
#set($splitDate = $dateFormatted.split(" "))
#set($intString2 = $splitDate[2])
#if($Integer.parseInt($splitDate[2]) < 10)
$splitDate[0] $splitDate[1] $splitDate[2].split('')[2] at $dateHours1:$splitTime[1]##
#else
$splitDate[0] $splitDate[1] $splitDate[2] at $dateHours1:$splitTime[1]##
#end
##Removing 0 from date less than 10 end
##$dateFormatted at $dateFormattedHours
##$Meeting <br>
##$Meeting.Name
##$Appointment_Start<br />
##Meeting SubType: $Meeting.Meeting_Sub_Type__c
##Differences: $is_upcoming <br />
#set($isMeetingMatchFound = 1)
#break
#end
#end

## Logic below is to default to upcoming Meeting
#if($isMeetingMatchFound == 0)
#foreach($Meeting in $sorter.sort($Activity_Marketo__cList, "StartDateTime__c:asc"))
##Assign Variables
#set($Appointment_Start = $date.toDate("MM/dd/yyyy hh:mm:ss a", $Meeting.Appointment_Start_DateTime_Text__c))
#set($Appointment_StartDateTime = $date.toDate('MMM dd, yyyy hh:mm aa', ${convert.parseDate(${Meeting.StartDateTime__c}, 'yyyy-MM-dd HH:mm:ss')}))
##StarDateTime: $Appointment_StartDateTime <br /><br />
#set($is_upcoming = $date.difference($x.time,$Appointment_StartDateTime).hours)
#set($formattedDate = $date.toDate("hh:mm:ss", $x.time))
##$is_upcoming <br />
#set($dateFormatted = $date.format("EEEE, MMM. dd", $Appointment_Start))
#set($dateFormattedHours = $date.format("hh:mm a", $Appointment_Start))
#if($is_upcoming > 0 && !$Meeting.StartDateTime__c.isEmpty() && $display.alt($Meeting.Meeting_Status__c,"").isEmpty() && !$Meeting.Meeting_Origin__c.isEmpty() && $Meeting.Event_Type__c == "Prospect Meeting" && $Meeting.IsChild__c == 0)
##Removing 0 from date less than 10 start
#set($splitTime = $dateFormattedHours.split(":"))
#set($intString = $splitTime[0])
#set($Integer = 0)
#if($Integer.parseInt($splitTime[0]) < 10)
#set($dateHours1 = $splitTime[0].split('')[2])
#else
#set($dateHours1 = $splitTime[0])
#end
#set($splitDate = $dateFormatted.split(" "))
#set($intString2 = $splitDate[2])
#if($Integer.parseInt($splitDate[2]) < 10)
$splitDate[0] $splitDate[1] $splitDate[2].split('')[2] at $dateHours1:$splitTime[1]##
#else
$splitDate[0] $splitDate[1] $splitDate[2] at $dateHours1:$splitTime[1]##
#end
#break
#end
#end
#end
SanfordWhiteman
Level 10 - Community Moderator

Re: 5000 Error invoking method 'get(java.lang.Integer)' in [Ljava.lang.String;

Hmm. There are innumerable things to fix about that huge block of code. Can see a bunch of best practices that aren't being followed.  For example, splitting date-like Strings yourself instead of using the Calendar parser is the wrong move.

 

If you can't trim down to the smallest snippet that throws this particular error, you need to look at every place that a nonexistent String index might be accessed. That's what get(java.lang.Integer) in [Ljava.lang.String literally means.

 

If you have a String $myString that's 2 bytes long and try to access $myString[2], that's fatal, since the value has only indices [0] and [1]. (While the Velocity engine swallows a whole bunch of other errors that would be fatal in pure Java, this kind of Java error throws hard in Velocity, too.)