1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

ActiveMq within tomcat 6

Discussion in 'Apache' started by hmikhail, Mar 1, 2010.

  1. #1
    Hello All,
    I am trying to use activemq within tomcat6 and interact from javascript using ajax, I am having lots of problems.
    When I deploy Tomcat I see in the log "Connector vm://localhost Started , so I am guessing that the configuration is correct, but when I try to send messages from my javascript I get an error message from the Error console of forefox saying "amq is not defined".
    In CATALINA_HOME/CONF/context.xml I put
    <Resource name="jms/ConnectionFactory" auth="Container" type="org.apache.activemq.ActiveMQConnectionFactory" description="JMS Connection Factory"
    factory="org.apache.activemq.jndi.JNDIReferenceFactory" brokerURL="vm://localhost" brokerName="LocalActiveMQBroker"/>

    I also added the following jar files to CATALINA_HOME/lib:
    geronimo-j2ee-management_1.0_spec-1.0.jar
    geronimo-jta_1.0.1B_spec-1.0.1.jar
    geronimo-jms_1.1_spec-1.1.1.jar
    activemq-web-5.3.0.jar
    activemq-core-5.3.0.jar
    activemq-all-5.3.0.jar

    In the web.xml file of my web-app I put:
    <context-param>
    <param-name>org.apache.activemq.brokerURL</param-name>
    <param-value>vm://localhost</param-value>
    <description>The URL of the Message Broker to connect
    to</description>
    </context-param>

    <context-param>
    <param-name>org.apache.activemq.embeddedBroker</param-name>
    <param-value>true</param-value>
    <description>Whether we should
    an embedded broker or not</description>

    <servlet>
    <servlet-name>AjaxServlet</servlet-name>
    <servlet-class>org.apache.activemq.web.AjaxServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
    <servlet-name>AjaxServlet</servlet-name>
    <url-pattern>/amq/*</url-pattern>
    </servlet-mapping>

    I really don't know how to make this work...would appreciate your help.

    Thanks,
    Henry
    hmikhail, Mar 1, 2010 IP
  2. FavouritesBlog

    FavouritesBlog Peon

    Messages:
    846
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What OS and control panel?
    FavouritesBlog, Mar 2, 2010 IP
  3. hmikhail

    hmikhail Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Windows XP pro, my guess it's something in the xml configuration files.

    Thanks,
    henry
    hmikhail, Mar 2, 2010 IP