Hi All,


I’ve been dealing with a perplexing issue for some weeks now. I’m running karaf 4.1.1 with a client bundle deployed that I would like to communicate via rmi using java serialization / deserialization with an EJB2 container, namely weblogic 10.3.6.


The ejb container has two jars deployed timesheet-ejb.jar and common.jar as part of a EAR. I have packaged these jars in addition to the wlclient.jar for 10.3.6 as embedded dependencies in my bundle see the following client bundle manifest:


Manifest-Version: 1.0
Bnd-LastModified: 1500856210705
Build-Jdk: 1.8.0_131
Built-By: mshaw
Bundle-ClassPath: .,common-5.0.0.jar,timesheet-ejb-5.0.0.jar,wlclient-10
Bundle-ManifestVersion: 2
Bundle-Name: legacywrapper
Bundle-SymbolicName: au.gov.qld.ambulance.tams.legacywrapper
Bundle-Version: 0.0.1.SNAPSHOT
Created-By: Apache Maven Bundle Plugin
Embed-Dependency: common|timesheet-ejb|wlclient;scope=compile|runtime
Embedded-Artifacts: common-5.0.0.jar;g="au.gov.qld.des.aftimesheet";a="c
Export-Package: au.gov.qld.ambulance.services.legacywrapper;version="0.0
Import-Package: javax.rmi.CORBA,org.omg.CORBA,org.omg.CORBA.portable,org
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
Service-Component: OSGI-INF/au.gov.qld.ambulance.services.legacywrapper.
Tool: Bnd-


The jars on both client and server are exactly the same. There is a session fašade in the timesheet-ejb.jar called TimesheetSessionFacade which I am calling the method getTimesheet(id) throws AFTimesheetException, remotely. I am making this call via apache camel and declarative services in my bundle. Here is the service which makes the call:


@Service(value = IeTimesheetEJB2Bean.class)
@Component(immediate = true)
public class eTimesheetEJB2Bean implements IeTimesheetEJB2Bean {

public static final String COMPONENT_LABEL = "au.gov.qld.ambulance.services.legacywrapper.eTimesheetEJB2Bean";
public static final String COMPONENT_DESCRIPTION = "The eTimesheet EJB remote invocation";

public String mediate(Integer eTimesheetId) {

        Hashtable env =
new Hashtable();
INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
PROVIDER_URL, "t3://poldesaps02:5013");

        Context ic =
try {
            ic =
new InitialContext(env);
return marshallTimesheetToJSON(ic ,getTimesheet(ic, eTimesheetId));

catch (NamingException e) {
throw new RuntimeException(e);


public TimesheetTransferObject getTimesheet (Context ic, Integer eTimesheetId) {
        Object homeObject =

try {
            homeObject = ic.lookup(TimesheetSessionFacadeHome.
catch (NamingException e) {
throw new RuntimeException(e);

        TimesheetSessionFacadeHome home = (TimesheetSessionFacadeHome) PortableRemoteObject.narrow(homeObject, TimesheetSessionFacadeHome.

        TimesheetSessionFacade remote =
try {
            remote = (TimesheetSessionFacade) PortableRemoteObject.narrow(home.create(), TimesheetSessionFacade.
            TimesheetTransferObject result = remote.getTimesheet(eTimesheetId);
//            TimesheetTransferObject result = new TimesheetTransferObject();

return result;
catch (ClassCastException e) {
throw new RuntimeException(e);
catch (RemoteException e) {
throw new RuntimeException(e);
catch (CreateException e) {
throw new RuntimeException(e);
catch (AFTimesheetException e) {
throw new RuntimeException(e);



Everything works fine when I retrieve a valid timesheet. However if I force the server to throw a TimesheetNotFoundException by passing an invalid Id, the server throws the following corba error:


org.omg.CORBA.BAD_PARAM: Could not find FVD class for: RMI:au.gov.qld.des.aftimesheet.exception.TimesheetNotFoundException:7CF87A9F87EF5638:00000000000003E8  vmcid: 0x0  minor code: 0  completed: No


The TimesheetNotFoundException is in the common.jar on the server. Both the common.jar and timesheet-ejb.jar are deployed as one app in an EAR file on the server. I am assuming this is a classloading problem on my client side.


I’ve tried all sorts of bundle deployment options on my client to no avail, such as deploying the server jars on the karaf system classpath, etc. I thought embedding the server jars into my bundle was the more sound approach as then they would all share the same classloader as the bundle.


The only other thing I can think of at the moment is removing apache camel from the equation and see if that works. I’ve re-read up on classloading in osgi versus weblogic/j2ee to try and find some answers but I am at a loss at the moment. If anyone has any insight into this I would greatly appreciate your assistance.


One other thing I have noticed is that karaf has a completely separate RMI thread running for the JMX functionality it provides. Could this be confusing things as I am using jndi to lookup the remote EJB?










This email, including any attachments sent with it, is confidential and for the sole use of the intended recipient(s). This confidentiality is not waived or lost, if you receive it and you are not the intended recipient(s), or if it is transmitted/received in error.

Any unauthorised use, alteration, disclosure, distribution or review of this email is strictly prohibited. The information contained in this email, including any attachment sent with it, may be subject to a statutory duty of confidentiality if it relates to health service matters.

If you are not the intended recipient(s), or if you have received this email in error, you are asked to immediately notify the sender. You should also delete this email, and any copies, from your computer system network and destroy any hard copies produced.

If not an intended recipient of this email, you must not copy, distribute or take any action(s) that relies on it; any form of disclosure, modification, distribution and/or publication of this email is also prohibited.

Although the Queensland Ambulance Service takes all reasonable steps to ensure this email does not contain malicious software, the Queensland Ambulance Service does not accept responsibility for the consequences if any person's computer inadvertently suffers any disruption to services, loss of information, harm or is infected with a virus, other malicious computer programme or code that may occur as a consequence of receiving this email.

Unless stated otherwise, this email represents only the views of the sender and not the views of the Queensland Government.


The content presented in this publication is distributed by the Queensland Government as an information source only. The State of Queensland makes no statements, representations or warranties about the accuracy, completeness or reliability of any information contained in this publication. The State of Queensland disclaims all responsibility and all liability (including without limitation for liability in negligence) for all expenses, losses, damages and costs you might incur as a result of the information being inaccurate or incomplete in any way, and for any reason reliance was placed on such information.