org.hibernate.InvalidMappingException: Could not parse mapping document from res

大家帮忙看看!

proxool.xml

<?xml version="1.0" encoding="utf-8"?>  
<something-else-entirely>  
<proxool>  
<alias>proxoolPool</alias>  
<!--proxool只能管理由自己产生的连接-->  
<driver-url>jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=Equipment</driver-url>  
<driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>  
<driver-properties> 
<property name="user" value="sa"/> 
<property name="password" value="123456"/> 
</driver-properties>  
<!-- proxool自动侦察各个连接状态的时间间隔(毫秒),侦察到空闲的连接就马上回收,超时的销毁-->  
<house-keeping-sleep-time>90000</house-keeping-sleep-time>  
<!-- 指因未有空闲连接可以分配而在队列中等候的最大请求数,超过这个请求数的用户连接就不会被接受-->  
<maximum-new-connections>20</maximum-new-connections>  
<!-- 最少保持的空闲连接数-->  
<prototype-count>5</prototype-count>  
<!-- 允许最大连接数,超过了这个连接,再有请求时,就排在队列中等候,最大的等待请求数由maximum-new-connections决定-->  
<maximum-connection-count>100</maximum-connection-count>  
<!-- 最小连接数-->  
<minimum-connection-count>10</minimum-connection-count> 
</proxool> 
</something-else-entirely> 


hibernate.cfg.xml:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration> 
<session-factory> 
   <property name="proxool.pool_alias">proxoolPool</property> 
    <property name="proxool.xml">proxool.xml</property> 
    <property name="connection.provider_class">org.hibernate.connection.ProxoolConnectionProvider</property> 
   <property name="connection.driver_class">com.microsoft.jdbc.sqlserver.SQLServerDriver</property>     
    <property name="show_sql">true</property> 
<mapping resource="com/soya/pojo/Admin.hbm.xml" />
<mapping resource="com/soya/pojo/FlowMeter.hbm.xml" />
<mapping resource="com/soya/pojo/Popedom.hbm.xml" />
<mapping resource="com/soya/pojo/AdminPopedom.hbm.xml" />
<mapping resource="com/soya/pojo/SiteInfo.hbm.xml" />
<mapping resource="com/soya/pojo/News.hbm.xml" />
<mapping resource="com/soya/pojo/NewsGroup.hbm.xml" />
<mapping resource="com/soya/pojo/ServerMan.hbm.xml" />
<mapping resource="com/soya/pojo/LinkGroup.hbm.xml" />
<mapping resource="com/soya/pojo/Link.hbm.xml" />
<mapping resource="com/soya/pojo/Bank.hbm.xml" />
<mapping resource="com/soya/pojo/OtherInfo.hbm.xml" />
<mapping resource="com/soya/pojo/GoodsGroup.hbm.xml" />
<mapping resource="com/soya/pojo/Goods.hbm.xml" />
<mapping resource="com/soya/pojo/Client.hbm.xml" />
<mapping resource="com/soya/pojo/Orders.hbm.xml" />
<mapping resource="com/soya/pojo/PayRecord.hbm.xml" />
<mapping resource="com/soya/pojo/GoodsOrders.hbm.xml" />
<mapping resource="com/soya/pojo/MainGroup.hbm.xml" />
</session-factory> 
</hibernate-configuration>



但是会报错!

888891 [http-8080-2] INFO cfg.Configuration  - configuring from resource: /hibernate.cfg.xml
888891 [http-8080-2] INFO cfg.Configuration  - Configuration resource: /hibernate.cfg.xml
888906 [http-8080-2] INFO cfg.Configuration  - Reading mappings from resource : com/soya/pojo/Admin.hbm.xml
888906 [http-8080-2] INFO cfg.Mappings  - duplicate import: com.soya.pojo.Admin->com.soya.pojo.Admin
888906 [http-8080-2] INFO cfg.Mappings  - duplicate import: com.soya.pojo.Admin->Admin
888906 [http-8080-2] INFO cfg.HbmBinder  - Mapping class: com.soya.pojo.Admin -> admin
%%%% Error Creating SessionFactory %%%%
org.hibernate.InvalidMappingException: Could not parse mapping document from resource com/soya/pojo/Admin.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:569)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1587)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1555)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1534)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1508)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1428)
at com.soya.factory.SessionFactory.rebuildSessionFactory(SessionFactory.java:69)
at com.soya.factory.SessionFactory.getSession(SessionFactory.java:53)
at com.soya.dao.BaseDAO.getSession(BaseDAO.java:25)
at com.soya.impl.FlowMeterImpl.existIp(FlowMeterImpl.java:271)
at com.soya.filter.IPFilter.doFilter(IPFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.hibernate.DuplicateMappingException: Duplicate collection role mapping com.soya.pojo.Admin.adminPopedoms
at org.hibernate.cfg.Mappings.addCollection(Mappings.java:124)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2066)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2041)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:359)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:273)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:144)
at org.hibernate.cfg.Configuration.add(Configuration.java:669)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:504)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:566)
... 22 more
java.lang.NullPointerException
at com.soya.impl.FlowMeterImpl.existIp(FlowMeterImpl.java:276)
at com.soya.filter.IPFilter.doFilter(IPFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:619)
java.lang.NullPointerException
at com.soya.impl.FlowMeterImpl.existIp(FlowMeterImpl.java:285)
at com.soya.filter.IPFilter.doFilter(IPFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:619)


怎么解决啊?

你可能感兴趣的:(java,apache,tomcat,Hibernate,xml)