1
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

I have my POM.xml as mentioned below -

<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>

I have also added Class-Path environment variable pointing to jco3.jar file and Path variable pointing jco library folder. While running the code in eclipse directly , it is working, giving output too. But when I am deploying the jar which generated during the maven build on spring xd server, it is not getting reference of jco jar file. Please help. Let me know if you need any more clarification.

Screenshot of my Package Structure

Suman Goswami
  • 33
  • 1
  • 4
  • https://myarch.com/classnotfound/ - some checklist if that can help. Try to unjar the Jar folder and verify the class which is not found is actually present. – Rk R Bairi Feb 13 '17 at 17:53

1 Answers1

0

You could consider packaging the dependencies:

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

or check your classpath where you are running your compiled jar to ensure that sapjco3.jar is included.

Community
  • 1
  • 1