linux运行java项目中的main方法,报错:Exception in thread "main" jav

J2EE 码拜 8年前 (2016-03-13) 2231次浏览
在windows环境运行正常的java netty项目部署到linux中调用main方法报错,修改过springmvc版本和jdk版本都没用,总是报 java.lang.ExceptionInInitializerError,还报空指针异常,NettyServer.java:18行是读取配置文件的ApplicationContext ac = new ClassPathXmlApplicationContext(“applicationContext.xml”);
[INFO]- org.springframework.context.support.AbstractApplicationContext.prepareRefresh(AbstractApplicationContext.java:510)- Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@3934f69a: startup date [Tue Jun 28 13:11:33 CST 2016]; root of context hierarchy
Exception in thread “main” java.lang.ExceptionInInitializerError
at org.springframework.context.support.AbstractRefreshableApplicationContext.createBeanFactory(AbstractRefreshableApplicationContext.java:195)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:128)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at com.heli.netty.NettyServer.main(NettyServer.java:18)
Caused by: java.lang.NullPointerException
at org.springframework.beans.factory.support.DefaultListableBeanFactory.<clinit>(DefaultListableBeanFactory.java:105)
… 7 more
解决方案

80

配置文件路径对吗

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明linux运行java项目中的main方法,报错:Exception in thread "main" jav
喜欢 (0)
[1034331897@qq.com]
分享 (0)