关于Hibernate或者java本身文件编码错误的问题?

2024-01-31 17:18

本文主要是介绍关于Hibernate或者java本身文件编码错误的问题?,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!


系统中使用了struts-menu,当代码如下时,树形菜单死活出不来
***************************************************************************

//  创建连接
  Session session=HibernateSessionFactory.getSession();
  //创建事务
  Transaction tx=session.beginTransaction();
  //创建对话
Query query=session.createQuery("FROM MenuItem2 m where m.description like '文件%' order by id");
*********************************************************************************


当把query里面的查询语句改为如下时,才显示树形菜单;
我大概知道可能是那2个中文字符“文件”惹的祸。这是编码的问题么?怎么导致的呢?
*****************************************************************************

//  创建连接
  Session session=HibernateSessionFactory.getSession();
  //创建事务
  Transaction tx=session.beginTransaction();
  //创建对话
  Query query=session.createQuery("FROM MenuItem2 m order by id");

****************************************************************

 

配置了过滤器,还是一样的问题,并且在最开始时还出现如下错误

信息: Server startup in 16141 ms
the parameter id is 243
INFO - Hibernate 3.0.5
INFO - hibernate.properties not found
INFO - using CGLIB reflection optimizer
INFO - using JDK 1.4 java.sql.Timestamp handling
INFO - configuring from resource: /hibernate.cfg.xml
INFO - configuring from resource: /hibernate.cfg.xml
INFO - Configuration resource: /hibernate.cfg.xml
INFO - Configuration resource: /hibernate.cfg.xml
INFO - Mapping resource: hci/hj/vo/book/MenuItem2.hbm.xml
INFO - Mapping resource: hci/hj/vo/book/MenuItem2.hbm.xml
ERROR - Could not configure datastore from input stream
org.dom4j.DocumentException: FWK005 parse may not be called while parsing. Nested exception: FWK005 parse may not be called while parsing.
 at org.dom4j.io.SAXReader.read(SAXReader.java:353)
 at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:398)
 at org.hibernate.cfg.Configuration.addResource(Configuration.java:449)
 at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1263)
 at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1235)
 at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1217)
 at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1184)
 at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
 at com.hibernate.SessionFactory.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:59)
 at com.hibernate.SessionFactory.HibernateSessionFactory.getSession(HibernateSessionFactory.java:43)
 at hci.hj.struts.action.GetfileAction.execute(GetfileAction.java:56)
 at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
 at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at hci.hj.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:124)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.ecside.filter.ECSideFilter.doFilter(ECSideFilter.java:188)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
 at java.lang.Thread.run(Thread.java:595)
Nested exception:
org.xml.sax.SAXException: FWK005 parse may not be called while parsing.
 at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
 at org.dom4j.io.SAXReader.read(SAXReader.java:334)
 at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:398)
 at org.hibernate.cfg.Configuration.addResource(Configuration.java:449)
 at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1263)
 at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1235)
 at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1217)
 at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1184)
 at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
 at com.hibernate.SessionFactory.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:59)
 at com.hibernate.SessionFactory.HibernateSessionFactory.getSession(HibernateSessionFactory.java:43)
 at hci.hj.struts.action.GetfileAction.execute(GetfileAction.java:56)
 at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
 at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at hci.hj.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:124)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.ecside.filter.ECSideFilter.doFilter(ECSideFilter.java:188)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
 at java.lang.Thread.run(Thread.java:595)
ERROR - Could not configure datastore from input stream
org.dom4j.DocumentException: null Nested exception: null
 at org.dom4j.io.SAXReader.read(SAXReader.java:353)
 at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:398)
 at org.hibernate.cfg.Configuration.addResource(Configuration.java:449)
 at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1263)
 at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1235)
 at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1217)
 at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1184)
 at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
 at com.hibernate.SessionFactory.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:59)
 at com.hibernate.SessionFactory.HibernateSessionFactory.getSession(HibernateSessionFactory.java:43)
 at hci.hj.struts.action.FindAction.execute(FindAction.java:53)
 at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
 at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at hci.hj.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:124)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.ecside.filter.ECSideFilter.doFilter(ECSideFilter.java:188)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
 at java.lang.Thread.run(Thread.java:595)
Nested exception:
java.lang.NullPointerException
 at org.dom4j.io.SAXContentHandler.characters(SAXContentHandler.java:280)
 at org.apache.xerces.parsers.AbstractSAXParser.characters(Unknown Source)
 at org.apache.xerces.impl.dtd.XMLDTDValidator.characters(Unknown Source)
 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanContent(Unknown Source)
 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
 at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
 at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
 at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
 at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
 at org.dom4j.io.SAXReader.read(SAXReader.java:334)
 at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:398)
 at org.hibernate.cfg.Configuration.addResource(Configuration.java:449)
 at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1263)
 at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1235)
 at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1217)
 at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1184)
 at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
 at com.hibernate.SessionFactory.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:59)
 at com.hibernate.SessionFactory.HibernateSessionFactory.getSession(HibernateSessionFactory.java:43)
 at hci.hj.struts.action.FindAction.execute(FindAction.java:53)
 at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
 at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at hci.hj.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:124)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.ecside.filter.ECSideFilter.doFilter(ECSideFilter.java:188)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
 at java.lang.Thread.run(Thread.java:595)
%%%% Error Creating SessionFactory %%%%
%%%% Error Creating SessionFactory %%%%
org.hibernate.MappingException: Error reading resource: hci/hj/vo/book/MenuItem2.hbm.xml
 at org.hibernate.cfg.Configuration.addResource(Configuration.java:452)
 at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1263)
 at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1235)
 at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1217)
 at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1184)
 at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
 at com.hibernate.SessionFactory.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:59)
 at com.hibernate.SessionFactory.HibernateSessionFactory.getSession(HibernateSessionFactory.java:43)
 at hci.hj.struts.action.GetfileAction.execute(GetfileAction.java:56)
 at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
 at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at hci.hj.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:124)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.ecside.filter.ECSideFilter.doFilter(ECSideFilter.java:188)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
 at java.lang.Thread.run(Thread.java:595)
Caused by: org.hibernate.MappingException: org.dom4j.DocumentException: FWK005 parse may not be called while parsing. Nested exception: FWK005 parse may not be called while parsing.
 at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:408)
 at org.hibernate.cfg.Configuration.addResource(Configuration.java:449)
 ... 34 more
Caused by: org.dom4j.DocumentException: FWK005 parse may not be called while parsing. Nested exception: FWK005 parse may not be called while parsing.
 at org.dom4j.io.SAXReader.read(SAXReader.java:353)
 at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:398)
 ... 35 more
org.hibernate.MappingException: Error reading resource: hci/hj/vo/book/MenuItem2.hbm.xml
 at org.hibernate.cfg.Configuration.addResource(Configuration.java:452)
 at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1263)
 at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1235)
 at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1217)
 at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1184)
 at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
 at com.hibernate.SessionFactory.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:59)
 at com.hibernate.SessionFactory.HibernateSessionFactory.getSession(HibernateSessionFactory.java:43)
 at hci.hj.struts.action.FindAction.execute(FindAction.java:53)
 at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
 at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at hci.hj.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:124)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.ecside.filter.ECSideFilter.doFilter(ECSideFilter.java:188)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
 at java.lang.Thread.run(Thread.java:595)
Caused by: org.hibernate.MappingException: org.dom4j.DocumentException: null Nested exception: null
 at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:408)
 at org.hibernate.cfg.Configuration.addResource(Configuration.java:449)
 ... 34 more
Caused by: org.dom4j.DocumentException: null Nested exception: null
 at org.dom4j.io.SAXReader.read(SAXReader.java:353)
 at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:398)
 ... 35 more
WARN - Unhandled Exception thrown: class java.lang.NullPointerException
WARN - Unhandled Exception thrown: class java.lang.NullPointerException
ERROR - Servlet.service() for servlet action threw exception
java.lang.NullPointerException
 at hci.hj.struts.action.FindAction.execute(FindAction.java:55)
 at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
 at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at hci.hj.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:124)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.ecside.filter.ECSideFilter.doFilter(ECSideFilter.java:188)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
 at java.lang.Thread.run(Thread.java:595)
ERROR - Servlet.service() for servlet action threw exception
java.lang.NullPointerException
 at hci.hj.struts.action.GetfileAction.execute(GetfileAction.java:57)
 at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
 at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at hci.hj.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:124)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.ecside.filter.ECSideFilter.doFilter(ECSideFilter.java:188)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
 at java.lang.Thread.run(Thread.java:595)

 

 

然后刷新几次页面,不出错了,很奇怪

这篇关于关于Hibernate或者java本身文件编码错误的问题?的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/664493

相关文章

在Ubuntu上部署SpringBoot应用的操作步骤

《在Ubuntu上部署SpringBoot应用的操作步骤》随着云计算和容器化技术的普及,Linux服务器已成为部署Web应用程序的主流平台之一,Java作为一种跨平台的编程语言,具有广泛的应用场景,本... 目录一、部署准备二、安装 Java 环境1. 安装 JDK2. 验证 Java 安装三、安装 mys

Springboot的ThreadPoolTaskScheduler线程池轻松搞定15分钟不操作自动取消订单

《Springboot的ThreadPoolTaskScheduler线程池轻松搞定15分钟不操作自动取消订单》:本文主要介绍Springboot的ThreadPoolTaskScheduler线... 目录ThreadPoolTaskScheduler线程池实现15分钟不操作自动取消订单概要1,创建订单后

详谈redis跟数据库的数据同步问题

《详谈redis跟数据库的数据同步问题》文章讨论了在Redis和数据库数据一致性问题上的解决方案,主要比较了先更新Redis缓存再更新数据库和先更新数据库再更新Redis缓存两种方案,文章指出,删除R... 目录一、Redis 数据库数据一致性的解决方案1.1、更新Redis缓存、删除Redis缓存的区别二

oracle数据库索引失效的问题及解决

《oracle数据库索引失效的问题及解决》本文总结了在Oracle数据库中索引失效的一些常见场景,包括使用isnull、isnotnull、!=、、、函数处理、like前置%查询以及范围索引和等值索引... 目录oracle数据库索引失效问题场景环境索引失效情况及验证结论一结论二结论三结论四结论五总结ora

JAVA中整型数组、字符串数组、整型数和字符串 的创建与转换的方法

《JAVA中整型数组、字符串数组、整型数和字符串的创建与转换的方法》本文介绍了Java中字符串、字符数组和整型数组的创建方法,以及它们之间的转换方法,还详细讲解了字符串中的一些常用方法,如index... 目录一、字符串、字符数组和整型数组的创建1、字符串的创建方法1.1 通过引用字符数组来创建字符串1.2

element-ui下拉输入框+resetFields无法回显的问题解决

《element-ui下拉输入框+resetFields无法回显的问题解决》本文主要介绍了在使用ElementUI的下拉输入框时,点击重置按钮后输入框无法回显数据的问题,具有一定的参考价值,感兴趣的... 目录描述原因问题重现解决方案方法一方法二总结描述第一次进入页面,不做任何操作,点击重置按钮,再进行下

SpringCloud集成AlloyDB的示例代码

《SpringCloud集成AlloyDB的示例代码》AlloyDB是GoogleCloud提供的一种高度可扩展、强性能的关系型数据库服务,它兼容PostgreSQL,并提供了更快的查询性能... 目录1.AlloyDBjavascript是什么?AlloyDB 的工作原理2.搭建测试环境3.代码工程1.

Java调用Python代码的几种方法小结

《Java调用Python代码的几种方法小结》Python语言有丰富的系统管理、数据处理、统计类软件包,因此从java应用中调用Python代码的需求很常见、实用,本文介绍几种方法从java调用Pyt... 目录引言Java core使用ProcessBuilder使用Java脚本引擎总结引言python

SpringBoot操作spark处理hdfs文件的操作方法

《SpringBoot操作spark处理hdfs文件的操作方法》本文介绍了如何使用SpringBoot操作Spark处理HDFS文件,包括导入依赖、配置Spark信息、编写Controller和Ser... 目录SpringBoot操作spark处理hdfs文件1、导入依赖2、配置spark信息3、cont

springboot整合 xxl-job及使用步骤

《springboot整合xxl-job及使用步骤》XXL-JOB是一个分布式任务调度平台,用于解决分布式系统中的任务调度和管理问题,文章详细介绍了XXL-JOB的架构,包括调度中心、执行器和Web... 目录一、xxl-job是什么二、使用步骤1. 下载并运行管理端代码2. 访问管理页面,确认是否启动成功