简体   繁体   English

Tomcat7在WEB-INF / lib / lookHere.jar中找不到类

[英]Tomcat7 can't find classes in WEB-INF/lib/lookHere.jar

Very weird problem with Tomcat7. Tomcat7的问题很奇怪。

I migrated some data objects out of my web app and into a jar file. 我将一些数据对象从Web应用程序迁移到了jar文件中。 Everythings works fine when I deploy to tomcat7 on my local development machine. 当我在本地开发计算机上部署到tomcat7时,一切正常。 However, when I try to deploy the same code to test, tomcat cannot find the data object classes that have been migrated to the jar file. 但是,当我尝试部署相同的代码进行测试时,tomcat无法找到已迁移到jar文件的数据对象类。 I don't understand why this is happening. 我不明白为什么会这样。 It's almost as if tomcat is still expecting to find the data object in the web app and therefore isn't even bothering to look in the jar file. 似乎tomcat仍然期望在Web应用程序中找到数据对象,因此甚至不必费心在jar文件中查找。

Does anyone know a way to FORCE tomcat to look in the WEB-INF/lib/lookHere.jar for the class files that it is not finding? 有谁知道一种WEB-INF/lib/lookHere.jar tomcat在WEB-INF/lib/lookHere.jar中查找找不到的类文件的方法?

I've already tried clearing the working directory to no avail. 我已经尝试清除工作目录无济于事。

Here's an example of the kind of errors that I'm getting when I try to invoke a servlet that utilizes one of these data objects: 这是当我尝试调用利用这些数据对象之一的servlet时遇到的那种错误的示例:

Example 1: 范例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>

But the class IS THERE in the jar file ... 但是该类在jar文件中...

com/alpine/data/http/image/postImage/response/PostImageResponse.class

Example 2: 范例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

But the packages AND classes ARE THERE in the jar file !!! 但是包和类都在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

How did you build the classes in the WAR and JAR? 您是如何在WAR和JAR中构建类的? The errors you describe look like a partially failed build. 您描述的错误看起来像是部分失败的构建。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM