Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Resolving EJB-dependencies
Resolving EJB-dependencies [message #547535] Sun, 18 July 2010 14:26 Go to next message
Philipp Leusmann is currently offline Philipp LeusmannFriend
Messages: 36
Registered: July 2009
Member
Hi,

in our RAP-Application we are using an EJB3 WebService running on JBoss.
When deploying our application as a war-file running in JBoss, is it
necessary to include the jboss-libs in the bundle or can the
dependencies somehow be resolved from the EJB3-Container at runtime?

Regards,
Philipp
Re: Resolving EJB-dependencies [message #547649 is a reply to message #547535] Mon, 19 July 2010 09:10 Go to previous messageGo to next message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 338
Registered: July 2009
Senior Member
Hi Philipp,

you should be able to use Import-Package to get a dependency to the
corresponding container packages. Same idea as with javax.servlet.

Just in case you need to run any code on the thread that cames from the
container (which most of the EJB stuff requires), take a look at
RWT#requestThreadExec

Regards,
Ben

Philipp Leusmann wrote:
> Hi,
>
> in our RAP-Application we are using an EJB3 WebService running on JBoss.
> When deploying our application as a war-file running in JBoss, is it
> necessary to include the jboss-libs in the bundle or can the
> dependencies somehow be resolved from the EJB3-Container at runtime?
>
> Regards,
> Philipp


--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource
Re: Resolving EJB-dependencies [message #548062 is a reply to message #547649] Tue, 20 July 2010 14:38 Go to previous message
Philipp Leusmann is currently offline Philipp LeusmannFriend
Messages: 36
Registered: July 2009
Member
Hi Ben,

thanks for your response, but I am still struggling ith all these
classpath-issues on jboss.

Is there anybody here, having experience with deploying RAP-applications
on Jboss and is using EJB3 Jax-WS Webservices? It would be great, if you
could explain your deployment structure.

Here is mine (for the RAP-part):

In the Eclipse-Environment I am using four Bundles:
A) The RAP-Application
B) custom-rap extensions / helper classes. shouldn't matter here.
C) data. All EJB3 Remote-Interfaces and classes used on both, client
(RAP) and server
D) jboss. A dummy-bundle containing all the JBoss-libs and exporting all
available packages

When starting in Eclipse, this is running fine.
In bundle C, I needed to add a Require-Bundle directive to bundle D.
Only requiring the packages exporting from D resulted in an error, since
obviously JBoss masks some java-classes with own implementations (For
example javax.xml.ws.spi.Provider). These jboss-classes were not
resolved when only adding the Required-Packages directive, but with the
required bundle, it works.

So I decided to make the required bundle optional, and added a
"DynamicImport-Package: *" to the manifest of package C, hoping it would
resolve the packages from the JBoss-ClassLoader at runtime.
But to no avail.

Before I go on explaining my situation, let me first ask, my assumption
is correct:
* Only the data-package need direct reference to the jboss-libs, because
it's the only bundle using them?

But when deploying the application as a war in JBoss 5.1 , it seems like
the dependencies cannot be resolved.

Is there any way to debug the classloading in OSGi? Like have any chance
to see for bundle X these are the theoretically available packages?
getPackages in the Equinox console does not really help.

It seems as OSGi running in a war in JBoss does not incorporate the
JBoss-classpath.
For example, when running a plain war in JBoss, the ClassLoader
Hierarchy looks like this:

Hierarchy of Thread.currentThread().getContextClassLoader():

Original class loader in Remote client is
org.jboss.web.tomcat.service.WebCtxLoader$ENCLoader
Parent of: org.jboss.web.tomcat.service.WebCtxLoader$ENCLoader is
org.jboss.classloader.spi.base.BaseClassLoader
Parent of: org.jboss.classloader.spi.base.BaseClassLoader is null
SystemClassLoader is sun.misc.Launcher$AppClassLoader


But when dumping the same in the RAP Application it looks like this:

Hierarchy of Thread.currentThread().getContextClassLoader():

Original class loader in Remote client is
org.eclipse.core.runtime.internal.adaptor.ContextFinder
Parent of: org.eclipse.core.runtime.internal.adaptor.ContextFinder is
sun.misc.Launcher$AppClassLoader
Parent of: sun.misc.Launcher$AppClassLoader is
sun.misc.Launcher$ExtClassLoader

SystemClassLoader is sun.misc.Launcher$AppClassLoader

Hierarchy of getClass.getClassLoader:

Parent of: org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader is
sun.misc.Launcher$AppClassLoader
Parent of: sun.misc.Launcher$AppClassLoader is
sun.misc.Launcher$ExtClassLoader



What makes me wonder is, that there isn't
org.jboss.classloader.spi.base.BaseClassLoader in the
ClassLoaderHierarchy in OSGi.


Is there somebody here, who can help me with my dilemma?
I am really getting desperate now.

Thanks,
Philipp

Am 19.07.10 11:10, schrieb Benjamin Muskalla:
> Hi Philipp,
>
> you should be able to use Import-Package to get a dependency to the
> corresponding container packages. Same idea as with javax.servlet.
>
> Just in case you need to run any code on the thread that cames from the
> container (which most of the EJB stuff requires), take a look at
> RWT#requestThreadExec
>
> Regards,
> Ben
>
> Philipp Leusmann wrote:
>> Hi,
>>
>> in our RAP-Application we are using an EJB3 WebService running on JBoss.
>> When deploying our application as a war-file running in JBoss, is it
>> necessary to include the jboss-libs in the bundle or can the
>> dependencies somehow be resolved from the EJB3-Container at runtime?
>>
>> Regards,
>> Philipp
>
>
Previous Topic:SessionStoreListener is not correctly notified?
Next Topic:Problem using GMap
Goto Forum:
  


Current Time: Sat Feb 24 12:32:11 GMT 2024

Powered by FUDForum. Page generated in 0.02380 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top