错误:"存储库中的字节代码无效。 Java转换无效"

时间:2014-10-14 14:30:31

标签: informatica-powercenter

我遇到了这个错误,并且已经编译了Java Transformation。什么可能是错的,遗失?

我的转换从表中获取数据(String FechaInicial)并在输出中生成表日历(String CaleId)。

代码如下:

Calendar calInici = Calendar.getInstance();
calInici.set(Calendar.YEAR, Integer.parseInt(FechaInicial.substring(0,4)));
calInici.set(Calendar.MONTH, Integer.parseInt(FechaInicial.substring(5,7)));
calInici.set(Calendar.DAY_OF_MONTH, Integer.parseInt(FechaInicial.substring(8,10)));


Calendar calFi = Calendar.getInstance();
calFi.set(Calendar.WEEK_OF_YEAR, 1);
calFi.set(Calendar.DAY_OF_WEEK, 1);
calFi.add(Calendar.MONTH, 1);


DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
for ( Calendar c = calInici; c.compareTo ( calFi ) <= 0; c.add(Calendar.DAY_OF_WEEK, 1 ) )
{
   CaleId = df.format(c.getTime());
   generateRow();
}

注意(10月15日):

我收到了这个,但在这种情况下没有意义,因为我已将代码缩减为:

   CaleId = FechaInicial;
   generateRow();

我收到了一位同事的回复,没有任何结果:

Problem Description 

Java Transformation fails with error TM_6279: The session instance encountered the following run-time validation error: Byte code in the repository is invalid. Java transformation is invalid. 

The issue starts to happen after changing the repository codepage from Latin1 to UTF8. After that, a Java transformation that used to work, failed showing a wrong byte code error message.

By recompiling the code or validating the map, the same error occurs. Also, when reviewing the Java Code transformation involved, the following is showed in the Java Code tab:

--
FieldName = "test^©";
generateRow();
--

The field value showed is wrong and it should not be like that. This field value has special characters used by Portuguese Brazilian Language, but also happens with Japanese, Chinese, or any language that uses special characters. 

Cause   


This issue occurs due to embedding of string of specific character set in the Java code after converting a single byte to multi byte. PowerCenter store the byte code in the repository and the client machine (Designer client machine) code page is used during compilation of the Java code.

Other transformations would work fine in UTF8 and Latin or Asian Languages. However, Java Transformations wouldn't work fine when using UTF-8.
Solution    


This is a known issue and CR 193867 has been raised to be addressed in future releases. However, an EBF is available on top of Informatica 9.0.1 HotFix 2. Contact Informatica Global Customer Support for the EBF. 
The fix consists in a DLL enhancement that should be applied at Server and Client side, to allow the Java transformations to work with UTF8 Code Page + special characters.
It is important to recompile all the involved Java Transformation codes, from all the impacted mappings after EBF installation.

1 个答案:

答案 0 :(得分:0)

我的猜测是,它可能是由客户端计算机和Integration Service服务器上安装的不兼容Java版本引起的。

http://blogs.hexaware.com/informatica-way/java-transformation/

  

Informatica PowerCenter客户端使用JDK编译Java代码并生成字节代码。 PowerCenter客户端将字节代码存储在PowerCenter存储库中。 Integration Service使用JRE在运行时执行生成的字节代码。