简体   繁体   中英

How do I expose a class from one WAR being referenced by TLD file in another in WebSphere

When I run WebSphere locally, I am getting "Failed to open resource" warnings because an entry in my app.tld file is referencing a base class in another WAR in the same EAR.

I don't have control over deployment, so jar'ing up these class files isn't a good solution for me. The only other feasible solution I can come up with is creating a subclass in my WAR, but due to our source control, I would have to check out all the subclasses manually when the base class changes.

I tried playing with classloader settings with no luck as well. Any suggestions/best practices on how to handle this situation?

The best practice is to put shared classes in a JAR in the lib directory of the EAR. The next best option would be to copy the JAR into both WARs. The final option I would consider is to change the application class loader policy to be "Application" rather than the default "Module" so that all WARs are loaded using the same class loader. See the Class loaders topic in the Knowledge Center for more information.

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