[Security & JAAS/JBoss] - Re: Problems using JAAS with EJB 3.0 on JBoss 4.0.4-GA
by jaikiran
Going by the number of people reporting this problem, i decided to test a sample application. Here's what i found:
- It looks like the way you mention the security domain in the jboss.xml has changed. In earlier versions, you were supposed to specify something like:
<jboss>
| <security-domain>java:/jaas/jbossmq</security-domain>
| </jboss>
i.e the entire jndi name.
However this version JBoss4.0.4 GA (i tried out only on this version), needs you to specify only the security domain name. Something like:
<jboss>
| <security-domain>jbossmq</security-domain>
| </jboss>
This worked for me(Replace the jbossmq with any other security domain name that you want to use and is defined in login-config.xml). I did not specify any SecurityDomain annotation in the bean and just added the above mentioned line in jboss.xml and it worked. So conclusion is, you can still use the jboss.xml without having to specify a annotation in the bean.
Now i am not sure whether this is a bug in JBoss or whether this change in behavior was intentional but was missed out in the documentation. If any JBoss developer considers this as a bug, do let me know, i can provide the test case along with the logs that i have.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976999#3976999
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3976999
19 years, 7 months
[JBoss jBPM] - jbpmContext in webapp
by fATbEAT
hi,
i want to adapt the jbpm webapp to the needs of our company, therefore i've implemeted an own context manager which creates a context instance with a certain configuration which is needed, that's the only thing i adopted so far, i've put these adoptions into the an own jbpmcontextfilter where i create my context with my own configuration, everything else (beans etc.) haven't been changed so far.
if i try out the webapp with one user everything works fine, but if i login with a second (using another browser) and starting two parallel processes i sometimes get an error which tells me that the context has already been closed and i should check my finally blocks.
there seems to be a problem with the filter, should not have every user an own context in his session?
gerald
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976996#3976996
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3976996
19 years, 7 months
[Messaging, JMS & JBossMQ] - Topic/QueueRequestor does not respond
by biroj
Hi all,
I'm not completely sure that it is new problem, but I've not found the solution yet in JBoss forum...
I'm using a stateless session bean which uses TopicRequestor.request to publish a message into a Topic and wait for the response. The subscriber of the target topic is a simple MDB.
This MDB receives the message and sends the answer back to the TemporaryTopic specified in the JMSReplyTo field correctly without throwing any exception, but the TopicRequestor.request hangs and does not receive any reply.
I reimplemented the TopicRequestor because I would need timeout feature in any case, but it has also the same problem. Is the temporaryQueue/Topic working in JBoss at all?
JBoss: 4.0.4 GA
Op. : Windows XP
My caller code which using TopicRequestor (HANGS):
//The STopicRequestor is my implementation, but the behaviour (except timeout handling of course) and error symptoms are the same
//Create a requestor using the session
| STopicRequestor requestor = new STopicRequestor(session,triggerTopic);
|
| //creating a trigger message
| TextMessage trigger = session.createTextMessage();
| trigger.setText("Trigger message SYNC");
|
| //sending message and waiting for the reply
| System.out.print("Sending sync trigger to the topic and waiting the response...");
|
| TextMessage replyMessage = (TextMessage) requestor.request(trigger,10000);
| System.out.print("Sending sync trigger to the topic and waiting the response...done");
| requestor.close();
|
The STopicRequestor implementation (WORKING):
public class STopicRequestor {
|
| private final TopicSession targetSession;
|
| private final TemporaryTopic callbackTopic;
|
| private final TopicPublisher publisher;
| private final TopicSubscriber subscriber;
|
| /**
| *
| * @param targetSession TopicSession (initialized) to be used
| * @param targetTopic Topic (intitialized) to be used
| * @throws JMSException Thrown in case of internal JMS error
| */
| public STopicRequestor(TopicSession targetSession, Topic targetTopic) throws JMSException
| {
| this.targetSession = targetSession;
|
| callbackTopic = targetSession.createTemporaryTopic();
| publisher = targetSession.createPublisher(targetTopic);
| subscriber = targetSession.createSubscriber(callbackTopic);
| }
|
|
| /**
| * Blocks the caller till the reply received or timeout expires
| * @param messageToBeSent The message to be sent to the Topic
| * @param timeoutMilliseconds If set to 0 no timeout is used
| * @return The reply message, null is returned if timeout expired
| * @throws JMSException Thrown in case of internal JMS error
| */
| public Message request(Message messageToBeSent, long timeoutMilliseconds) throws JMSException
| {
| Message replyMessage = null;
|
| messageToBeSent.setJMSReplyTo(callbackTopic);
|
| publisher.publish(messageToBeSent);
|
| replyMessage = subscriber.receive(timeoutMilliseconds);
|
| return replyMessage;
| }
|
| public void close() throws JMSException
| {
| targetSession.close();
| callbackTopic.delete();
| }
|
| }
The MDB Code which consumes the message (WORKING)
//Create a connection to JMS Provider
| TopicConnection connection = factory.createTopicConnection();
|
| //Create a session which is a helper class during communication
| //no transaction is needed, second parameter is meaningless in case of publishing
| TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
|
| //Create a publisher using the session
| TopicPublisher publisher = session.createPublisher(callback);
|
| //creating the response
| TextMessage response = session.createTextMessage();
| response.setText("Synchronous response");
|
| System.out.print("Sending response to temporary topic..." + publisher.toString());
| //sending message
| publisher.publish(response);
|
| System.out.print("Sending response to temporary topic...done");
|
| publisher.close();
I have seen in the specification that a TemporaryQueue/Topic can be consumed only using the same Session that created it before. But how coul I pass a Session to the MDB? I'm a little bit confused by the spec. and some examples.
Could you help me and propose a working solution?
Thanks a lot for your help in advance,
Bye,
Janos Biro
janos.biro(a)siemens.com
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976992#3976992
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3976992
19 years, 7 months