[jira] Created: (AMQ-775) MessageAuthorizationPolicy doesn't work

2006-06-22 Thread Ning Li (JIRA)
MessageAuthorizationPolicy doesn't work
---

 Key: AMQ-775
 URL: https://issues.apache.org/activemq/browse/AMQ-775
 Project: ActiveMQ
Type: Bug

  Components: Broker  
Versions: 4.0
 Environment: windows NT 2003 server
Reporter: Ning Li


Use default config, set a MessageAuthorizationPolicy to BrokerService and start 
the broker.
There are several issues:
1) In BrokerService::startTransportConnector() method, 
connector.setMessageAuthorizationPolicy(policy); is in the wrong place, it 
should be moved to almost the very end of the method, otherwise if you use JMX, 
the ManageedTransportConnector won't have authorization policy info.
2) ManagedTransportConnector doesn't pass the auth policy to ManagedTransport, 
I think the easiest way to fix it is in AbstractConnection constructor,
adding this line:
this.messageAuthorizationPolicy = connector.getMessageAuthorizationPolicy();
and remove this line:
   answer.setMessageAuthorizationPolicy(messageAuthorizationPolicy); 
from TransportConnector::createConnection(), then it will work for both 
TransportConnection and ManagedTransportConnection
3) AbstrctConnection doesn't pass the auth policy to ConnectionContext, I think 
this can be fixed by adding this line:
  context.setMessageAuthorizationPolicy(this.getMessageAuthorizationPolicy());
to AbstractConnection::processAddConnection() method.

Now the auth policy can be reached by 
MessageAuthorizationPolicy::isAllowedToConsume(ConnectionContext context, 
Message message) method, but the real problem is message value is null, but we 
need to use it to check right, some of the right information is a property 
inside the message. 

Please take a look at the problem, thanks


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



[jira] Created: (AMQ-749) MQ multithreaded issue

2006-06-12 Thread Ning Li (JIRA)
MQ multithreaded issue
--

 Key: AMQ-749
 URL: https://issues.apache.org/activemq/browse/AMQ-749
 Project: ActiveMQ
Type: Bug

Versions: 4.0
 Environment: Windows
Reporter: Ning Li
Priority: Critical
 Fix For: incubation


Unable to run multithreaded MQ application, even for the simplest case.

This is the peudo code, modified the ProducerTool.java

For ( thread 1 to 30 )
{
Connection  connection = createConnection();
Session session = createSession(connection);
   Producer producer = createProducer(session);
   sendMessages(producer, 20);  //send 20 messages to broker using all default 
settings
}

these are the exceptions from broker:
Caught: javax.jms.JMSException: java.util.ConcurrentModificationException
[cp://localhost/127.0.0.1:61616] ActiveMQConnection WARN  Async 
exception with no exception listener: java.util.ConcurrentModificationException
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:787)
at java.util.HashMap$EntryIterator.next(HashMap.java:829)
at java.util.HashMap$EntryIterator.next(HashMap.java:827)
at 
org.apache.activemq.broker.view.ConnectionDotFileInterceptor.printProducers(ConnectionDotFileInterceptor.java:157)
at 
org.apache.activemq.broker.view.ConnectionDotFileInterceptor.generateFile(ConnectionDotFileInterceptor.java:140)
at 
org.apache.activemq.broker.view.DotFileInterceptorSupport.generateFile(DotFileInterceptorSupport.java:47)
at 
org.apache.activemq.broker.view.ConnectionDotFileInterceptor.addProducer(ConnectionDotFileInterceptor.java:85)
at 
org.apache.activemq.broker.MutableBrokerFilter.addProducer(MutableBrokerFilter.java:90)
at 
org.apache.activemq.broker.AbstractConnection.processAddProducer(AbstractConnection.java:397)
at org.apache.activemq.command.ProducerInfo.visit(ProducerInfo.java:100)
at 
org.apache.activemq.broker.AbstractConnection.service(AbstractConnection.java:201)
at 
org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:62)
at 
org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:97)
at 
org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:63)
at 
org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:114)
at 
org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:122)
at 
org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:87)
at 
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:143)
at java.lang.Thread.run(Thread.java:595)


and exception in the client side:
javax.jms.JMSException: java.util.ConcurrentModificationException
at 
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:45)
at 
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1137)
at org.apache.activemq.AdvisoryConsumer.init(AdvisoryConsumer.java:45)
at 
org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1227)
at 
org.apache.activemq.ActiveMQConnection.start(ActiveMQConnection.java:435)
at 
com.businessobjects.framework.services.mq.ToolSupport.createConnection(ToolSupport.java:51)
at 
com.businessobjects.framework.services.mq.ProducerTool.run(ProducerTool.java:106)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



[jira] Created: (AMQ-750) multi-threaded issues with failover transport

2006-06-12 Thread Ning Li (JIRA)
multi-threaded issues with failover transport
-

 Key: AMQ-750
 URL: https://issues.apache.org/activemq/browse/AMQ-750
 Project: ActiveMQ
Type: Bug

  Components: Transport  
Versions: 4.0
 Environment: Got the June 6 code using svn, and test is run on Windows
Reporter: Ning Li
Priority: Minor
 Fix For: incubation


Modified ProducerTool.java into multi-threaded test code:

This is the peudo code:

For ( thread 1 to 30 ) 
{ 
Connection connection = createConnection(); 
Session session = createSession(connection); 
   Producer producer = createProducer(session); 
   sendMessages(producer, 10); //each thread send 10 messages to broker, using 
url = failover:tcp://localhost:61616
} 

Please turn on Debug info for log4j, otherwise you will hit other threading 
issue before this one, when client shutting down, this exception will be thrown:
Thread-13 Sending total message: 10 Total time: 203 DONE !!!

[ Thread-13] FailoverTransport  DEBUG Stopped.
[cp://localhost/127.0.0.1:61616] FailoverTransport  DEBUG Transport 
failed, starting up reconnect task
java.net.SocketException: socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at 
org.apache.activemq.transport.tcp.TcpBufferedInputStream.fill(TcpBufferedInputStream.java:48)
at 
org.apache.activemq.transport.tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:55)
at java.io.DataInputStream.readInt(DataInputStream.java:353)
at 
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:274)
at 
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:142)
at java.lang.Thread.run(Thread.java:595)
[ActiveMQ Scheduler] InactivityMonitor  DEBUG Message 
sent since last write check, resetting flag
[cp://localhost/127.0.0.1:61616] FailoverTransport  DEBUG Transport 
failed, starting up reconnect task
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at 
org.apache.activemq.transport.tcp.TcpBufferedInputStream.fill(TcpBufferedInputStream.java:48)
at 
org.apache.activemq.transport.tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:55)
at java.io.DataInputStream.readInt(DataInputStream.java:353)
at 
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:274)
at 
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:142)
at java.lang.Thread.run(Thread.java:595)
[ ActiveMQ Task] FailoverTransport  DEBUG 
Attempting connect to: tcp://localhost:61616


Thread-17 Sending total message: 10 Total time: 109 DONE !!!
[ Thread-17] FailoverTransport  DEBUG Stopped.
[cp://localhost/127.0.0.1:61616] FailoverTransport  DEBUG Transport 
failed, starting up reconnect task
java.net.SocketException: socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at 
org.apache.activemq.transport.tcp.TcpBufferedInputStream.fill(TcpBufferedInputStream.java:48)
at 
org.apache.activemq.transport.tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:55)
at java.io.DataInputStream.readInt(DataInputStream.java:353)
at 
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:274)
at 
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:142)
at java.lang.Thread.run(Thread.java:595)


Thread-14 Sending total message: 10 Total time: 328 DONE !!!
[cp://localhost/127.0.0.1:61616] FailoverTransport  DEBUG Transport 
failed, starting up reconnect task
java.net.SocketException: socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at 
org.apache.activemq.transport.tcp.TcpBufferedInputStream.fill(TcpBufferedInputStream.java:48)
at 
org.apache.activemq.transport.tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:55)
at java.io.DataInputStream.readInt(DataInputStream.java:353)
at 
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:274)
at 
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:142)
at java.lang.Thread.run(Thread.java:595)





-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira