BeanDefinitionStoreException:从类路径资源[xx-config.xml]解析XML文档时发生意外异常;

时间:2016-05-24 02:20:11

标签: spring maven jar fat

我有spring batch application。 我的主要课程是指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");
    }      

在我的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>

最后我确实得到了最后的胖罐 - myapp-jar-with-dependencies.jar 清单文件看起来不错。

但是当我以 - java -jar myapp-jar-with-dependencies.jar

执行jar时

我收到此错误 -

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)

1 个答案:

答案 0 :(得分:0)

对于任何有相同问题的人..我添加了弹簧处理程序和模式,使用了阴影插件..解决了这个问题。程序集插件在我的情况下没有帮助......哇!!