Skip to main content
Solved

JSONTemplater Error - unexpected "{", expecting "external" or ":="


jess
Contributor
Forum|alt.badge.img+1
  • Contributor

I'm getting a weird error while using the XMLTemplater. 

JSONTemplater(XMLTemplaterFactory): The following error occurred near line 5, column 49 of the query:

JSONTemplater(XMLTemplaterFactory): invalid expression: syntax error, unexpected "{", expecting "external" or ":="

JSONTemplater(XMLTemplaterFactory): An error occurred while parsing the ROOT template

JSONTemplater(XMLTemplaterFactory): A fatal error has occurred. Check the logfile above for details

Very simple template, in fact I can reduce it to only "{}" and still get the error. It seems to be the same error as is talked about here:

https://knowledge.safe.com/questions/3947/xmltempl...

and mentioned by @pwittle (another post?) in the comments.

I don't remember a problem with this workbench before when we were at version 10.0 of ArcGIS Desktop (now at 10.3.1) if that helps. Underlying RDBMS on our geodatabase is Oracle 11g on the source data.

Version: FME Desktop 2015.0 Build 15250

Is this a documented bug that I'm not finding with the search engine?

Thanks,

~jess~

Best answer by brianatsafe

Hi, I've been working with @jess via our customer support channel and we have found that this was an issue present in the FME 2015.0 release and has since been fixed with 2015.1+. The problem was tied to how the JSONTemplater populates the root document with parameters from each reader and one of these parameters was causing this error message to occur. Sorry for any inconvenience that this issue may have caused.

View original
Did this help you find an answer to your question?
<strong>This post is closed to further activity.</strong><br /> It may be a question with a best answer, an implemented idea, or just a post needing no comment.<br /> If you have a follow-up or related question, please <a href="https://community.safe.com/topic/new">post a new question or idea</a>.<br /> If there is a genuine update to be made, please contact us and request that the post is reopened.

16 replies

david_r
Celebrity
  • December 7, 2015

Could you post your template here, if it isn't too big?


jess
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • December 7, 2015
{
        "routeNo" : fme:get-attribute("PLOW_ROUTE_SHORT"),
        "priority" : fme:get-attribute("PLOW_PRIORITY")
}

jess
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • December 7, 2015

...But I can get the same error message using only "{}" as my template. Same when loading from textfile vs from an expression.


david_r
Celebrity
  • December 7, 2015
jess wrote:
{
        "routeNo" : fme:get-attribute("PLOW_ROUTE_SHORT"),
        "priority" : fme:get-attribute("PLOW_PRIORITY")
}

As you probably already know, there is nothing obviously wrong with your template.

I would try deleting the JSONTemplater from your workspace and to re-create it, to see if there are some weird settings stuck in there.


david_r
Celebrity
  • December 7, 2015
jess wrote:
{
        "routeNo" : fme:get-attribute("PLOW_ROUTE_SHORT"),
        "priority" : fme:get-attribute("PLOW_PRIORITY")
}

Something is weird, though. The error message above states that problem lies on line 5, column 49, which does not exist in this template.


jess
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • December 7, 2015
david_r wrote:

As you probably already know, there is nothing obviously wrong with your template.

I would try deleting the JSONTemplater from your workspace and to re-create it, to see if there are some weird settings stuck in there.

Thanks for your responses @david_r

I'm going to try re-creating the workspace from scratch. My thinking is the same as yours on this. Ditto for your comment on the "line 5, column 49" - obviously there is a memory overflow or data mismatch or something strange going on with this workspace.


jess
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • December 7, 2015

UPDATE: Completely rebuilt the workbench but the problem remains. I can avoid the error by removing the JSONTemplater/XMLTemplater from the workflow (both produce this error).


jess
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • December 7, 2015
david_r wrote:

As you probably already know, there is nothing obviously wrong with your template.

I would try deleting the JSONTemplater from your workspace and to re-create it, to see if there are some weird settings stuck in there.

Starting to think its more to do with the transformer itself...


jess
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • December 7, 2015

Certainly a problem with the ESRI ArcSDE reader. Works fine with a creator as source data, but as soon as I bring data from SDE, even with a blank {} template, same error. Now I just need to figure out which program (or both) needs to be re-installed... Any help Safe?


david_r
Celebrity
  • December 8, 2015
jess wrote:

Certainly a problem with the ESRI ArcSDE reader. Works fine with a creator as source data, but as soon as I bring data from SDE, even with a blank {} template, same error. Now I just need to figure out which program (or both) needs to be re-installed... Any help Safe?

Maybe try inserting an AttributeKeeper just before the JSONTemplater so you do not get any unwanted attributes from the ArcSDE reader. Be sure to only select the attributes you really need.


david_r
Celebrity
  • December 8, 2015
jess wrote:

UPDATE: Completely rebuilt the workbench but the problem remains. I can avoid the error by removing the JSONTemplater/XMLTemplater from the workflow (both produce this error).

That is strange. If the AttributeKeeper (see below) doesn't work, consider sending a minimalist workspace to reproduce the problem to Safe support.


jess
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • December 8, 2015
david_r wrote:

That is strange. If the AttributeKeeper (see below) doesn't work, consider sending a minimalist workspace to reproduce the problem to Safe support.

Yeah that's where I am. Thanks for you help! I'll post back if a) AttributeKeeper works or b) Safe gets back to me with a fix.


mark2atsafe
Safer
Forum|alt.badge.img+44
  • Safer
  • December 8, 2015
david_r wrote:

Could you post your template here, if it isn't too big?

Maybe post a screenshot of the transformer dialog - with all options for brace matching, spaces/tabs, etc turned on? Also, do you get the same error if you just attach a Creator transformer instead of incoming data?


jess
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • December 8, 2015
david_r wrote:

Maybe try inserting an AttributeKeeper just before the JSONTemplater so you do not get any unwanted attributes from the ArcSDE reader. Be sure to only select the attributes you really need.

Tried it, same behavior. Error occurs when ESRI ArcSDE reader is in the workspace at all, even unconnected.


brianatsafe
Safer
Forum|alt.badge.img+11
  • Safer
  • Best Answer
  • December 9, 2015

Hi, I've been working with @jess via our customer support channel and we have found that this was an issue present in the FME 2015.0 release and has since been fixed with 2015.1+. The problem was tied to how the JSONTemplater populates the root document with parameters from each reader and one of these parameters was causing this error message to occur. Sorry for any inconvenience that this issue may have caused.


jess
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • December 10, 2015
brianatsafe wrote:

Hi, I've been working with @jess via our customer support channel and we have found that this was an issue present in the FME 2015.0 release and has since been fixed with 2015.1+. The problem was tied to how the JSONTemplater populates the root document with parameters from each reader and one of these parameters was causing this error message to occur. Sorry for any inconvenience that this issue may have caused.

Thanks Brian and Safe!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings