[英]Tomcat can't access jar library referenced by my library in WEB-INF/lib
[英]Tomcat7 can't find classes in WEB-INF/lib/lookHere.jar
Tomcat7的问题很奇怪。
我将一些数据对象从Web应用程序迁移到了jar文件中。 当我在本地开发计算机上部署到tomcat7时,一切正常。 但是,当我尝试部署相同的代码进行测试时,tomcat无法找到已迁移到jar文件的数据对象类。 我不明白为什么会这样。 似乎tomcat仍然期望在Web应用程序中找到数据对象,因此甚至不必费心在jar文件中查找。
有谁知道一种WEB-INF/lib/lookHere.jar
tomcat在WEB-INF/lib/lookHere.jar
中查找找不到的类文件的方法?
我已经尝试清除工作目录无济于事。
这是当我尝试调用利用这些数据对象之一的servlet时遇到的那种错误的示例:
范例1:
root cause
java.lang.Error: Unresolved compilation problems:
The import com.alpine.data.http.image cannot be resolved
PostImageResponse cannot be resolved to a type
PostImageResponse cannot be resolved to a type</pre>
但是该类在jar文件中...
com/alpine/data/http/image/postImage/response/PostImageResponse.class
范例2:
java.lang.Error: Unresolved compilation problems:
The import com.alpine.data.http.gas.getStation cannot be resolved
The import com.alpine.data.http.message cannot be resolved
The import com.alpine.data.http.postDevicelogentries2 cannot be resolved
GetMessagesResponseRecord cannot be resolved to a type
The method getMessages(String, String, String, String) from the type MessageManager refers to the missing type GetMessagesResponseRecord
但是包和类都在jar文件中!
com/alpine/data/http/gas/getStations/
com/alpine/data/http/message/
com/alpine/data/http/postDevicelogentries2/
com/alpine/data/http/postDevicelogentries2/request/DeviceLogEntry2.class
com/alpine/data/http/message/getMessage/response/GetMessagesResponseRecord.class
您是如何在WAR和JAR中构建类的? 您描述的错误看起来像是部分失败的构建。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.