import utility rest api related exceptions

Post Reply
mdpremkumar
Posts: 26
Joined: 17 Apr 2017, 09:06

Hi,

For the purpose of importing external data into EA model, we have done a PoC on consuming import utility rest API through Microsoft C# based standalone application.

Here are the version details.
Essential import utility 1.6.5
Tomcat 7.0

We have configured Excel and XML import activities to import few test Technology_Product data.
Initially we downloaded essentialInstall6 released on April, 18th 2017.

Before testing Rest API through code, wanted to check through service request test forms provided with essential import utility pack. Excel based request form (serviceRequestForm.html) worked fine. But XML based request form (serviceRequestXMLForm.html) throws exception. Below are the details of exception.

======================================================
Exception thrown by import utility based on April, 18th installation:
======================================================
type Exception report

message com.enterprise_architecture.essential.importutility.service.ImportServiceImpl cannot be cast to com.enterprise_architecture.essential.importutility.service.XmlImportServiceImpl

description The server encountered an internal error that prevented it from fulfilling this request.

exception

java.lang.ClassCastException: com.enterprise_architecture.essential.importutility.service.ImportServiceImpl cannot be cast to com.enterprise_architecture.essential.importutility.service.XmlImportServiceImpl
com.enterprise_architecture.essential.importutility.service.XmlImportService.getImportController(XmlImportService.java:821)
com.enterprise_architecture.essential.importutility.service.XmlImportService.doPost(XmlImportService.java:532)
javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
======================================================

Looks like an another release has been done on April, 28th and so downloaded that pack and established import utility. Before doing this renamed old version's name as essential_import_Utility1_6_5_old. The new web apps folder is essential_import_utility1_6_5.

Tested the rest api request forms of Excel and XML. Now Excel fails and XML works.

Below are the details of exception

======================================================
Exception thrown by import utility based on April, 28th installation:
======================================================
type Exception report

message com.enterprise_architecture.essential.importutility.service.XmlImportServiceImpl cannot be cast to com.enterprise_architecture.essential.importutility.service.ImportServiceImpl

description The server encountered an internal error that prevented it from fulfilling this request.

exception

java.lang.ClassCastException: com.enterprise_architecture.essential.importutility.service.XmlImportServiceImpl cannot be cast to com.enterprise_architecture.essential.importutility.service.ImportServiceImpl
com.enterprise_architecture.essential.importutility.service.ImportService.getImportController(ImportService.java:703)
com.enterprise_architecture.essential.importutility.service.ImportService.doPost(ImportService.java:612)
javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
======================================================

When using our C# based program also, the behaviour is similar.

Has anyone encountered such problems?
Please suggest if we are doing something wrong at our end.

Thanks.
Prem
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Thanks for posting this, Prem.

I think you've discovered a bug! I can see what's causing it and I'll get that resolved - we're preparing a new release of the Import Utility right now, so this is excellent timing.

Can you confirm that the error message changes depending on whether you try an Excel or an XML import first? That is, if you try an Excel import first, you'll get this error on a subsequent XML import and vice versa?

Jonathan
Essential Project Team
User avatar
jonathan.carter
Posts: 1087
Joined: 04 Feb 2009, 15:44

Hi Prem,

We have just released version 6.0.2 of the Essential Open Source software, which includes changes to address this issue.

You can download this from our Downloads page. Please note that we have had to rename our installers to use a '.install' suffix. Once you have downloaded the installer - in your case 'essentialinstallupgrade602' - you must rename this to 'essentialinstallupgrade602.jar'.

Then double-click on it to run the installer. You can choose to only install the new version of the Import Utility - version 1.7.1

Once you have installed the new version of the Import Utility, export your configuration from your current version (from the System Admin panel). Save this configuration file and then upload it to your new (1.7.1) Import Utility to bring all your Import Activities into this new version.

Do let us know how you get on

Jonathan
Essential Project Team
mdpremkumar
Posts: 26
Joined: 17 Apr 2017, 09:06

Hi Jonathan,

Thank you so much for replying.
I am very sorry for my delayed reply and just now got a chance to look on the post.
I will follow your instructions to install latest import utility and confirm you soon if Excel/XML imports work fine.

Cheers,
Prem
mdpremkumar
Posts: 26
Joined: 17 Apr 2017, 09:06

Hi Jonathan,

I haven't got a chance yet to test the latest import utility REST APIs but will sure have a look on that very soon.

Actually we started looking on this REST api because we like to perform a synchronization between ServiceNow and EA meta model. The idea to perform this is as follows.

> Define an XML import activity with needed specifications in import utility.
> Invoke REST api of servicenow and generate XML file in the format as needed by import utility.
> Post generated XML to import utility's REST api which will trigger data transfer to EA meta model.

We checked this approach with the help of a PoC and it works fine.

Now we would like to hear some suggestions from you guys (and also from all the members of EA community who have done something similar to this) about performing sync between ServiceNow and EA.

Our primary goal is to move data from cmdb_ci to EA. Basically this base table contains data from other derived tables like cmdb_ci_spkg, cmdb_ci_firewall_network, cmdb_ci_computer (and its descendants), cmdb_ci_network_adapter, etc. All of these data should be segregated and moved to different EA classes.

We think that the items in cmdb_ci_spkg could be moved to Technology_Product and the entries related to cmdb_ci_computer and its descendants to Technology_Node. If you have some ideas on the mapping between ServiceNow tables and EA classes, kindly request you to provide some suggestions.

We are looking forward to hear suggestions on this from our community as well.

By the way, when posting large XML files to import utility, it takes more time to transfer data. For example I am checking with a file having a size of around 40 MB. Is there a way to improve the performance when posting such files?

Thanks.
Prem
mdpremkumar
Posts: 26
Joined: 17 Apr 2017, 09:06

Hi Jonathan,

Excel and XML REST APIs both work fine when using latest installation of import utility 1.7.1.
Thank you so much for providing this fix.

Cheers,
Prem
jonathan.carter wrote: 14 Jun 2017, 12:04 Hi Prem,

We have just released version 6.0.2 of the Essential Open Source software, which includes changes to address this issue.

You can download this from our Downloads page. Please note that we have had to rename our installers to use a '.install' suffix. Once you have downloaded the installer - in your case 'essentialinstallupgrade602' - you must rename this to 'essentialinstallupgrade602.jar'.

Then double-click on it to run the installer. You can choose to only install the new version of the Import Utility - version 1.7.1

Once you have installed the new version of the Import Utility, export your configuration from your current version (from the System Admin panel). Save this configuration file and then upload it to your new (1.7.1) Import Utility to bring all your Import Activities into this new version.

Do let us know how you get on

Jonathan
Post Reply