在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
[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
配置文件路径对吗