srh
srh

Reputation: 1671

Eclipse: XDoclet Plugin is setting wrong ejb-client-jar in ejb-jar.xml

I am working with an old Enterprise app which uses EJB 2.1. The app was build in 2000s using Eclipse and XDoclet 1.2.3.

The app consist of 1 Enterprise Application Project named AppEar, 1 EJB Project named AppEjb, 1 EJB Client Project named AppEjbClient, 1 Utility Project named AppSrc and 1 Dynamic Web Project named AppWeb.

The ejb-jar.xml is located in ejbModule\META-INF folder of AppEjb project and points to AppEjbClient project by having this entry :

<ejb-client-jar>AppEjbClient.jar</ejb-client-jar>

I upgrade the app to Eclipse Kepler (My workspace is D:\WORK\WORKSPACE-eclipse-jee-kepler). But the issue I am having is XDoclet Plugin is now setting wrong ejb-client-jar in ejb-jar.xml. This is how it is setting now:

<ejb-client-jar>AppSrc.jar</ejb-client-jar>

So somehow the XDcolet plugin is now thinking that AppSrc is the EJB Client Project instead of AppEjbClient.

I investigated a bit and find that the XDcolet plugin runs the ant script tempAnt.xml which is located in .metadata\.plugins\org.eclipse.jst.j2ee.ejb.annotations.xdoclet folder of the workspace. That folder also has a build.properties file which has 2 properties related to the EJB Client Module:

ejb.dd.clientjar=AppSrc.jar
ejb.client.module.src=D:/WORK/WORKSPACE-eclipse-jee-kepler/AppSrc/src

I thought I just need to change them in build.properties file to point to right EJB Client so I change them this way:

ejb.dd.clientjar=AppEjbClient.jar
ejb.client.module.src=D:/WORK/WORKSPACE-eclipse-jee-kepler/AppEjbClient/ejbModule

Save the build.properties file and then do clean and build the whole workspace again.

But still got the same wrong ejb-client-jar in ejb-jar.xml.

Check the build.properties file in .metadata\.plugins\org.eclipse.jst.j2ee.ejb.annotations.xdoclet folder and it was reverted back by removing my changes. So XDoclet Plugin overwrites this file.

How can I fix this so it pick the correct ejb-client-jar in ejb-jar.xml?

Upvotes: 0

Views: 515

Answers (1)

briadeus
briadeus

Reputation: 605

We run in the same issue recently. The way to overcome this was to remove the Utility Project from the eclipse workspace, as dependecies were resolved via maven poms anyway.
After that, the client under Java EE Tools > Remove EJB Client (and thus in ejb.dd.clientjar) was set correctly.
Probably some bug similar to this https://bugs.eclipse.org/bugs/show_bug.cgi?id=122274.

Upvotes: 0

Related Questions