简体   繁体   中英

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

Very weird problem with Tomcat7.

I migrated some data objects out of my web app and into a jar file. Everythings works fine when I deploy to tomcat7 on my local development machine. 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. 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.

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?

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:

Example 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 ...

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

Example 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 !!!

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? The errors you describe look like a partially failed build.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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