3

I'm trying to run the following unit test in a Maven project using a WebSphere 8.5 embeddable container:

import javax.ejb.embeddable.EJBContainer;

...

private EJBContainer ec;

@Before
public void setUp() {
    final Map<String, Object> properties = new HashMap<String, Object>();

    properties.put(EJBContainer.PROVIDER, "com.ibm.websphere.ejbcontainer.EmbeddableContainerProvider");

    ec = EJBContainer.createEJBContainer(properties);
}

@Test
public void test1(){
...
}

But I'm getting the following exception in the setup method:

CNTR9403E: The embeddable enterprise bean container cannot start multiple modules with the same file name: project1\target\classes and project2\target\classes

Does anybody know how to get around this issue? I searched but couldn't find anything useful.

Edit: I've found the documentation for the exception CNTR9403E here:

http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/index.jsp?topic=%2Fcom.ibm.websphere.messages.doc%2Fcom.ibm.ejs.container.container.html

CNTR9403E: The embeddable enterprise bean container cannot start multiple modules with the same file name: {0} and {1}

Explanation   User code has directed the embeddable container to start multiple modules with the same file name.
Action    Specify a list of modules that does not have duplicate file names, or rename one of the modules with a unique file name.

But I don't see how I can fix this. Is it complaining about the two "classes" directories at the end of the paths? How can I solve this in a Maven multi-module project? Or is it a bug in WebSphere 8.5?

Puce
  • 37,247
  • 13
  • 80
  • 152

1 Answers1

1

Yes, the classes directory name is causing the conflict. There is no workaround for using those directory names, so I would recommend testing the generated .jar instead, though I have no expertise with Maven, so I don't know how feasible that is. This is somewhat unsatisfactory, so you could open a WebSphere RFE to allow properties to be specified to disambiguate.

Brett Kail
  • 33,593
  • 2
  • 85
  • 90