It might work but I have never tried it before though. To solve your current runtime problem, you will need to use "wrap" to install xerces jar as it is a plain jar but not a bundle:
osgi/install -s wrap:mvn:xerces/xercesImpl/2.4.0
It would allow the created xerces bundle to export "org.apache.xerces.jaxp" package.
Give it a try to see how far it goes.
I tryed this but I'm still get the same error
ERROR CommandLineExecutionFailed:org.apache.geronimo.gshell.command.CommandException: javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found
I also added felix.log.level=4 but nothing else is logged.
I have verifyed that the org.apache.xerces.jaxp.DocumentBuilderFactoryImpl exist in the xerces.jar.
To verify that the created xerces bundle does export "org.apache.xerces.jaxp" package, you will need to use below command:
smx@root:/> packages/exports | grep org.apache.xerces.jaxp
If the package was indeed exported by xerces bundle that you just installed, then it means that one of your EJB client jars needs to "import" the package.
So you might want to try to convert the jars to OSGI bundles yourself using "bnd" tool (http://www.aqute.biz/Code/Bnd) instead of using "wrap" protocol to add the package "org.apache.xerces.jaxp" into "Import-Package" header of MANIFEST.MF file of the EJB client bundle then.
Was wondering if you ever got around to solving your issue with EJB2.x, as I have the same need and would love to hear what solution did you use to invoke EJB2.x from OSGi service in Felix container (SMX-FUSE-4.4.1).