You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Marko Viitanen <Ma...@nextpage.com> on 2002/09/05 20:49:33 UTC
How to run James with Jboss?
Hi,
I need to write a mailet that communicates with EJBs residing on Jboss.
Does anyone know how to do this?
Marko
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: How to run James with Jboss?
Posted by Thomas Jachmann <ho...@gmx.de>.
Hi Marko,
> I need to write a mailet that communicates with EJBs residing on
> Jboss. Does anyone know how to do this?
You should be able to connect to any J2EE server just as your code would run
in a standard standalone application. So doing something like this:
import javax.naming.Context;
import javax.naming.InitialContext;
Hashtable environment = new Hashtable(2);
environment.put(Context.PROVIDER_URL,
"iiop://localhost:900/");
environment.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory");
Context context = new InitialContext(environment);
Where you have to provide the provider url and initial context factory that
suit your server setup. The properties used above are for IBM WebSphere Test
Environment.
Then you have a context and can call context.lookup(<JNDI name of your
EJB>); to access your EJB.
I don't think there'd be something special about accessing EJBs from inside
JAMES than from anywhere else.
HTH,
Thomas
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>