java.lang.Double

Pentaho BI Platform Tracking | Andrei Puhach | 3 years ago
  1. 0

    "If field value is null" ("Replace null value") step works differently in PDI 5.0.1 compared with PDI 4.4.0: if a transformation is created/saved in PDI 4 and is opened in PDI 5 the new "Set empty string?" option is populated as "Y" what causes producing empty strings where NULLs were required. It may cause ValueMetaBase exceptions from further steps expecting the Number type when a String value may be cast to Double. Unexpected conversion error while converting value [myField Number] to a Number java.lang.String cannot be cast to java.lang.Double at org.pentaho.di.core.row.value.ValueMetaBase.getNumber(ValueMetaBase.java:1598) ... at java.lang.Thread.run(Thread.java:724) Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Double at org.pentaho.di.core.row.value.ValueMetaBase.getNumber(ValueMetaBase.java:1527) ... 10 more The problem is located in the IfNullMeta class: https://github.com/pentaho/pentaho-kettle/blob/c03038462b892307eea99f92e5baa17da9e2ad7a/engine/src/org/pentaho/di/trans/steps/ifnull/IfNullMeta.java#L320: for ( int i = 0; i < nrtypes; i++ ) { Node tnode = XMLHandler.getSubNodeByNr( types, "valuetype", i ); ... String typeemptyString = XMLHandler.getTagValue( tnode, "set_type_empty_string" ); setTypeEmptyString[i] = Const.isEmpty( typeemptyString ) || "Y".equalsIgnoreCase( typeemptyString ); } should be for ( int i = 0; i < nrtypes; i++ ) { Node tnode = XMLHandler.getSubNodeByNr( types, "valuetype", i ); String typeemptyString = XMLHandler.getTagValue( tnode, "set_type_empty_string" ); setTypeEmptyString[i] = !Const.isEmpty( typeemptyString ) && "Y".equalsIgnoreCase( typeemptyString ); }

    Pentaho BI Platform Tracking | 3 years ago | Andrei Puhach
    java.lang.Double
  2. 0

    "If field value is null" ("Replace null value") step works differently in PDI 5.0.1 compared with PDI 4.4.0: if a transformation is created/saved in PDI 4 and is opened in PDI 5 the new "Set empty string?" option is populated as "Y" what causes producing empty strings where NULLs were required. It may cause ValueMetaBase exceptions from further steps expecting the Number type when a String value may be cast to Double. Unexpected conversion error while converting value [myField Number] to a Number java.lang.String cannot be cast to java.lang.Double at org.pentaho.di.core.row.value.ValueMetaBase.getNumber(ValueMetaBase.java:1598) ... at java.lang.Thread.run(Thread.java:724) Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Double at org.pentaho.di.core.row.value.ValueMetaBase.getNumber(ValueMetaBase.java:1527) ... 10 more The problem is located in the IfNullMeta class: https://github.com/pentaho/pentaho-kettle/blob/c03038462b892307eea99f92e5baa17da9e2ad7a/engine/src/org/pentaho/di/trans/steps/ifnull/IfNullMeta.java#L320: for ( int i = 0; i < nrtypes; i++ ) { Node tnode = XMLHandler.getSubNodeByNr( types, "valuetype", i ); ... String typeemptyString = XMLHandler.getTagValue( tnode, "set_type_empty_string" ); setTypeEmptyString[i] = Const.isEmpty( typeemptyString ) || "Y".equalsIgnoreCase( typeemptyString ); } should be for ( int i = 0; i < nrtypes; i++ ) { Node tnode = XMLHandler.getSubNodeByNr( types, "valuetype", i ); String typeemptyString = XMLHandler.getTagValue( tnode, "set_type_empty_string" ); setTypeEmptyString[i] = !Const.isEmpty( typeemptyString ) && "Y".equalsIgnoreCase( typeemptyString ); }

    Pentaho BI Platform Tracking | 3 years ago | Andrei Puhach
    java.lang.Double
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    HTML is not escaped for the contents of failed macros and bad links. For normal JIRA usage this means that the Wiki Rendered fields may produce unexpected results for html special characters (<, & etc) in the event of a macro typo or malformed url. If you enter in the description from JRA-6372 (included below) it blows up the viewing of the issue. It is treating the Velocity stuff as unknown macros. {noformat} I've exhausted all efforts thru the user forum. Maybe someone can help me? I want to include values of custom fields in my email notifiactions. I was successful (at first) by using some code from another user: #foreach ($cfv in ${issue.getRelated("ChildCustomFieldValue")}) #set ($cf = ${cfv.getRelatedOne("ParentCustomField")}) #if (${cfv.getString("stringvalue")}) <tr><td width=20%><b>${cf.getString("name")}:</b></td><td width=80%>${cfv.getString("stringvalue")}</td></tr> #elseif (${cfv.getString("textvalue")}) <tr><td width=20%><b>${cf.getString("name")}:</b></td><td width=80%>${cfv.getString("textvalue")}</td></tr> #elseif (${cfv.getString("numbervalue")}) <tr><td width=20%><b>${cf.getString("name")}:</b></td><td width=80%>${cfv.getLong("numbervalue")}</td></tr> #end #end Well, that seemed to work, but then I found that NOT ALL custom fields were handled by the above code. Specifically, drop down values. However, it didn't bother me so much that for some custom fields the values displayed as internal codes. The problem was one project that had a custom field of type 'project picker'. email notifications for that project caused the template to break with an error: Invocation of method 'getLong' in class org.ofbiz.core.entity.GenericValue threw exception class java.lang.ClassCastException : java.lang.Double at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:246) at ... etc. ... I tried putting in #else code to handle some cases, I tried putting in code I found from Anton in the user forum: #elseif ($cf.getLong("fieldtype").intValue() == 1 || $cf.getLong("fieldtype").intValue() == 3 || $cf.getLong("fieldtype").intValue() == 5) <tr><td width=20%><b>${cf.getString("name")} : </b></td><td width=80%>${cfv.getString("stringvalue")} #elseif ($cf.getLong("fieldtype").intValue() == 2) <tr><td width=20%><b>${cf.getString("name")} : </b></td><td width=80%>${cfv.getLong("numbervalue")} #elseif ($cf.getLong("fieldtype").intValue() == 4) <tr><td width=20%><b>${cf.getString("name")} : </b></td><td width=80%>${cfv.getDate("datevalue")} all to no avail. I really would like to get this working - or at least not broken. I've looked at the Velocity user's manual and scoured the source code, but I can't find how to do this. As a side note (I can log an issue if you like), I noticed that when viewing an issue that has been moved between projects, the "Change History" also shows the internal project ID rather than the project name, so even within the web interface, it looks like internal ID's still show up sometimes. {noformat}

    Atlassian JIRA | 1 decade ago | Nick Menere [Atlassian]
    java.lang.Double

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.Double

      No message provided

      at org.pentaho.di.core.row.value.ValueMetaBase.getNumber()
    2. org.pentaho.di
      ValueMetaBase.getNumber
      1. org.pentaho.di.core.row.value.ValueMetaBase.getNumber(ValueMetaBase.java:1598)
      1 frame