Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Issue while Enabling AIF custom port

Posted on by 796

Hi All,

We have created few custom ports using HTTP adapter  and those working fine Development and testing environment. and while moving in to Production we are facing some errors.

We have two AOS's but I have stopped one AOS and deployment then FULL CIL then up the both the AOS and .. now every thing is fine but EP is not working .. Getting below sequence of LOGS ..

Can some suggest me to solve he issue as it is in production it is critical at my end.

Generation of the WCF configuration has failed, and the previously saved local configuration will be used.

Exception details:
System.InvalidOperationException: Unable to connect to a Microsoft Dynamics AX WCF service. Ensure that the Microsoft Dynamics AX AOS has fully started and that the requested WCF service is available. See the exception message below for details:
>Metadata contains a reference that cannot be resolved: 'XXX/.../AddItems'.
at Microsoft.Dynamics.AX.Framework.Services.Client.Configuration.ClientConfigurationInternal.GetEndpointCollectionFromWsdlUri(String wsdlUri)
at Microsoft.Dynamics.AX.Framework.Services.Client.Configuration.ClientConfigurationInternal.RetrieveIntegrationPortEndpoints(String aosServer, Int32 wsdlPort, List`1 portInfoList, Dictionary`2 endpointPortMap)
at Microsoft.Dynamics.AX.Framework.Services.Client.Configuration.ClientConfigurationInternal.RetrieveEndpointsFromMetadata(String aosServer, Int32 wsdlPort, List`1 portInfoList, Dictionary`2 endpointPortMap)
at Microsoft.Dynamics.AX.Framework.Services.Client.Configuration.ClientConfigurationInternal.ParseWsdlFromAos(String aosServer, Int32 wsdlPort, List`1 portInfoList)
at Microsoft.Dynamics.AX.Framework.Services.Client.Configuration.ClientConfigurationInternal.GetClientConfiguration()

Dynamics Adapter CallStaticClassMethod failed.

The requested operation cannot be performed because you are not logged on to Microsoft Dynamics.

Microsoft.Dynamics.AX.ManagedInterop.NotLoggedOnException
at Microsoft.Dynamics.AX.ManagedInterop.RuntimeContext.CallStaticClassMethodWithReturnType(String className, String methodName, Type returnType, Object[] paramList)
at Microsoft.Dynamics.AX.ManagedInterop.RuntimeContext.CallStaticClassMethod(String className, String methodName, Object param1)
at Microsoft.Dynamics.Framework.BusinessConnector.Session.DynamicsAdapter.CallStaticClassMethod(String className, String methodName, Object param1)

"The operation failed due to an issue with connecting to the AOT. The connection has now been restored. You must redo the last operation." was shown due to the exception NoKernelSessionException: No .NET Business Connector session could be found.


Dynamics Object Adapter Call failed.

The server terminated the session.

Microsoft.Dynamics.AX.ManagedInterop.SessionTerminatedException
at Microsoft.Dynamics.AX.ManagedInterop.TranslateRPCErrorForCurrentThread(IAxSession* pAxSession)
at Microsoft.Dynamics.AX.ManagedInterop.Object.CallWithReturnType(String methodName, Type returnType, Object[] paramList)
at Microsoft.Dynamics.AX.ManagedInterop.Object.Call(String methodName)
at Microsoft.Dynamics.Framework.BusinessConnector.Session.DynamicsObjectAdapter.Call(String methodName)


"The operation failed due to an issue with connecting to the AOT. The connection has now been restored. You must redo the last operation." was shown due to the exception NoKernelSessionException: No .NET Business Connector session could be found.

Dynamics Object Adapter Call failed.

The server terminated the session.

Microsoft.Dynamics.AX.ManagedInterop.SessionTerminatedException
at Microsoft.Dynamics.AX.ManagedInterop.TranslateRPCErrorForCurrentThread(IAxSession* pAxSession)
at Microsoft.Dynamics.AX.ManagedInterop.Object.CallWithReturnType(String methodName, Type returnType, Object[] paramList)
at Microsoft.Dynamics.AX.ManagedInterop.Object.Call(String methodName)
at Microsoft.Dynamics.Framework.BusinessConnector.Session.DynamicsObjectAdapter.Call(String methodName)


There was an error during processing of the managed application service auto-start for configuration path: 'MACHINE/WEBROOT/APPHOST/Default Web Site/MicrosoftDynamicsAXAif60'. The error message returned is: 'An initialization error occurred while trying to preload an application.

Exception: System.InvalidOperationException

Message: Well known object of type 'System.Web.Hosting.PreloadHost' already exists in this App Domain.

StackTrace: at System.Web.Hosting.HostingEnvironment.CreateWellKnownObjectInstance(String assemblyQualifiedName, Boolean failIfExists)
at System.Web.Hosting.HostingEnvironment.CreateWellKnownObjectInstance(String assemblyQualifiedName, Boolean failIfExists)
at System.Web.Hosting.ApplicationManager.CreateObjectInternal(String appId, Type type, IApplicationHost appHost, Boolean failIfExists, HostingEnvironmentParameters hostingParameters)
at System.Web.Hosting.ProcessHost.PreloadApplicationIfRequired(String appId, IApplicationHost appHostParameter, HostingEnvironmentParameters hostingParameters, LockableAppDomainContext ac)
at System.Web.Hosting.ProcessHost.<>c__DisplayClass11.<PreloadApplicationIfNotShuttingdown>b__f(Object o)'. The worker process will be marked unhealthy and be shutdown. The data field contains the error code.

  • Verified answer
    kvnkk Profile Picture
    kvnkk 796 on at
    RE: Issue while Enabling AIF custom port

    By Refreshing WCF configuration in AX, client configuration on SharePoint server solved my issue.

    Thanks for your prompt response Nikolaos Mäenpää 

  • kvnkk Profile Picture
    kvnkk 796 on at
    RE: Issue while Enabling AIF custom port

    Yes.. before every thing working fine. Major code relating to the AIF webservices was moved long bank currently we have moved only changes .(that to very less code). We started facing this issue after enabling the ports. Now we have disabled the code but still its not working.. Every time we are getting above shown message.

    We are getting  below issue :-

    2450.Issue1.png

  • nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Issue while Enabling AIF custom port

    Was everything working before your latest prod update?

  • kvnkk Profile Picture
    kvnkk 796 on at
    RE: Issue while Enabling AIF custom port

    From Visual studio I am able to deploy the code but not from AX .. More over I am encountering another error while checking from share point

    An unhandled error has occurred. To view details about this error, enable debugging in the web.config file or view the Windows event logs.

    Error executing code: xInfo object does not have method 'connectorSessionStart'.

    Stack trace

    (C)\Classes\xInfo\connectorSessionStart

    Error executing code: No system global variables.

    Stack trace

    (C)\Classes\ClassFactory\globalCache - line 3

    (C)\Classes\Global\clientKind - line 3

    (C)\Classes\Global\webSessionClient - line 17

    (C)\Classes\Global\webSession - line 19

    Microsoft.Dynamics.Framework.BusinessConnector

      at Microsoft.Dynamics.Framework.BusinessConnector.Session.DynamicsSession.HandleException(String message, Exception exception, HandleExceptionCallback callback)

      at Microsoft.Dynamics.Framework.BusinessConnector.Session.DynamicsAdapter.CallStaticClassMethod(String className, String methodName, Object param1, Object param2, Object param3)

      at Microsoft.Dynamics.Framework.Portal.AxWebSession.GetGlobalWebSession()

      at Microsoft.Dynamics.Framework.Portal.AxWebSession.InitializeWebSession(Guid siteId, String localSiteLink, Boolean isAxaptaSite, String masterClass, Boolean isPostBack, Boolean isPostSafe, Boolean isSharePoint)

      at Microsoft.Dynamics.Framework.Portal.AxWebSession.InitWeb(HttpContext context, Boolean isPostBack)

      at Microsoft.Dynamics.Framework.Portal.AxSharepointWebSession.InitWeb(HttpContext context, Boolean isPostBack)

      at Microsoft.Dynamics.Framework.Portal.AxWebSession.InitWeb()

      at Microsoft.Dynamics.Framework.Portal.AxWebSession.OnSessionAcquired()

      at Microsoft.Dynamics.Framework.BusinessConnector.Session.DynamicsSession.AddRef(ICacheContext context, Object lockobject)

  • nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Issue while Enabling AIF custom port

    What do you mean by VS? Do you use Visual Studio in production environment?

  • kvnkk Profile Picture
    kvnkk 796 on at
    RE: Issue while Enabling AIF custom port

    Hi Nikolash,

    Thanks for the reply. Deployment is fine. Even CIL generated with out issue. All services are activated and able to browse the urls. But the main problem is .. EP is not working..

    7725.EP.png

    while deploying any webcrontol we are getting this error " The request failed with HTTP status 403: Forbidden. " But the control is getting deployed from VS.

    Apart from above log thing was tracked.

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Issue while Enabling AIF custom port

    Also, once CIL is ok, you need to refresh services list in AOT, and deploy your Service group(s).

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Issue while Enabling AIF custom port

    How did you move your changes to prod? Most likely your deployment process is not following the best practices.

    Most likely you don't have up to date CIL in your prod system.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans