Spring Assert.notNull
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Spring Assert.notNull相关的知识,希望对你有一定的参考价值。
Exception in thread "main" java.lang.IllegalArgumentException: Source must not be null at org.springframework.util.Assert.notNull(Assert.java:115) at Test.getaVoid(Test.java:11) at Test.main(Test.java:6) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
import org.springframework.util.Assert; public class Test { public static void main(String[] args) { getaVoid(); System.out.println("hello"); } private static void getaVoid() { Assert.notNull(null, "Source must not be null"); } }
以上是关于Spring Assert.notNull的主要内容,如果未能解决你的问题,请参考以下文章
spring IOC之篇六 bean的加载---bean的创建
Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
SPRING05_BeanFactory概述HierarchicalBeanFactoryListableBeanFacotoryDefaultListableBeanFactory档案馆详解(代码片
Spring中Bean初始化及销毁方法(InitializingBean接口DisposableBean接口@PostConstruct注解@PreDestroy注解以及init-method(代码片