简体   繁体   English

使用 Java 和 Spring 自动装配无法正常工作的 IBM Rhapsody 脚本

[英]Script for IBM Rhapsody made with Java and Spring autowiring not working

I developed a script for IBM Rhapsody using it's API for java.我为 IBM Rhapsody 开发了一个脚本,使用它的 API for java。 The script is working fine when is run from my IDE.从我的 IDE 运行时,该脚本运行良好。 When I run the script from Rhapsody using the JAR and HEP file I get NullPointerException when I use autowired beans.当我使用 JAR 和 HEP 文件从 Rhapsody 运行脚本时,当我使用自动装配的 bean 时,我得到 NullPointerException。

Does anyone know if the Spring is nor supported for Rhapsody API or haw I can fix my script?有谁知道 Rhapsody API 是否不支持 Spring 或者我可以修复我的脚本?

The solution is to export as an executable JAR.解决方案是将 JAR 导出为可执行文件。 This way the JAR is exported with the necessary library included.通过这种方式,JAR 与包含的必要库一起导出。 My problem was that when Rhapsody run my JAR file it did not find spring in the classpath.我的问题是,当 Rhapsody 运行我的 JAR 文件时,它没有在类路径中找到 spring。

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

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