[
https://issues.apache.org/jira/browse/OPENEJB-1330?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Thorsten Wärtel updated OPENEJB-1330:
-------------------------------------
Affects Version/s: 4.0-beta-1
3.1.4
This still does not work for me. If there are two Modules with
META-INF/application-client.xml on the classpath, OpenEJB 3.1.4 will raise a
NameAlreadyBoundException, if both Modules contain @LocalClient annotated
classes.
OpenEJB 4.0.0-beta-1 does not raise a NameAlreadyBoundException anymore, but
still fails to perform local client injection (injection targets are still
null). This only happens in 4.0.0-beta-1, if two application-client.xml are on
the classpath. Local client injection works fine, if only one
application-client.xml is on the classpath.
I will try to create an example project that shows this bug and upload it later
this week.
> providing id in application-client.xml has no effect on local client module
> name
> --------------------------------------------------------------------------------
>
> Key: OPENEJB-1330
> URL: https://issues.apache.org/jira/browse/OPENEJB-1330
> Project: OpenEJB
> Issue Type: Bug
> Components: configuration
> Affects Versions: 3.1.2, 3.1.4, 4.0-beta-1
> Reporter: Thorsten Wärtel
> Attachments: AppInfoBuilder.java.patch
>
>
> Some weeks ago, a problem with duplicate local client module names was posted
> on the openejb-users mailing list:
> http://openejb.979440.n4.nabble.com/OpenEJB-localclient-module-name-td2238205.html
> I am having the same problem in the following scenario:
> - multi-module project
> - module-a tests do local client injection, so there is an
> application-client.xml present in module-a/target/test-classes/META-INF
> - module-a builds an attached test-jar
> - module-b has a dependency on module-a's test-jar
> - module-b also does local client injection
> If I run tests in this project from command line, everything works fine in
> module-b: LocalClients from module-a are deployed with a local client module
> name of "module-a-1.0.0-SNAPSHOT-tests" and LocalClients from module-b use
> module name "test-classes".
> However, if I run tests in eclipse (using m2eclipse 0.10.2), a
> NameAlreadyBoundException is raised because LocalClients from module-a are
> already bound using alocal client module name of "test-classes", so
> module-b's LocalClients try to bind under the same name.
> The first reply on the mailing list hints that using a unique id attribute in
> application-client.xml would prevent this, but unfortunately this does not
> work in 3.1.2 (and current 3.1.3-SNAPSHOT).
> Doing some debugging, I found out that the id attribute is correctly set into
> class ApplicationClient when reading application-client.xml and also
> correctly passed on to class ClientModule. But I think there might be an
> error in AppInfoBuilder.getClientModuleId(ClientModule), where a module id is
> determined from ClientModule.getJarLocation() instead
> ClientModule.getModuleId(). The moduleId is already set to jarLocation in
> ClientModule, if no explicit id is provided. Changing getClientModuleId() to
> use getModuleId() did the trick for me, application-client.xml ids are now
> used as local client module names and there is no NameAlreadyBoundException
> raised anymore.
> I will attach a patch containing the change I made.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira