我现在是在内网上运行程序,没办法连接外网,这个xml里面引用的是外网的地址,直接就报错了。怎么解决啊??  急~~~谢谢<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">

解决方案 »

  1.   

    可以肯定这些代码跟连不连接外网没有关系,不连接外网也可以正常启动。
    有可能是你少加了Lib包导致的,你仔细检查一下相应的包都引入了吗。
    另外也可能是你的配置错了,贴错误报告,让大家帮你分析分析。
      

  2.   

    2011-04-11 10:33:09,791: Root WebApplicationContext: initialization started
    2011-04-11 10:33:09,908: Refreshing org.springframework.web.context.support.XmlWebApplicationContext@1bdbf9d: display name [Root WebApplicationContext]; startup date [Mon Apr 11 10:33:09 CST 2011]; root of context hierarchy
    2011-04-11 10:33:10,190: Loading XML bean definitions from ServletContext resource [/WEB-INF/adminConsole-servlet.xml]
    2011-04-11 10:33:11,576: Loading XML bean definitions from ServletContext resource [/WEB-INF/classes/workflow-resource.xml]
    2011-04-11 10:33:11,592: Loading XML bean definitions from ServletContext resource [/WEB-INF/classes/workflow-service.xml]
    2011-04-11 10:33:11,608: Loading XML bean definitions from ServletContext resource [/WEB-INF/classes/workflow-dao.xml]
    2011-04-11 10:33:11,624: Loading XML bean definitions from ServletContext resource [/WEB-INF/classes/meeting-dao.xml]
    2011-04-11 10:33:11,633: Loading XML bean definitions from ServletContext resource [/WEB-INF/classes/meeting-service.xml]
    2011-04-11 10:33:11,648: Loading XML bean definitions from ServletContext resource [/WEB-INF/classes/workday-dao.xml]
    2011-04-11 10:33:11,657: Loading XML bean definitions from ServletContext resource [/WEB-INF/classes/workday-service.xml]
    2011-04-11 10:33:11,670: Loading XML bean definitions from ServletContext resource [/WEB-INF/classes/applicationContext-timer.xml]
    2011-04-11 10:33:12,408: Ignored XML validation warning
    org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/beans/spring-beans-3.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.warning(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaWarning(Unknown Source)
    at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown Source)
    at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(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.DOMParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:351)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147)
    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:101)
    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:389)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:324)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
    at org.apache.catalina.core.StandardService.start(StandardService.java:519)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
    2011-04-11 10:33:12,415: Context initialization failed
      

  3.   

    一看就知在加载文件时候出错了,是在web.xml中设置的启动方式吗? 写文件路径有问题。
      

  4.   

    你先去网上下载需要的xsd文件  再指定本地目录的文件上
    看下这个http://blog.csdn.net/cangwu_lee/archive/2009/01/05/3714879.aspx
      

  5.   

    我也是用Spring3.0 ,复制你的代码到我的Spring配置文件,我断网了也可以正常启动
    可能是你引用的包版本差异导致
    贴你用的Spring包版本
      

  6.   

    在本机开启Web服务(如Tomcat等等),并设置端口为80,然后根据DTD/xsd 的目录结构建立相应的结构,并把DTD/xsd文件放进去。然后在hosts文件里把本机的地址映射到相应的DTD/xsd指定的网站去,如: 代码
      127.0.0.1 www.springframework.org   
    < type="text/javascript">render_code(); 
      这样打开XML文件时就会在本机寻找DTD/xsd文件进行验证,速度就快很多了
      

  7.   

    再问一下,我已经把下面这4个xsd下载完成了,怎么引用进来啊?
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
    http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
      

  8.   

    我现在是这么干的,这几个xsd我都能找到。为什么报错还是说有3.0呢?
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:jee="http://www.springframework.org/schema/jee"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans classpath:org/springframework/beans/factory/xml/spring-beans-2.0.6.xsd
    http://www.springframework.org/schema/context classpath:org/springframework/context/config/spring-context-2.0.6.xsd  
    http://www.springframework.org/schema/jee classpath:org/springframework/ejb/config/spring-jee-2.0.6.xsd
    http://www.springframework.org/schema/tx classpath:org/springframework/transaction/config/spring-tx-2.0.6.xsd">
      

  9.   

    我用的是Spring 3.0的架包
    你改成这样试试<?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
    xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
    http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
      

  10.   

    ok,已经解决了。用下面的办法的:调试了好些时候,发现是要从网上DOWN xsd ,于是修改这个问题。先下载用到的 xsd 等的文件,再指定本地目录的文件上,如:<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
           xsi:schemaLocation="http://www.springframework.org/schema/beans _xsd/spring-beans-2.0.xsd
                http://www.springframework.org/schema/aop _xsd/spring-aop-2.0.xsd
                http://www.springframework.org/schema/tx _xsd/spring-tx-2.0.xsd"
           default-lazy-init="true">
    ……