Topic: 练习hibernate入门例子时发生错误

  Print this page

1.练习hibernate入门例子时发生错误 Copy to clipboard
Posted by: feiling
Posted on: 2006-11-24 23:28

入门第一个例子就运行不起来..减弱了我对它的兴趣...~_~不过还是要学的....
运行的时候发生如下错误:
严重: Error parsing XML: XML InputStream(28) The content of element type "class" must match "(meta*,(cache|jcs-cache)?,(id|composite-id),discriminator?,(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|any|map|set|list|bag|idbag|array|primitive-array)*,(subclass*|joined-subclass*))".
net.sf.hibernate.MappingException: Error reading resource: deng/hibernate/UserInfo.hbm.xml
那个UserInfo.hbm.xml我是用synchronizer生成的,代码如下:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
  "-//Hibernate/Hibernate Mapping DTD//EN"
  "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >

<hibernate-mapping package="deng.hibernate">
  <class
    name="UserInfo"
    table="userInfo"
  >

    <property
      name="UserName"
      column="UserName"
      type="string"
      not-null="false"
      length="25"
    />
    <property
      name="Password"
      column="Password"
      type="string"
      not-null="false"
      length="20"
    />

  </class>  
</hibernate-mapping>
请好心人指教一下,要不然真是干不下去了...(抹泪中...)

2.Re:练习hibernate入门例子时发生错误 [Re: feiling] Copy to clipboard
Posted by: sljsuper
Posted on: 2006-12-05 15:39

XML不对吧,主键呢


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923