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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Working with ExtensionMigratorBase - "Export file missing version information"

jasong
1-Newbie

Working with ExtensionMigratorBase - "Export file missing version information"

Hey all, I was trying to tinker with the ExtensionMigratorBase class to see how it all works and how this might be able to help me out. It is easy to code up using the Eclipse extension but I am unable to actually get any code to run.

public class QueueServerMigration extends ExtensionMigratorBase {

  private Logger log = LogUtilities.getInstance().getApplicationLogger(QueueServerMigration.class);

  public QueueServerMigration() {

     super();

     log.error("Entered QueueServerMigration.Constructor()");

  }

  @Override

  public void migrate(ImportedEntityCollection imports) throws Exception {

     log.error("Entered QueueServerMigration.migrate()");

  }

  @Override

  public void postMigrate(ImportedEntityCollection imports) throws Exception {

     super.postMigrate(imports);

     log.error("Entered QueueServerMigration.postMigrate()");

}

None of these logs show up for me, nor when I am attached to Tomcat can I hit breakpoints.

I do get an error in the Thingworx Application Log, which I do not understand: "Export file missing version information.  No migration will be performed."

The previous log is this "Starting entity import of C:\ThingworxStorage\extensions\temp\DeviceTemplate.QueueServer_a6764a4b-30c2-4f5b-9b93-d04dce45b21b\DeviceTemplate.QueueServer\metadata.xml"

This implies that my metadata.xml file is missing package version information, but it is not: packageVersion="1.0.4"

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

<Entities>

  <ExtensionPackages>

      <ExtensionPackage description="QueueServer and related Device Template"

            migratorClass="com.devicify.extension.QueueServerMigration"

            minimumThingWorxVersion="7.2.3" name="DeviceTemplate.QueueServer"

            packageVersion="1.0.4" vendor="Devicify">

            <JarResources>

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

            </JarResources>

      </ExtensionPackage>

  </ExtensionPackages>

</Entities>

The extension imports fine, all is well, it's just the migration code never executes.

Any ideas? There is not exactly a ton of information out there on this, that I can find at least.

5 REPLIES 5
posipova
20-Turquoise
(To:jasong)

Hi Jason,

What are the libraries included in your extension? I recall a situation with a similar error observed when two unsupported libraries were included. Would it be possible for you to also attach your project to see if we could dig in further?

The package is quite thin, no additional libraries, just some XML based entities at this point. Literally the only Java code is the migrator class.

I won't give you my package here, but if you email me privately I can send it over for you to check out.

jgeiger@devicify.net

This is my first package that I built with Gradle and I have some other issues with it, when trying to access dependent projects, so I may switch back to ANT since I am more familiar with it. But I am unsure if that is related since everything does compile fine as-is.

Jason,

Any update on this? Was Polina Osipova's post helpful? If so, could you click on the "correct answer" or "mark as helpful" button and let us know?

jasong
1-Newbie
(To:jasong)

Thanks for pushing me on this. I was working with tech support.

The update on this - basically, I was not using the latest and greatest version of the Extension package developer guide, which explains how this thing works a bit better. My issue was pretty much in my misunderstanding of what this this actually was doing and how it was called. Now that I know how it works, this is not the exact solution for me, which is fine, I was treating this as a post-install script for the Extension package (that would be good to have - request!) to generate some default data. I have dependent packages so if a certain package is installed I want it to look, upon install, for the other package, gather some information, and do some stuff. I suppose this is achievable a few ways, but it's not a large task for me at the moment.

Anyway, thanks for the help, I appreciate it.

jlin-4
1-Newbie
(To:jasong)

Hi, Jason

Is there any solution? I got the error in the Thingworx Application Log,too.

I try my customized extension,import to

A. Thingworx(Neo4j)  --->work fine.

B. Thingworx(PostgreSQL)--->not work..

    1. Thingworx Application Log: "Export file missing version information.  No migration will be performed."

    2. I just can see my customized extension files in the extension path:"/ThingworxStorage/extensions",but not work.

Hope to give me some suggestion... Thank you ~

Top Tags