banq,你好问一个关于《java使用系统开发指南》的问题

05-11-18 gmslzm
我在调试第四章时发现CastorHandler类中函数getMapping(String mappingFile)执行propsUtil.getConfFile(mappingFile);时总是得到null,无论我把mapping.xml放在那里它都取不到,麻烦帮我解答一下,日志中报以下错误:
05-11-18 10:05:20 [Debug:com.jdon.cms.events.PageAction:Verbose] ----> extractPageForm Action
05-11-18 10:05:20 [Debug:com.jdon.cms.events.FormBeanUtil:Verbose] enter to save the arribute .
05-11-18 10:05:20 [Debug:com.jdon.cms.events.FormBeanUtil:Verbose] Creating new Formbean under key navlinkForm
05-11-18 10:05:20 [Debug:com.jdon.cms.xml.NavlinkManager:Verbose] .... enter init navlinlk
05-11-18 10:05:20 [Debug:com.jdon.cms.xml.NavlinkManager:Verbose] wrtie navlink to xmfile:C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\web\WEB-INF/conf\navlink.xml
05-11-18 10:05:20 [Debug:com.jdon.cms.xml.CastorHandler:Error] get mapping error org.exolab.castor.mapping.MappingException: Nested error: java.net.MalformedURLException
05-11-18 10:05:26 [Debug:com.jdon.cms.events.PageAction:Verbose] ----> PageAction Action
05-11-18 10:05:26 [Debug:com.jdon.cms.events.PageAction:Verbose] ----> extractPageForm Action
05-11-18 10:05:26 [Debug:com.jdon.cms.events.FormBeanUtil:Verbose] remove old attribute =pageForm
05-11-18 10:05:26 [Debug:com.jdon.cms.events.FormBeanUtil:Verbose] enter to save the arribute .
05-11-18 10:05:26 [Debug:com.jdon.cms.events.FormBeanUtil:Verbose] Creating new Formbean under key pageForm
05-11-18 10:05:26 [Debug:com.jdon.cms.events.PageAction:Verbose] setAction = create
05-11-18 10:05:26 [Debug:com.jdon.cms.events.PageAction:Verbose] forward to the page create
05-11-18 10:05:27 [Debug:com.jdon.cms.events.PageAction:Verbose] ----> extractPageForm Action
05-11-18 10:05:27 [Debug:com.jdon.cms.events.FormBeanUtil:Verbose] enter to save the arribute .
05-11-18 10:05:27 [Debug:com.jdon.cms.events.FormBeanUtil:Verbose] Creating new Formbean under key navlinkForm
05-11-18 10:05:34 [Debug:com.jdon.cms.events.PageForm:Verbose] reset pageForm
05-11-18 10:05:34 [Debug:com.jdon.cms.events.PageForm:Verbose] validate pageForm
05-11-18 10:05:34 [Debug:com.jdon.cms.events.FormBeanUtil:Verbose] remove old attribute =pageForm
05-11-18 10:05:34 [Debug:com.jdon.cms.events.SavePageAction:Verbose] action = create
05-11-18 10:05:34 [Debug:com.jdon.cms.events.SavePageAction:Verbose] copyProperties ..
05-11-18 10:05:34 [Debug:com.jdon.cms.events.SavePageAction:Verbose] send event to pageHandler ..
05-11-18 10:05:34 [Debug:com.jdon.util.XmlUtil:Verbose] mapping file:null
05-11-18 10:05:34 [Debug:com.jdon.util.XmlUtil:Error] error: java.lang.NullPointerException
05-11-18 10:05:34 [Debug:com.jdon.controller.WebServiceFactory:Error] getWebService error: java.lang.NullPointerException
05-11-18 10:05:34 [Debug:com.jdon.controller.ServiceProxyHandler:Error] ServiceFactory error: java.lang.Exception: java.lang.NullPointerException
05-11-18 10:05:34 [Debug:com.jdon.cms.events.SavePageAction:Verbose] update page success
05-11-18 10:05:35 [Debug:com.jdon.cms.events.PageAction:Verbose] ----> extractPageForm Action
05-11-18 10:05:35 [Debug:com.jdon.cms.events.FormBeanUtil:Verbose] enter to save the arribute .
05-11-18 10:05:35 [Debug:com.jdon.cms.events.FormBeanUtil:Verbose] Creating new Formbean under key navlinkForm

gmslzm
2005-11-18 10:34
另外,我在部署时报告以下错误:
信息: Installing web application at context path /web from URL file:C:/Program Files/Apache Software Foundation/Tomcat 5.0/webapps/web
log4j:ERROR Could not create an Appender. Reported error follows.
java.lang.ClassNotFoundException: org.jboss.logging.appender.DailyRollingFileAppender
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at org.apache.log4j.helpers.Loader.loadClass(Loader.java:160)
at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:164)
at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:140)
at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:153)
at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:415)
at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:384)
at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:783)
at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:666)
at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:616)
at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:602)
at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:460)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:113)
at org.apache.log4j.Logger.getLogger(Logger.java:85)
at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:102)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at org.apache.commons.beanutils.ConvertUtilsBean.<init>(ConvertUtilsBean.java:130)
at org.apache.commons.beanutils.BeanUtilsBean.<init>(BeanUtilsBean.java:110)
at org.apache.commons.beanutils.BeanUtilsBean$1.initialValue(BeanUtilsBean.java:68)
at org.apache.commons.beanutils.ContextClassLoaderLocal.get(ContextClassLoaderLocal.java:80)
at org.apache.commons.beanutils.BeanUtilsBean.getInstance(BeanUtilsBean.java:78)
at org.apache.commons.beanutils.ConvertUtilsBean.getInstance(ConvertUtilsBean.java:115)
at org.apache.commons.beanutils.ConvertUtils.convert(ConvertUtils.java:217)
at org.apache.commons.digester.CallMethodRule.end(CallMethodRule.java:457)
at org.apache.commons.digester.Rule.end(Rule.java:276)
at org.apache.commons.digester.Digester.endElement(Digester.java:1058)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at org.apache.catalina.startup.ContextConfig.defaultConfig(ContextConfig.java:515)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:623)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:216)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4290)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:625)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:431)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1083)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:327)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardHost.backgroundProcess(StandardHost.java:800)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1619)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1628)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1608)
at java.lang.Thread.run(Thread.java:536)
log4j:ERROR Could not parse input source [org.xml.sax.InputSource@1fcca7b].
java.lang.NullPointerException
at java.util.Hashtable.put(Hashtable.java:389)
at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:141)
at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:153)
at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:415)
at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:384)
at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:783)
at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:666)
at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:616)
at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:602)
at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:460)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:113)
at org.apache.log4j.Logger.getLogger(Logger.java:85)
at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:102)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at org.apache.commons.beanutils.ConvertUtilsBean.<init>(ConvertUtilsBean.java:130)
at org.apache.commons.beanutils.BeanUtilsBean.<init>(BeanUtilsBean.java:110)
at org.apache.commons.beanutils.BeanUtilsBean$1.initialValue(BeanUtilsBean.java:68)
at org.apache.commons.beanutils.ContextClassLoaderLocal.get(ContextClassLoaderLocal.java:80)
at org.apache.commons.beanutils.BeanUtilsBean.getInstance(BeanUtilsBean.java:78)
at org.apache.commons.beanutils.ConvertUtilsBean.getInstance(ConvertUtilsBean.java:115)
at org.apache.commons.beanutils.ConvertUtils.convert(ConvertUtils.java:217)
at org.apache.commons.digester.CallMethodRule.end(CallMethodRule.java:457)
at org.apache.commons.digester.Rule.end(Rule.java:276)
at org.apache.commons.digester.Digester.endElement(Digester.java:1058)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at org.apache.catalina.startup.ContextConfig.defaultConfig(ContextConfig.java:515)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:623)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:216)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4290)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:625)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:431)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1083)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:327)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardHost.backgroundProcess(StandardHost.java:800)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1619)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1628)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1608)
at java.lang.Thread.run(Thread.java:536)
05-11-18 10:03:43 [Debug:com.jdon.cms.events.FileEnvPlugIn:Warning] Initializing file env plug in from '
05-11-18 10:03:43 [Debug:com.jdon.cms.xml.XmlUtil:Verbose] <<-->> InitFileEnv
05-11-18 10:03:43 [Debug:com.jdon.cms.xml.XmlUtil:Verbose] <<-->> create conf real directoryC:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\web\WEB-INF/conf
05-11-18 10:03:43 [Debug:com.jdon.cms.xml.XmlUtil:Verbose] <<-->> create data real directoryC:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\web\data
java.lang.NullPointerException
at com.jdon.util.XMLProperties.saveProperties(XMLProperties.java:221)
at com.jdon.util.XMLProperties.setProperty(XMLProperties.java:186)
at com.jdon.util.PropsUtil.setProperty(PropsUtil.java:127)
at com.jdon.util.PropsUtil.setProperty(PropsUtil.java:122)
at com.jdon.cms.xml.XmlUtil.InitFileEnv(XmlUtil.java:85)
at com.jdon.cms.events.FileEnvPlugIn.init(FileEnvPlugIn.java:102)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1158)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:625)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:431)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1083)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:327)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardHost.backgroundProcess(StandardHost.java:800)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1619)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1628)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1608)
at java.lang.Thread.run(Thread.java:536)
java.lang.NullPointerException
at com.jdon.util.XMLProperties.saveProperties(XMLProperties.java:234)
at com.jdon.util.XMLProperties.setProperty(XMLProperties.java:186)
at com.jdon.util.PropsUtil.setProperty(PropsUtil.java:127)
at com.jdon.util.PropsUtil.setProperty(PropsUtil.java:122)
at com.jdon.cms.xml.XmlUtil.InitFileEnv(XmlUtil.java:85)
at com.jdon.cms.events.FileEnvPlugIn.init(FileEnvPlugIn.java:102)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1158)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:625)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:431)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1083)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:327)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardHost.backgroundProcess(StandardHost.java:800)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1619)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1628)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1608)
at java.lang.Thread.run(Thread.java:536)
2005-11-18 10:05:08 org.apache.struts.util.PropertyMessageResources <init>
信息: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
2005-11-18 10:05:08 org.apache.struts.util.PropertyMessageResources <init>
信息: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
2005-11-18 10:05:08 org.apache.struts.util.PropertyMessageResources <init>
信息: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
2005-11-18 10:05:08 org.apache.struts.util.PropertyMessageResources <init>
信息: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
2005-11-18 10:05:08 org.apache.struts.util.PropertyMessageResources <init>
信息: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true

banq
2005-11-19 12:43
CastorHandler:Error] get mapping error org.exolab.castor.mapping.MappingException: Nested error: java.net.MalformedURLException

将mapping.xml放在classpath中肯定能找到。

后面一个贴错误是log4j缺失,无关。

推荐使用JBoss

猜你喜欢