[prev in list] [next in list] [prev in thread] [next in thread] 

List:       james-user
Subject:    RE: Calling EJBs from mailet
From:       "Steve Short" <sshort () postx ! com>
Date:       2003-07-30 16:41:19
[Download RAW message or body]

Yes but you don't need all of them.  The following from one of my script
files may help:

  set cp=%cp%;%JBOSS_PATH%/client/concurrent.jar
  set cp=%cp%;%JBOSS_PATH%/client/gnu-regexp.jar
  set cp=%cp%;%JBOSS_PATH%/client/jboss-j2ee.jar
  set cp=%cp%;%JBOSS_PATH%/client/jbossall-client.jar
  set cp=%cp%;%JBOSS_PATH%/client/jaas.jar
  set cp=%cp%;%JBOSS_PATH%/client/jnp-client.jar
  set cp=%cp%;%JBOSS_PATH%/client/jbossmq-client.jar
  set cp=%cp%;%JBOSS_PATH%/client/log4j.jar

Also Satish, you should just be able to use the URL
http://193.50.50.23:1099 like this:

      Hashtable props = new Hashtable();
      props.put(Context.INITIAL_CONTEXT_FACTORY,
org.jnp.interfaces.NamingContextFactory");
      props.put(Context.PROVIDER_URL, "193.50.50.23:1099");
      props.put("java.naming.rmi.security.manager", "yes");
      props.put(Context.URL_PKG_PREFIXES,  "org.jboss.naming");

      Context ctx = new InitialContext(props);

Cheers
Steve

> -----Original Message-----
> From: Marco Tedone [mailto:mtedone@jemos.org] 
> Sent: Wednesday, July 30, 2003 2:36 AM
> To: James Users List
> Subject: Re: Calling EJBs from mailet
> 
> 
> I think you should have in your jar also the jars under 
> %JBOSS_HOME%/client
> 
> Hope it will help,
> 
> Marco
> ----- Original Message ----- 
> From: "Satish" <satish@nunet-tech.com>
> To: "'James Users List'" <server-user@james.apache.org>
> Sent: Wednesday, July 30, 2003 6:23 AM
> Subject: RE: Calling EJBs from mailet
> 
> 
> > Steve,
> > 
> > Thanks for the mail. The following is the code I'm using in 
> the mailet 
> > (invoking ejb deployed on jboss from them mailet):
> > 
> > Properties p = new Properties(); 
> > 
> p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jboss.naming.HttpNamingCont
> > ex
> > tFactory");
> > System.out.println(".......step 1.......");
> > p.put(Context.PROVIDER_URL,
> > "http://193.50.50.23:8080/invoker/JNDIFactory");
> > System.out.println(".......step 2.......");
> > //p.put(Context.SECURITY_PRINCIPAL,user);
> > //p.put(Context.SECURITY_CREDENTIALS,password);
> > //return new javax.naming.InitialContext(p);
> > Context ctx = new javax.naming.InitialContext(p);
> > System.out.println(".......step 3......."); 
> > Object obj=ctx.lookup("MailLogSearch");
> > System.out.println(".......step 4.......");
> > 
> > 
> > I compile and copy the .jar file to james/lib.
> > When I invoke this mailet, I'm getting the following error after 
> > pringint ...step1....and ....step2..... So, the error is in the line
> > Context ctx = new javax.naming.InitialContext(p);
> > 
> > There was a fatal error while starting Embeddor.
> > ReflectionException: Class not found: mx4j.adaptor.http.HttpAdaptor
> > Cause: java.lang.ClassNotFoundException: 
> mx4j.adaptor.http.HttpAdaptor
> > 
> > 
> > It's asking for all jboss packages. Why is it so?
> > 
> > Regards,
> > Satish
> > 
> > -----Original Message-----
> > From: Steve Short [mailto:sshort@postx.com]
> > Sent: Monday, July 21, 2003 11:17 PM
> > To: James Users List
> > Subject: RE: Calling EJBs from mailet
> > 
> > Satish,
> > 
> > The code is exactly the same as calling EJBs from anywhere 
> else !  Are 
> > you running James in the same VM as Jboss?  If not you may 
> need to set 
> > up some additional properties when creating the InitialContext.
> > 
> > If you provide more information I may be able to help you further.
> > 
> > Steve
> > 
> > > -----Original Message-----
> > > From: Satish [mailto:satish@nunet-tech.com]
> > > Sent: Monday, July 21, 2003 5:11 AM
> > > To: 'James Users List'
> > > Subject: Calling EJBs from mailet
> > > 
> > > 
> > > Can anyone give me a code snippet of calling EJBs running on
> > > JBoss from a JAMES mailet?
> > > 
> > > Thanks
> > > Satish
> > > 
> > > 
> > > 
> --------------------------------------------------------------------
> > > -
> > > To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> > > For additional commands, e-mail: server-user-help@james.apache.org
> > > 
> > > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> > For additional commands, e-mail: server-user-help@james.apache.org
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> > For additional commands, e-mail: server-user-help@james.apache.org
> > 
> > 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic