-
1. Re: Injecting EJB into cxfse service impl...
ffang Sep 30, 2010 6:16 AM (in response to yusuf.jakoet)Hi,
I think you need import-package javax.ejb in the pom.xml for your cxf-se bundle.
Freeman
-
2. Re: Injecting EJB into cxfse service impl...
yusuf.jakoet Sep 30, 2010 6:33 AM (in response to ffang)That's the thing, it's already there. And if I do a manual lookup in code then it works. For some reason the spring config doesn't...
-
3. Re: Injecting EJB into cxfse service impl...
yusuf.jakoet Sep 30, 2010 7:06 AM (in response to yusuf.jakoet)A couple of questions:
a) Would it be possible to deploy a spring configuration containing the ejb and then do an osgi lookup via jndi?
b) Can I configure a remote ejb via blueprint configuration? and would i be able to deploy the configuration to smx?
-
4. Re: Injecting EJB into cxfse service impl...
yusuf.jakoet Sep 30, 2010 7:17 AM (in response to yusuf.jakoet)Just tried to deploy a spring config to smx and got the same error:
Caused by: java.lang.ClassNotFoundException: *** Class 'javax.ejb.EJBHome' was not found because bundle org.springframework.context does not import 'javax.ejb' even though bundle wrap_file_____var_java_mtest_jboss_client_jbossall-client.jar does export it. To resolve this issue, add an import for 'javax.ejb' to bundle org.springframework.context . ***
Would I be able to configure the org.springframework.context bundle?
-
5. Re: Injecting EJB into cxfse service impl...
ffang Sep 30, 2010 8:22 AM (in response to yusuf.jakoet)Hi,
Actually org.springframework.context import javax.ejb, but as optional, so after you install your bundle wrap_file_____var_java_mtest_jboss_client_jbossall-client.jar which export javax.ejb, you do osgi:refresh bundle_id_for org.springframework.context, then you could see this package get resolved for org.springframework.context, then you install your cxf-se bundle, you will not see 'javax.ejb.EJBHome' CNFE.
Freeman
-
6. Re: Injecting EJB into cxfse service impl...
yusuf.jakoet Sep 30, 2010 9:19 AM (in response to ffang)Thanks for that. It makes sense, but at which point would the osgi:refresh make the spring-context bundle see my packages? The refresh isn't picking up the packages.
Will re-installing the jbossall-client.jar help?
Thanks
-
7. Re: Injecting EJB into cxfse service impl...
ffang Sep 30, 2010 9:46 AM (in response to yusuf.jakoet)Hi,
jbossall-client.jar export javax.ejb package, right?
After you install jbossall-client.jar successfully(you can check this bundle status, and check if jbossall-client.jar export javax.ejb), then refresh spring-context should get javax.ejb resolved, it expected the javax.ejb version [2.1.0, 4.0.0), ensure the javax.ejb version exported by jbossall-client.jar meet the requirement.
Freeman
-
8. Re: Injecting EJB into cxfse service impl...
yusuf.jakoet Sep 30, 2010 10:07 AM (in response to ffang)Yes it does export javax.ejb.
When I refresh the spring-context, i get a few exceptions :
ERROR: JarContent: Unable to read bytes. (java.lang.IllegalStateException: zip file closed)
once it settles, then i can no longer use the 'osgi:' commands in the karaf shell...
here's a snippet of what's happening after i install the jbossall-client.jar...
karaf@root> osgi:list | grep Spring
ID State Blueprint Spring Level Name
Apache Karaf :: Spring Deployer (2.0.0)
Spring Aspects (3.0.3.RELEASE)
Spring Context (3.0.3.RELEASE)
Spring Context Support (3.0.3.RELEASE)
Spring Expression Language (3.0.3.RELEASE)
Spring Transaction (3.0.3.RELEASE)
karaf@root> osgi:refresh 60
karaf@root> ERROR: JarContent: Unable to read bytes. (java.lang.IllegalStateException: zip file closed)
java.lang.IllegalStateException: zip file closed
-
9. Re: Injecting EJB into cxfse service impl...
ffang Sep 30, 2010 10:21 AM (in response to yusuf.jakoet)Hi,
What FUSE ESB version you're using?
If you're using 4.3.0-fuse-00-00, edit etc/config.properties
change
karaf.framework=felix
to
karaf.framework=equinox
Or you should use 4.3.0-fuse-00-01.
I think there's a felix[1] issue related to refresh spring-context bundles
https://issues.apache.org/jira/browse/FELIX-2480
Freeman
-
10. Re: Injecting EJB into cxfse service impl...
yusuf.jakoet Sep 30, 2010 10:41 AM (in response to ffang)I've switched to equinox. The bundle installs fine, but cannot start due to the spring dependency. Same issue, though the spring-context refresh doesn't kill servicemix..
How do i know if the Spring-Context has picked up the packages correctly?
-
11. Re: Injecting EJB into cxfse service impl...
ffang Sep 30, 2010 8:32 PM (in response to yusuf.jakoet)Hi,
You can use
packages:imports bundle_id
to check which package the bundle import
Freeman
-
12. Re: Injecting EJB into cxfse service impl...
yusuf.jakoet Oct 1, 2010 3:35 AM (in response to ffang)Hi,
Okay, the Spring Context bundle isn't importing javax.ejb. The command I'm using to install the jbossall-client.jar is
osgi:install -s wrap:file:////path/to/file.jar
Once the bundle is active, and I do a osgi:refresh on the spring context, should it work? How can I be sure that the Spring Context bundle is the culprit?
Thanks
-
13. Re: Injecting EJB into cxfse service impl...
yusuf.jakoet Oct 1, 2010 3:44 AM (in response to ffang)I've noticed that the packages exported by jbossall-client bundle have the version set to "0.0.0" ie. (done via packages:export...)
wrap_file_____var_java_mtest_jboss_client_jbossall-client.jar (172): javax.ejb; version="0.0.0"
wrap_file_____var_java_mtest_jboss_client_jbossall-client.jar (172): javax.ejb.spi; version="0.0.0"
Could this be the cause. If so, how do I go about changing that value?
-
14. Re: Injecting EJB into cxfse service impl...
yusuf.jakoet Oct 14, 2010 8:30 AM (in response to yusuf.jakoet)Caused by: java.lang.NoClassDefFoundError: javax/ejb/EJBHome
Is anyone able to get around this issue when injecting an EJB into a cxfse bundle...?