Developer forum

Forum » Integration » Adding adapter breaks job

Adding adapter breaks job

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

Adding an adapter to an integration job breaks that job with an exception.

Steps:

1. Open integration job 
2. Click Add Adapter
3. Type a name and choose ConcatanateFieldsAdapter [sic]
4. Click Save and Close
5. Click Save and Close again
6. Click on the job name

Expected results:
The job opens

Actual results
Error:

Server Error in '/' Application.


Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:
 

[NullReferenceException: Object reference not set to an instance of an object.]
   Dynamicweb.Admin.DoMapping.Page_Load(Object sender, EventArgs e) +356
   System.Web.UI.Control.OnLoad(EventArgs e) +107
   System.Web.UI.Control.LoadRecursive() +89
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1601

I noticed that after saving I have now two nested sources. Could that be it?

  <CreateMappingAtRuntime>False</CreateMappingAtRuntime>
  <source type="Dynamicweb.DataIntegration.Integration.Adapters.ConcatanateFieldsAdapter" name="Test">
    <source type="Dynamicweb.DataIntegration.Providers.DynamicwebProvider.DynamicwebProvider">

      <RemoveMissingAfterImport>False</RemoveMissingAfterImport>

 

Or is that adapter that ships in the box demo ware only?

Imar

 


Replies

 
Rasmus Sanggaard Dynamicweb Employee
Rasmus Sanggaard
Reply

Hi,

This was actually an old test and shouldn't be in the project. We will remove it.

BR Rasmus

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

I see, that's good to know. I just tried it with an existing adapter and there it works.

Are adapters not supported with the OData provider? I am getting the following when I try to add one:

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   Dynamicweb.DataIntegration.Providers.ODataProvider.ODataProvider.GetEntityName() +27
   Dynamicweb.DataIntegration.Providers.ODataProvider.ODataProvider.GetOriginalSourceSchema() +52
   MyCustomer.TableScripts.Adapters.ConcatenateWithSeparatorAdapter.GetOriginalSourceSchema() +198
   MyCustomer.TableScripts.Adapters.ConcatenateWithSeparatorAdapter.get_OutputSchema() +56
   MyCustomer.TableScripts.Adapters.ConcatenateWithSeparatorAdapter.SaveAsXml(XmlTextWriter xmlTextWriter) +393
   Dynamicweb.DataIntegration.Integration.Job.SaveAsXml(String savePath) +649
   Dynamicweb.Admin.AddAdapter.SaveAndClose(Job job) in E:\DOA\_w\5\s\src\11 - DW9\Dynamicweb.Admin\Dynamicweb.Admin\Admin\Module\IntegrationV2\AddAdapter.aspx.vb:77
   Dynamicweb.Admin.AddAdapter.Page_Load(Object sender, EventArgs e) in E:\DOA\_w\5\s\src\11 - DW9\Dynamicweb.Admin\Dynamicweb.Admin\Admin\Module\IntegrationV2\AddAdapter.aspx.vb:32
   System.Web.UI.Control.OnLoad(EventArgs e) +107
   System.Web.UI.Control.LoadRecursive() +89
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1601

Imar

 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

No, they have not been tested with Odata. Adapters never made real good use-case and they are abandoned again on DW10.

What are you trying to accomplish - then there might be another way. What are you trying to solve witht the adapter?

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Combining two source fields. Ended up fixing it with a table script, but an adapter is nice since it has UI.

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

We had another reason for an adapter today: flipping the value of a boolean. I have a value that comes in from integration as Inactive and we need to map it to an Active column. Seems simple enough for an adapter.

But maybe we will see something like this some day on a column mapping?

@Code(!Convert.ToBoolean(row.CurrentValue))

In other words, a Code expression with access to the current valuie being processed?

Imar

 

 
Stephen Anthony Jackson
Stephen Anthony Jackson
Reply

Was there ever a solution to this? I need to concat two fields, and really dont wanna have to make a table script just for that. I get the exact same exception aswell. Latest and greatest 9.17 branch

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Stephen,

AFAIK, it's just the adapter that ships with DW is broken. You can still add your own. Attached you find the source code for a concatenate with separator adapter; it was taken from the original source code of ConcatenateAdapter (which I can no longer find). Compiling and adding it to your solution should be enough to have it light up in the job UI.

Hope this helps,

Imar

 

You must be logged in to post in the forum