WebSphere + RAD + Taglib

I have a problem developing my application for WebSphere 7. Here's the setup. I have a maven based project consisting of several modules that are developed in RAD 7.5.5.2

One of the modules is a regular web application (war) that uses JSP and relies on taglib.

Taglib itself is another module - a simple Java project with two files, a taglib descriptor and a tag file in META-INF / tags.

When I create a taglib banner and manually copy it to the WEB-INF / lib of the web application, the tag is selected correctly and displayed on the page.

When I deploy the project via RAD - taglib is not selected. The error says:

``` com.ibm.ws.jsp.JspCoreException: JSPG0047E: Unable to locate tag library for uri http://juriy.com/myproject/jsp/my-taglib ``` 

The same tag libraries that are packaged in the JAR and added to WEB-INF / lib work fine.

When I open the WebSphere admin console, I see that the taglib project is recognized by WebSphere. However, it is not packaged as a JAR; instead, the project path is added to the webapp class path. IN

 ``` Troublehooting -> Class Loader Viewer -> Module - com.ibm.ws.classloader.CompoundClassLoader ``` 

I see an entry for my taglib:

 ``` file:/D:/Data/MyProject/UIComponents/target/classes ``` 

In other words, WS doesn't seem to want to pack the project as a JAR during the development cycle, and then it doesn't fit like taglib.

Is there a way to tell RAD (or WebSphere) "Please pack this project as a JAR before adding it to the classpath"? Any alternative way to do this work is also welcome. I can’t manually copy the jar all the time during development - we all want everything to work automatically.

Disclaimer: I am not a WebSphere expert (only a week working with this animal), and I may have missed some obvious settings. Please suggest anything that can solve this problem.

+4
source share
3 answers

As far as I know, RAD is made on the eclipse platform. I know that with maven you can create artifacts that build jar files and put into the local repository. Other modules can reference these banks using the variable M2_REPO . Then you use maven and should use maven eclipse plugins that help integrate maven into eclipse. But consider customizing your project using the project constructor and ant . You can then easily run the ant targets during the build to make your cans before deployment. This method is used not only in the Eclipse IDE, but also in other IDEs. Accomplishing ant goals before or after building a project is an invaluable feature.

0
source

Taglib package as a maven banner and install it in your local .m2 repository. Then specify the dependency in pom for your main project. It will be pulled in for packing. If it is solved for local development, it is probably because workspace resolution is enabled.

In addition, adding cans to WEB-INF / lib in a Maven-based project is not a good practice, since you have bypassed the main goal of maven, which is to control the dependencies needed to create the project.

0
source

Have you tried adding manifest to your WAR?

0
source

Source: https://habr.com/ru/post/1469032/


All Articles