`
duaiai
  • 浏览: 3043 次
  • 性别: Icon_minigender_2
  • 来自: 西安
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

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)


怎么解决啊?
分享到:
评论

相关推荐

    annotations.zip

    Android Build 时报错: java.io.IOException: Could not parse XML from android/accounts/annotati...Android构建时报错: app:lintVitalRelease[Fatal Error] :3:214: 与元素类型 “item” 相关联的 “name” ...

    java.text.ParseException: Unparseable date: 2/10/2010 15:20:05

    在Java编程中,`ParseException` 是 `java.text.ParseException` 类的一个异常,通常在尝试解析日期或时间字符串时遇到无法解析的格式时抛出。在给定的标题 "java.text.ParseException: Unparseable date: 2/10/2010...

    JSqlparser4.4版作者提供的应急版,解决无法解析mysql中JSON_OBJECT函数存在其它函数问题

    SELECT JSON_ARRAYAGG(obj) FROM (SELECT trt.relevance_id,JSON_OBJECT('id',CAST(trt.id AS CHAR),'taskName',trt.task_name,'openStatus',trt.open_status,'taskSort',trt.task_sort) as obj FROM tb_review_task...

    httpcomponents-client-4.5.9.zip

    import org.apache.http.ParseException; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpUriRequest; import ...

    java调用net开发的webservice实例

    javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.: org.xml.sax.SAXParseException: The element type "p" must be terminated by the matching end-tag ...

    annotations.zip app:lintVitalRelease[Fatal Error] :3:214: 与元素类型 “item” 相关联的 “nam

    用于解决,Android构建APk时报错: ...java.io.IOException: Could not parse XML from android/accounts/annotations.xml 将上述文件替换替换SDK目录下的/platform-tools/api/下对应的文件即可解决

    py4j源码安装包源码

    安装JayDeBeApi时,如果报错,提示:error: Could not find suitable distribution for Requirement.parse('py4j') 需要先安装这个py4j

    El表达式使用问题javax.el.ELException:Failed to parse the expression的解决方式

    然而,当出现`javax.el.ELException: Failed to parse the expression`错误时,这通常意味着EL表达式没有被正确解析,导致程序无法正常运行。该错误通常是由于违反了EL表达式的语法规则,或者尝试执行了不合法的操作...

    通过import org.springframework.web.multipart.MultipartFile;上传文件

    通过import org.springframework.web.multipart.MultipartFile;上传文件的一个工具性的jar.

    Downloads.zip

    Could not read /Users/panxin/Library/Android/sdk/platform-tools/api/annotations.zip java.io.IOException: Could not parse XML from annotations/android/widget/annotations.xml 请将本文件解压后的...

    Jboss启动报Failed to parse WEB-INFweb.xml; - nested throwable错误

    Jboss启动报Failed to parse WEB-INF/web.xml; - nested throwable错误解决方案 在Jboss应用服务器中,启动报错Failed to parse WEB-INF/web.xml; - nested throwable是一种常见的错误,本文将对此错误进行深入分析...

    asm5.0.jar

    nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis- config.xml]; nested exception is org.apache.ibatis.builder....

    pytz-2020.1.tar.gz

    distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pytz&gt;=2010') 下载后解压安装 tar zxvf pytz-2020.1.tar.gz cd pytz python setup.py install

    hive函数大全(中文版)

    1. UNIX时间戳转日期函数: from_unixtime 18 2. 获取当前UNIX时间戳函数: unix_timestamp 18 3. 日期转UNIX时间戳函数: unix_timestamp 18 4. 指定格式日期转UNIX时间戳函数: unix_timestamp 18 5. 日期时间转日期...

    解决dbf Failed to parse Number: For input string: "-.---"

    本文将深入探讨标题和描述中提到的问题:“解决dbf Failed to parse Number: For input string: "-.---""”,以及如何在不依赖特定jar包的情况下处理DBF文件。 首先,"Failed to parse Number: For input string: ...

    AndroidSDK下/platform-tools/api/annotations.zip

    编译时遇到以下报错:app:...java.io.IOException: Could not parse XML from annotations/android/widget/annotations.xml 请将本文件替换SDK目录下的/platform-tools/api/annotations.zip文件,建议替换前备份原文件

    org.jsoup.zip

    "org.jsoup.zip" 是一个与Java相关的压缩包文件,它包含了一个名为 "org.jsoup" 的开发包以及一些相关资源。这个开发包是用于处理HTML解析和提取数据的库,非常适用于网页抓取和数据挖掘任务。以下是关于org.jsoup库...

    org.apache.commons.lang.StringEscapeUtils

    解决json数据中,返回的数据格式中带有反斜杠 如下所示{\"Count\":\"3\",\"ErrorString\":\"\",\"Success\":true,\"URL\":\"http:\\\/\\\/172.16.80.65:8080\\\/LoginSSO.aspx?UserCode=wubg&Type=WorkItem\",\...

    dom4j解析XML(带jar包了).

    3. **读取XML文件**:使用`DocumentFactory`的`parse()`方法,传入XML文件的路径,来读取XML文件并生成`Document`对象。 ```java File file = new File("mjy.xml"); DocumentFactory factory = DocumentFactory....

    Android代码-PhotoDraweeView

    PhotoDraweeView PhotoView For Fresco ...mPhotoDraweeView.setPhotoUri(Uri.parse("http://your.image.url")); Using the ControllerBuilder PipelineDraweeControllerBuilder controller = Fres

Global site tag (gtag.js) - Google Analytics