Hi,
I'm trying to create an OSGi bundle from an existing ear-file in order to
deploy the ear-file as an OSGi bundle in Payara (that "internally" uses Felix
as its OSGi env). To do this I'm using maven-bundle-plugin (version 4.2.1 if
that matters).
The problem I'm facing is that when deploying, Payara can't seem to find any
valid EJBs in the bundle and thus fails to deploy the bundle correctly (it gets
installed, in OSGi-terms, correctly but does not deploy, in Java EE terms,
correctly). This is obviously not the fault of maven-bundle-plugin but I
suspect that I'm not using the instructions correctly to build my ear-file.
This is what I'm attempting:
Using maven-ear-plugin to build/assemble the ear file (this is what we've
always done).
Using maven-bundle-plugin to generate a proper Manifest file and using that
manifest as the manifest of the ear file.
Now, the reason I'm asking about this on this mail list is because
maven-bundle-plugin generates a warning:
[WARNING] Manifest se.conciliate:MTServer-EAR:ear:5.2-u2 : Classes found in the
wrong directory:
{WEB-INF/classes/se/conciliate/mt/web/ClientCallImpl.class=se.conciliate.mt.web.ClientCallImpl
[...lots of more classes]}
I suspect that this leads to maven-bundle-plugin not recognizing the classes
correctly and thus not generating a proper class-path or correct import/export
package instructions.
Here is the configuration I'm using for maven-bundle-plugin
<configuration>
<supportedProjectTypes>
<supportedProjectType>bundle</supportedProjectType>
<supportedProjectType>jar</supportedProjectType>
<supportedProjectType>war</supportedProjectType>
<supportedProjectType>ejb</supportedProjectType>
<supportedProjectType>ear</supportedProjectType>
</supportedProjectTypes>
<instructions>
<Private-Package/>
<Export-Package/>
<Import-Package>*</Import-Package>
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
<Bundle-ClassPath>.</Bundle-ClassPath>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Name>${project.name}</Bundle-Name>
<Export-EJB>ALL</Export-EJB>
</instructions>
</configuration>
The ear-file contains a war file that in turn contains JAX-RS classes and an
"embedded" ejb.jar with classes for entity java beans.
Has anyone gotten something like this working? An EAR-file with an OSGi
manifest successfully deployed to Payara/Glassfish.
I've also asked about this over at Payara (as a more general question about how
to deploy OSGi bundles to Payara) but none of the answers has helped me resolve
this issue, which is why I'm trying here too.
Best Regards,
Per-Erik Svensson