Re: ActiveMQ(MQTT) crash when subscribe

2015-07-19 Thread roox_4000
I use https://github.com/sskaje/mqtt Lib And It  Work With Activemq Broker
Very Well 



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/ActiveMQ-MQTT-crash-when-subscribe-tp4698367p4699314.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ(MQTT) crash when subscribe

2015-07-14 Thread roox_4000
My project is very important and because of this problem it has been down. I
asked many times from supporters, the answered once but it didn't help me. I
really need to know how to solve the problem.
I appreciate it if anybody can help.






--
View this message in context: 
http://activemq.2283324.n4.nabble.com/ActiveMQ-MQTT-crash-when-subscribe-tp4698367p4699230.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ(MQTT) crash when subscribe

2015-07-14 Thread Christopher Shannon
It's difficult to track down the cause based on what you have provided
because unfortunately the full stack trace is missing for the
ArrayIndexOutOfBoundsException.  The broker needs to be updated to log the
full stack trace which I can update.  I can let you know when the latest
snapshot has that change so you can try it again and hopefully have some
more information to help debug the issue.

Also, I doubt many people here are familiar with using that PHP client.
Would it be possible to try your example with a different kind of client to
see if the issue still exists? The easiest to debug is if it is a Java test
case.

On Tue, Jul 14, 2015 at 7:08 AM, roox_4000 reza.mazar...@gmail.com wrote:

 My project is very important and because of this problem it has been down.
 I
 asked many times from supporters, the answered once but it didn't help me.
 I
 really need to know how to solve the problem.
 I appreciate it if anybody can help.






 --
 View this message in context:
 http://activemq.2283324.n4.nabble.com/ActiveMQ-MQTT-crash-when-subscribe-tp4698367p4699230.html
 Sent from the ActiveMQ - User mailing list archive at Nabble.com.



Re: ActiveMQ(MQTT) crash when subscribe

2015-07-14 Thread Christopher Shannon
So good news, it turns out if you enable debug logging there is already a
check in place to log the full stack trace. Take a look at this page:
http://activemq.apache.org/how-do-i-enable-debug-logging.html for
instructions on how to enable debug and then you should get the full print
out of the ArrayIndexOutOfBoundsException that you are getting.

On Tue, Jul 14, 2015 at 9:42 AM, Christopher Shannon 
christopher.l.shan...@gmail.com wrote:

 It's difficult to track down the cause based on what you have provided
 because unfortunately the full stack trace is missing for the
 ArrayIndexOutOfBoundsException.  The broker needs to be updated to log the
 full stack trace which I can update.  I can let you know when the latest
 snapshot has that change so you can try it again and hopefully have some
 more information to help debug the issue.

 Also, I doubt many people here are familiar with using that PHP client.
 Would it be possible to try your example with a different kind of client to
 see if the issue still exists? The easiest to debug is if it is a Java test
 case.

 On Tue, Jul 14, 2015 at 7:08 AM, roox_4000 reza.mazar...@gmail.com
 wrote:

 My project is very important and because of this problem it has been
 down. I
 asked many times from supporters, the answered once but it didn't help
 me. I
 really need to know how to solve the problem.
 I appreciate it if anybody can help.






 --
 View this message in context:
 http://activemq.2283324.n4.nabble.com/ActiveMQ-MQTT-crash-when-subscribe-tp4698367p4699230.html
 Sent from the ActiveMQ - User mailing list archive at Nabble.com.





Re: ActiveMQ(MQTT) crash when subscribe

2015-07-04 Thread roox_4000
I Try With v5.12 Snapshot But activemq console give me laste error :

WARN : Transport Connection to :tcp://127.0.0.1:18967 
 failed:java.io.IOExeption:Unexpected error 
 occurred:java.lang.ArrayIndexOutOfBoundsException :12 

That 12 in Above Error Equal With Topic Character That I Enter In Subscribe
Method

chat/general =12 Character

$topics['*chat/general*'] = array(qos=0, function=procmsg); 
$mqtt-subscribe($topics,0); 


This Subscribe Part Of phpMQTT Class (bluerhinos)  Tht I Use It 

  /* subscribe: subscribes to topics */ 
function subscribe($topics, $qos = 0){ 
$i = 0; 
$buffer = ; 
$id = $this-msgid; 
$buffer .= chr($id  8);  $i++; 
$buffer .= chr($id % 256);  $i++; 

foreach($topics as $key = $topic){ 
$buffer .= $this-strwritestring($key,$i); 
$buffer .= chr($topic[qos]);  $i++; 
$this-topics[$key] = $topic; 
} 

$cmd = 0x80; 
//$qos 
$cmd += ($qos  1); 


$head = chr($cmd); 
$head .= chr($i); 

fwrite($this-socket, $head, 2); 
fwrite($this-socket, $buffer, $i); 
$string = $this-read(2); 

$bytes = ord(substr($string,1,1)); 
$string = $this-read($bytes); 
} 







--
View this message in context: 
http://activemq.2283324.n4.nabble.com/ActiveMQ-MQTT-crash-when-subscribe-tp4698367p4698578.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ(MQTT) crash when subscribe

2015-07-01 Thread roox_4000
);
}while ( $len  0 );
return $string;
}

/* strwritestring: writes a string to a buffer */
function strwritestring($str, $i){
$ret =  ;
$len = strlen($str);
$msb = $len  8;
$lsb = $len % 256;
$ret = chr($msb);
$ret .= chr($lsb);
$ret .= $str;
$i += ($len+2);
return $ret;
}

function printstr($string){
$strlen = strlen($string);
for($j=0;$j$strlen;$j++){
$num = ord($string{$j});
if($num  31) 
$chr = $string{$j}; else $chr =  ;
printf(%4d: %08b : 0x%02x : %s 
\n,$j,$num,$num,$chr);
}
}
}

?




--
View this message in context: 
http://activemq.2283324.n4.nabble.com/ActiveMQ-MQTT-crash-when-subscribe-tp4698367p4698437.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ(MQTT) crash when subscribe

2015-07-01 Thread roox_4000
 |
org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
Transport: tcp:///127.0.0.1:27509@1885
2015-07-01 14:51:32,562 | WARN  | Transport Connection to:
tcp://127.0.0.1:27510 failed: java.io.IOException: Unexpected error
occurred: java.lang.ArrayIndexOutOfBoundsException: 9 |
org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
Transport: tcp:///127.0.0.1:27510@1885
2015-07-01 14:51:32,687 | WARN  | Transport Connection to:
tcp://127.0.0.1:27511 failed: java.io.IOException: Unexpected error
occurred: java.lang.ArrayIndexOutOfBoundsException: 9 |
org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
Transport: tcp:///127.0.0.1:27511@1885
2015-07-01 14:51:32,812 | WARN  | Transport Connection to:
tcp://127.0.0.1:27512 failed: java.io.IOException: Unexpected error
occurred: java.lang.ArrayIndexOutOfBoundsException: 9 |
org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
Transport: tcp:///127.0.0.1:27512@1885
2015-07-01 14:51:32,937 | WARN  | Transport Connection to:
tcp://127.0.0.1:27513 failed: java.io.IOException: Unexpected error
occurred: java.lang.ArrayIndexOutOfBoundsException: 9 |
org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
Transport: tcp:///127.0.0.1:27513@1885
2015-07-01 14:51:33,047 | WARN  | Transport Connection to:
tcp://127.0.0.1:27514 failed: java.io.IOException: Unexpected error
occurred: java.lang.ArrayIndexOutOfBoundsException: 9 |
org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
Transport: tcp:///127.0.0.1:27514@1885
2015-07-01 14:51:33,172 | WARN  | Transport Connection to:
tcp://127.0.0.1:27515 failed: java.io.IOException: Unexpected error
occurred: java.lang.ArrayIndexOutOfBoundsException: 9 |
org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
Transport: tcp:///127.0.0.1:27515@1885
2015-07-01 14:51:33,297 | WARN  | Transport Connection to:
tcp://127.0.0.1:27516 failed: java.io.IOException: Unexpected error
occurred: java.lang.ArrayIndexOutOfBoundsException: 9 |
org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
Transport: tcp:///127.0.0.1:27516@1885
2015-07-01 14:51:33,422 | WARN  | Transport Connection to:
tcp://127.0.0.1:27517 failed: java.io.IOException: Unexpected error
occurred: java.lang.ArrayIndexOutOfBoundsException: 9 |
org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
Transport: tcp:///127.0.0.1:27517@1885
2015-07-01 14:51:33,547 | WARN  | Transport Connection to:
tcp://127.0.0.1:27518 failed: java.io.IOException: Unexpected error
occurred: java.lang.ArrayIndexOutOfBoundsException: 9 |
org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
Transport: tcp:///127.0.0.1:27518@1885
2015-07-01 14:51:33,672 | WARN  | Transport Connection to:
tcp://127.0.0.1:27519 failed: java.io.IOException: Unexpected error
occurred: java.lang.ArrayIndexOutOfBoundsException: 9 |
org.apache.activemq.broker.TransportConnection.Transport | ActiveMQ
Transport: tcp:///127.0.0.1:27519@1885





--
View this message in context: 
http://activemq.2283324.n4.nabble.com/ActiveMQ-MQTT-crash-when-subscribe-tp4698367p4698436.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ(MQTT) crash when subscribe

2015-06-30 Thread Christopher Shannon
Minor correction...the version in master is 5.12-SNAPSHOT

On Tue, Jun 30, 2015 at 10:39 PM, Christopher Shannon 
christopher.l.shan...@gmail.com wrote:

 Is the full stack trace in a log file that you could paste?  It would make
 it easier to track down where the out of bounds exception happened.

 Also, can you try running against the latest 5.12.0-SNAPSHOT? There's been
 some work done to MQTT over Websockets and I'm wondering if this issue
 still exists against the latest build.

 On Mon, Jun 29, 2015 at 4:08 PM, roox_4000 reza.mazar...@gmail.com
 wrote:

 I Download ActiveMQ Broker v5.11.1 And Run It (Use MQTT). I Can Publish
 And
 Subscribe With Websocket  PHP For Publish And Broker Work Well.

 But When Use PHP for subscribe Broker Console Give Me This ERROR And Dont
 Subscribe Topic

 WARN : Transport Connection to :tcp://127.0.0.1:18967
  failed:java.io.IOExeption:Unexpected error
  occurred:java.lang.ArrayIndexOutOfBoundsException :12

 http://activemq.2283324.n4.nabble.com/file/n4698367/activemq.jpg

 This Error In A loop That Port Error(tcp://127.0.0.1:18967) In Each
 Period
 Is Changed

 Subscribe.php :

 ?php

 require(../phpMQTT.php);


 $mqtt = new phpMQTT(localhost, 1883, phpMQTT Sub Example); //Change
 client name to something unique

 if(!$mqtt-connect()){
 exit(1);
 }

 $topics['chat/general'] = array(qos=0, function=procmsg);
 $mqtt-subscribe($topics,0);

 while($mqtt-proc()){

 }


 $mqtt-close();

 function procmsg($topic,$msg){
 echo Msg Recieved: .date(r).\nTopic:{$topic}\n$msg\n;
 }



 ?



 --
 View this message in context:
 http://activemq.2283324.n4.nabble.com/ActiveMQ-MQTT-crash-when-subscribe-tp4698367.html
 Sent from the ActiveMQ - User mailing list archive at Nabble.com.





ActiveMQ(MQTT) crash when subscribe

2015-06-29 Thread roox_4000
I Download ActiveMQ Broker v5.11.1 And Run It (Use MQTT). I Can Publish And
Subscribe With Websocket  PHP For Publish And Broker Work Well.

But When Use PHP for subscribe Broker Console Give Me This ERROR And Dont
Subscribe Topic

WARN : Transport Connection to :tcp://127.0.0.1:18967
 failed:java.io.IOExeption:Unexpected error 
 occurred:java.lang.ArrayIndexOutOfBoundsException :12

http://activemq.2283324.n4.nabble.com/file/n4698367/activemq.jpg 

This Error In A loop That Port Error(tcp://127.0.0.1:18967) In Each Period
Is Changed

Subscribe.php :

?php

require(../phpMQTT.php);


$mqtt = new phpMQTT(localhost, 1883, phpMQTT Sub Example); //Change
client name to something unique

if(!$mqtt-connect()){
exit(1);
}

$topics['chat/general'] = array(qos=0, function=procmsg);
$mqtt-subscribe($topics,0);

while($mqtt-proc()){

}


$mqtt-close();

function procmsg($topic,$msg){
echo Msg Recieved: .date(r).\nTopic:{$topic}\n$msg\n;
}



?



--
View this message in context: 
http://activemq.2283324.n4.nabble.com/ActiveMQ-MQTT-crash-when-subscribe-tp4698367.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.