WebSphere 8.5 Unit Testing and Embeddable Container
I am trying to run the following unit test on a Maven project using the 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 in the install method I am getting the following exception:
CNTR9403E: Embedded enterprise container bean cannot run multiple modules with the same filename: project1 \ target \ classes and project2 \ target \ classes
Does anyone know how to get around this issue? I searched but didn't find anything useful.
Edit: I found the documentation for the CNTR9403E exception here:
CNTR9403E: Embedded Enterprise container bean cannot run multiple modules with the same filename: {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 understand how I can fix this. Does it complain about the two "class" directories at the end of the paths? How can I solve this problem in a multi-module Maven project? Or is this a bug in WebSphere 8.5?
source to share
Yes, the directory name classes
is in conflict. There is no workaround for using these directory names, so I would recommend testing the generated one .jar
instead, although I have no experience with Maven so I don't know how possible this is. This is somewhat unsatisfactory, so you can open WebSphere RFE to resolve properties to disambiguate.
source to share