[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xmlblaster] Errors when testing C-API



Jan Petranek wrote:
Hi Vaughn,

Am Samstag, 16. April 2005 14:05 schrieb Vaughn Combs:

Many Thanks. I tried it and it seems like they are
transforming &lt; to < at some point.


Question is, where does this substitution happen.


Here is the predicate that I am submitting:

Submitted Predicate:
/xmlBlaster/key[metadata/BasicTemporal/beginning_date_time_
group/hour_time &lt; 22 ]


and the exception that it pushes back is:



org.infospherics.commonAPI.impl.exception.PlatformFailureException:
XmlBlasterEx
ception errorCode=[resource.configuration]
serverSideException=true location=[Sa
xHandlerBase.parse()] message=[#exported Error while
SAX parsing :3:-1 : org.xml
.sax.SAXParseException: The content beginning "< " is
not legal markup. Perhaps
the " " (&#20;) character should be a letter.] [See
URL http://www.xmlblaster.or
g/xmlBlaster/doc/requirements/admin.errorcodes.listing.html#resource.config
urati on]
       at
mil.af.rl.jbi.platform.shared.capi.core.plugin.xmlblaster.BlasterList
ener.<init>(SubscriberSequenceReceptor.java:184)
       at
mil.af.rl.jbi.platform.shared.capi.core.plugin.xmlblaster.SubscriberS
equenceReceptor.init(SubscriberSequenceReceptor.java:80)
       at
mil.af.rl.jbi.platform.client.capi.core.plugin.xmlblaster.SubscriberS
equence.activateSequence(SubscriberSequence.java:301)
       at
mil.af.rl.jbi.platform.client.capi.impl.SubscriberSequence.activateSe
quence(SubscriberSequence.java:316)
       at
mil.af.rl.jbi.commonAPI.impl.jms.tests.sub.SubTest.main(SubTest.java:
140)



I wonder if there is something wrong in how I am
invoking the interface. Here is the code:



System.out.println("\n\n\nSubmitted Predicate:
"+submitPredicate+"\n\n\n");

this.con.subscribe("<key
oid='"+this.type+"#"+this.version+"'
queryType='XPATH'>"+
          submitPredicate+"</key>", "<qos/>");


If it works for you then I must be doing something wrong. Any ideas would be greatly appreciated.


It seems to work, but I use the C-API and the socket-connection. The transmitted subscription is:

[client] Subscribe key: <key queryType='XPATH'>//*[local-name()='Impact' and number(text())&lt;1]</key>
^^^
[client] Subscribe qos: <qos> <content>true</content> <persistent>false</persistent> <notify>false</notify><updateOneway>true</updateOneway></qos>
[client] Subscribe success, returned status is '
<qos>
<subscribe id='__subId:XPATH1113674459065000000'/>
<isSubscribe/>
</qos>'


This seems to work here, whereas a subscription with [client] Subscribe key: <key queryType='XPATH'>//*[local-name()='Impact' and number(text())<1]</key>
produces pretty much the same error as you receive.


It seems, the Java-API substitutes the entities, before the SAX-Parser gets it. You might try to find out, if it is the client, who substitutes the entities by running a network sniffer (e.g. ethereal) to monitor the subscription. (This is pretty straightforward with the socket-API, as the subscription messages are in plain text).

just start

  java org.xmlBlaster.Main -dump[socket]

and

  java <your client> ... -protocol SOCKET -dump[socket]

to see all messages in plain text.


Which connections do you use?

These differences between the C-API and the JAVA-API could indicate a bug in the Java-API. Well, until somebody fixes this, you could just write your subscription x<y
as y>x
This is just an ugly work-around, sorry I don't have a real solution.
:-), nice hack!

Marcel

Enjoy your weekend nevertheless,

Jan Petranek




--
http://www.xmlBlaster.org