Not sure this is accurate.

The entire webapp itself should be treated as one EjbModule and all jars in 
WEB-INF/lib/ and WEB-INF/classes are part of the same module.

The path of the EjbModule needs to be the same as the WebModule or ejb-link 
functionality will break as will resolving persistence units when there is more 
than one unit with the same name and the module path is used to distinguish 
each.


-David

On Jan 27, 2012, at 3:20 AM, [email protected] wrote:

> Author: rmannibucau
> Date: Fri Jan 27 11:20:06 2012
> New Revision: 1236635
> 
> URL: http://svn.apache.org/viewvc?rev=1236635&view=rev
> Log:
> trying to create the web ejb module from WEB-INF/classes if exists to get DD 
> read
> 
> Modified:
>    
> openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
> 
> Modified: 
> openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
> URL: 
> http://svn.apache.org/viewvc/openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java?rev=1236635&r1=1236634&r2=1236635&view=diff
> ==============================================================================
> --- 
> openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
>  (original)
> +++ 
> openejb/trunk/openejb/container/openejb-core/src/main/java/org/apache/openejb/config/DeploymentLoader.java
>  Fri Jan 27 11:20:06 2012
> @@ -644,8 +644,27 @@ public class DeploymentLoader implements
>         // than an ear file, so the ear-style code we were previously
>         // using doesn't exactly work anymore.
>         //
> +        // EjbModule webEjbModule = new 
> EjbModule(webModule.getClassLoader(), webModule.getModuleId(), 
> webModule.getJarLocation(), null, null);
> +        EjbModule webEjbModule = null;
> +        StringBuilder webInfClassesPath = new StringBuilder(warPath);
> +        if (!warPath.endsWith("/")) {
> +            webInfClassesPath.append("/");
> +        }
> +        webInfClassesPath.append("WEB-INF/classes");
> +        final String webInfClasses = webInfClassesPath.toString();
> +        final File webInfClassesFile = new File(webInfClasses);
> +        if (webInfClassesFile.exists()) {
> +            try {
> +                webEjbModule = 
> createEjbModule(webInfClassesFile.toURI().toURL(), 
> webModule.getJarLocation(), webModule.getClassLoader(), 
> webModule.getModuleId());
> +            } catch (MalformedURLException e) {
> +                logger.error("can't create an ejbmodule with 
> WEB-INF/classes");
> +                // don't throw it we use the next test to initialize the 
> ejbmodule
> +            }
> +        }
> +        if (webEjbModule == null) {
> +            webEjbModule = new EjbModule(webModule.getClassLoader(), 
> webModule.getModuleId(), webModule.getJarLocation(), null, null);
> +        }
> 
> -        EjbModule webEjbModule = new EjbModule(webModule.getClassLoader(), 
> webModule.getModuleId(), webModule.getJarLocation(), null, null);
>         webEjbModule.getAltDDs().putAll(webModule.getAltDDs());
>         appModule.getEjbModules().add(webEjbModule);
> 
> 
> 
> 

Reply via email to