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文件的引用。请帮帮忙。如果你需要更多的澄清,请告诉我。

发布于 2017-02-14 18:15:16
您可以考虑打包依赖项:
How can I create an executable JAR with dependencies using Maven?
或者检查您正在运行已编译jar的类路径,以确保包含sapjco3.jar。
https://stackoverflow.com/questions/42208792
复制相似问题