This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Created attachment 131668 [details] Example Project Hello In our company we use an EAR project with a single EJB Container. The EJB project itself is empty. But it has dependencies to to other projects (JAR projects) that include Sessionbeans. We use the Maven Shade plugin to insert these decencies directly inside the jar. So after building the jar with Maven the corresponding jar is not empty anymore. If I pick the EAR and put it into the Glassfish autodeploy folder the projects deploys fine without problems. However if we try to deploy the EAR with Netbeans, the IDE creates a own ejb jar without the depencies included. And because empty EJB container are not allowed the deployment fails. I've created an example project that shows the behavior. If you build die EAR and deploy it self everything works as expected, but if you let Netbeans deploy the application it won't work because the ejb container is empty.
There is an easy workarround (not saying the best one), you just need to create one dummy session bean with dummy method in your EJB module --> decreasing priority to P3 Anyway the proper fix for this can be quite problematic. Even if we finds out whether the EJB contains some SessionBean from shaded modules for example Deploy On Save won't work for such classes. I'll take a deeper look on it during the bug fixing..
Just internal note for myself: Either InitialServerFileDistributor.distribute() or BaseEEModuleImpl.getArchiveContents() should be improved to traverse over the included .jars and look for valid SessionBean there
Thank you for looking into this. Yes I'm aware that this problem could be difficult to solve. But even if you decide not to fix it please think of a way to provide to inform the users that if they use the deploy feature from Netbeans the build might differ from the original Maven build. Maybe some kind of a warning Message if they use the feature for the first time.
Sure, thanks for interesting proposal. I'll think about that as a backup solution (hopefully I'll find a better one :))
I think this bug is more or less the same as this bug I reported a while ago: http://netbeans.org/bugzilla/show_bug.cgi?id=213960
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.