-
1. Re: HornetQException(unable to validate user: null) cause the loss of messages
ataylor Feb 6, 2010 4:34 AM (in response to farmerzen)do the examples work? if not i would try reisntalling HornetQ as you installation looks screwed. -
2. Re: HornetQException(unable to validate user: null) cause the loss of messages
clebert.suconic Feb 6, 2010 11:56 PM (in response to ataylor)I guess what the user is saying is the transaction is not marked as rollback only (and throwing an exception) when a security exception happens.
This test would fail at SecurityTest.java
public void testSendTX() throws Exception { Configuration configuration = createDefaultConfig(false); configuration.setSecurityEnabled(true); HornetQServer server = createServer(false, configuration); try { server.start(); HierarchicalRepository<Set<Role>> securityRepository = server.getSecurityRepository(); HornetQSecurityManager securityManager = server.getSecurityManager(); securityManager.addUser("auser", "pass"); Role role = new Role("arole", false, false, true, false, false, false, false); Set<Role> roles = new HashSet<Role>(); roles.add(role); securityRepository.addMatch(SecurityTest.addressA, roles); securityManager.addRole("auser", "arole"); ClientSessionFactory cf = createInVMFactory(); ClientSession session = cf.createSession("auser", "pass", false, true, true, false, -1); session.createQueue(SecurityTest.addressA, SecurityTest.queueA, true); ClientProducer cp = session.createProducer(SecurityTest.addressA); cp.send(session.createMessage(false)); boolean ex = false; try { session.commit(); } catch (HornetQException e) { ex = true; e.printStackTrace(); Assert.assertEquals(HornetQException.SECURITY_EXCEPTION, e.getCode()); } assertTrue(ex); session.close(); } finally { if (server.isStarted()) { server.stop(); } } }
any thoughts?
-
3. Re: HornetQException(unable to validate user: null) cause the loss of messages
clebert.suconic Feb 7, 2010 12:21 AM (in response to clebert.suconic)OOps, my bad.. I forgot to use a transaction session on my example.. ignore my last post
Rico, When you send non-blocking messages, the security exception will be only received on the client when doing a commit, so you have to make sure you're using transaction (if you expect to have security exceptions).
Now, I didn't understand if your problem was related to authentication not working properly, or if you're complaining about security not giving you exceptions at the client. (what could happen due to non-blocking messages).
-
4. Re: HornetQException(unable to validate user: null) cause the loss of messages
timfox Feb 7, 2010 2:51 AM (in response to clebert.suconic)Please take a look at http://community.jboss.org/wiki/Howtoreportabugissue
-
5. Re: HornetQException(unable to validate user: null) cause the loss of messages
farmerzen Feb 7, 2010 7:17 AM (in response to ataylor)Andy,
Thanks for your reply.
I will check the examples and my installation.
Rico
-
6. Re: HornetQException(unable to validate user: null) cause the loss of messages
farmerzen Feb 7, 2010 8:13 AM (in response to clebert.suconic)Hi Clebert,
Many thanks for your reply.
Sorry but I forgot to say that I use JMS (javax.jms) in all the process and then the Hornet implementation in a lower level.
I think my problem is conserning with the authentication not working properly.
My transaction is done in the 'server', not in MDB. MDB only does some tasks with the message.
Has I said:
1º It only happens from time to time, not allways.
2º Since I send the message to the queue, I can say that the transaction his commited (if I get no JMSException).
3º Hornet throws the HornetQException. Since is not catched anywhere (JMS or by me) I cannot rollback the transaction.
Hope I got more clear this time
Thanks again,
Rico
-
7. Re: HornetQException(unable to validate user: null) cause the loss of messages
farmerzen Feb 7, 2010 8:18 AM (in response to timfox)Hi Tim,
Thanks for your reply.
Sorry if I've been miss understood.
I will take a look at the user manual again and the anti-pattern guide.
I will post something when I got some news/doubts about this.
Thanks
Rico
-
8. Re: HornetQException(unable to validate user: null) cause the loss of messages
timfox Feb 7, 2010 2:18 PM (in response to farmerzen)If you can post a test case which reproduces the issue, someone will investigate further.
Also, creating the test case, and isolating the issue will help you understand the issue better.