我有一个使用myfaces,Ajax和Javascript的Web应用程序。我已成功将其部署在Tomcat 6.x中。
现在,当我尝试单击应用程序中的一个链接时,它会在Tomcat日志中显示以下堆栈跟踪“发生服务器错误”。
我真的不明白这个错误是什么。但我可以看到它说它无法在库中找到一些文件(未知来源)。
但是我已经仔细检查了一下,我在那个jar文件中找到了所有文件。
任何帮助都将不胜感激。
2014-08-01 13:57:10,305 [http-9999-4] ERROR com.milan.products.tchart.dao.survey.cn.RailProfileDAO - Error occured while reading for left/right profile records
java.lang.IllegalArgumentException: Can't read rail profile file(s) C:\Installs\eclipse\ws\TrackIT\docroot\railprofile\049\2014050602\2014050602049.rpi C:\Installs\eclipse\ws\TrackIT\docroot\railprofile\049\2014050602\2014050602049.rpd!
at com.milan.libraries.RailProfileUtils.file.AbstractRpFile.getDataFileHeader(Unknown Source)
at com.milan.libraries.RailProfileUtils.file.AbstractRpFile.getFileVersion(Unknown Source)
at com.milan.libraries.RailProfileUtils.file.RpFileFactory.getRpFile(Unknown Source)
at com.milan.libraries.RailProfileUtils.file.RpFileFactory.getRpFile(Unknown Source)
at com.milan.products.tchart.dao.survey.cn.RailProfileDAO.getChannelData(RailProfileDAO.java:125)
at com.milan.products.tchart.channel.AbstractTrackChartChannel.getChannelData(AbstractTrackChartChannel.java:112)
at com.milan.products.tchart.composer.AbstractTrackChartComposer.populateTrackChartWithChannelFeatures(AbstractTrackChartComposer.java:90)
at com.milan.products.tchart.composer.AbstractTrackChartComposer.drawTrackChart(AbstractTrackChartComposer.java:59)
at com.milan.products.tchart.facade.TrackITTrackChartFacade.createChart(TrackITTrackChartFacade.java:225)
at com.milan.products.trackit.tchart.business.service.impl.ChartService.getCharts(ChartService.java:151)
at com.milan.products.trackit.ui.handler.XYChartImageHandler.createChart(XYChartImageHandler.java:102)
at com.milan.products.trackit.ui.handler.XYChartImageHandler.search(XYChartImageHandler.java:61)
at com.milan.products.trackit.common.ui.listener.ImageTabChangeListener.processTabChange(ImageTabChangeListener.java:55)
at org.apache.myfaces.custom.tabbedpane.TabChangeEvent.processListener(TabChangeEvent.java:63)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:554)
at org.apache.myfaces.custom.tabbedpane.AbstractHtmlPanelTabbedPane.broadcast(AbstractHtmlPanelTabbedPane.java:206)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
at org.ajax4jsf.framework.ajax.JsfOneOneInvoker.invokeOnRegionOrRoot(JsfOneOneInvoker.java:62)
at org.ajax4jsf.framework.ajax.AjaxContext.invokeOnRegionOrRoot(AjaxContext.java:176)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.processDecodes(AjaxViewRoot.java:267)
at org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(ApplyRequestValuesExecutor.java:32)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:151)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:301)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.milan.products.trackit.common.security.SecurityFilter.doFilter(SecurityFilter.java:107)
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:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
at java.lang.Thread.run(Thread.java:662)
答案 0 :(得分:0)
你是怎么做罐子的?服务器可能不是在jar中查找这些文件,而是在文件系统中查找。错误中的路径不是相对路径,而是指向计算机上特定位置的特定路径。
java.lang.IllegalArgumentException: Can't read rail profile file(s) C:\Installs\eclipse\ws\TrackIT\docroot\railprofile\049\2014050602\2014050602049.rpi C:\Installs\eclipse\ws\TrackIT\docroot\railprofile\049\2014050602\2014050602049.rpd!
另外有趣的是,它在eclipse中查找文档,我想这是你正在使用的IDE。检查您的代码,看看您是否在某个地方对此路径进行了硬编码,如果是,您可能需要尝试将其更改为相对路径(类似\TrackIT\docroot\railprofile\049\2014050602\2014050602049.rpd
)。