Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Connect to JBOSS ejb3 via RMI
Connect to JBOSS ejb3 via RMI [message #444005] Wed, 08 February 2006 01:12 Go to next message
Robert is currently offline RobertFriend
Messages: 45
Registered: July 2009
Member
Hi everyone,
I'm trying to connect my RCP application to my back end EJB3 server
application running on JBOSS4.0.3sp1.

I have read the earlier postings regarding connecting from an RCP client
to an ejb via rmi.

the code that i am using is:
---
> try{
> Context ctx = new InitialContext();
> ms = (MaseSystem) ctx.lookup(MaseSystem.class.getName());
> }catch(Exception e){
> e.printStackTrace();
> }
---
where MaseSystem is my remote interface. I have included the server
application code as a dependency for my Rcp application.

This code works fine when i use it in a command line application client
however i get the following error inside my RCP application:

---
javax.naming.NoInitialContextException: Cannot instantiate class:
org.jnp.interfaces.NamingContextFactory [Root exception is
java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
---

I have tried the proposed solution that is mentioned in the thread
"problem accessin ejbs on jboss from rcp" but this did not work.

-Is there something that I'm missing?
-does the fact that I'm using ejb3 standard have an impact on how things
work?

Please help.

Thanks,
Robert.
Re: Connect to JBOSS ejb3 via RMI [message #444012 is a reply to message #444005] Wed, 08 February 2006 10:35 Go to previous messageGo to next message
Stephan Wilczek is currently offline Stephan WilczekFriend
Messages: 10
Registered: July 2009
Junior Member
Hi Robert,

if you have some time, try to take a look at the sources of

http://sourceforge.net/projects/paperdog

Here we connect a RCP frontend to EJBs on a JBoss Server. It is even
possible to hook up the RCP-client to JBoss transparently over http,
which makes it interesting for firewalled environments :)

Regards
Stephan
--
www.imedic.de
www.rcp-training.com



Robert wrote:
> Hi everyone,
> I'm trying to connect my RCP application to my back end EJB3 server
> application running on JBOSS4.0.3sp1.
>
> I have read the earlier postings regarding connecting from an RCP client
> to an ejb via rmi.
>
> the code that i am using is:
> ---
> > try{
> > Context ctx = new InitialContext();
> > ms = (MaseSystem) ctx.lookup(MaseSystem.class.getName());
> > }catch(Exception e){
> > e.printStackTrace();
> > }
> ---
> where MaseSystem is my remote interface. I have included the server
> application code as a dependency for my Rcp application.
>
> This code works fine when i use it in a command line application client
> however i get the following error inside my RCP application:
>
> ---
> javax.naming.NoInitialContextException: Cannot instantiate class:
> org.jnp.interfaces.NamingContextFactory [Root exception is
> java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
> ---
>
> I have tried the proposed solution that is mentioned in the thread
> "problem accessin ejbs on jboss from rcp" but this did not work.
>
> -Is there something that I'm missing?
> -does the fact that I'm using ejb3 standard have an impact on how things
> work?
>
> Please help.
>
> Thanks,
> Robert.
Re: Connect to JBOSS ejb3 via RMI [message #444029 is a reply to message #444012] Wed, 08 February 2006 17:00 Go to previous messageGo to next message
Robert is currently offline RobertFriend
Messages: 45
Registered: July 2009
Member
Thanks for the link Stephan, I've looked at the code for a bit but i
still think that I'm missing something. are you using a jndi.properties
file? where do you specify this information? It doesn't appear like you
are using the EJB3 standard in the linked application? Do you know if
there is a difference on how connection is done with ejb3 and RCP clients?

In my code when i go to create the initial context:

Context ctx = new InitialContext();

this is throwing the the naming exception i mentioned in my earlier
post. The error message says that this is caused by:

Caused by: java.lang.ClassNotFoundException:
org.jnp.interfaces.NamingContextFactory

do i need to include a specific lib? if so which one?

now I'm still new to RCP development so i was wondering if there is a
much simpler example out there that i could look at or if there is a
tutorial or book that explains how to connect to EJB's from and RCP client.

Thanks Again,
Robert.



Stephan Wilczek wrote:
> Hi Robert,
>
> if you have some time, try to take a look at the sources of
>
> http://sourceforge.net/projects/paperdog
>
> Here we connect a RCP frontend to EJBs on a JBoss Server. It is even
> possible to hook up the RCP-client to JBoss transparently over http,
> which makes it interesting for firewalled environments :)
>
> Regards
> Stephan
Re: Connect to JBOSS ejb3 via RMI [message #444303 is a reply to message #444029] Mon, 13 February 2006 17:09 Go to previous message
Aleksey Aristov is currently offline Aleksey AristovFriend
Messages: 17
Registered: July 2009
Junior Member
Hello!

> In my code when i go to create the initial context:
>
> Context ctx = new InitialContext();
>
> this is throwing the the naming exception i mentioned in my earlier
> post. The error message says that this is caused by:
>
> Caused by: java.lang.ClassNotFoundException:
> org.jnp.interfaces.NamingContextFactory

It seems to be a very common problem for those, who tries to access
J2EE server from RCP clients. We decided to create a small example, that
illustrates how to overcome RCP class loading behavior in such cases.

This example can be downloaded from here:
http://www.rcp-training.com/examples/JNDIBrowserExample.zip

Please take a closer look at JNDIView.getInitialContext() implementation. If
you have any further questions - feel free to ask.



Aleksey Aristov

--
www.imedic.de
www.rcp-training.com
Previous Topic:Split the editor area
Next Topic:RCP app wont start after update
Goto Forum:
  


Current Time: Fri Apr 26 18:57:05 GMT 2024

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

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

Back to the top