Search code examples
eclipsemavenejbwebsphere

Websphere can't load EJB interface with eclipse hot-deploy


Try compose ear with maven and deploy it to WebSphere AS with eclipse. My ear has next structure:

test-ejb-ear.ear
|
+-test-ejb.jar
|
+lib
-|
-+-test-ejb-interface.jar

It works ok when I deploy it using admin console. But when I'm using eclipse hot-deploy it generates next exception

CWMDF0015E: The class loader cannot load the ru.test.EjbInterface on ru.test.EjbInterfaceImpl Enterprise JavaBeans (EJB) file

What can I do? Using Eclipse Mars with WAS 8.5.5.5.

ejb-plugin of test-ejb

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-ejb-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <ejbVersion>3.1</ejbVersion>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>

ear-plugin of test-ejb-ear:

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-ear-plugin</artifactId>
                <version>2.8</version>
                <configuration>
                    <defaultLibBundleDir>lib/</defaultLibBundleDir>
                    <skinnyWars>true</skinnyWars>
                    <version>6</version>
                    <modules>
                        <ejbModule>
                            <groupId>ru.test.ejb</groupId>
                            <artifactId>test-ejb</artifactId>
                        </ejbModule>
                    </modules>
                </configuration>
            </plugin>
        </plugins>
    </build>

Solution

  • Solved by changing version of maven-ear-plugin to 2.10 and changing defaultLibBundleDir to 'lib'

    <build>
            <plugins>
                <plugin>
                    <artifactId>maven-ear-plugin</artifactId>
                    <version>2.10</version>
                    <configuration>
                        <defaultLibBundleDir>lib</defaultLibBundleDir>
                        <skinnyWars>true</skinnyWars>
                        <version>6</version>
                        <modules>
                            <ejbModule>
                                <groupId>ru.test.ejb</groupId>
                                <artifactId>test-ejb</artifactId>
                            </ejbModule>
                        </modules>
                    </configuration>
                </plugin>
            </plugins>
        </build>