Hi,

I am also facing the same problem.  Did we find a way to to change at least
the ServiceMix initial context factory 
extend or to be able to bypass the ServiceMix interceptor?

Thanks
Krushna


Dan Salt wrote:
> 
> Hi JB,
> 
> Great, thanks. As a temporary solution, where in the servicemix code do I
> need to change to bypass the Servicemix interceptor for LDAP contexts? 
> 
> Cheers,
> Dan
> 
> 
> Jean-Baptiste Onofré wrote:
>> 
>> Hi Dan,
>> 
>> Yes, I have already seen this problem.
>> 
>> For your information, I have begun to implement a servicemix-ldap 
>> binding component. It's not yet released, but I'm going to resume code 
>> on it. You can get the current source code here:
>> http://svn.apache.org/repos/asf/servicemix/components/bindings/servicemix-ldap/trunk/
>> 
>> Nevertheless, if you want to use the Camel LDAP component, you can raise 
>> a jira task to change at least the ServiceMix initial context factory 
>> extend or to be able to bypass the ServiceMix interceptor.
>> 
>> Regards
>> JB
>> 
>> Dan Salt wrote:
>>> Hi,
>>> 
>>> I'm trying to get LDAP working in Camel via ServiceMix 4. However, I get
>>> an
>>> exception when trying to use the "search" method against the LDAP
>>> "DirContext" object (obtained either using the Camel ProducerTemplate,
>>> or
>>> directly in code). 
>>> 
>>> I have diagnosed the problem via debugging, and have sourced the problem
>>> to
>>> servicemix.naming.InitialContextWrapper. When the LDAP InitialContext is
>>> created, Servicemix is internally intercepting this and inserting an
>>> InitialContextWrapper instead.
>>> 
>>> This InitialContextWrapper extends InitialContext, not DirContext, and
>>> so
>>> when the Java LDAP classes try to execute the "search(...)" method, it
>>> checks to see if the Default Context is an instanceof "DirContext",
>>> which it
>>> isn't, and throws an exception.
>>> 
>>> 22:42:14,203 | WARN  | enerContainer-43 | EndpointMessageListener         
>>> |
>>> nent.jms.EndpointMessageListener   98 |
>>> Endpoint[activemq:queue:spf-jms-endpoint] consumer caught an exception
>>> while
>>> processing JMS message: ActiveMQTextMessage {commandId = 8,
>>> responseRequired
>>> = true, messageId = ID:saltda-cbg-3684-1246329564484-0:0:2:1:1,
>>> originalDestination = null, originalTransactionId = null, producerId =
>>> ID:saltda-cbg-3684-1246329564484-0:0:2:1, destination =
>>> queue://spf-jms-endpoint, transactionId = null, expiration =
>>> 1246329584875,
>>> timestamp = 1246329564875, arrival = 0, brokerInTime = 1246329564875,
>>> brokerOutTime = 1246329564875, correlationId =
>>> ID-saltda-cbg/3683-1246329563750/3-0, replyTo =
>>> temp-queue://ID:saltda-cbg-3684-1246329564484-0:0:1, persistent = true,
>>> type
>>> = null, priority = 4, groupID = null, groupSequence = 0,
>>> targetConsumerId =
>>> null, compressed = false, userID = null, content = null,
>>> marshalledProperties = org.apache.activemq.util.byteseque...@5faa7,
>>> dataStructure = null, redeliveryCounter = 0, size = 0, properties =
>>> {SPF_SERVICE_NAME=http://spf.sse.ge/ExampleObjectService/GetObjectValue},
>>> readOnlyProperties = true, readOnlyBody = true, droppable = false, text
>>> =
>>> <?xml version="1.0" encoding="UTF-8" standalo...ObjectValue>}
>>> org.apache.camel.RuntimeCamelException:
>>> javax.naming.NotContextException:
>>> Not an instance of DirContext
>>>     at
>>> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:845)
>>>     at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:138)
>>>     at
>>> org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:101)
>>>     at
>>> org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:105)
>>>     at
>>> org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:121)
>>>     at
>>> org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:201)
>>>     at
>>> ge.sse.spf.spf_core_eips.ServiceLookup.process(ServiceLookup.java:38)
>>> 
>>> Please can anyone advise how to get around this - as it's a total
>>> show-stopper for me. My only option is to run all my Camel routes
>>> OUTSIDE of
>>> Servicemix, which isn't the solution I want.
>>> 
>>> Many thanks,
>>> Dan Salt
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/ServiceMix-InitialContextWrapper-breaks-LDAP-Requests-tp24266066p26001289.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to