Question

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

One the modules is a plain web application (war) that uses JSPs and relies on a taglib.

Taglib itself is the other module - plain java project with just two files, the taglib descriptor and tag file under META-INF/tags.

When I build the taglib jar and manually copy it to WEB-INF/lib of a web application the tag is picked correctly and rendered on the page.

When I deploy project via RAD - the taglib is not picked up. 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 library packaged as JAR and added to WEB-INF/lib works perfectly.

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

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

I see the entry for my taglib:

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

In other words it looks like WS doesn't care to package a project as JAR during development cycle and then it is not picked up as a taglib.

Is there a way to tell RAD (or WebSphere) "Please package this project as JAR before you add it to the classpath"? Any alternative way to make this setup work is also appreciated. I cannot copy jar manually all the time during development - we all want things to work automatically.

Disclaimer: I'm not a WebSphere expert (only a week working with this beast) and I might have missed some obvious settings. Please suggest whatever might solve this issue.

No correct solution

OTHER TIPS

As far as I know RAD is made on eclipse platform. I know that with maven you can create artifacts that builds jar files and placed into the local repository. Other modules could reference that jars via M2_REPO variable. Then you stick with maven and have to use maven plugins to eclipse that help to integrate maven into eclipse. But consider the option to configure your project with project builder and ant. Then you could easily run ant targets upon build to make your jars before the deployment. This technique is used not only in eclipse IDE but other IDEs. Running ant targets before or after project build is invaluable feature.

Package your taglib as a maven jar and install it to your local .m2 repository. Then reference the dependency in the pom for your main project. It will be pulled in for packaging. If it is relsolving for local development it is probably because workspace resolution is turned on.

Also, adding jars to the WEB-INF/lib in a Maven based project is not best practice as you have circumvented the main purpose of maven which is to control the dependencies required to build a project.

Did you try to add manifest to your WAR?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top