PAFA 框架报错java.io.FileNotFoundException: class path resource [log4j.properties] cannot be resolved to
14:02:44,170 INFO [DefaultListableBeanFactory] Creating shared instance of singleton bean 'logConfigRefresher'
14:02:44,172 INFO [STDOUT] 2016-06-12 14:02:44.172 <WARNING> PAFA初始化配置文件core-context.xml 出错!
14:02:44,172 ERROR [STDERR] com.paic.pafa.app.lwc.core.beans.factory.BeanCreationException: class path resource [log4j.properties] cannot be resolved to absolute file path because it does not reside in the file system: URL=[jar:file:/D:/IDE/jboss-4.2.3.GA/jboss-4.2.3.GA/bin/run.jar!/log4j.properties]
14:02:44,172 ERROR [STDERR] java.io.FileNotFoundException: class path resource [log4j.properties] cannot be resolved to absolute file path because it does not reside in the file system: URL=[jar:file:/D:/IDE/jboss-4.2.3.GA/jboss-4.2.3.GA/bin/run.jar!/log4j.properties]
14:02:44,172 ERROR [STDERR] at com.paic.pafa.app.lwc.core.basic.io.ClassPathResource.getFile(ClassPathResource.java:108)
14:02:44,173 ERROR [STDERR] at com.paic.pafa.app.lwc.core.util.LogConfigRefresher.afterPropertiesSet(LogConfigRefresher.java:38)
14:02:44,173 ERROR [STDERR] at com.paic.pafa.app.lwc.core.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:718)
14:02:44,173 ERROR [STDERR] at com.paic.pafa.app.lwc.core.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:213)
14:02:44,173 ERROR [STDERR] at com.paic.pafa.app.lwc.core.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159)
14:02:44,173 ERROR [STDERR] at com.paic.pafa.app.lwc.core.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:178)
14:02:44,173 ERROR [STDERR] at com.paic.pafa.app.lwc.core.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:273)
14:02:44,173 ERROR [STDERR] at com.paic.pafa.app.lwc.core.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:58)
14:02:44,173 ERROR [STDERR] at com.paic.pafa.app.lwc.core.context.support.PafaApplicationContext.<init>(PafaApplicationContext.java:38)
14:02:44,173 ERROR [STDERR] at com.paic.pafa.app.lwc.core.context.support.PafaCoreContexton.getInstance(PafaCoreContexton.java:105)
14:02:44,173 ERROR [STDERR] at com.paic.pafa.app.web.servlet.mvc.AbstractController.<init>(AbstractController.java:114)
14:02:44,173 ERROR [STDERR] at com.paic.pafa.app.web.servlet.mvc.ParameterizableViewController.<init>(ParameterizableViewController.java:67)
14:02:44,173 ERROR [STDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
14:02:44,173 ERROR [STDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
14:02:44,173 ERROR [STDERR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
14:02:44,173 ERROR [STDERR] at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
14:02:44,173 ERROR [STDERR] at java.lang.Class.newInstance0(Class.java:355)
14:02:44,173 ERROR [STDERR] at java.lang.Class.newInstance(Class.java:308)
14:02:44,173 ERROR [STDERR] at com.paic.pafa.app.lwc.core.beans.BeanUtils.instantiateClass(BeanUtils.java:46)
14:02:44,173 ERROR [STDERR] at com.paic.pafa.app.lwc.core.beans.BeanWrapperImpl.<init>(BeanWrapperImpl.java:168)
14:02:44,173 ERROR [STDERR] at com.paic.pafa.app.lwc.core.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:184)
14:02:44,173 ERROR [STDERR] at com.paic.pafa.app.lwc.core.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:159)
14:02:44,173 ERROR [STDERR] at com.paic.pafa.app.lwc.core.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:178)
14:02:44,173 ERROR [STDERR] at com.paic.pafa.app.lwc.core.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:273)
14:02:44,173 ERROR [STDERR] at com.paic.pafa.app.web.context.support.XmlWebApplicationContext.refresh(XmlWebApplicationContext.java:131)
14:02:44,173 ERROR [STDERR] at com.paic.pafa.app.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:281)
14:02:44,174 ERROR [STDERR] at com.paic.pafa.app.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:229)
14:02:44,174 ERROR [STDERR] at com.paic.pafa.app.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:199)
14:02:44,174 ERROR [STDERR] at com.paic.pafa.app.web.servlet.HttpServletBean.init(HttpServletBean.java:95)
14:02:44,174 ERROR [STDERR] at javax.servlet.GenericServlet.init(GenericServlet.java:211)
14:02:44,174 ERROR [STDERR] at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
14:02:44,174 ERROR [STDERR] at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
14:02:44,174 ERROR [STDERR] at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3951)
14:02:44,174 ERROR [STDERR] at org.apache.catalina.core.StandardContext.start(StandardContext.java:4225)
14:02:44,174 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
14:02:44,174 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
14:02:44,174 ERROR [STDERR] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
14:02:44,174 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14:02:44,174 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
14:02:44,174 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
14:02:44,174 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
14:02:44,174 ERROR [STDERR] at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
14:02:44,174 ERROR [STDERR] at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
14:02:44,174 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
14:02:44,174 ERROR [STDERR] at org.apache.catalina.core.StandardContext.init(StandardContext.java:5052)
14:02:44,174 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14:02:44,174 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
14:02:44,174 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
14:02:44,174 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
14:02:44,174 ERROR [STDERR] at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
14:02:44,174 ERROR [STDERR] at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
14:02:44,175 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
14:02:44,175 ERROR [STDERR] at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:297)
14:02:44,175 ERROR [STDERR] at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103)
14:02:44,175 ERROR [STDERR] at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371)
14:02:44,175 ERROR [STDERR] at org.jboss.web.WebModule.startModule(WebModule.java:83)
14:02:44,175 ERROR [STDERR] at org.jboss.web.WebModule.startService(WebModule.java:61)
14:02:44,175 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
14:02:44,175 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
14:02:44,175 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
14:02:44,175 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
14:02:44,175 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
14:02:44,175 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
14:02:44,175 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
14:02:44,175 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
14:02:44,175 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
14:02:44,175 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
14:02:44,175 ERROR [STDERR] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
14:02:44,175 ERROR [STDERR] at $Proxy0.start(Unknown Source)
14:02:44,175 ERROR [STDERR] at org.jboss.system.ServiceController.start(ServiceController.java:417)
14:02:44,175 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
14:02:44,175 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
14:02:44,175 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
14:02:44,175 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
14:02:44,175 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
14:02:44,175 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
14:02:44,175 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
14:02:44,176 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
14:02:44,176 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
14:02:44,176 ERROR [STDERR] at $Proxy38.start(Unknown Source)
14:02:44,176 ERROR [STDERR] at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
14:02:44,176 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14:02:44,176 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
14:02:44,176 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
14:02:44,176 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
14:02:44,176 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
14:02:44,176 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
14:02:44,176 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
14:02:44,176 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
14:02:44,176 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
14:02:44,176 ERROR [STDERR] at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
14:02:44,176 ERROR [STDERR] at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
14:02:44,176 ERROR [STDERR] at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92)
14:02:44,176 ERROR [STDERR] at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
14:02:44,176 ERROR [STDERR] at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
14:02:44,176 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
14:02:44,176 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
14:02:44,176 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
14:02:44,176 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
14:02:44,176 ERROR [STDERR] at $Proxy39.start(Unknown Source)
14:02:44,176 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
14:02:44,176 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
14:02:44,176 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
14:02:44,177 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
14:02:44,177 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source)
14:02:44,177 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
14:02:44,177 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
14:02:44,177 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
14:02:44,177 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
14:02:44,177 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
14:02:44,177 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
14:02:44,177 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
14:02:44,177 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
14:02:44,177 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
14:02:44,177 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
14:02:44,177 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
14:02:44,177 ERROR [STDERR] at $Proxy8.deploy(Unknown Source)
14:02:44,177 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
14:02:44,177 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
14:02:44,177 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
14:02:44,177 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
14:02:44,177 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
14:02:44,177 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
14:02:44,177 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
14:02:44,177 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
14:02:44,177 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
14:02:44,177 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
14:02:44,177 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
14:02:44,177 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
14:02:44,178 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
14:02:44,178 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
14:02:44,178 ERROR [STDERR] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
14:02:44,178 ERROR [STDERR] at $Proxy0.start(Unknown Source)
14:02:44,178 ERROR [STDERR] at org.jboss.system.ServiceController.start(ServiceController.java:417)
14:02:44,178 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
14:02:44,178 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
尝试了很多方法都没有解决,崩溃,后来我按照日志挨个找下来,注释了core-context.xml里面这些就可以了
<?xml version="1.0" encoding="GB2312"?>
<!DOCTYPE beans PUBLIC "-//LWC//DTD BEAN//EN" "lwc-beans.dtd">
<beans>
<description>配置应用系统的日志</description>
<!--=====================================================================-->
<!-- 配置外部变量文件 -->
<!--=====================================================================-->
<bean id="propertyConfigurer"
class="com.paic.pafa.app.lwc.core.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<description>可以引用CLASSPATH中context.properties中定义的变量</description>
<value>classpath:context-MVC.properties</value>
</property>
</bean>
<!--=====================================================================-->
<!-- 定义日志记录器,新版本的日志采用Log4j实现 -->
<!--=====================================================================-->
<bean id="tracer" class="com.paic.pafa.logging3.impl.Log4JLogger">
<constructor-arg>
<description>日志记录器的名称</description>
<value>tracer</value>
</constructor-arg>
<property name="pattern">
<value>%impt %uid %ip %date %ms %seq %log %lv %cls %mtd %tid %err %msg %th %cust</value>
</property>
</bean>
<bean id="auditLogger" class="com.paic.pafa.logging3.impl.Log4JLogger">
<constructor-arg>
<description>日志记录器的名称</description>
<value>auditLogger</value>
</constructor-arg>
<property name="pattern">
<value>%impt %uid %ip %date %ms %seq %log %lv %cls %mtd %tid %err %msg %th %cust</value>
</property>
</bean>
<bean id="errorLogger" class="com.paic.pafa.logging3.impl.Log4JLogger">
<constructor-arg>
<description>日志记录器的名称</description>
<value>errorLogger</value>
</constructor-arg>
<property name="pattern">
<value> %uid %msg %uid</value>
</property>
</bean>
<!--=====================================================================-->
<!-- 以下配置一般不需更改 -->
<!--=====================================================================-->
<!-- 日志配置文件的刷新器。这个bean在3.5.3中才提供,若您使用的pafa版本低于3.5.3,请将此bean注释掉
<bean id="logConfigRefresher"
class="com.paic.pafa.app.lwc.core.util.LogConfigRefresher">
<description>log4j日志配置文件刷新器</description>
<property name="refreshInterval">
<description>默认值为60000毫秒</description>
<value>10000</value>
</property>
</bean>
<bean id="idGenerator"
class="com.paic.pafa.core.service.IDGenerator">
<description>用于生成记录的ID</description>
</bean>
<bean id="threadContext"
class="com.paic.pafa.core.service.PafaThreadContext">
<description>线程的Context</description>
</bean>
-->
</beans>