- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我正在尝试以下代码:http://www.dineshonjava.com/2012/12/spring-mvc-with-hibernate-crud-example.html#.Uus0bvnoSGcsdnext-servlet.xml如下
<beans xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/beans" 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/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<context:property-placeholder location="classpath:resources/database.properties">
</context:property-placeholder>
<context:component-scan base-package="com.dineshonjava">
</context:component-scan>
<tx:annotation-driven transaction-manager="hibernateTransactionManager">
</tx:annotation-driven>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" id="jspViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"></property>
<property name="prefix" value="/WEB-INF/views/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
<bean class="org.springframework.jdbc.datasource.DriverManagerDataSource" id="dataSource">
<property name="driverClassName" value="${database.driver}"></property>
<property name="url" value="${database.url}"></property>
<property name="username" value="${database.user}"></property>
<property name="password" value="${database.password}"></property>
</bean>
<bean class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean" id="sessionFactory">
<property name="dataSource" ref="dataSource"></property>
<property name="annotatedClasses">
<list>
<value>com.dineshonjava.model.Employee</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto} </prop>
</props>
</property>
</bean>
<bean class="org.springframework.orm.hibernate3.HibernateTransactionManager" id="hibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
</beans>
我遇到了异常
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 12 in XML document from ServletContext resource [/WEB-INF/config/sdnext-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 62; cvc-elt.1: Cannot find the declaration of element 'beans'.
我不知道哪里出了问题。请帮忙
最佳答案
将xml命名空间定义改成这个
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
它应该可以工作
问题出在您对 xsi:schemalocation
的定义上,错字是 L
它应该是大写的,只有这样它才能识别标签。
关于XMLBeanDefinitionStoreException : Cannot find the declaration of element 'beans' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21474223/
当尝试部署我的 portlet(使用 Web 服务)时,我收到此异常: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreExce
我正在尝试以下代码:http://www.dineshonjava.com/2012/12/spring-mvc-with-hibernate-crud-example.html#.Uus0bvnoS
已关闭。这个问题是 not reproducible or was caused by typos 。目前不接受答案。 这个问题是由拼写错误或无法再重现的问题引起的。虽然类似的问题可能是 on-top
我正在尝试在我的应用程序中实现 spring 安全性> 我正在关注此代码项目教程 http://www.codeproject.com/Articles/253901/Getting-Started-
我环顾四周,所以我还没有找到解决这个问题的解决方案。我有一个使用 Spring 的 Maven 项目,我调用 assembly-single 并构建一个可运行的 jar。该项目在 IDE 中运行良好,
我想从我的jsp访问我的资源(css,js ...)文件夹..我正在使用带有hibernate集成的spring security ....为了访问这些文件,我使用了 mvc:resources ..
本文整理了Java中org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException.()方法的一些代码示例,展示了XmlBe
本文整理了Java中org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException.getCause()方法的一些代码示例,
我使用 spring mvc 和 hibernate 开发服务器。所以,我使用 Spring mvc 和 maven 编写我的服务器程序。但是,当我在 tomcat 服务器上启动我的服务器程序时,会发
好吧,我是第一次使用 spring mvc,我不知道如何解决这个错误。我正在尝试一个简单的 mvc 程序 这是我的 web.xml 文件 FirstSpringMVCProject
org.hibernate.di
以下是错误堆栈跟踪。 SEVERE: Exception sending context initialized event to listener instance of class org.spr
我是一名优秀的程序员,十分优秀!