English 中文(简体)
春季Hibernate使用的问题
原标题:Problems using Spring Hibernate

我先是利用春天亚行,取得了巨大成功,但我对这个项目感到忧虑。 我把这部法典联系起来(它只是一个小型和sil性的项目,如果我能够接手和运行,以便我今后能够使用仇恨):

xml-file: http://codepaste.net/uw19zc

主编:

我有吨错误,如

[Fatal Error] bean2.out.xml:1:1: Premature end of file.
13:21:39,471 FATAL [main] Main  - getAssociatedStylesheets failed

并且,我有一只 t子。

最佳回答

This error is due to incorrect parsing of the xml file. Using Eclipse to validate it gives the error:

cvc-complex-type.2.3: 元素豆类不能具有特性[子女],因为内容类型只是元素。

在<代码><bean>各项声明之间似乎有些奇怪。 您是否从其他地方读过这一案文?

在<代码><bean>下定义之间移除所有空间和新线特性,并将其带回编辑。

UPDATE Copying & pasting into notepad++ the text in the codepaste you provided, and setting the charset to UTF-8 showed these characters in the blank lines: xA0. This is the standard Unicode translation for &nbsp;. This is likely to be the cause of this problem.

This validates ok for me:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    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.xsd">
     <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
        destroy-method="close">
        <property name="driverClassName" value="com.mysql.jdbc.Driver" />
        <property name="url" value="jdbc:mysql://localhost:3306/HibernateDB" />
        <property name="username" value="HibernateDB" />
        <property name="password" value="java" />
    </bean>
    <bean id="sessionFactory"
        class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="configurationClass" value="org.hibernate.cfg.AnnotationConfiguration" />
        <property name="annotatedClasses">
            <list>
                <value>hdao.HibernateObject</value>
            </list>
        </property>
    </bean><bean id="springHibernateOperator" class="hdao.SpringHibernateOperatorImplementation">
        <property name="sessionFactory" ref="sessionFactory" />
    </bean>
</beans>
问题回答

如果你身处地圈子,则使用<条码>-v文档名称.xml,在您的xml文档中检测出特殊的“无形”特性,如M-BM-。

有时在附属地或一些信条定义中存在隐蔽性,你从一些辅导网站读到。 找到这些隐蔽特征的最佳途径是`

ctrl +向F

this will format your document and you can see that hidden character in between some tag `





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签