使用 Spring Hibernate 的问题
我使用 Spring JDBC 取得了巨大成功,但在这个项目中遇到了很多麻烦。我将在此处发布代码链接(这只是一个小而愚蠢的项目,用于测试我是否可以启动并运行它,以便将来可以使用 Hibernate):
xml-file: http://codepaste.net/uw19zc
主文件:http://codepaste.net/iks1cp
我收到大量错误,例如
[Fatal Error] bean2.out.xml:1:1: Premature end of file.
13:21:39,471 FATAL [main] Main - getAssociatedStylesheets failed
,我还没有创建 a.out.xml 文件。
I've been using Spring JDBC with great success but I am having alot of trouble with this project. I'll post the code links here(it's just a small and silly project to test if I can get it up and running so that I can use Hibernate in the future):
xml-file: http://codepaste.net/uw19zc
main-file: http://codepaste.net/iks1cp
I get tons of errors such as
[Fatal Error] bean2.out.xml:1:1: Premature end of file.
13:21:39,471 FATAL [main] Main - getAssociatedStylesheets failed
and I haven't created a.out.xml file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
发布评论
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
此错误是由于 xml 文件解析不正确造成的。
使用Eclipse验证它会给出错误:
在一个或多个
声明之间似乎存在一些奇怪的字符。您是否从其他地方复制了此文本?删除
定义之间的所有空格和换行符,并将它们放回编辑器中。更新
的标准 Unicode 翻译。这很可能是这个问题的原因。
复印&将您提供的代码粘贴中的文本粘贴到记事本++中,并将字符集设置为UTF-8,在空行中显示这些字符:xA0。这是
这对我来说验证没问题:
This error is due to incorrect parsing of the xml file.
Using Eclipse to validate it gives the error:
There appears to be some strange character in between one or many of those
<bean>
declarations. Have you copied this text from somewhere else?Remove all spaces and newline characters between
<bean>
definitions and put them back with your editor.UPDATE
. This is likely to be the cause of this problem.
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
This validates ok for me: