8 Replies Latest reply on Jul 12, 2013 11:13 AM by borges

    hornetq-2.3.0.Final. errors occurred when creating client connection.

    Tianwei Du Newbie

      after I started and stoped many client coonections ,  new Clients can't connect to Server .

      I must restart the server .... thank you for help ..

       

       

      on the Server side , the logs :

      2013-07-06 15:31:01 [WARN ] org.hornetq.core.server (ManagementServiceImpl.java:426) - HQ222111: exception while invoking createTopic on jms.server

      java.lang.reflect.InvocationTargetException

              at sun.reflect.GeneratedMethodAccessor298.invoke(Unknown Source)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

              at java.lang.reflect.Method.invoke(Method.java:601)

              at org.hornetq.core.server.management.impl.ManagementServiceImpl.invokeOperation(ManagementServiceImpl.java:843)

              at org.hornetq.core.server.management.impl.ManagementServiceImpl.handleMessage(ManagementServiceImpl.java:418)

              at org.hornetq.core.server.impl.ServerSessionImpl.handleManagementMessage(ServerSessionImpl.java:1513)

              at org.hornetq.core.server.impl.ServerSessionImpl.send(ServerSessionImpl.java:1274)

              at org.hornetq.core.protocol.core.ServerSessionPacketHandler.handlePacket(ServerSessionPacketHandler.java:445)

              at org.hornetq.core.protocol.core.impl.ChannelImpl.handlePacket(ChannelImpl.java:631)

              at org.hornetq.core.protocol.core.impl.RemotingConnectionImpl.doBufferReceived(RemotingConnectionImpl.java:547)

              at org.hornetq.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:523)

              at org.hornetq.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:564)

              at org.hornetq.core.remoting.impl.netty.HornetQChannelHandler.messageReceived(HornetQChannelHandler.java:72)

              at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:88)

              at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560)

              at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:787)

              at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:281)

              at org.hornetq.core.remoting.impl.netty.HornetQFrameDecoder2.decode(HornetQFrameDecoder2.java:169)

              at org.hornetq.core.remoting.impl.netty.HornetQFrameDecoder2.messageReceived(HornetQFrameDecoder2.java:134)

              at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)

              at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560)

              at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:555)

              at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)

              at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)

              at org.jboss.netty.channel.socket.oio.OioWorker.process(OioWorker.java:71)

              at org.jboss.netty.channel.socket.oio.AbstractOioWorker.run(AbstractOioWorker.java:73)

              at org.jboss.netty.channel.socket.oio.OioWorker.run(OioWorker.java:51)

              at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)

              at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)

              at org.jboss.netty.util.VirtualExecutorService$ChildExecutorRunnable.run(VirtualExecutorService.java:175)

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

              at java.lang.Thread.run(Thread.java:722)

      Caused by: java.lang.NullPointerException

              at org.hornetq.core.postoffice.impl.WildcardAddressManager.addBinding(WildcardAddressManager.java:112)

              at org.hornetq.core.postoffice.impl.PostOfficeImpl.addBinding(PostOfficeImpl.java:453)

              at org.hornetq.core.server.impl.HornetQServerImpl.createQueue(HornetQServerImpl.java:1850)

              at org.hornetq.core.server.impl.HornetQServerImpl.deployQueue(HornetQServerImpl.java:1137)

              at org.hornetq.jms.server.impl.JMSServerManagerImpl.internalCreateTopic(JMSServerManagerImpl.java:1280)

              at org.hornetq.jms.server.impl.JMSServerManagerImpl.access$800(JMSServerManagerImpl.java:105)

              at org.hornetq.jms.server.impl.JMSServerManagerImpl$2.runException(JMSServerManagerImpl.java:650)

              at org.hornetq.jms.server.impl.JMSServerManagerImpl.runAfterActive(JMSServerManagerImpl.java:1832)

              at org.hornetq.jms.server.impl.JMSServerManagerImpl.createTopic(JMSServerManagerImpl.java:637)

              at org.hornetq.jms.management.impl.JMSServerControlImpl.createTopic(JMSServerControlImpl.java:481)

              at org.hornetq.jms.management.impl.JMSServerControlImpl.createTopic(JMSServerControlImpl.java:470)

              ... 33 more

      2013-07-06 15:31:01 [WARN ] org.hornetq.core.server (ServerSessionPacketHandler.java:541) - Sending unexpected exception to the client

      java.lang.NullPointerException

              at org.hornetq.core.postoffice.impl.WildcardAddressManager.addBinding(WildcardAddressManager.java:112)

       

       

      Client:

       

      Caused by: javax.jms.JMSException

                at org.hornetq.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:378)

                at org.hornetq.core.client.impl.ClientSessionImpl.internalCreateQueue(ClientSessionImpl.java:1987)

                at org.hornetq.core.client.impl.ClientSessionImpl.createTemporaryQueue(ClientSessionImpl.java:356)

                at org.hornetq.core.client.impl.DelegatingSession.createTemporaryQueue(DelegatingSession.java:304)

                at org.hornetq.jms.client.HornetQSession.createConsumer(HornetQSession.java:559)

                at org.hornetq.jms.client.HornetQSession.createConsumer(HornetQSession.java:378)

                at org.hornetq.jms.client.HornetQSession.createConsumer(HornetQSession.java:353)

                at com.gamebean.toolkit.jms.hornetq.impl.MessageBridgeImpl.init(MessageBridgeImpl.java:89)

                ... 131 more

      Caused by: HornetQException[errorType=INTERNAL_ERROR message=null]

                ... 139 more

        • 1. Re: hornetq-2.3.0.Final. errors occurred when creating client connection.
          Clebert Suconic Master

          it would help us if you could help us replicate the issue..

          • 2. Re: hornetq-2.3.0.Final. errors occurred when creating client connection.
            Tianwei Du Newbie

            Thank you for reply .

             

            It happens very often to me .

            We found it in development environment , most time we close the client process without close the client connection.

            A simple way to replicate it , it just open 30+ client connections in seconds ,and kill the client Process.

            so I think if I have 100 client connections from every application server to the HornetQ server , and one of the appserver crash , then no new client connections could be open any more.

            • 3. Re: hornetq-2.3.0.Final. errors occurred when creating client connection.
              borges Novice

              All this information you provided in your answer does not help us figure out what is going on.

               

              can you give us the configuration details of the Topic you were creating when the NullPointerException happened? Perhaps also the whole server's configuration.

              • 4. Re: hornetq-2.3.0.Final. errors occurred when creating client connection.
                Tianwei Du Newbie

                I have 2 ways to configure the service , 1 is embedded ,another is stand alone.both have this problem.

                 

                 

                Excuse me ,that I put some Chinese chars in my embedded code.

                • 5. Re: hornetq-2.3.0.Final. errors occurred when creating client connection.
                  Tianwei Du Newbie

                  package com.gamebean.base.service.message.impl;

                  import java.lang.management.ManagementFactory;

                  import java.util.ArrayList;

                  import java.util.HashMap;

                  import java.util.Map;

                  import java.util.Map.Entry;

                  import java.util.ServiceLoader;

                  import java.util.Set;

                  import java.util.concurrent.locks.LockSupport;

                  import javax.annotation.PostConstruct;

                  import javax.annotation.PreDestroy;

                  import javax.jms.Connection;

                  import javax.jms.ConnectionFactory;

                  import javax.jms.DeliveryMode;

                  import javax.jms.Destination;

                  import javax.jms.Message;

                  import javax.jms.MessageConsumer;

                  import javax.jms.MessageListener;

                  import javax.jms.MessageProducer;

                  import javax.jms.Queue;

                  import javax.jms.QueueConnection;

                  import javax.jms.QueueConnectionFactory;

                  import javax.jms.QueueRequestor;

                  import javax.jms.QueueSession;

                  import javax.jms.Session;

                  import javax.jms.Topic;

                  import javax.management.MBeanServer;

                  import javax.management.ObjectName;

                  import javax.naming.Context;

                  import javax.naming.InitialContext;

                  import javax.naming.NamingException;

                  import org.hornetq.api.core.TransportConfiguration;

                  import org.hornetq.api.jms.HornetQJMSClient;

                  import org.hornetq.api.jms.management.JMSManagementHelper;

                  import org.hornetq.core.config.Configuration;

                  import org.hornetq.core.config.impl.ConfigurationImpl;

                  import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;

                  import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;

                  import org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory;

                  import org.hornetq.core.remoting.impl.netty.NettyConnectorFactory;

                  import org.hornetq.jms.server.config.ConnectionFactoryConfiguration;

                  import org.hornetq.jms.server.config.impl.ConnectionFactoryConfigurationImpl;

                  import org.hornetq.jms.server.config.impl.JMSConfigurationImpl;

                  import org.hornetq.jms.server.embedded.EmbeddedJMS;

                  import org.slf4j.Logger;

                  import org.slf4j.LoggerFactory;

                   

                   

                  import com.gamebean.base.service.ServiceManager;

                  import com.gamebean.base.service.message.EventListener;

                  import com.gamebean.base.service.message.MessageService;

                  import com.gamebean.base.service.message.spi.MessageServiceExt;

                   

                   

                  public class MessageServiceImpl implements MessageService,

                    MessageServiceImplMBean {

                   

                   

                    public static final String EMBEDDED_CONNECTION_FACTORY_JNDI_NAME = "jms:/local/embedded/connectionFactory";

                   

                   

                    public static MessageService getInstance() {

                    return instance;

                    }

                   

                   

                    private EmbeddedJMS ejms;

                    // private LinkedHashMap<Connection, EventListener> listeners = new

                    // LinkedHashMap<>();

                    private Connection eventConnection;

                    private boolean inited = false;

                   

                   

                    private ObjectName mbeanName;

                    // private boolean localService;

                   

                   

                    private Map<String, Object> readOnlyConfig;

                   

                   

                    private final static Logger logger = LoggerFactory

                    .getLogger(MessageServiceImpl.class);

                   

                   

                    private static MessageServiceImpl instance = new MessageServiceImpl();

                   

                   

                    public MessageServiceImpl() {

                    }

                   

                   

                    @Override

                    public Connection addEventListener(final EventListener listener,

                    String eventTopic) {

                    return addEventListener(listener, eventTopic, null);

                    }

                   

                   

                    @Override

                    public Connection addEventListener(final EventListener listener,

                    String eventTopic, String messageSelector) {

                    if (logger.isDebugEnabled()) {

                    logger.info("增加事件监听器:" + listener + ",Topic:" + eventTopic

                    + ",selector:" + messageSelector);

                    }

                    try {

                    //

                    createDynamicTopic(eventTopic);

                    ConnectionFactory cf = this.getConnectionFactory();

                    //

                    Connection conn = cf.createConnection();

                    Session session = conn.createSession(false,

                    Session.AUTO_ACKNOWLEDGE);

                    Topic topic = session.createTopic(eventTopic);

                    MessageConsumer consumer = session.createConsumer(topic,

                    messageSelector);

                    consumer.setMessageListener(new MessageListener() {

                   

                   

                    @Override

                    public void onMessage(Message message) {

                    try {

                    String topicOrQueue;

                    Destination jmsDestination = message

                    .getJMSDestination();

                    if (jmsDestination instanceof Topic) {

                    topicOrQueue = ((Topic) jmsDestination)

                    .getTopicName();

                    } else {

                    topicOrQueue = ((Queue) jmsDestination)

                    .getQueueName();

                    }

                    listener.onEvent(topicOrQueue, message);

                    } catch (Throwable e) {

                    logger.error("处理消息错误", e);

                    }

                   

                   

                    }

                    });

                    conn.setExceptionListener(new ConnectionExceptionListener(this,

                    listener, eventTopic, messageSelector));

                    conn.start();

                    // listeners.put(conn, listener);

                    return conn;

                    } catch (Exception e) {

                    throw new RuntimeException(e);

                    }

                    }

                   

                   

                    private void configInTransport(Configuration config) {

                    Map<String, Object> propMap = new HashMap<>();

                    String acceptorName = "HornetQ JMS Server-Acceptor-Inner";

                    TransportConfiguration acceptorConfiguration = new TransportConfiguration(

                    InVMAcceptorFactory.class.getName(), propMap, acceptorName);

                    config.getAcceptorConfigurations().add(acceptorConfiguration);

                   

                   

                    String connectorName = "HornetQ JMS Server-Connector-Inner";

                    TransportConfiguration connectorConfig = new TransportConfiguration(

                    InVMConnectorFactory.class.getName(), propMap, connectorName);

                    config.getConnectorConfigurations().put("connector-inner",

                    connectorConfig);

                    }

                   

                   

                    private void configOutAcceptor(Configuration config) {

                    try {

                    // 杜天微 JVM外部通信

                    Map<String, Object> propMap = getConfigure("jms-acceptor",

                    NettyAcceptorFactory.class.newInstance()

                    .getAllowableProperties());

                    if (propMap == null) {

                    return;

                    }

                    Map<String, Object> m = new HashMap<>(readOnlyConfig);

                    m.put("jms-acceptor", propMap);

                    this.readOnlyConfig = m;

                    String acceptorName = "HornetQ JMS Server-Acceptor-Outer";

                    TransportConfiguration acceptorConfiguration = new TransportConfiguration(

                    NettyAcceptorFactory.class.getName(), propMap, acceptorName);

                    config.getAcceptorConfigurations().add(acceptorConfiguration);

                    } catch (Exception e) {

                    logger.error("读取JMS Acceptor配置异常", e);

                    }

                    }

                   

                   

                    /**

                    * JVM外部连接

                    *

                    * @param config

                    * @return 成功读取外部配置返回true,否则返回false

                    */

                    private boolean configOutConnector(Configuration config) {

                    // 杜天微 JVM外部通信

                    try {

                    Map<String, Object> propMap = getConfigure("jms-connector",

                    NettyConnectorFactory.class.newInstance()

                    .getAllowableProperties());

                    if (propMap == null) {

                    return false;

                    }

                    Map<String, Object> m = new HashMap<>(readOnlyConfig);

                    m.put("jms-connector", propMap);

                    this.readOnlyConfig = m;

                    String connectorName = "HornetQ JMS Server-Connector-Outer";

                    TransportConfiguration outTransportConfiguration = new TransportConfiguration(

                    NettyConnectorFactory.class.getName(), propMap,

                    connectorName);

                    config.getConnectorConfigurations().put("connector-outer",

                    outTransportConfiguration);

                    return true;

                    } catch (Exception e) {

                    logger.error("读取JMS Connector配置异常", e);

                    return false;

                    }

                    }

                   

                   

                    @Override

                    public void createDynamicTopic(String topic) {

                    if (logger.isDebugEnabled()) {

                    logger.debug("创建Topic:" + topic);

                    }

                    try {

                    QueueConnectionFactory connectionFactory = (QueueConnectionFactory) ejms

                    .lookup(EMBEDDED_CONNECTION_FACTORY_JNDI_NAME);

                    QueueConnection connection = connectionFactory

                    .createQueueConnection();

                    Queue managementQueue = HornetQJMSClient

                    .createQueue("hornetq.management");

                    QueueSession session = connection.createQueueSession(false,

                    Session.AUTO_ACKNOWLEDGE);

                    connection.start();

                    Message m = session.createMessage();

                    JMSManagementHelper.putOperationInvocation(m, "jms.server",

                    "createTopic", topic);

                    QueueRequestor requestor = new QueueRequestor(session,

                    managementQueue);

                    @SuppressWarnings("unused")

                    Message reply = requestor.request(m);

                    session.close();

                    connection.close();

                    } catch (Exception e) {

                    throw new RuntimeException(e);

                    }

                    }

                   

                   

                    @PreDestroy

                    public void destory() {

                    try {

                    ejms.stop();

                    LockSupport.parkNanos(500);// 等待断开通知发送成功

                    } catch (Exception e) {

                    logger.error("停止消息服务错误", e);

                    }

                    MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();

                    try {

                    mbs.unregisterMBean(mbeanName);

                    } catch (Exception e) {

                    logger.error("", e);

                    }

                    }

                   

                   

                    @SuppressWarnings("unchecked")

                    private Map<String, Object> getConfigure(String name, Set<String> filter) {

                    try {

                    Context context = new InitialContext();

                    try {

                    Map<String, Object> r = (Map<String, Object>) context

                    .lookup(name);

                    logger.info("在默认JNDI空间找到配置: " + name);

                    return filter(r, filter);

                    } catch (NamingException e) {

                    logger.debug("未在默认JNDI空间找到配置: " + name

                    + e.getLocalizedMessage());

                    context = (Context) context.lookup("java:comp/env");

                    Map<String, Object> r = (Map<String, Object>) context

                    .lookup(name);

                    logger.info("在容器JNDI空间找到配置: " + name);

                    return filter(r, filter);

                    }

                   

                   

                    } catch (NamingException e) {

                    logger.debug("未在默认和容器JNDI空间找到配置: " + name + e.getLocalizedMessage());

                    }

                    return null;

                    }

                   

                   

                    private Map<String, Object> filter(Map<String, Object> m, Set<String> filter) {

                    Map<String, Object> ret = new HashMap<>();

                    for (Map.Entry<String, Object> e : m.entrySet()) {

                    if (filter.contains(e.getKey())) {

                    ret.put(e.getKey(), e.getValue());

                    }

                    }

                    return ret;

                    }

                   

                   

                    @Override

                    public ConnectionFactory getConnectionFactory() {

                    return (ConnectionFactory) ejms

                    .lookup(EMBEDDED_CONNECTION_FACTORY_JNDI_NAME);

                    }

                   

                   

                    @PostConstruct

                    public synchronized void init() {

                    if (inited) {

                    return;

                    }

                   

                   

                    // HornetQ config

                    Configuration config = new ConfigurationImpl();

                   

                   

                    // if (configOutConnector(config)) {

                    // // this.localService = false;

                    // } else {

                    // // this.localService = true;

                    // configOutAcceptor(config);

                    // }

                   

                   

                    String connector;

                    // 连接外部JMS服务器

                    this.readOnlyConfig = new HashMap<>();

                    if (configOutConnector(config)) {

                    connector = "connector-outer";

                    } else {

                    // 启动JVM服务端口

                    configOutAcceptor(config);

                    /*

                    * JVM内部通信

                    */

                    configInTransport(config);

                    connector = "connector-inner";

                    }

                   

                   

                    config.setWildcardRoutingEnabled(true);

                   

                   

                    config.setPersistenceEnabled(false);

                   

                   

                    config.setSecurityEnabled(false);

                    // jmsConfig

                    JMSConfigurationImpl jmsConfig = new JMSConfigurationImpl();

                   

                   

                    ArrayList<String> connectorNames = new ArrayList<String>();

                    connectorNames.add(connector);

                    ConnectionFactoryConfiguration cfConfig = new ConnectionFactoryConfigurationImpl(

                    "cf", false, connectorNames,

                    EMBEDDED_CONNECTION_FACTORY_JNDI_NAME);

                    cfConfig.setClientID("internal");

                    cfConfig.setReconnectAttempts(-1);

                    cfConfig.setRetryInterval(20);

                    jmsConfig.getConnectionFactoryConfigurations().add(cfConfig);

                   

                   

                    // start ejms

                    ejms = new EmbeddedJMS();

                    ejms.setConfiguration(config);

                    ejms.setJmsConfiguration(jmsConfig);

                    try {

                    ejms.start();

                   

                   

                    ConnectionFactory connectionFactory = this.getConnectionFactory();

                    this.eventConnection = connectionFactory.createConnection();

                   

                   

                    ServiceManager.getInstance().registerService(MessageService.class,

                    this);

                    try {

                   

                   

                    MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();

                    this.mbeanName = new ObjectName("热血足球经理:type=服务,name=消息服务");

                    mbs.registerMBean(this, mbeanName);

                    } catch (Exception e) {

                    e.printStackTrace();

                    }

                    inited = true;

                    ServiceLoader<MessageServiceExt> exts = ServiceLoader

                    .load(MessageServiceExt.class);

                    for (MessageServiceExt ext : exts) {

                    try {

                    ext.setMessageService(this);

                    } catch (Exception e) {

                    logger.error("扩展服务初始化异常" + ext, e);

                    }

                    }

                    // createDynamicTopic(MESSAGE_SERVICE_CLOSEING_EVENT_TOPIC);

                    inited = true;

                    } catch (Exception e) {

                    throw new RuntimeException(e);

                    }

                    }

                   

                   

                    @Override

                    public void sendEvent(String eventTopic, Map<String, Object> event) {

                    Session session = null;

                    try {

                    // if (logger.isDebugEnabled()) {

                    // logger.debug("异步事件:" + eventTopic + " " + event);

                    // }

                    session = eventConnection.createSession(false,

                    Session.DUPS_OK_ACKNOWLEDGE);

                    Message map = session.createMessage();

                    for (Entry<String, Object> entry : event.entrySet()) {

                    map.setObjectProperty(entry.getKey(), entry.getValue());

                    }

                    map.setObjectProperty(TOPIC_KEY, eventTopic);

                    MessageProducer producer = session.createProducer(session

                    .createTopic(eventTopic));

                    producer.setDisableMessageID(true);

                    producer.setDisableMessageTimestamp(false);

                    producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);

                    producer.send(map);

                    } catch (Exception e) {

                    logger.error("发送事件错误", e);

                    throw new RuntimeException(e);

                    } finally {

                    if (session != null) {

                    try {

                    session.close();

                    } catch (Exception e) {

                   

                   

                    }

                    }

                    }

                    }

                   

                   

                    @Override

                    public Map<String, Object> getReadOnlyConfig() {

                    return readOnlyConfig;

                    }

                   

                   

                  }

                  • 6. Re: hornetq-2.3.0.Final. errors occurred when creating client connection.
                    Tianwei Du Newbie

                    I just edited the non-slustered configure :

                     

                     

                    <configuration xmlns="urn:hornetq"

                                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                                   xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd">

                     

                     

                       <paging-directory>${data.dir:../data}/paging</paging-directory>

                      

                       <bindings-directory>${data.dir:../data}/bindings</bindings-directory>

                      

                       <journal-directory>${data.dir:../data}/journal</journal-directory>

                      

                       <journal-min-files>10</journal-min-files>

                      

                       <large-messages-directory>${data.dir:../data}/large-messages</large-messages-directory>

                      

                       <connectors>

                          <connector name="netty">

                             <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>

                             <param key="host"  value="${hornetq.remoting.netty.host:0.0.0.0}"/>

                             <param key="port"  value="${hornetq.remoting.netty.port:5545}"/>

                          </connector>

                         

                          <connector name="netty-throughput">

                             <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>

                             <param key="host"  value="${hornetq.remoting.netty.host:0.0.0.0}"/>

                             <param key="port"  value="${hornetq.remoting.netty.batch.port:5555}"/>

                             <param key="batch-delay" value="50"/>

                          </connector>

                       </connectors>

                     

                     

                       <acceptors>

                          <acceptor name="netty">

                             <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>

                             <param key="host"  value="${hornetq.remoting.netty.host:0.0.0.0}"/>

                             <param key="port"  value="${hornetq.remoting.netty.port:5545}"/>

                          </acceptor>

                         

                          <acceptor name="netty-throughput">

                             <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>

                             <param key="host"  value="${hornetq.remoting.netty.host:0.0.0.0}"/>

                             <param key="port"  value="${hornetq.remoting.netty.batch.port:5555}"/>

                             <param key="batch-delay" value="50"/>

                             <param key="direct-deliver" value="false"/>

                          </acceptor>

                       </acceptors>

                     

                     

                       <security-enabled>false</security-enabled>

                       <security-settings>

                          <security-setting match="#">

                     

                     

                             <permission type="createDurableQueue" roles="guest"/>

                      <permission type="deleteDurableQueue" roles="guest"/>

                     

                     

                             <permission type="createNonDurableQueue" roles="guest"/>

                             <permission type="deleteNonDurableQueue" roles="guest"/>

                             <permission type="consume" roles="guest"/>

                             <permission type="send" roles="guest"/>

                      

                      <permission type="manage" roles="manage"/>

                      

                          </security-setting>

                       </security-settings>

                     

                     

                       <address-settings>

                          <!--default for catch all-->

                          <address-setting match="#">

                             <dead-letter-address>jms.queue.DLQ</dead-letter-address>

                             <expiry-address>jms.queue.ExpiryQueue</expiry-address>

                             <redelivery-delay>0</redelivery-delay>

                             <max-size-bytes>10485760</max-size-bytes>      

                             <message-counter-history-day-limit>10</message-counter-history-day-limit>

                             <address-full-policy>BLOCK</address-full-policy>

                          </address-setting>

                       </address-settings>

                     

                     

                    </configuration>

                    • 7. Re: hornetq-2.3.0.Final. errors occurred when creating client connection.
                      Tianwei Du Newbie

                      In the tomcat's context.xml , I config the JNDI as that :

                       

                                <Resource name="jms-acceptor"

                                          factory="com.gamebean.base.toolkit.HashMapObjectFactory" host="192.168.1.172"

                                          connection-ttl="5000" port="5555" />

                                          <!--

                                <Resource name="jms-connector"

                                          factory="com.gamebean.base.toolkit.HashMapObjectFactory" host="192.168.1.39"

                                          port="5555" />

                                          -->

                       

                       

                      And , you can see the way how I create a Topic.

                      Thank you.

                      • 8. Re: hornetq-2.3.0.Final. errors occurred when creating client connection.
                        borges Novice

                        Hi,

                         

                        Thanks for all the posted information but I have to tell you that that is not helping me help you ;-)

                         

                        [...]

                         

                        I imagine you have some complex selector string which you are using to create the topic, so what could help us figure out what is going wrong are the arguments used to that createTopic call which is leading to the NullPointerException.

                         

                        I could then try to write a unittest to reproduce the issue assuming it is something in the selector String which gets handled in the wrong way.

                         

                        If that fails, then the one thing that would help us for sure is if you managed to write a unit-test that reproduced the issue. Sending a simple unittest that reproduces an issue is an almost sure way of getting a fix back and pretty fast.

                         

                        Consider reading this link https://community.jboss.org/wiki/HowToReportABugIssue (specially item 6 and 7).