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 Scott Stephany <ss...@sbcglobal.net> on 2006/07/12 01:47:21 UTC

Using JMS from a Mailet

Hi again!  I'd like to explore some ways to use a mailet as a JMS client to
publish certain messages to a JBoss JMS Topic.  It seems the best way to
connect to a JMS destination, however, is through an InitialContext, which
makes me think I need to explore using a JNDI implementation as well.  Am I
on the right track?
-- 
View this message in context: http://www.nabble.com/Using-JMS-from-a-Mailet-tf1927981.html#a5280221
Sent from the James - Users forum at Nabble.com.


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


Re: Using JMS from a Mailet

Posted by Scott Stephany <ss...@sbcglobal.net>.
Excellent, thanks for the tip.  I'll grab the latest and start playing around
with it.
-- 
View this message in context: http://www.nabble.com/Using-JMS-from-a-Mailet-tf1927981.html#a5310899
Sent from the James - Users forum at Nabble.com.


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


Re: Using JMS from a Mailet

Posted by Stefano Bagnara <ap...@bago.org>.
Hi Scott,

HostedSystemManager is only available in the last phoenix release (the 
one we bundle with James 2.3).

You may want to start testing James 2.3.0b3.

We all are working to make that release stable as fast as possible, so 
maybe it's not a problem for you to start your developing against a beta.

Stefano

Scott Stephany wrote:
> Hi Bernd-
> 
> I'm using 2.2.0.  I've changed the line in kernel.xml pertaining to the
> SystemManager to:
> 
>         <component role="org.apache.avalon.phoenix.interfaces.SystemManager"
>            
> class="org.apache.avalon.phoenix.components.manager.HostedSystemManager"
>             logger="manager" >
>           <manager-adaptor-port>8082</manager-adaptor-port>
>           <enable-rmi-adaptor>true</enable-rmi-adaptor>
>          
> <rmi-naming-factory>com.sun.jndi.rmi.registry.RegistryContextFactory</rmi-naming-factory>
>           <stylesheets-dir>conf/xsl</stylesheets-dir>
>           <!--
>           <user>
>             <name>user</name>
>             <password>password</password>
>           </user>
>           -->
>         </component>
> 
> The stack trace I'm getting is:
> 
> There was an uncaught exception:
> ---------------------------------------------------------
> --- Message ---
> There was an unexpected error while creating Components for Embeddor.
> org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.createComponents(DefaultEmbeddor.java:427)
>         ... 11 more
> rethrown from
> java.lang.ClassNotFoundException:
> org.apache.avalon.phoenix.components.manager.HostedSystemManager
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>         at java.security.AccessController.doPrivileged(Native Method)


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


Re: Using JMS from a Mailet

Posted by Scott Stephany <ss...@sbcglobal.net>.
Hi Bernd-

I'm using 2.2.0.  I've changed the line in kernel.xml pertaining to the
SystemManager to:

        <component role="org.apache.avalon.phoenix.interfaces.SystemManager"
           
class="org.apache.avalon.phoenix.components.manager.HostedSystemManager"
            logger="manager" >
          <manager-adaptor-port>8082</manager-adaptor-port>
          <enable-rmi-adaptor>true</enable-rmi-adaptor>
         
<rmi-naming-factory>com.sun.jndi.rmi.registry.RegistryContextFactory</rmi-naming-factory>
          <stylesheets-dir>conf/xsl</stylesheets-dir>
          <!--
          <user>
            <name>user</name>
            <password>password</password>
          </user>
          -->
        </component>

The stack trace I'm getting is:

There was an uncaught exception:
---------------------------------------------------------
--- Message ---
There was an unexpected error while creating Components for Embeddor.
--- Stack Trace ---
org.apache.avalon.framework.CascadingException: There was an unexpected
error while creating Components for Embeddor.
        at
org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.createComponents(DefaultEmbeddor.java:437)
        at
org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.initialize(DefaultEmbeddor.java:199)
        at
org.apache.avalon.framework.container.ContainerUtil.initialize(ContainerUtil.java:235)
        at
org.apache.avalon.phoenix.frontends.CLIMain.startup(CLIMain.java:194)
        at
org.apache.avalon.phoenix.frontends.CLIMain.execute(CLIMain.java:122)
        at
org.apache.avalon.phoenix.frontends.CLIMain.main(CLIMain.java:102)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.avalon.phoenix.launcher.Main.startup(Main.java:94)
        at org.apache.avalon.phoenix.launcher.Main.main(Main.java:46)
Caused by: java.lang.ClassNotFoundException:
org.apache.avalon.phoenix.components.manager.HostedSystemManager
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:164)
        at
org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.createComponents(DefaultEmbeddor.java:427)
        ... 11 more
rethrown from
java.lang.ClassNotFoundException:
org.apache.avalon.phoenix.components.manager.HostedSystemManager
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:164)
        at
org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.createComponents(DefaultEmbeddor.java:427)
        at
org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.initialize(DefaultEmbeddor.java:199)
        at
org.apache.avalon.framework.container.ContainerUtil.initialize(ContainerUtil.java:235)
        at
org.apache.avalon.phoenix.frontends.CLIMain.startup(CLIMain.java:194)
        at
org.apache.avalon.phoenix.frontends.CLIMain.execute(CLIMain.java:122)
        at
org.apache.avalon.phoenix.frontends.CLIMain.main(CLIMain.java:102)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.avalon.phoenix.launcher.Main.startup(Main.java:94)
        at org.apache.avalon.phoenix.launcher.Main.main(Main.java:46)

---------------------------------------------------------

Thanks for any help.

Scott
-- 
View this message in context: http://www.nabble.com/Using-JMS-from-a-Mailet-tf1927981.html#a5299527
Sent from the James - Users forum at Nabble.com.


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


Re: Using JMS from a Mailet

Posted by Bernd Fondermann <bf...@brainlounge.de>.
Scott Stephany wrote:
> 
> I've been playing around with JMX in my mailets as well - with JDK1.5 it
> works great.  I was having trouble using the MBeanServer that comes with the
> JDK, though, to use the MBeans created with James.  Couldn't find the
> org.apache.avalon.phoenix.components.manager.HostedSystemManager class as
> defined in the phoenix kernel.xml file as described in the Wiki.

Are you running James 2.2.0 or the 2.3 branch?
What exception do you get on startup?
Can you post the kernel.xml you are using?

Thanks,

   Bernd

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


RE: Using JMS from a Mailet

Posted by "Noel J. Bergman" <no...@devtech.com>.
Scott Stephany wrote:

> I'm really just looking for ways to cluster James in a distributed
> environment and have them keep in sync.  For example, let's say I've
> got a blacklist mailet that detects abuse in one James instance.
>  I'd love to have that instance propogate this to all James
> instances in the cluster if detected by one instance.

At present, your best option would be a shared database.  But if you look at
the proposal I posted for replacing the spool mechanism, you'll find what
you're looking for there.  But don't hold your breath in the meantime.

	--- Noel


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


RE: Using JMS from a Mailet

Posted by Scott Stephany <ss...@sbcglobal.net>.
I was thinking it would be nice to have a cluster of James instances able to
talk to each other by publishing/subscribing to a JMS topic.  With JNDI,
they could even use EJBs, etc.  I've been trying to think of ways to work
with James in a distributed environment.

I've been playing around with JMX in my mailets as well - with JDK1.5 it
works great.  I was having trouble using the MBeanServer that comes with the
JDK, though, to use the MBeans created with James.  Couldn't find the
org.apache.avalon.phoenix.components.manager.HostedSystemManager class as
defined in the phoenix kernel.xml file as described in the Wiki.

I'm really just looking for ways to cluster James in a distributed
environment and have them keep in sync.  For example, let's say I've got a
blacklist mailet that detects abuse in one James instance.  I'd love to have
that instance propogate this to all James instances in the cluster if
detected by one instance.
-- 
View this message in context: http://www.nabble.com/Using-JMS-from-a-Mailet-tf1927981.html#a5281030
Sent from the James - Users forum at Nabble.com.


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


RE: Using JMS from a Mailet

Posted by "Noel J. Bergman" <no...@devtech.com>.
Scott Stephany wrote:

> Hi again!  I'd like to explore some ways to use a mailet as a JMS client
to
> publish certain messages to a JBoss JMS Topic.  It seems the best way to
> connect to a JMS destination, however, is through an InitialContext, which
> makes me think I need to explore using a JNDI implementation as well.

JAMES does not currently expose JNDI and JMS to mailets.  I hope that will
change, and would not mind having someone else around to help that happen.

	--- Noel


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