Junos Space SDK > Developer Guides > Junos Space Application Developer Guide > Programming with the Junos Space SDK > Using the Junos Space SDK Plug-in

Migrating to the Latest SDK

A Junos Space application created with an older version of the SDK plug-in might not function as required when you upgrade to the latest SDK plug-in. To resolve the incompatibility, a new Migrate to Latest SDK tool enables you to upgrade your application. The migration tool automatically updates the .jar files in the project, and changes the build dependency to reflect these updates.

Note: If you try to migrate a Junos Space application after it has been already migrated, the message indicates "Junos Space Application has already been migrated with the latest SDK jars."

To upgrade to the latest SDK version:

  1. Start the Eclipse IDE.
  2. Select Junos Space > Migrate To Latest SDK. The Migrate to Latest SDK window is displayed.

  3. In the Migrate to Latest SDK window, select the appropriate checkboxes to choose the corresponding .jar files.

  4. Jar Displays a list of .jar files to be added or upgraded.
    Status Displays the status of the .jar file. Options are New, Old, or Obsolete. If an application has a .jar file that is no longer required by the SDK plug-in, the .jar file is considered obsolete.
    Action Displays the action to be taken on the .jar file.

    Note: By default the Select All checkbox is selected. Select or clear the individual checkboxes for any .jar files you want migrated or not, as appropriate.

  5. Click Finish to complete the application migration process. The selected .jar files are updated. The application is now compatible with the latest SDK plug-in.

Resolving a Build or Deploy Error

If you use the latest SDK plug-in to build or deploy an old application created with the 1.0 SDK plug-in, an error message similar to the following is displayed:


To resolve this error:

  1. Open the .packages file of the EAR project. To quickly find the .packages file, select Navigate > Open Resource (or enter the shortcut Ctrl-Shift-R) and enter .packages. Choose the proper .packages file from the list of matching items and click the Open button.
  2. Change the value of the todir attribute from C:/Temp/ to ./bin/ as shown below:
  3. Restart the Eclipse IDE.

Resolving a Build or Deploy Versioning Error

Error: "JSVA cannot downgrade app version from <app-version> to lower version"

If you use the latest SDK plug-in and build or deploy an old application created with an older version of the SDK plug-in, the following error message might be displayed while you are redeploying the application:

ERROR: "JSVA cannot downgrade app version from <version-number> to lower version"

Downgrading an application to a lower version that is not supported.

To resolve this error:

  1. Open the app-info editor and change the version number to something higher than the version current deployed.
  2. Save your changes, and redeploy the application.

or

  1. Uninstall the old application and deploy the updated application, without changing the version in the app-info editor.

Error: "Old RPM name"

If you use the latest SDK plug-in and build or deploy an old application created with an older version of the SDK plug-in, the following error message might be displayed when you open the app-info editor:

ERROR: "Old Rpm Naming convention Detected!"

To resolve this error:

  1. Copy the latest app-info.xsd file from the Junos Space SDK home folder's "docs" folder to your application.
  2. Refresh your application's Ear Project.
  3. Modify something in the app-info editor and save.

Error: "Platform does not support the current JPA facet version"

For a resolution, see the Projects Facet Error discussion below.

Editing the RESTified Resources of the SDK Version 1.0.1 or Older

When you try to edit the RESTified resources of SDK version 1.0.1 or older, the EJB-REST wizard might not be able to locate the existing code. In more recent versions, the default target package and REST classes might have different names, so the wizard does not find the desired resources.

To resolve this problem, while editing the RESTified code, manually change the Interface Target Package and Interface Target File to valid values so that the EJB-REST wizard is able to locate them and open them in edit mode. Change these values at the REST Interface Creation window by right-clicking the EJB interface in the Eclipse Project Explorer tab, then choosing the Create/Edit REST Resources menu option.

Migrating Applications from Eclipse Helios to Eclipse Indigo

Migrating applications that are created in older versions of Eclipse to Eclipse Indigo can cause errors. You might encounter errors in the EJB project related to JPA project facets, such as:

These errors are displayed because Eclipse Indigo adds JPA 2.0 support. JPA 2.0 is not compatible with JPA 1.0 (which is supported by earlier versions of Eclipse). To resolve these errors manually, perform the following steps:

  1. Select Junos Space > Migrate To Latest SDK. The Migrate to Latest SDK window is displayed.
  2. Select all the JARs and click Finish.

    Note: Make sure you select all JPA 2.x related jars, which are shown with an "Add" value in the "Action" column.

  3. Select the Project Facets option in the EJB project properties window. The Project Facets window is displayed.
  4. Select 2.0 from the JPA version drop-down menu and click Further configuration required error message. The Modify Faceted Project window is displayed.

  5. Select Generic 2.0 from the Platform drop-down menu and Disable Library Configuration from the JPA implementation dropdown menu.

  6. Click OK.
  7. If the application uses database queries, ensure all queries use correct JPQL statement syntax, which requires that identification variables are declared in the FROM clause. For example:
    • Query: select count(id) from CountryEntity
    • Modify to: select count(c.id) from CountryEntity c
  8. Include all Persist classes in persistence.xml. For example, if the classes "vnd.jssdk.helloworld.jpa.CountryEntity" and "vnd.jssdk.helloworld.jpa.StateEntity" display an error:
    • Error: Classes "vnd.jssdk.helloworld.jpa.CountryEntity" and "vnd.jssdk.helloworld.jpa.StateEntity" are mapped, but not included in any persistence unit.
    • Solution: Add these class names in the persistence.xml file. Change "MySQL" to "MySQL5" in the value.