Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
Hello community,
I wanted to try importing my latest project into a new platform using the extension method that I have heard about.
For those who do not know what I mean, there is a way to import a project created on thingworx onto another platform as an extension. This has several benefits like you can make entities non-editable and when upgrading versions old entities are not left on the platform.
Anyway, while trying this I ran into an issue that seems to be quite old.
"Attribute 'aspect.show' is not allowed to appear in element 'FieldDefinition'." - as well as other similar errors like aspect.isIndexed.
I tried to look up some fixes for it and found this post from a few years back.
Now, in this post it is said that if you are going to import something in in a way other than the "import from source control" way, then you should export your entities using the "normal" export function.
It also says the same thing in this support article, although it is also from a few years back.
I tried this, however the "aspect.show" property is still there in the field definition.
And I still get the same error while trying to import my project as an extension.
I do not see it feasible to manually remove these different aspects either as most (perhaps not all) are needed.
Eventually I'll probably open a case with PTC, but before that I thought I'd throw the question out there.
Thanks,
Jens
Solved! Go to Solution.
Hello Community,
One final update.
PTC support found the issue. We had used a reserved name in one of our data shapes:
"ThingShape" is apparently a reserved word by the platform.
The error message was not very clear so the PTC support has reported this to R&D so we can only hope this will be prevented in future releases.
Regards,
Jens
Hello,
Forgot to say what versions I am using.
I have exported my project as source control from a 9.3.5 platform.
My first test was to import it into a 9.1 platform, which I figured perhaps wasn't the best test as there could be some compatibility issues.
So I tried it on a 9.3.4 platform but ended up with a different yet similar error message:
"Element 'ThingShape' cannot have character [children], because the type's content type is element-only."
When checking my "ThingShape" element in the entity that fails it looks like:
<ThingShape>
<PropertyDefinitions></PropertyDefinitions>
<ServiceDefinitions></ServiceDefinitions>
<EventDefinitions></EventDefinitions>
<ServiceMappings></ServiceMappings>
<ServiceImplementations></ServiceImplementations>
<Subscriptions></Subscriptions>
</ThingShape>
Not really sure why it wouldn't work though...
Thanks,
Jens
Hi @jensc.
What version(s) of java are you running on each system? When you did the export, did you export as a project and if so, did you include dependencies? Also, did you validate that it works on a 9.3.5 system?
Regards.
--Sharon
Hello @slangley,
We are running these java versions:
9.1.x platform: jdk11.0.16_8
9.3.4 platform: jdk11.0.16_9
When I exported the project I exported it as "Source Control Entities":
I also tried it on a 9.3.5 platform but got the same error.
Just as a clarification, the error doesn't come when trying to import the extension, it comes when I try to validate the extension so I haven't tried importing it in case something breaks.
One of my colleagues has managed to do this and somewhere in the back of my mind I remember him saying that we needed to modify the entity files in some way to make this work. I just don't remember exactly what he said and he is on sick leave currently so I can't ask him.
If we can't figure it out I'll just wait until my colleague is back and check with him what it is that I forgot. If that still doesn't fix it I think I'll open a support ticket.
Thanks,
Jens
Just as Info: We always export the single entities in the entity export to source control
Not sure if this exports differently than the export project to source control..
It's the same way.
@jensc are those Java versions Coretto, or something else like OpenJDK?
I suspect the original error message (not the second) is visible in 9.1 because the validation logic is missing a fix (introduced in 9.2.0, here, specifically Fixed an issue that was causing an error when deploying packages from Solution Central to ThingWorx instances).
I am not sure why it would fail in importing in 9.3.4 though.
Hello @VladimirRosu,
They are both Amazon Corretto.
Ah, okay, I suppose that is why I got a different error message when trying to import into 9.3.+ then.
I did hear back from my colleague and he said that we might have to use project type "Component" for it to work, but he hadn't seen the same error as I am facing before.
So I think I'll open a case to see if perhaps there is some information to be gained from the platform logs or something like this.
Thanks,
Jens
Hello,
I wanted to make an update on this.
My case with PTC is still open and is being looked into.
I will update this post again once the case is resolved.
Regards,
Jens
Hello Community,
One final update.
PTC support found the issue. We had used a reserved name in one of our data shapes:
"ThingShape" is apparently a reserved word by the platform.
The error message was not very clear so the PTC support has reported this to R&D so we can only hope this will be prevented in future releases.
Regards,
Jens