cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Can't import a ThingShape in an extension

Highlighted
Newbie

Can't import a ThingShape in an extension

I'm trying to load up some objects through an extension I'm writing and I keep running into blocks when I import things. I have right now a ThingTemplate

@ThingworxBaseTemplateDefinition(name = "GenericThing")

@ThingworxPropertyDefinitions(properties = {

  @ThingworxPropertyDefinition(name = "Name", description = "Name of thing on Timeli's platform (required). Should be unique.", category = "", baseType = "STRING", isLocalOnly = false, aspects = {

  "isPersistent:true", "dataChangeType:VALUE" }), @ThingworxPropertyDefinition(name = "Samples", description = "", category = "", baseType = "THINGNAME", isLocalOnly = false, aspects = {

  "thingShape:Samples", "dataChangeType:VALUE" }) })

public class MyThingTemplate extends Thing { ...

and two ThingShape objects, Samples

@ThingworxPropertyDefinitions(properties = {

  @ThingworxPropertyDefinition(name = "Samples", description = "", category = "", baseType = "INFOTABLE", isLocalOnly = false, aspects = {

  "dataChangeType:VALUE", "isEntityDataShape:true", "dataShape:Sample" }) })

public class Samples extends ThingShape {

and Sample (singular)

@ThingworxPropertyDefinitions(properties = {

  @ThingworxPropertyDefinition(name = "Timestamp", description = "", category = "", baseType = "DATETIME", isLocalOnly = false, aspects = {

  "dataChangeType:VALUE" }), @ThingworxPropertyDefinition(name = "Value", description = "", category = "", baseType = "NUMBER", isLocalOnly = false, aspects = {

  "dataChangeType:VALUE" }) })

public class Sample extends ThingShape {

All objects are stubs in the sense there's as yet no Java code in them.

My metadata.xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?><Entities>

    <ExtensionPackages>

        <ExtensionPackage dependsOn="" description="" minimumThingWorxVersion="7.2.1" name="penrose" packageVersion="0.0.0004" vendor="">

            <JarResources>

                <FileResource description="" file="penrose.jar" type="JAR"/>

            </JarResources>

        </ExtensionPackage>

    </ExtensionPackages>

    <ThingPackages>

        <ThingPackage className="io.timeli.penrose.MyThingTemplate" description="" name="MyThingTemplatePackage"/>

    </ThingPackages>

    <ThingTemplates>

        <ThingTemplate aspect.isEditableExtensionObject="false" description="" name="MyThingTemplate" thingPackage="MyThingTemplatePackage"/>

    </ThingTemplates>

    <ThingShapes>

        <ThingShape aspect.isEditableExtensionObject="false" className="io.timeli.penrose.Samples" description="" name="Samples"/>

        <ThingShape aspect.isEditableExtensionObject="false" className="io.timeli.penrose.Sample" description="" name="Sample"/>

    </ThingShapes>

</Entities>

It builds on my local, of course, because there's no code to compile. But when I import, I get the following:

Import Failed: Validation Failure: ThingShape Samples Had An Invalid Class Name : [io.timeli.penrose.Samples] - Possibly Missing Extension Package

What am I missing? Please feel free to ask for more information. But it seems to me I've declared the fully qualified classname for Samples in the metadata.xml and the class file is present in the jar. The objects all extend the appropriate base classes. So what else is there to do?

11 REPLIES 11

Re: Can't import a ThingShape in an extension

The only thing I can think of for this is, are you sure these classes are properly located in this package (io.timeli.penrose)? Perhaps there is an issue with the property and thingShape having the same name? I don't see why that would be a problem... are you still having issues with this?

Re: Can't import a ThingShape in an extension

Thanks for the response.

I'm sure of these things. What I have right now is pretty close to the most basic possible project, so I'm pretty confused.

I've set up using Eclipse (Neon) and the TW plugin. I even created another project entirely in case there was some artifact of my messing around earlier causing issues. All entities were created using the plugin, the only thing I changed was adding the "extends ThingShape" to the Samples object in case the error message was mischaracterized somehow and it was really just having difficulty implementing a ThingShape with the class.

Here's a screenshot of the project as it stands:Screenshot 2016-11-03 18.19.01.png

And here's a screenshot of trying to upload patterns.zip from my distributions directory:

Screenshot 2016-11-03 18.31.09.png

If it helps anyone (for perusing logs), the IP of the AWS instance this was attempted on is 52.5.227.117.

Re: Can't import a ThingShape in an extension

I faced the same issue, I do not have proper solution, but I noticed that the 'className' attribute for ThingShape in metadata.xml is not acceptable for some reason. If I remove it then the extension installs fine. However I am not sure if this is a proper fix, I do not have anything meaningful in my class to be able to check.

Re: Can't import a ThingShape in an extension

I have the same probelm.

Did you find any solution?

Re: Can't import a ThingShape in an extension

Tori Tielebein​ have you investigated this any further and/or created a ticket on customer's behalf? If not, please do, especially now with multiple people reporting.

Rafael PALLARESSajid PatelKeith Nordstrom​ what are the thingworx and sdk version you are using? Please note this article too, https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS214774&lang=en_US  although at least from the first screenshot in this thread it's obvious the version is 7.x.

Re: Can't import a ThingShape in an extension

I cannot reproduce this using the 7.2 SDK and importing into 7.3. My ThingShape and ThingTemplate both import fine, even though they are in a package and everything. I am really not sure what the issue is here.

Re: Can't import a ThingShape in an extension

Hello,

I'm using ThingWorx 7.1.3 and the SDK version is 7.1.0.

I just created the ThingShape using the eclipse plugin as I create other entities.

The node created into metadata.xml is very simple:

<ThingShapes>

    <ThingShape aspect.isEditableExtensionObject="false" className="a.java.package.QueryBuilderSParam" description="" name="QueryBuilderSParam"/>

</ThingShapes>

Re: Can't import a ThingShape in an extension

Keith,

Any update on this issue? Have you made any progress?

Re: Can't import a ThingShape in an extension

Hi all,

I also have the same problem. This is with Thingworx 8.0 and Extension SDK 8.0, Thingworx extension builder lpgin for Eclipse 7.2 and Eclipse Mars 4.5.2. It is my understanding that these are the latest stable versions for all software.

I can verify that if you remove the className node in the ThingShape definition in the metadata.xml file then the extension will import but all my services in the custom ThingShape are not available.

I have similar issues with creating a resource library (it won't import), a script library (it won't create and services).

So we need a fix for this, otherwise all I can create through the extension plugin is a custom thing template, which is rather limiting.

Regards

Ben