This error was encountered when I wrote a Java program on the Linux system a few days ago to consume activemq messages because of the hostname of the activemq client in the Linux system. Changing the hostname to localhost is a problem. But the specific reason is not clear.
The following prompt: The BFG-OSER-273 is the hostname of the client accessing activemq;
Warning: cocould not generate unique stub
Java.net. unknownhostexception: BFG-OSER-273: BFG-OSER-273
At java.net. inetaddress. getlocalhost (inetaddress. Java: 1353)
At org. Apache. activemq. util. idgenerator. <clinit> (idgenerator. Java: 51)
At org. Apache. activemq. activemqconnection. <clinit> (activemqconnection. Java: 108)
At org. Apache. activemq. activemqconnectionfactory. createactivemqconnection (activemqconnectionfactory. Java: 285)
At org. Apache. activemq. activemqconnectionfactory. createactivemqconnection (activemqconnectionfactory. Java: 253)
At org. Apache. activemq. activemqconnectionfactory. createactivemqconnection (activemqconnectionfactory. Java: 224)
At org. Apache. activemq. activemqconnectionfactory. createconnection (activemqconnectionfactory. Java: 172)
At com. Baofeng. activemqmonitor. Consumer. abstractconsumer. Start (abstractconsumer. Java: 67)
At com. Baofeng. activemqmonitor. mainclass. Main (mainclass. Java: 34)
Aug 18,201 0 7:31:54 org. Apache. activemq. Transport. failover. failovertransport doreconnect
Info: successfully connected to TCP: // 60.28.110.228: 61616
Javax. JMS. jmsexception: Broker cannot add a consumer to a session that had not been registered: ID: null0: 0:-1
At org. Apache. activemq. util. jmsexceptionsupport. Create (jmsexceptionsupport. Java: 49)
At org. Apache. activemq. activemqconnection. syncsendpacket (activemqconnection. Java: 1244)
At org. Apache. activemq. advisoryconsumer. <init> (advisoryconsumer. Java: 50)
At org. Apache. activemq. activemqconnection. ensureconnectioninfosent (activemqconnection. Java: 1348)
At org. Apache. activemq. activemqconnection. createsession (activemqconnection. Java: 298)
At com. Baofeng. activemqmonitor. Consumer. abstractconsumer. Start (abstractconsumer. Java: 68)
At com. Baofeng. activemqmonitor. mainclass. Main (mainclass. Java: 34)
Caused by: Java. Lang. illegalstateexception: Broker cannot add a consumer to a session that had not been registered: ID: null0: 0:-1
At org. Apache. activemq. Broker. transportconnection. processaddconsumer (transportconnection. Java: 535)
At org. Apache. activemq. Command. consumerinfo. Visit (consumerinfo. Java: 345)
At org. Apache. activemq. Broker. transportconnection. Service (transportconnection. Java: 305)
At org. Apache. activemq. Broker. transportconnection $1. oncommand (transportconnection. Java: 179)
At org. Apache. activemq. Transport. transportfilter. oncommand (transportfilter. Java: 68)
At org. Apache. activemq. Transport. wireformatnegotiator. oncommand (wireformatnegotiator. Java: 143)
At org. Apache. activemq. Transport. inactivitymonitor. oncommand (inactivitymonitor. Java: 206)
At org. Apache. activemq. Transport. transportsupport. doconsume (transportsupport. Java: 84)
At org. Apache. activemq. Transport. tcp. tcptransport. dorun (tcptransport. Java: 203)
At org. Apache. activemq. Transport. tcp. tcptransport. Run (tcptransport. Java: 185)
At java. Lang. thread. Run (thread. Java: 619)
Aug 18,201 0 7:31:54 org. Apache. activemq. Transport. failover. failovertransport handletransportfailure
Warning: Transport failed to TCP: // 60.28.110.228: 61616, attempting to automatically reconnect due to: Java. Io. eofexception