gpt4 book ai didi

java - 在 Tomcat 5 上部署 .war 时出现问题(空指针异常)

转载 作者:行者123 更新时间:2023-11-28 22:45:26 26 4
gpt4 key购买 nike

我准备了 .war 文件并将其部署到我的 topmcat 服务器上,但是 servlet 有问题。

每个人通常遇到的问题是 ClassNotFoundException,但这个问题是 NullPointerException,我找不到原因。感谢您的帮助。

我用的是jdk 1.5,我的项目是GWT 2.3.0,tomcat是Tomcat 5。

Properties.java 的第 365 行是 inLimit = inStream.read(inBuf); 其中 inStream(InputStream) 是类构造函数的输入参数 行阅读器。异常是从方法 readLine() 中抛出的。

这是堆栈跟踪:

- Marking servlet generalService as unavailable
- Allocate exception for servlet generalService
java.lang.NullPointerException
at java.util.Properties$LineReader.readLine(Properties.java:365)
at java.util.Properties.load(Properties.java:293)
at com.cs.eyeks.gwt.core.EyeksGwtConf.<init>(EyeksGwtConf.java:17)
at com.cs.eyeks.gwt.core.EyeksGwtConf.getConfiguration(EyeksGwtConf.java
:29)
at com.cs.eyeks.gwt.EyeksGwtRemoteServiceServlet.<init>(EyeksGwtRemoteSe
rviceServlet.java:28)
at tr.gov.gib.mhdb.vimer.vimerapp.server.GeneralServiceImpl.<init>(Gener
alServiceImpl.java:64)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:501)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:1089)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.jav
a:791)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:127)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:870)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p
rocessConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
int.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol
lowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:685)
at java.lang.Thread.run(Thread.java:595)

最佳答案

EyeksGwtConf.java,第 17 行尝试加载一个不存在的配置文件,或者 Properties 的文件名是空的。

关于java - 在 Tomcat 5 上部署 .war 时出现问题(空指针异常),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6729661/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com