Getting around JSON response error

165 views
Skip to first unread message

Sean Adams-Hiett

unread,
Jan 25, 2012, 11:50:21 AM1/25/12
to ajax...@googlegroups.com
Great work on this project! Very cool concept and execution.

I have been trying to follow the demo, which I am hoping to adapt for a project that I am working on.  I am running into issues with the "Talking to Solr" step, which appear to relate to the json (jsonp?) response. When I change out provided solr url with the url to my solr instance, I am getting the follow error when the page is loading:

Uncaught SyntaxError: Unexpected token ILLEGAL (chrome)

unterminated string literal (firefox)

I gather from reading up on this that this has something to do with the way the json is formatted and problems with U-2028 and U-2029. I have read the following threads to see if there are any workarounds:

I am using Solr 3.5 running as a Tomcat6 webapp on a hard drive.

Is it possible that there is an issue with my solrconfig.xml?

James McKinney

unread,
Jan 25, 2012, 12:27:24 PM1/25/12
to ajax...@googlegroups.com
See this Solr issue: https://issues.apache.org/jira/browse/SOLR-2520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel It was apparently fixed in Solr 3.2.

What happens when you run the Solr response through http://www.jslint.com/? or if you try to evaluate it with JSON.parse? can you evaluate it with eval()?

What version of jQuery are you using? In Manager.jquery.js, have you tried removing "json.wrf=?"?

Sean Adams-Hiett

unread,
Jan 25, 2012, 1:37:38 PM1/25/12
to ajax...@googlegroups.com
Removing the "json.wrf=?" caused those errors to go away. Now I seem to have stumbled onto a more fundamental issue. The Manager.afterRequest() is never firing.  I went and took a look at the json that was coming back and I noticed that it seems to have no closing brackets.  Here is an example:

{"responseHeader":{"status":0,"QTime":0},"response":{"numFound":43678,"start":0,"docs":[{"contents":"idlotoer patriota department of the rolfe arrowlocal itemsrobi anderson of denver, colo., ur-rived in plover the latter part of tho week for a short visit with relatives and iri'-.'idst <; owen returned monday from hampton, iowa. mr owen reports that .mrs owen w.is successfully operated upon in the hospital there, ;md is now w.'ll on the road to recovery.real estate loans-wo are quoting low rotes on real estate ioudb. if you are expecting to make u loan on your farm this year, it will pay you to see us.wo solicit your banking uusl--ness on the basis of prompt, efficient service to you.peoples saving banki5st. 1883 the community dank:~:~:~>m~:~:~x\"xkk-:->m~:~>®x\">¯ 11the variety of our win-ned goods should appeal lo œ i }ou. especially at this sea- ||[ son ('aimed vegetables, canned fruits, meals, soups œ and so on. make your housework lighter during œ this season by being a con- œ slant \\isilor lo our canned goods department| saturday specials19c 19c 19c 19c 19c 19ci t11 i5:i!vlib. of pollock dakingpowder for ... 1 cnn white seal lllnc-kitaspbenlea for \\i i.iiiih oysters forsaturday special þ' cans hominy forsaturday special i pkgs. com starch.i willi spoon) i large can plm applesaturday spi-riultwo kxtk\\ specials white (jrtipcse\\tra special pem'lii'k-kxtra .special15c 15cfred ehler's| the right place to tradem. i helvlg spent last sunday in hampton with his daughter, mikk ivis, who is in a hospital fn that city, recovering from the effects of ® recent operation. martin reports that she is getting rlong nicely and will probably be home some, time the latter part of the weekmr and mrs. f j sarhv were holfi visitors last saturday and sundaythe m y ¯. club met with mrs l. n. moody last thursday afternoonmr and mrs. chas. england, mid mrs. england's father. mr brle.kson. of albert city, mr. and mrs. enoch erlckson and children of marathon, and mr. and mrs. a b. cobbs of rolfe spent sunday at the a. w. hess home in tjii8 city.jack (j ton on was recently thrown from a horse and suffered a broken arm.if you want to buy a ®ood corn planter, buy a. \"cbbc\" and pet the rest. see j. w. mangun, plover, iowa.p. j. nacke has purchased a buick touring car, and is now busy learning to operate the same.miss freda gcmbler, daughter of pred oembler, was taken suddenly ill while in school one day last week. a physician was called and after examination pronounced it a case of scarlet fevermr sherlock of bmmotsburg was a business visitor here tuesday,1 h pollock has been making an improvement on bis farm residence by tho addition of a largo porch.ii .1. watts of des molncs spent sunday at the home of bis brother, chas. 15. watts.p 11. henderson has sold the building now occupied by the harness shop to geo. jcffriub.a. j eggspuehler has rctirfd from the management of the drury store mid is upending his time on his farm south of townif von want a gang plow that has no side draft, buy an \"oliver\" of j w \\!\\vr:!t\\, plover. iowa.m->v. iv. c. a. n'otksthe y w c a of plover lias been þliihe active of late, and the meetings held recently have enjoyed an excellent attendance. much interest has been shown in the work. it is certain that whatever we put into this work w.i will get as much out of it, and all young women of this community who desire right to win should give their support to the movement. make it a practice to attend our meetings-we ull need the spiritual food.twt-iity-8l\\ attended the meeting of inst week, and twenty were present at this week's meeting.miss ivis llclvig has missed the last two meeting!) on account of illness, but she is now improving rapidly and wo will expect to see her in attendance again soon.b--yplover \"y\" \\0tks the plover \"y\" donated $2.\" to the county work last week we have decided that we arc in this way put ting our money to very good use as the work is something extremely worth while. it will probably come in handy, as the county is a little short on money this yearif anyone has anything-money or other glftr.-to give to the \"y,\" {lr, for instance, the donation by mr c a oarlock, we would greatly appreciate it. and will put it lo the best use possible.afiflkat ilrondwny fttnr in n groat trod popular broadway play, supported by ilia beautiful unit attractive universal star. jtoremary tlieby. a lavuli production, far hurpurblnir anything ever attempted on ttio speaking vtage. i a photoplay t-o unuhuat that it is worth golnjr mllck to hh.at the idle hour, friday, may, 12plover school notes m. a. koster, snpt.\"some districts begin with consolidation, some achieve consolidation, and some have consolidation thrust upon them ' we were surprised last week lo learn that some of our territory wab in tho very act of slipping away to other districts-there was no time- for 'watchful waiting' any longer saturday night petitions, signed by more than two-thirds of tho, voters, were presented to the board and the notices are now posted calling for a special election for may 20th, in the manual training room of tho plover school building. although we would ordinarily not consider ourselves in favor of consolidation for this district, we are strongly in favor of it in this particular situation it is possible for other districts to take territory from this district until we havo only sixteen sections remaining; in order to maintain the school at its pri-sent standard it would then be necessary to raise the tax rate from the present thirty-two mills to something over forty mills. we have no new building to erect, most of our equipment in here, consolidation would reduce the expense of operation by reason of the closing of tho outside schools, an additional $500 in state aid would be secured for next year; prnctirally no change (as explained last week) need be made in the school itself, we would have a larger terrl-tnr\\ from which to draw the running expenses - ' can see no reason why the tax rate should be raised at all next year under consolidation.an informal vote will be taken on tho day ot tho election to decide as to whether the present method of transportation shall be continued, and perhaps a barn or shed built for tin tianih, or whethc. the district prefers to purchase iiubboh and hire drivers it can he done either wayprobably it number of those who will come in to the election have never before had an opportunity to learn just exactly what we do here. why not plan to take a half-hour off saturday afternoon and look over our equipment. someono will be here all afternoon to show you the equipmentmr eggspiiehler kindly invited the entire school to a matinee tuesday afternoon. wo went down in a body from tho hchool building at 4 o'clock, and enjoyed a film portraying tho lifo of general jackson the \"idle hour' is attempting to co-operate with the school by running nl least one cdu-catlonal film in the program saturday evening. this week it will be the story of abbolcm, as taken from tho diblc. this plan is to be tried during the remainder of the year as an experiment, if successful it will bo continued during the next school year.alfred roberts returned to school monday after an absence ot two weeks.tho seniors entertained the rest of the high school at their \"funeral\" last priday evening this was quite a jolly affair, despite the name. tho event of the evening was tho burial of tho class mascot, the spade which they have carried with them during their four years of high school life. ice cream and cake were served. we are all sorry that this is their last year, and yet we expect most of them back next year as bpcclal students in the normal training cottrbo-it will not be quite the same as it has been this year, howeverfreda gemblor is out of school this week on account of illness.tho hawkeyes will be entertained priday evening by the cleos. the latter promise their guests a good time.mrs. 11. a. kerns was ill the first of the week, so maudcllc was out of school monday to help in the housework.at last the flro escape is here, and is now being installed on the cast side of the building. it is a rather noisy job. but it wont last long, and tho results will, we believe, justify tho trouble involved50-->-plover methodist church notes hot. lewis ?f. moody, l'nstor last sunday evening several of our laymen again demonstrated the fact that a person need not be ordained in order to bo able to preach. ^sunday school at 10 o'clock and the preaching service at 11 o'clock, sunday morning.instead of the usual preaching scr-vlco next sunday evening, the ep-worth league will celebrate its anniversary by giving a mother's day program. everyone ib cordially invited, and especially the mothers of tho community. the offering, alter paying expenses, will go toward tho support of mr. roberts, the league's missionary in africa.¯-vbuy your farming machinery of us. wo have tho largest stock in tho county from which to make your selection. tho ware implement co., þware, iowa. 1 50tfpeterson well liked and here's our old friend, gus peterson, running for the republican nom-i: atlon, for county treasurer up in pocahontas county. if anything would make us vote the republican ticket it would be because gus peterson's name was on it. we have known liim fei thirty years, ever since he went to i'nincroy and started in the general merchandise business. our folks did practically all of their \"trading\" with him when he was in business, and there never was a squarer merchant anywhere. he is living in plover now, having moved there a few years ago to run a general merchandise store, which he has sold out. he is well educated, shrewd, careful, and honest tis the sun. if pocahontas county republican* should nominate gus peter-bon for treasurer they would never regret their action. it will occasion regret among his many friends in calhoun county that they do not live v/hero they can vote for him.-manson democrat3¯->laugh today, and tomorrow you may forget your grouch.a lot of people make a noise, but only a few got a hearing.notice in probate in the district court op the state op iowa, in and for pocahontas county: in the matter of the estate op joseph w. gari/ock. deceased-notice op the appointment of executorto whom it may concern:notice is hereby given that the undersigned has been appointed and has qualified as administrator of tho estate of joseph w oarlock, late of pocahontas county, iowa, deceased. all persons in any manner indebted to said deceased or his estate will make payment to the undersigned; and tliosc having claims against said deceased or his estate will present them in manner and form as by law required, for allowance and payment.hated this 1st day of march. a. d., 1'hg.2-:it c. a garlock,adm of said estate.s>---->notice of specialcounty electionss:court house proposition state of iowa ^pocahontas county fpublic notice is hereby given that ii special election of the county of i'oc.ihontas. in the state of iowa, will be held on tho 5th day of june, 1916, at which election the following proposition will be submitted to the voters of said county, to be by them voted uponþ shall the county of pocahontas, in the state of iowa, erect a new court house, and borrow money by the issuance of bonds to the amount of $150,000.00 to defray the cost of the erection of such court house, and levy a tax upon all of the taxable property within said county, at the rate of not to exceed two (2)) mills on tho dollar of the taxable value, in addition to all other taxes, year bydrury'sspecial sale-on-men's work and dress hats and shoesa lot or men's $2.00 and $2.50 hats to go this sale at only <œ f aoeach.......-......--- ®pi yoa lot of men's $1.60 and $2.00 hats to go this sale at only oftr*each --........-........--- \"ola lot of hoys' 50c and 76chatb to go nt ----........men's slippers, $3.60 and$-1.00 values, at..........ladles' slippers, $3.00 and$3.50 values, at......children's slippers, in black, tan andwhite, to go at..............costa lot of ladies' house drosses, $1.25, $1.50 and $1 75 values at œj qqa lot of 15c and 25c summer dress goods, to go at only, 1 (\\nper yard.............. l\"t25c $2.98 $2.78specials for 3 cans early juno peasspecial for saturday .. 3 5c plcga. any wash powderspecial for saturday-----7 bars pearl white laundrysoap, special-----.......1 10c bars of lloud soap forspecial for saturday . . ^þ6dl*25c can poaches, heavy syruf special for saturday .saturday25c 10c 25c 25c 19c'crakd prize > win ncr 'at, san franciscpthe low cloverleaf gives the manure two healthy beatings1x7e used to think that if we threw manure onto the ground any old way and plowed it under, we were doing a good job. but now we know that won't do. to do any real good, the manure must be broken up into small pieces and spread evenly.the low cloverleaf spreader is the one that does this \\vork best. it gives the manure two healthy beatings, one with the regular beater, the other with the wide spread disks. when the manure reaches the ground in that condition your soil gets all the good there is in it, and gets it quickly. the low cloverleaf is one spreader it will pay you to see before you buy. see tbe local dealer who has one set up for you to look at.international harvester company of america(bcarpontcj) low clorerlesf spreaders are sold byj. w. mangun, plover, iowai 1i 1!i*cheapest in the long run best from the startimckenzie steel fence posts give lln-rijjhl iippriinimx lo i he fiirm. tintl ttrc rapidly roming inlo general use in ihe best loctil-ilies, where liind values arc highest, sleel fence posls are very popularmckenzik steel fence posts can be ([tiickly set. simpk drive ihcm into ihe ground; and can he easily moved lo another location. this feature alone is worth more lltiin will first appear lo you.mckenzie steel fence posts admit of ihe farm being kepi free from noxious weeds by making it possible to burn over the ground along the fence as often as desired, without injury to the fence.mckenzie steel fence posts are much superior lo other sleel fence posls in many ways. they are heavy, and the shape is such thai tbe utmost strength is assured. uigidky when in the ground is sure, as the steel side plate is large .ind so secured that it ciinnol become detached, or shear off ihe rivets holding il, when the post is being driven into the bard ground. all wires attached lo tbe posts are grounded, conse-tpienlh then- is no danger- of live stock being killed by lightning, in coming m eon-lacl with the tenec.mckenzie steel cop.ner and strain pos'i's are long and heavy, with large anchor plates, and make a strong, permanent antl attractive anchorage for the fence. a mckenzik steel fence is the fence hint you ought to liave on your farm.the principle is righl-the posts are right-the prices are right-c-^jplease call and see these postsplover lumber companyplover, iowa-x\":--xx-v<®x®.x-k-:^:-:®:-:-x><->:\"><^ii!v v vit!vtii*iiivo trill havo for sntiirtny i-'rosli stran-licrrlcs, celery, lotiicp, had-ishes, aflpnragns, oranges ltnnanas antl appleshighest prices paidjfor butter and eggs. call us uj saturday and find out what th>y are.yours for a square dealed drljryby the clerksyear, to pay 6ald bonds and the interest thereon until said ponds and the interest thereon are. completely paid\"the polls of said election will be open from el^ht o'clock a. m . until seven o'clock v m, in the several election precincts of said county, at the corresponding polling places, as fnllowb'(pri-cliictl- ll'ollinr places) -bclhillp ..town of palmer t'edar.. . town of fonda. icenter ...townof pocahonui> iclinton .....town of rolfe.colfax . . .-center school housr cummins ..center school house dos moines.. center school housedover.....town of varina.garfield_____center school house.grant-___center school house.lake no. 1 . -center school house. lake no. 2...town of gilmore citylincoln_____center school house.uzard.......school houhe.walsutjlst.marshall----center school house.powhatan. . town of ploverroosevelt----center school housesherman----village of ware.swan lake.. town of laurens. washington-town of havelock. at -which election all of tho legal1 voters of said county are notified tr appear at said tlrno and place.this n

So, that clearly seems to be a problem. To test this out, I went into the Solr Admin and did a "*:*" search from there, and then manually added the "&wt=json" to it. I spot checked half a dozen records by changing the "start=" and every one I looked at seems to suffer from this same issue.

I know this is outside the scope of Ajax Solr, but do you have any idea why that could happen?

Sean Adams-Hiett

unread,
Jan 25, 2012, 1:40:20 PM1/25/12
to ajax...@googlegroups.com
I should probably also add that when I looked at the same results using xml, I didn't see any problems.

James McKinney

unread,
Jan 25, 2012, 2:38:13 PM1/25/12
to ajax...@googlegroups.com
It may be a Tomcat issue. People had a similar issue when using Jetty, and switching to LucidWords fixed it. I recommend sending your question to the solr-user mailing list: http://lucene.apache.org/solr/mailing_lists.html
Reply all
Reply to author
Forward
0 new messages