Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Simple Chat Demo

    Hi

    I installed the simple chat demo on a tomcat machine and I cannot get it to work when trying to connect to activemq. I was wondering if you can tell me what am I doing wrong.

    Here is my context.xml entry for tomcat

    <Resource auth="Container" brokerName="DefaultActiveMQBroker" brokerURL="tcp://0.0.0.0:61616"
    clientID="gwtUIFromTOmcat" description="JMS Connection Factory" factory="org.apache.activemq.jndi.JNDIReferenceFactory"
    name="jms/guiConnectionFactory" password="manager"
    type="org.apache.activemq.ActiveMQConnectionFactory"
    useEmbeddedBroker="false" userName="system"/>


    This is the entry from my server.properties
    # jms configuration - for JMSMessageDispatcher only
    messaging.dispatcherImplementer: com.isomorphic.messaging.JMSMessageDispatcher
    messaging.jms.context: _container_
    messaging.jms.jndiPrefix: jms
    messaging.jms.topicConnectionFactory: guiConnectionFactory




    This is the error that I get
    = 2012-02-28 16:29:47,384 [5-15] ERROR MessagingServlet - MessagingServlet top
    -level exception
    javax.jms.InvalidClientIDException: Broker: DefaultActiveMQBroker - Client: gwtU
    IFromTOmcat already connected from /10.1.255.20:62395
    at org.apache.activemq.broker.region.RegionBroker.addConnection(RegionBr
    oker.java:242)
    at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.ja
    va:85)
    at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.ja
    va:85)
    at org.apache.activemq.advisory.AdvisoryBroker.addConnection(AdvisoryBro
    ker.java:78)
    at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.ja
    va:85)
    at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.ja
    va:85)
    at org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableB
    rokerFilter.java:91)
    at org.apache.activemq.broker.TransportConnection.processAddConnection(T
    ransportConnection.java:694)
    at org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddC
    onnection(ManagedTransportConnection.java:83)
    at org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:
    137)
    at org.apache.activemq.broker.TransportConnection.service(TransportConne
    ction.java:309)
    at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportC
    onnection.java:185)
    at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilt
    er.java:69)
    at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireForm
    atNegotiator.java:113)
    at org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityM
    onitor.java:228)
    at org.apache.activemq.transport.TransportSupport.doConsume(TransportSup
    port.java:83)
    at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.jav
    a:219)
    at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:
    201)
    at java.lang.Thread.run(Thread.java:662)
    === 2012-02-28 16:29:50,028 [5-15] INFO RequestContext - URL: '/simplechat/simp
    lechat/sc/messaging', User-Agent: 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT
    6.1; Win64; x64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .N
    ET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3)': MSIE wi
    th Accept-Encoding header, ready for compressed JS
    === 2012-02-28 16:29:50,031 [5-15] DEBUG JNDI - No configuration for JNDI contex
    t '_container_' - assuming default initialContext
    === 2012-02-28 16:29:50,032 [5-15] DEBUG JNDI - Detected container context, usin
    g new InitialContext(env) lookup method
    === 2012-02-28 16:29:50,047 [5-15] ERROR MessagingServlet - MessagingServlet top
    -level exception
    javax.jms.InvalidClientIDException: Broker: DefaultActiveMQBroker - Client: gwtU
    IFromTOmcat already connected from /10.1.255.20:62395
    at org.apache.activemq.broker.region.RegionBroker.addConnection(RegionBr
    oker.java:242)
    at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.ja
    va:85)
    at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.ja
    va:85)
    at org.apache.activemq.advisory.AdvisoryBroker.addConnection(AdvisoryBro
    ker.java:78)
    at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.ja
    va:85)
    at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.ja
    va:85)
    at org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableB
    rokerFilter.java:91)
    at org.apache.activemq.broker.TransportConnection.processAddConnection(T
    ransportConnection.java:694)
    at org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddC
    onnection(ManagedTransportConnection.java:83)
    at org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:
    137)
    at org.apache.activemq.broker.TransportConnection.service(TransportConne
    ction.java:309)
    at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportC
    onnection.java:185)
    at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilt
    er.java:69)
    at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireForm
    atNegotiator.java:113)
    at org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityM
    onitor.java:228)
    at org.apache.activemq.transport.TransportSupport.doConsume(TransportSup
    port.java:83)
    at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.jav
    a:219)
    at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:
    201)




    It appears its trying to connect over and over again but ActiveMQ will not let it. I was wondering do I have it set up correctly.

    Thanks

    #2
    Hi, please use the following configuration as a guide:

    server.properties
    Code:
    messaging.dispatcherImplementer: com.isomorphic.messaging.JMSMessageDispatcher
    jndi.messaging.java.naming.factory.initial: org.apache.activemq.jndi.ActiveMQInitialContextFactory
    jndi.messaging.java.naming.provider.url: tcp://hostname:61616
    messaging.jms.context: _container_
    messaging.jms.jndiPrefix: 
    messaging.jms.topicConnectionFactory: jms/ConnectionFactory
    context.xml
    Code:
    <Resource auth="Container"
              name="jms/ConnectionFactory"
              type="org.apache.activemq.ActiveMQConnectionFactory"
              description="JMS Connection Factory"
              factory="org.apache.activemq.jndi.JNDIReferenceFactory"
              brokerURL="tcp://0.0.0.0:61616"
              brokerName="localhost"/>
     
    <Resource auth="Container"
              name="chatChannel"
              type="org.apache.activemq.command.ActiveMQTopic"
              description="JMS Topic"
              factory="org.apache.activemq.jndi.JNDIReferenceFactory"
              physicalName="chatChannel"/>

    Comment


      #3
      I installed the application all files from war file folder to tomcat machine,but it do not connect database,then i writed a test jsp,i worked fine,so I was wondering if you can tell me what am I doing wrong.
      server.proporties.
      Code:
      webRoot: __AUTODETECT__
      
      isomorphicPathRootRelative: test/sc
      apps.adminConsole.location: $webRoot/test/tools
      ui.adminConsole.location: $webRoot/test/tools
      sql.defaultDatabase: Oracle
      project.datasources: $webRoot/ds
      project.ui: $webRoot/shared/ui
      project.apps: $webRoot/shared/app
      #for development
      RPCManager.enabledBuiltinMethods: *
      FilesystemDataSource.enabled: false
      sql.Oracle.driver.serverName: 192.168.1.16
      sql.Oracle.driver.portNumber: 1521
      sql.Oracle.driver.databaseName: test
      sql.Oracle.driver.user: root
      sql.Oracle.driver.password: kaka
      context.xml
      Code:
      <Context>
        <Listener className="org.apache.catalina.startup.TldConfig"/>
        <Resource
          auth="Container"
          description="oracle"
          name="Oracle"
          type="javax.sql.DataSource"
          maxActive="4"
          maxIdle="2"
          username="root"
          maxWait="5000"
          driverClassName="oracle.jdbc.OracleDriver"
          password="kaka"
          url="jdbc:oracle:thin:@192.168.1.16:1521:test"/>
      </Context>

      Comment

      Working...
      X