gpt4 book ai didi

java.lang.NoClassDefFoundError : com/sap/conn/jco/JCoException Error

转载 作者:太空宇宙 更新时间:2023-11-04 11:47:25 24 4
gpt4 key购买 nike

java.lang.NoClassDefFoundError: com/sap/conn/jco/JCoException
at testSAP.TestSAP.execute(TestSAP.java:41) ~[na:na]
at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:406) ~[spring-batch-core-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:330) ~[spring-batch-core-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) ~[spring-tx-4.2.4.RELEASE.jar:4.2.4.RELEASE]
at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:271) ~[spring-batch-core-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:81) ~[spring-batch-core-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:374) ~[spring-batch-infrastructure-3.0.5.RELEASE.jar:3.0.5.RELEASE]
at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:215) ~[spring-batch-infrastructure-3.0.5.RELEASE.jar:3.0.5.RELEA

我有如下所述的 POM.xml -

<dependency>
<groupId>com.sap.conn.jco</groupId>
<artifactId>sapjco3</artifactId>
<version>3.0.15</version>
<scope>system</scope>
<systemPath>${pom.basedir}\src\main\resources\sapjco3.jar</systemPath>
</dependency>

我还添加了指向 jco3.jar 文件的 Class-Path 环境变量和指向 jco 库文件夹的 Path 变量。当直接在 eclipse 中运行代码时,它正在工作,也给出输出。但是当我在 spring xd 服务器上部署在 maven 构建期间生成的 jar 时,它没有获取 jco jar 文件的引用。请帮忙。如果您需要更多说明,请告诉我。

Screenshot of my Package Structure

最佳答案

您可以考虑打包依赖项:

How can I create an executable JAR with dependencies using Maven?

或者检查运行已编译 jar 的类路径,以确保包含 sapjco3.jar。

关于java.lang.NoClassDefFoundError : com/sap/conn/jco/JCoException Error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42208792/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com