zoukankan      html  css  js  c++  java
  • Spring中 cl.loadClass("javax.inject.Provider") 报空指针异常

    Spring中 cl.loadClass("javax.inject.Provider") 报空指针错误

    今天碰到一个错误折腾了很久.

    org.springframework.beans.factory.support.DefaultListableBeanFactory.<clinit>(DefaultListableBeanFactory.java:104)
    这里报空指针错误.



    错误堆栈
    =================================================================
    java.lang.ExceptionInInitializerError
    at org.springframework.context.support.GenericApplicationContext.<init>(GenericApplicationContext.java:102)
    at com.taobao.itest.spring.context.GenericXmlContextLoader.loadContext(GenericXmlContextLoader.java:36)
    at com.taobao.itest.spring.context.SpringContextManager.loadApplicationContext(SpringContextManager.java:57)
    at com.taobao.itest.listener.ITestSpringContextListener.prepareTestInstance(ITestSpringContextListener.java:61)
    at com.taobao.itest.core.TestContextManager.prepareTestInstance(TestContextManager.java:100)
    at com.taobao.itest.core.ITestJunit4ClassRunner.createTest(ITestJunit4ClassRunner.java:67)
    at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:251)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:248)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at com.taobao.itest.core.statements.RunBeforeTestClass.evaluate(RunBeforeTestClass.java:49)
    at com.taobao.itest.core.statements.RunAfterTestClass.evaluate(RunAfterTestClass.java:56)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
    Caused by: java.lang.NullPointerException
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.<clinit>(DefaultListableBeanFactory.java:104)
    ... 25 more


    ===============================================================

    原因是,引入的父项目中的jar包,设置成了系统jar包导致的错误.


    去掉设置成系统jar包就可以了.
     
     
     
     
     
  • 相关阅读:
    python的三元运算符
    百度站长社区有价值SEO问题提炼(一)
    Python文件夹与文件的操作
    python核心编程课后题第二版第十章264页
    python核心编程课后题第二版第九章230页
    python核心编程课后题第二版第八章209页
    《python核心编程》课后题第二版第十一章308页
    PhoneGap源码分析1——说明
    EF db first 获取表名称
    SQL Server使用证书最小粒度授权
  • 原文地址:https://www.cnblogs.com/qgzhan/p/2971884.html
Copyright © 2011-2022 走看看