You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Christian Schneider <ch...@die-schneider.net> on 2016/01/15 15:52:08 UTC

[Discuss] Working with secured JMS in weblogic requires InitialContext stay open per thread

I am working on a JMS issue reported by Guillaume. He reported that a 
secured weblogic jms can not be accessed with the
current JMS transport.

The reason seems to be that Weblogic seems to establish a security 
context on the thread when the InitialContext is opened.
It will remove that context when the InitialContext is closed.

https://issues.apache.org/jira/browse/CXF-6742

The problem is that we currently only create the InitialContext when 
retrieving the ConnectionFactory or when looking up a Destination from 
JNDI close it directly after.
For most jms providers this seems to be fine but weblogic complains with 
a SecurityException when the Consumer is opened outside that context. A 
similar problem also appears on the sending side.

I have now committed a first part of the proposed change from Guillaume. 
It makes sure the InitialContext is opened before on creating the 
Consumer on the listener threads of the MessageListenerContainer. This 
seems to work fine and should not have a big performance impact.

The problem is rather on the client side. We currently open a new 
session and producer for each message we send. This is not a big problem 
as both of these objects are cheap to create.
It will be different though if we also need to make sure an 
InitialContext is open. I am not sure but I assume that creating an 
InitialContext might involve a remote connection and so it might impact 
the performance quite
severly.

Does anyone have experience with secured Weblogic and possible 
performance impacts?
Are there better solutions ?

Christian


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com