`
isiqi
  • 浏览: 16600746 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

关于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)

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

分享到:
评论

相关推荐

    Hibernatetools编码格式的问题

    5. **文件编码**:检查Hibernate Tools处理的文件,如.hbm.xml映射文件或数据库脚本,确保它们都是UTF-8编码。 6. **运行环境**:在部署和运行应用时,确保运行环境(如Tomcat或Jetty)也支持UTF-8编码。 在解决这...

    java 饮食文化的资源

    10. **MyDay.java**:这可能是项目中的一个源代码文件,可能是一个简单的日程管理类或者代表开发者每天编程的习惯。 11. **Java.jpg**:这个文件可能是Java语言相关的图形或logo,可能用于教学、展示或作为项目标识...

    java试题(Hibernate,j2ee )

    错误** — ApplicationResources.properties 是一个资源文件本身,而不是用来引用其他资源文件的地方。 - **c. 正确** — Struts-config.xml 文件中可以添加对资源文件的引用。 - **d. 错误** — Application...

    JAVA错误处理大集合

    本文将详细介绍一系列常见的Java错误及其处理方法,帮助开发者更好地理解和解决这些问题。 #### 异常概述 在Java中,异常是程序运行时发生的错误或意外情况的一种特殊类型。它们可以被分类为两大类:检查性异常...

    Hibernate_MySQL中文乱码问题.doc

    在使用Hibernate框架进行Java应用程序开发的过程中,尤其是在连接MySQL数据库时,经常会遇到中文显示乱码的问题。这一问题通常发生在从数据库读取或向数据库写入中文数据时。中文乱码不仅影响用户体验,还可能导致...

    Struts+Hibernate+MyEclipse+Tomcat+MySQL的乱码之解决

    在开发Java Web应用程序时,经常会遇到编码问题,尤其是在使用Struts、Hibernate、MyEclipse、Tomcat和MySQL等技术栈时。这个问题主要涉及到各种组件之间的编码一致性,以及数据的正确转换。本文将针对这些技术的...

    java 实训报告

    在Java中,可以使用JDBC(Java Database Connectivity)来访问数据库,或者使用ORM(Object-Relational Mapping)框架如Hibernate、MyBatis等简化数据库操作。虽然时钟动画项目本身并未涉及复杂的数据库交互,但掌握...

    Java学习材料(499篇文章)

    2. **异常处理**:Java中的异常处理是程序错误管理的关键部分,它允许程序员优雅地处理可能出现的问题,避免程序突然终止。 3. **集合框架**:Java集合框架包括接口(如List、Set、Map)和实现这些接口的类(如...

    ssh(structs,spring,hibernate)框架中的上传下载

    Tfile的Hibernate映射文件Tfile.hbm.xml放在Tfile .java类文件的相同目录下:  代码 2 领域对象映射文件 1. <?xml version="1.0"?> 2. !DOCTYPE hibernate-mapping PUBLIC 3. "-//Hibernate/Hibernate Mapping ...

    Java 使用注解拼接SQL语句

    综上所述,使用Java自定义注解来拼接SQL语句是一种高效且灵活的编程方式,它可以提高代码的可读性和可维护性,同时减少错误的可能性。然而,也需要权衡其带来的性能影响,并遵循最佳实践来确保代码的质量和安全。

    Hibernate笔试题加答案

    下面关于Hibernate的说法,错误的是(C) **选项解析:** - **A)** Hibernate是一个“对象-关系映射”的实现:这是正确的,Hibernate通过ORM技术将Java对象映射到关系型数据库表中。 - **B)** Hibernate是一种数据...

    java成神之路思维导图——Hollis.zip

    14. **算法与数据结构**:虽然不是Java语言本身的内容,但它是任何编程语言的基石,对于提升编程能力至关重要。 15. **最佳实践与规范**:理解编码规范,如Google Java Style Guide,以及如何编写高质量的代码。 ...

    专题之java实习报告.pdf

    1. Java基础:Java语言本身是本次实习报告的核心内容,涵盖了Java的基本语法和基本概念。Java是一种广泛使用的面向对象的编程语言,以其平台独立性而闻名。 2. Java SE(Standard Edition):Java SE是Java的基础...

    Struts、Spring、Hibernate三大框架的原理和优点

    通过这种方式,对象之间的依赖关系不再是硬编码的,而是通过配置文件或者注解动态设置。这种方式降低了组件间的耦合度,提高了代码的可测试性和可复用性。 - **面向切面编程(AOP)**:Spring支持AOP,使得可以在不...

    Java经典入门教程

    Java程序既可以在开发平台中创建,也可以在安装了JRE的环境中运行,这意味着Java程序的部署依赖于Java平台本身。 #### 二、Java的应用领域 **2.1 桌面级应用** - **定义与特征**:桌面级应用是指运行在用户本地...

    java程序员必须掌握的基础知识

    作为一名合格的Java程序员,除了精通Java本身外,还需要具备一定的广度知识。这包括但不限于数据库操作(如SQL查询)、常用开源框架(如Spring、Hibernate)的使用、Web服务器配置(如Tomcat、Jetty)等。此外,熟悉...

    深入体验Java Web项目开发

    1. Java Web技术栈:Java Web项目开发涉及的技术范围通常包括Java语言本身、Servlet/JSP技术、Java数据库连接(JDBC)、以及支持Web应用的框架技术,比如Spring和Hibernate等。本书可能包含了这些技术的深入介绍和...

    选修课程管理系统V1.2.3-JAVA代码

    这个文件名没有提供关于系统本身的详细信息,但暗示了在压缩包内可能包含源代码、数据库配置文件、文档、测试数据等相关资源。 综合以上信息,这个选修课程管理系统可能包含以下关键知识点: 1. **Java编程**:...

    华为安全编码规范考试.md

    - **知识点**:解压 ZIP 文件时,除了判断和限制文件本身的大小外,还应注意其他安全措施。 - **解释**:例如,检查 ZIP 文件中的路径操纵尝试,以及限制提取的文件和目录数量。 #### 函数返回值处理 - **知识点**...

    Java面试题

    5. ssh框架:指的是Struts、Spring和Hibernate,这是Java企业级应用开发中常用的框架,它们分别处理MVC设计模式、依赖注入、持久化操作。 6. Java基础知识点: - 一个".java"文件中可以包含多个类,但只能有一个...

Global site tag (gtag.js) - Google Analytics