Hi, All

We have implimented a JMS provider like the one discused by Scott Farquhar and Tim 
Pouyer on the 15th of November 2001 on the list (see the message from the list archive 
below).  

I get the following error message when Orion is initialising.

...
Error deploying file:D:/:/orion/applications/beantest/ejb homes: JMS Error: Invalid 
acknowledgeMode
Orion/1.5.4 initialized

Our message broker is SonicMQ.  Has anyone got any suggestions as to what can be 
causing this.

Regards
Justin Wood

--------------------message from archive--------------
Magnus has said that documentation on MDB and resource provider would be
comming sortly but that was some time ago so here goes nothing:

First off if you want to get your MDB's to listen to a 3rd party JMS
implementation you will need to write a class that implements the
ResourceProvider interface provided by orion.  This interface is not
documented anywhere so you will just have to look at my example below. 
This is a fairly simple interface to implement, I have provided my
implementation below which is mostly borrowed from a post that was on
this mailing list a few months ago except that implementation was for
TIBCO JMS and mine is for FioranoMQ, but you should be able to modify it
for MQSeries.

Next you will have to provide some additional xml tags in your
orion-application.xml file.  These tags will tell orion what class to
load when looking up external resources ie. your ResourceProvider
implementation.  You will notice how some of the tag names will match
with values found in the ResourceProvider implementation so that you may
use these values in your implementation without having to rebuild your
class if you want to change topics,queues,tcfs, or qcfs.  I have
provided and example orion-applications.xml file for you so that you can
see what these tags are and where they should be placed in the file.

Finaly you will have to tell your MDB what topic or queue and what tcf
or qcf to listen to. This is done in your orion-ejb-jar.xml file.  I
will assume that you know how to set up the ejb-jar.xml file for an
MDB.  In the <message-driven-deployment> tag you will need as
attributes:

name="name-you-gave-in-ejb-jar.xml-file"
destination-location="java:comp/resource/NameOfResourceProvider/topics.Name-0f-topic"
connection-factory-location="java:comp/resource/NameOfResourceProvider/Name-Of-TCF"
min-instances="Some-Number" this can be set to more plus you can supply
a max-instances="Some-Number" value as well.

Now all you have to do is package everything up and deploy it inside
orion.  Nifty huh!


On Thu, 2001-11-15 at 07:56, Kaseman, Mark T wrote:
> I have tried searching the mail archives on www.orionserver.com and at
> www.atlassian.com for details on making mqseries work with orion, but I
> can't seem to find any details.
> 
> -----Original Message-----
> From: Scott Farquhar [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 14, 2001 9:30 PM
> To: Orion-Interest
> Subject: Re: Message Driven Beans
> 
> 
> Jeff,
> 
> You can setup Orion to use another JMS provider if you want to use 
> another JMS provider such as Sonic MQ or MQ Series.
> 
> This allows you to have the speed and flexibility of Orion for EJB & Web 
> (where it excels), and the reliability of a 3rd party JMS provider.
> 
> We have clients who have this setup, and are quite happy with it.
> 
> Cheers,
> Scott
> 
> -- 
> Scott Farquhar :: [EMAIL PROTECTED]
> 
> Atlassian :: http://www.atlassian.com
>       Supporting YOUR J2EE World
> 
> 
> El Jeffo wrote:
> 
> > I must have totally missed it, does orion or will orion support 
> > message driven beans soon?  If so, could you provide a few details
> > to just point me in the right direction?
> > 
> > If orion won't support this in the next month, would you recommend
> > another server which might do the job well? 
> > 
> > I like orion for its simplicity, but sometimes I need more 
> > bleeding edge stuff too.
> > 
> > Jeff
> > 
> > 
> > 
> 
> 
> 
> 


package com.eximtechnologies.xmd.jms.integration.orion;

import com.evermind.server.deployment.ResourceProvider;
import com.evermind.server.deployment.EnvironmentPropertyDescription;
import com.evermind.server.deployment.ResourceInfo;

import javax.jms.TopicConnectionFactory;
import javax.jms.QueueConnectionFactory;
import javax.jms.XATopicConnectionFactory;
import javax.jms.XAQueueConnectionFactory;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.util.*;

public class FioranoJMSProvider implements ResourceProvider {

    protected TopicConnectionFactory topicConnectionFactory;
    protected QueueConnectionFactory queueConnectionFactory;
    protected XATopicConnectionFactory xaTopicConnectionFactory;
    protected XAQueueConnectionFactory xaQueueConnectionFactory;
    protected Map others = new HashMap();
    protected String name = "";

    public EnvironmentPropertyDescription[] getPropertyDescriptions() {
        return null;
    }

    public String getDescription() {
        return "A resource provider that connects Orion to Fiorano JMS";
    }

    public ResourceInfo getDefaultResource(String s) {
        return null;
    }

    public Set getResources(String s) {
        return null;
    }

    public Object getResource(String s) throws InstantiationException {
        System.out.println("---> getResource(" + s + ")");

        if (s.equals("TopicConnectionFactory")) {
            return topicConnectionFactory;
        } else if (s.equals("QueueConnectionFactory")) {
            return queueConnectionFactory;
        } else if (s.equals("XATopicConnectionFactory")) {
            return xaTopicConnectionFactory;
        } else if (s.equals("XAQueueConnectionFactory")) {
            return xaQueueConnectionFactory;
        } else {
            return others.get(s);
        }
    }

    public Set getHandledTypes() {
        System.out.println("---> getHandledTypes()");
        Set set = new HashSet();
        set.add("javax.jms.Queue");
        set.add("javax.jms.Topic");
        set.add("javax.jms.QueueConnectionFactory");
        set.add("javax.jms.TopicConnectionFactory");
        set.add("javax.jms.XAQueueConnectionFactory");
        set.add("javax.jms.XATopicConnectionFactory");
        return set;
    }

    public String getDisplayName() {
        return "Context resource provider for FioranoJMS";
    }

    public void setName(String s) {
        System.out.println("---> setName(" + s + ")");
        name = s;
    }

    public String getName() {
        return name;
    }

    public void init(Map map) throws InstantiationException {
        try {
            InitialContext ctx = new InitialContext(new Hashtable(map));
            topicConnectionFactory = (TopicConnectionFactory) 
ctx.lookup("TopicConnectionFactory");
            queueConnectionFactory = (QueueConnectionFactory) 
ctx.lookup("QueueConnectionFactory");
            xaTopicConnectionFactory = (XATopicConnectionFactory) 
ctx.lookup("XATopicConnectionFactory");
            xaQueueConnectionFactory = (XAQueueConnectionFactory) 
ctx.lookup("XAQueueConnectionFactory");

            StringTokenizer st = new StringTokenizer((String) map.get("queues"), ", ");
            while (st.hasMoreTokens()) {
                String queue = st.nextToken();
                others.put("queues." + queue, ctx.lookup(queue));
            }

            st = new StringTokenizer((String) map.get("topics"), ", ");
            while (st.hasMoreTokens()) {
                String topic = st.nextToken();
                others.put("topics." + topic, ctx.lookup(topic));
            }
        } catch (NamingException e) {
            e.printStackTrace();
            throw new InstantiationError(e.getMessage());
        }
    }
}


<?xml version="1.0"?>
<!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN" 
"http://www.orionserver.com/dtds/orion-ejb-jar.dtd";;>

<orion-ejb-jar deployment-version="1.5.2" >
   <enterprise-beans>
      <message-driven-deployment
         name="EmailDeliveryAgent"
         
destination-location="java:comp/resource/FioranoJMS/topics.Test-Outgoing-Topic"
         
connection-factory-location="java:comp/resource/FioranoJMS/TopicConnectionFactory"
         min-instances="0">
      <resource-ref-mapping location="mail/DeliverySession" 
name="mail/DeliverySession" />
      </message-driven-deployment>
   </enterprise-beans>
   <assembly-descriptor>
      <security-role-mapping name="users">
      </security-role-mapping>
      <default-method-access>
         <security-role-mapping name="&lt;default-ejb-caller-role&gt;" 
impliesAll="true" />
      </default-method-access>
   </assembly-descriptor>
</orion-ejb-jar>

<?xml version="1.0"?>
<!DOCTYPE orion-application PUBLIC "-//Evermind//DTD J2EE Application runtime 1.2//EN" 
"http://www.orionserver.com/dtds/orion-application.dtd";;>

<orion-application deployment-version="1.5.2">
   <ejb-module remote="false" path="/tidal-reader-ejb.jar" />
   <ejb-module remote="false" path="/document-splitter-ejb.jar" />
   <ejb-module remote="false" path="/nodepath-ejb.jar" />
   <ejb-module remote="false" path="/conversation-ejb.jar" />
   <ejb-module remote="false" path="/conversation-agent-ejb.jar" />
   <ejb-module remote="false" path="/client-profile-ejb2.jar" />
   <ejb-module remote="false" path="/message-entity-ejb.jar" />
   <ejb-module remote="false" path="/translation-mapping-ejb.jar" />
   <ejb-module remote="false" path="/tidal-reader-ejb.jar" />
   <ejb-module remote="false" path="/document-router-ejb.jar" />
   <ejb-module remote="false" path="/supplier-role-ejb.jar" />
   <ejb-module remote="false" path="/retailer-role-ejb.jar" />
   <ejb-module remote="false" path="/email-mdb-ejb.jar" />
   <ejb-module remote="false" path="/receiver-mdb-ejb.jar" />
   <web-module id="web-app" path="web-app" />
   <persistence path="persistence" />
        <principals path="principals.xml" />
   <log>
      <file path="application.log" />
   </log>
   <resource-provider name="FioranoJMS" 
class="com.eximtechnologies.xmdjms.integration.orion.FioranoJMSProvider">
      <property name="java.naming.provider.url" value="http://10.1.4.10:8080";; />
      <property name="java.naming.security.principal" value="anonymous" />
      <property name="java.naming.security.credentials" value="anonymous" />
      <property name="java.naming.factory.initial" 
value="fiorano.jms.runtime.naming.FioranoInitialContextFactory" />
      <property name="topics" value="Test-Incoming-Topic,Test-Outgoing-Topic" />
      <property name="queues" value="PrimaryQueue" />
      <property name="TRANSPORT_PROTOCOL" value="HTTP" />
   </resource-provider>
   <namespace-access>
      <read-access>
         <namespace-resource root="">
            <security-role-mapping name="&lt;jndi-user-role&gt;">
               <group name="administrators" />
            </security-role-mapping>
         </namespace-resource>
      </read-access>
      <write-access>
         <namespace-resource root="">
            <security-role-mapping name="&lt;jndi-user-role&gt;">
               <group name="administrators" />
            </security-role-mapping>
         </namespace-resource>
      </write-access>
   </namespace-access>
   <mail-session location="mail/DeliverySession" smtp-host="mail.eximtechnologies.com">
      <property name="mail.transport.protocol" value="smtp"/>
      <property name="mail.smtp.from" value="messenger@eximtechnologiescom"/>
   </mail-session>
   <mail-session location="mail/ErrorSession" smtp-host="mail.eximtechnologies.com">
      <property name="mail.transport.protocol" value="smtp"/>
      <property name="mail.smtp.from" value="[EMAIL PROTECTED]"/>
   </mail-session>

</orion-application>

--- End Message ---

Reply via email to