1

I'm working on an existing project that was recently converted to use Maven. It's a multi-module EAR project for Websphere Application Server 7.0.

Our current development environment is Eclipse Juno with the latest versions of m2e-wtp plugin and Websphere 7.0 Development Tools from the marketplace.

We want to be able to use Eclipse for debugging and testing on a Websphere server running locally, so we've been trying to use the m2e-wtp plugin to take advantage of Eclipse features. We've been dealing with all sorts of problems getting this to work, but I have one issue I'm struggling to deal with in particular right now.

The projects in our workspace are targeted to the Websphere Application Server server runtime. This gives the project access to the Websphere runtime libraries. Also, in the Project Explorer view, there is a container inside the project labeled "Websphere Application Server 7.0". If you expand that container, it displays the jars in the libraries.

Now comes the tricky part. As soon as you enable the Maven nature on the project, that Websphere Application Server container in the project is empty. We start getting errors from missing classes from the runtime libraries, so we know that the projects no longer have access to the jars from the library.

The maven builds work fine, and we can load the generated EAR through the server's administrative console and it runs, but we would have to debug manually with server logs. We've tried various combinations of versions of Websphere tools, m2e, and Eclipse. I didn't have this issue working with an earlier version of the Websphere tools, but it wasn't fully compatible with the most recent version of the m2e plugin. But we need the most recent version of the m2e plugin to configure the Eclipse projects correctly, it seems. If the projects aren't configured correctly Eclipse can't load it on the server for testing/debugging.

Is there somewhere I can configure the server runtime library manually? So far the best I can do is just add the required jars directly to the classpath. As soon as I remove the Maven nature, it goes back to normal. But of course we no longer have the Maven dependencies.

1 Answer 1

1

We've encountered similar issues at my place of work. We just ended up adding the following maven dependency:

<dependency>
    <groupId>javaee</groupId>
    <artifactId>javaee-api</artifactId>
    <version>5</version>
    <scope>provided</scope>
</dependency>

Obviously this is not exactly the solution you're looking for, but I have my suspicions that there is a bug that exists between the Maven plugin and Eclipse. The real solution will hopefully come from this bug entry: https://bugs.eclipse.org/bugs/show_bug.cgi?id=443148.

Addendum to the above

We've still encountered issues after adding the above dependency. It might be best to stick with the maven CLI plugin until this issue is addressed. It's disappointing to see such a critical issue with the Eclipse plugin.

1
  • No, that doesn't solve my issue. But it does give me an idea of where to look for a solution. We did have to add dependencies for the j2ee and the websphere runtime, maybe there is another dependency I need to add to add for the additional plugin libraries we are missing. Thanks for the input.
    – Archa5238
    Sep 22, 2014 at 21:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.