Senaka, This is Synapse API and as far as it is unchanged you will not be affected by the implementation of the registry, because the Synapse API is not bound to any of the registry implementations.
Thanks, Ruwan Senaka Fernando wrote: > Hi Indika, > > Yep, the latest fix seem to solve my problem. Btw, one more question. > I managed to read the contents of the DataHandler in the following manner. > > OMNode textNode = registry.lookup(registryKey); > DataHandler dh = (DataHandler)(((OMText)textNode).getDataHandler()); > BufferedReader br = new BufferedReader(new > InputStreamReader((InputStream)(dh.getContent()))); > > Do all Registries implemented by WSO2ESB or any in the future do > confirm to this layout? That means, am I certain that I can read > non-XML content from any registry in this manner? > > Thanks, > Senaka > > 2008/8/10 Indika Kumara <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> > > Hi Senaka > > There was an issue as there are no parent for wrapping OMText > Element that used to wrap binary and plain text as a DataHandler. > As I can remember , I had tested this scenario when I was adding > handling binary and plain text . But , there was no > result.detach() method at that svn revision. It seems that this > (result.detach()) was added for fixing an issue and after that it > seems to forget to test a scenario accessing resources with binary > and plain text content. > > I have fixed this and update sample 350 to demonstrates this. That > sample use Java script files in native form. > > Please update both synapse and ESB source and try out your > scenario again. > > Thanks > Indika > > > Senaka Fernando wrote: >> Hi all, >> >> Recently when working on the ESB Registry, >> (org.wso2.esb.registry.ESBRegistry), I discovered that I can >> quite easily obtain the contents of an XML file using a >> lookup(String). According to the implementation, it also seems to >> handle non-XML file types (ex:- .txt) as well, and creates a >> OMText along with the file attached as a DataHandler to it. Did I >> get this correct? or am I mistaken? >> >> If I got it right, it works fine upto, result.detach(). At this >> point I get an exception, >> >> org.apache.axiom.om.OMException: Elements that doesn't have a >> parent can not be detached >> at >> org.apache.axiom.om.impl.llom.OMNodeImpl.detach(OMNodeImpl.java:195) >> at org.wso2.esb.registry.ESBRegistry.lookup(ESBRegistry.java:207) >> at >> >> org.sciflex.plugins.synapse.esper.mediators.AxiomMediator.mediate(AxiomMediator.java:221) >> at >> >> org.apache.synapse.mediators.ext.ClassMediator.mediate(ClassMediator.java:78) >> at >> >> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:58) >> at >> >> org.apache.synapse.mediators.filters.FilterMediator.mediate(FilterMediator.java:95) >> at >> >> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:58) >> at >> >> org.apache.synapse.mediators.filters.InMediator.mediate(InMediator.java:60) >> at >> >> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:58) >> at >> >> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:125) >> at >> >> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:176) >> at >> >> org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:89) >> at >> org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:170) >> at >> >> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275) >> at >> >> org.apache.synapse.transport.nhttp.ServerWorker.processPost(ServerWorker.java:244) >> at >> >> org.apache.synapse.transport.nhttp.ServerWorker.run(ServerWorker.java:185) >> at >> >> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) >> at >> >> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) >> at java.lang.Thread.run(Thread.java:619) >> >> It might most probably be that I'm making a mistake here. If so, >> can you please tell me how I could for instance read a .txt file >> that I save in the ESBRegistry? >> >> Thanks, >> Senaka >> No virus found in this incoming message. >> Checked by AVG - http://www.avg.com >> Version: 8.0.138 / Virus Database: 270.6.0/1602 - Release Date: 8/9/2008 >> 1:22 PM >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Esb-java-dev mailing list >> [email protected] <mailto:[email protected]> >> http://mailman.wso2.org/cgi-bin/mailman/listinfo/esb-java-dev >> > > > _______________________________________________ > Esb-java-dev mailing list > [email protected] <mailto:[email protected]> > http://mailman.wso2.org/cgi-bin/mailman/listinfo/esb-java-dev > > > ------------------------------------------------------------------------ > > _______________________________________________ > Esb-java-dev mailing list > [email protected] > http://mailman.wso2.org/cgi-bin/mailman/listinfo/esb-java-dev > _______________________________________________ Esb-java-dev mailing list [email protected] http://mailman.wso2.org/cgi-bin/mailman/listinfo/esb-java-dev
