0

Tomcat7的非常奇怪的问题。

我将一些数据对象从我的网络应用程序中迁移到一个 jar 文件中。当我在本地开发机器上部署到 tomcat7 时,一切工作正常。但是,当我尝试部署相同的代码进行测试时,tomcat找不到已经迁移到jar文件的数据对象类。我不明白为什么会这样。就好像 tomcat 仍然期望在 Web 应用程序中找到数据对象,因此甚至不费心去查看 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
4

1 回答 1

1

您是如何在 WAR 和 JAR 中构建类的?您描述的错误看起来像是部分失败的构建。

于 2013-09-03T18:55:49.127 回答