简体   繁体   English

自定义函数 不支持major.minor 版本 51.0 TIBCO Designer 5.7

[英]Custom Function Unsupported major.minor version 51.0 TIBCO Designer 5.7

I am using TIBCO Designer 5.7.我正在使用 TIBCO Designer 5.7。

In the Mapper pallet of my Designer code, I am using a Custom Java Function "Utilities", but while using it it is giving me an error saying "Custom Function Utilities: Unsupported major.minor version 51.0".In the XPath section it is saying "no such function".在我的 Designer 代码的 Mapper 托盘中,我使用了一个自定义 Java 函数“实用程序”,但是在使用它时它给我一个错误提示“自定义函数实用程序:不支持的major.minor 版本 51.0”。在 XPath 部分它是说“没有这样的功能”。 I assume this is because of incompatibility of TIBCO's Java with my Java JDK.我认为这是因为 TIBCO 的 Java 与我的 Java JDK 不兼容。 Can someone explain in detail how to resolve this issue?有人可以详细解释如何解决这个问题吗?

Please refer to the image for the error.有关错误,请参阅图像。

错误

As you said you have incompatible Java version in your Tibco JRE and custom function .class file.正如您所说,您的 Tibco JRE 和自定义函数 .class 文件中有不兼容的 Java 版本。 Unsupported major.minor version 51.0 error comes when you run a class file created using Java 1.7 (major version 51.0) into a lower Tibco environment JRE version for example JRE 6 or 5.当您将使用 Java 1.7(主要版本 51.0)创建的类文件运行到较低的 Tibco 环境 JRE 版本(例如 JRE 6 或 5)时,会出现 Unsupported major.minor version 51.0 错误。

The major numbers are:主要数字是:

Java SE 13 = 57,
Java SE 12 = 56,
Java SE 11 = 55,
Java SE 10 = 54,
Java SE 9 = 53,
Java SE 8 = 52,
Java SE 7 = 51,
Java SE 6.0 = 50,
Java SE 5.0 = 49,
JDK 1.4 = 48,
JDK 1.3 = 47,
JDK 1.2 = 46,
JDK 1.1 = 45

(Source: https://en.wikipedia.org/wiki/Java_class_file#General_layout ) (来源: https : //en.wikipedia.org/wiki/Java_class_file#General_layout

You can check Tibco JRE version in Tibco Designer Help->Runtime Environment -> Java tab ->(java.runtime.version)您可以在 Tibco Designer Help->Runtime Environment -> Java tab ->(java.runtime.version) 中查看 Tibco JRE 版本

You can check version of you custom function by您可以通过以下方式检查自定义功能的版本

javap -verbose MyFunction.class| findstr "major"

how to check the jdk version used to compile a .class file 如何检查用于编译 .class 文件的 jdk 版本

So, you need either change your tibco JRE version to be compatible with your class version or re-build you custom function class with the version that compatible with your Tibco JRE.因此,您需要更改您的 tibco JRE 版本以与您的类版本兼容,或者使用与您的 Tibco JRE 兼容的版本重新构建您的自定义函数类。

You can use -target option for specifying java version in java compiler when build your function.您可以在构建函数时使用 -target 选项在 java 编译器中指定 java 版本。

javac -target 1.6 MyFunction.java

If you don't have source code of the function you can use decompiler like JD http://jd.benow.ca/如果你没有函数的源代码,你可以使用像 JD 这样的反编译器http://jd.benow.ca/

For changing JRE in Tibco you need to reconfigure all .tra files to new java version path.要在 Tibco 中更改 JRE,您需要将所有 .tra 文件重新配置为新的 Java 版本路径。 You can use /tra//bin/traUpgradeManager utility for that:您可以使用 /tra//bin/traUpgradeManager 实用程序:

traUpgradeManager -path C:/tibco/bw/5.7 -jre C:/tibco/jre/1.7
traUpgradeManager -path C:/tibco -jre C:/tibco/jre/1.7     

Please see https://support.tibco.com/s/article/Tibco-KnowledgeArticle-Article-33612 for the details.详情请参阅https://support.tibco.com/s/article/Tibco-KnowledgeArticle-Article-33612

Please note that changing JRE in all tibco environments may be not trivial process.请注意,在所有 tibco 环境中更改 JRE 可能不是一个简单的过程。 In your case it's match easier to re-compile the custom function.在您的情况下,重新编译自定义函数会更容易。

Hi I am able to resolve it via below steps:- 1) Go to the folder where your Custom java class is stored, in my case it is "Utilities.java"嗨,我可以通过以下步骤解决它:- 1)转到存储自定义 java 类的文件夹,在我的情况下它是“Utilities.java” 自定义类.java

2) Now we will create a .class file for this class USING the TIBCO's java, not our own local installed java jre, as the new .class file will be of TIBCO's, for this Go to your TIBCO_HOME>tibcojre64>1.6.0>bin, Run CMD there and give the commandad below:- 2) 现在我们将使用 TIBCO 的 java 为这个类创建一个 .class 文件,而不是我们自己本地安装的 java jre,因为新的 .class 文件将是 TIBCO 的,为此转到您的 TIBCO_HOME>tibcojre64>1.6.0> bin,在那里运行 CMD 并给出以下命令:- 创建 .class 文件的命令

This will create a Utilities.class file in the same folder这将在同一文件夹中创建一个 Utilities.class 文件

3) Now create a Custom Java function in Designer and refer this .class file. 3) 现在在 Designer 中创建一个自定义 Java 函数并引用这个 .class 文件。

java自定义函数

4) Now Load-> Apply-> save the project and Restart your designer. 4) 现在加载-> 应用-> 保存项目并重新启动您的设计器。 The error will be gone错误将消失

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM