The problem is that, the jar file uses Spring ORM for loading the persistance configurations, and based on these configurations, files are moved to suitable folders in HDFS. Now If i use, 'java -cp' instead of 'hadoop jar', it fails to copy to HDFS, with FileSystem error.
While invoking the jar with hadoop jar command (having spring orm injected) the exception is as:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0' defined in class path resource [applicationContext.xml
Error creating bean with name 'entityManagerFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Conflicting persistence unit definitions for name 'Persistance': file:/home/user/Desktop/ABC/apnJar.jar, file:/tmp/hadoop-ABC/hadoop-unjar2841422106164401019/
Caused by: java.lang.IllegalStateException: Conflicting persistence unit definitions for name 'Persistance'
Seems like Hadoop is unpacking the jar file to some tmp folder, is this really required? Can we skip this step by any configuration change?
Any thoughts on this are welcome.