You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by aragoubi <ay...@gmail.com> on 2017/05/30 14:03:32 UTC

load class from activeMQ broker config

I have an activemq broker deployed inside my jboss server.
I am following this link in order to limit the connectivity to the ActiveMQ
server based on Token 
*https://mariuszprzydatek.com/2014/01/04/token-based-authentication-plugin-for-activemq/*.

I created a project named "authentification" in eclipse containing the two
classes "TokenAuthentificationPlugin" and "TokenAuthentificationBroker" and
deployed it in my server as a war file.

My question is how can I get reference to the tokenAuthenticationPlugin
class from my broker config file.
I tried this : 
 <bean id="tokenAuthenticationPlugin"
class="authentification.TokenAuthentificationPlugin"
xmlns="http://www.springframework.org/schema/beans"> 

But I am getting this error when activemq start to be deployed : Caused by:
java.lang.ClassNotFoundException:
authentification.TokenAuthentificationPlugin from [Module
"deployment.activemq-rar-5.9.0.rar:main" from Service Module Loader].

Could someone help me with this? 



--
View this message in context: http://activemq.2283324.n4.nabble.com/load-class-from-activeMQ-broker-config-tp4726700.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: load class from activeMQ broker config

Posted by aragoubi <ay...@gmail.com>.
No I'm not dynamically adding meta-data to messages which the user sends.
The system stores users and generates tokens for them after connection.
tokens are expired within a period of time.
So my broker receive token, and then send it back to the system for security
matters and to identify users(getting more informations to identify from
which topics they should get data). 



--
View this message in context: http://activemq.2283324.n4.nabble.com/load-class-from-activeMQ-broker-config-file-tp4726700p4726709.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: load class from activeMQ broker config

Posted by Justin Bertram <jb...@apache.org>.
> How can I change my packaging/deployment? Could you tell me more ?

I believe that's being addressed on your JBoss forum thread.


> I should receive token from client who try to connect to my broker, then send it to a system in order to verify client and to get further informations about him.

I'm still curious...

What additional information are you retrieving and how are you using it?  Are you dynamically adding meta-data to messages which the user sends?


Justin

----- Original Message -----
From: "aragoubi" <ay...@gmail.com>
To: users@activemq.apache.org
Sent: Tuesday, May 30, 2017 9:50:36 AM
Subject: Re: load class from activeMQ broker config

How can I change my packaging/deployment? Could you tell me more ?

For the "token" use-case, I should receive token from client who try to
connect to my broker, then send it to a system in order to verify client and
to get further informations about him.





--
View this message in context: http://activemq.2283324.n4.nabble.com/load-class-from-activeMQ-broker-config-file-tp4726700p4726704.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: load class from activeMQ broker config

Posted by aragoubi <ay...@gmail.com>.
How can I change my packaging/deployment? Could you tell me more ?

For the "token" use-case, I should receive token from client who try to
connect to my broker, then send it to a system in order to verify client and
to get further informations about him.





--
View this message in context: http://activemq.2283324.n4.nabble.com/load-class-from-activeMQ-broker-config-file-tp4726700p4726704.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: load class from activeMQ broker config

Posted by Justin Bertram <jb...@apache.org>.
If you're using a modern version of JBoss (e.g. 7.x or Wildfly) then just about everything has an isolated classloader.  It won't matter that the WAR is deployed before the broker.  The broker still won't be able to see classes in the WAR (and that is a good thing).  You'll need to configure things on the application server (and possibly change your packaging/deployment) so that the broker can actually see the plugin classes.

I'm curious about your "token" use-case.  Can you elaborate any further?


Justin

----- Original Message -----
From: "aragoubi" <ay...@gmail.com>
To: users@activemq.apache.org
Sent: Tuesday, May 30, 2017 9:27:46 AM
Subject: Re: load class from activeMQ broker config

1) When I start my jboss, I see that the war is deployed before activeMQ.
2) I need this plugin because I need to implement a code that send token to
a remote system to verify token passed by client.

To summerize my purpose is to call a class included in a war from the
activemq rar.
I also posted this question in jboss forum, I hope that I get an answer.



--
View this message in context: http://activemq.2283324.n4.nabble.com/load-class-from-activeMQ-broker-config-file-tp4726700p4726702.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: load class from activeMQ broker config

Posted by aragoubi <ay...@gmail.com>.
1) When I start my jboss, I see that the war is deployed before activeMQ.
2) I need this plugin because I need to implement a code that send token to
a remote system to verify token passed by client.

To summerize my purpose is to call a class included in a war from the
activemq rar.
I also posted this question in jboss forum, I hope that I get an answer.



--
View this message in context: http://activemq.2283324.n4.nabble.com/load-class-from-activeMQ-broker-config-file-tp4726700p4726702.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: load class from activeMQ broker config

Posted by Justin Bertram <jb...@apache.org>.
I think this question is probably best answered by the JBoss community as the problem is almost certainly related to classloading and/or dependency management.  In general there are a couple of things that don't make sense to me about what you've described:

  1) You've configured your broker to use a class that you've deployed in a WAR file.  But the broker itself is almost certainly started by the application server before applications (e.g. your WAR) are deployed.  How then can the broker access a class that isn't available?

  2) The whole "token based authentication" plugin thing seems completely redundant to me.  If you've enabled security properly this kind of check already happens.  If a user doesn't exist then they aren't allowed to connect.  Perhaps I'm missing something, but I don't see why you actually need this plugin.


Justin

----- Original Message -----
From: "aragoubi" <ay...@gmail.com>
To: users@activemq.apache.org
Sent: Tuesday, May 30, 2017 9:03:32 AM
Subject: load class from activeMQ broker config

I have an activemq broker deployed inside my jboss server.
I am following this link in order to limit the connectivity to the ActiveMQ
server based on Token 
*https://mariuszprzydatek.com/2014/01/04/token-based-authentication-plugin-for-activemq/*.

I created a project named "authentification" in eclipse containing the two
classes "TokenAuthentificationPlugin" and "TokenAuthentificationBroker" and
deployed it in my server as a war file.

My question is how can I get reference to the tokenAuthenticationPlugin
class from my broker config file.
I tried this : 
 <bean id="tokenAuthenticationPlugin"
class="authentification.TokenAuthentificationPlugin"
xmlns="http://www.springframework.org/schema/beans"> 

But I am getting this error when activemq start to be deployed : Caused by:
java.lang.ClassNotFoundException:
authentification.TokenAuthentificationPlugin from [Module
"deployment.activemq-rar-5.9.0.rar:main" from Service Module Loader].

Could someone help me with this? 



--
View this message in context: http://activemq.2283324.n4.nabble.com/load-class-from-activeMQ-broker-config-tp4726700.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.