eclipse-ee4j / glassfish

Eclipse GlassFish
https://eclipse-ee4j.github.io/glassfish/
386 stars 144 forks source link

Deployment of EAR with Remote EJBs doesn't work #25054

Open chicko12345 opened 3 months ago

chicko12345 commented 3 months ago

Deployment of EAR with Remote EJBs doesn't work

Hello Community,

first of all - thank you for your work. Since the glassfish AS development was moved to Eclipse, the progress is on another level. Kudos to you!

Environment Details


Problem Description

We're trying to migrate our application from glassfish 5.1.0 to the current version (7.0.15) Unfortunately the deployment of our EAR fails because several Remote EJBs cannot be found by the ejb-container. We've tried to track the problem down and found the commit, which has changed the behaviour of the ejb-container in such way, that the deployment fails: Commit HASH: 6fbf8956e02e61911771d9e198ee18cb8383ca15 Commit Message: Fixes generated EJB remote interfaces loading Class com.sun.ejb.codegen.ClassGenerator

Just one code line was replaced by this commit in the method:

private static boolean useMethodHandles(final ClassLoader loader, final Class<?> anchorClass, final String targetPackageName)

old version: return Objects.equals(targetPackageName, anchorClass.getPackageName()); new version: return Objects.equals(anchorClass.getPackage(), loader.getDefinedPackage(targetPackageName));

To be sure, that was the only cause, we've reverted this commit, built the ejb-container locally and the application can be deployed without any further problems.

Our Remote EJB Interfaces and the corresponding implementations are parts of different jars within the EAR. The package names of the Remote EJB Interfaces and their implementation can also differ. The partition is done to provide Remote EJB Interface definitions to other remote service consumer applications in the minimal way.

Kind Regards

avpinchuk commented 3 months ago

Hi, @chicko12345.

Could you please provide the stack traces from the server.log? And, if possible, more information on how to reproduce the problem.

Thanks.