[main] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@2d6764b2: defining beans [propertyPlaceholderConfigurer,cmsDataSource,pNewsDataSource,cmsSlaveDataSource,interfaceDataSource,interfaceSlaveDataSource,picsDataSource,picsSlaveDataSource,liveDataSource,liveSlaveDataSource,weiboDataSource,weiboSlaveDataSource,weixinDataSource,weixinSlaveDataSource,userSlaveDataSource,newstvinfoDao,newsDao,newsOwnerDao,newsExtendDao,channelTagDao,channelDao,localChannelDao,pushDao,adInfoDao,packAdInfoDao,functionTemplateDao,slaveMpaperJdbcTemplate,channelCategoryDao,channelCategoryRelationDao,channelDisplaySupportDao,jdbcTemplate,channelNewsMysqlDao,channelNewsMysqlService,topNewsMysqlDao,topNewsMysqlService,mongoConfig,channelNewsMongoDao,channelNewsServiceMongoService,linkNewsMongoDao,linkNewsServiceMongoService,gbcodeNewsMongoDao,gbcodeNewsServiceMongoService,topNewsMongoDao,topNewsServiceMongoService,newsaudioDao]; root of factory hierarchy
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.sohu.smc.wechat.applet.service.impl.NewsServiceImpl.<init>(NewsServiceImpl.java:41)
at com.sohu.smc.wechat.applet.service.ServiceFactory.<clinit>(ServiceFactory.java:18)
at com.sohu.smc.wechat.applet.helper.NewsArticleHelper.<init>(NewsArticleHelper.java:39)
at com.sohu.smc.wechat.applet.controller.NewsArticleController.<clinit>(NewsArticleController.java:27)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at com.sohu.smc.common.http.server.DefaultProxyFactory.getObject(DefaultProxyFactory.java:17)
at com.sohu.smc.common.http.server.Configuration.build(Configuration.java:60)
at com.sohu.smc.wechat.applet.server.WechatAppletServer.main(WechatAppletServer.java:39)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cmsDataSource' defined in class path resource [dao-beans.xml]: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1038)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:984)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:487)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:633)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at com.sohu.smc.api.news.factory.NewsDaoFactory.init(NewsDaoFactory.java:19)
at com.sohu.smc.api.news.factory.NewsDaoFactory.<clinit>(NewsDaoFactory.java:15)
... 12 more
<bean id="cmsDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="${jdbc.connection.driver_class}"/>
<property name="jdbcUrl" value="${jdbc.connection.url}"/>
<property name="user" value="${jdbc.connection.username}"/>
<property name="password" value="${jdbc.connection.password}"/>
<property name="minPoolSize" value="1"></property>
<property name="maxPoolSize" value="10"></property>
<property name="initialPoolSize" value="1"></property>
<property name="maxIdleTime" value="60"></property>
<property name="acquireIncrement" value="2"></property>
<property name="maxStatements" value="0"></property>
<property name="idleConnectionTestPeriod" value="60"></property>
<property name="acquireRetryAttempts" value="30"></property>
<property name="breakAfterAcquireFailure" value="false"></property>
<property name="testConnectionOnCheckout" value="false"></property>
</bean>
创建bean错误
在同事那里能正常启动 我本地就报错 请问是什么原因啊。
确定你们两个的所有环境和代码时一致的吗