0

I have a spring batch application. my main class refers to config xml --

    public class MyApp{
        public static void main(String[] args) {    
            String[] config  =  {   "myApp-job-config.xml"  };   
            ConfigurableApplicationContext context = 
                    new ClassPathXmlApplicationContext("/myapp-job-config.xml");
    }      

In my pom.xml ---

        <plugin>
                            <artifactId>maven-assembly-plugin</artifactId>
                    <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
<mainClass>com.xx.xx.MyApp</mainClass>                      
                            </manifest>
                    </archive>
                    </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

Finally I do get the final fat jar as -- myapp-jar-with-dependencies.jar The manifest file looks good.

But when I execute the jar as -- java -jar myapp-jar-with-dependencies.jar

I get this error --

Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [myapp-job-config.xml]; nested exception is java.lang.NullPointerException ................. Caused by: java.lang.NullPointerException at sun.net.www.protocol.http.NegotiateAuthentication.isSupportedImpl(Unknown Source)

Senjuti Mahapatra
  • 2,570
  • 4
  • 27
  • 38

1 Answers1

0

For anyone having same problem .. I have added the spring handlers and schemas, with shade plugin..resolved the issue. assembly plugin did not help in my case... whew!!