Problem with Exchange Integration

I've been trying to set up exchange integration but I've run into a road block. I'm unsure of what the problem could be and am looking for some help. I've got a connection set up and its connected to the EWS web service and sync engine and mailbox. When I enable the connection that status is stuck on waiting to sync and the following error is logged in to tomcat logs:

Any help is much appreciated.

Sep 22, 2014 12:04:29 AM org.apache.catalina.core.StandardWrapperValve invoke

SEVERE: Servlet.service() for servlet dispatch threw exception

java.lang.NullPointerException

at com.sage.scrm.model.sync.SyncIntegrationExchange.getServerName(SyncIntegrationExchange.java:207)

at sun.reflect.GeneratedMethodAccessor2088.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.sun.xml.internal.bind.v2.runtime.reflect.Accessor$GetterSetterReflection.get(Unknown Source)

at com.sun.xml.internal.bind.v2.runtime.reflect.Accessor.getUnadapted(Unknown Source)

at com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.hasValue(Unknown Source)

at com.sun.xml.internal.bind.v2.runtime.property.SingleElementLeafProperty.serializeBody(Unknown Source)

at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(Unknown Source)

at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsSoleContent(Unknown Source)

at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeRoot(Unknown Source)

at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsRoot(Unknown Source)

at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(Unknown Source)

at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.marshal(Unknown Source)

at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(Unknown Source)

at com.sage.scrm.view.xml.ExchangeSyncEngineConfigurationServiceGenerator.createDocument(ExchangeSyncEngineConfigurationServiceGenerator.java:62)

at com.sage.scrm.view.xml.ExchangeSyncEngineConfigurationServiceGenerator.getDocument(ExchangeSyncEngineConfigurationServiceGenerator.java:44)

at com.sage.scrm.view.SDataViewTransformer.render(SDataViewTransformer.java:109)

at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)

at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at com.sage.scrm.controller.util.AbstractSessionRequestFilter.doFilter(AbstractSessionRequestFilter.java:125)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at com.sage.scrm.scrmcommons.controller.util.EncodingRequestFilter.doFilter(EncodingRequestFilter.java:81)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

at java.lang.Thread.run(Unknown Source)

  • 0

    Hi,

    I reckon you'll want to check out your ServerNames entry on Custom_Sysparams. You can retrieve it by running the following:

    select parm_name, parm_value

    from custom_sysparams

    where parm_name = N'ServerNames'

    You should only have multiple entries in there if you're using multi-server CRM - otherwise, it should be an (all caps) string terminated by a semi-colon. For a CRM web server with a hostname of crmserver, the entry should look like this:

    CRMSERVER;

    When CRM is running, the value is pulled from the metadata, so I'd suggest refreshing your CRM metadata and restarting your Tomcat service if you change the value. I wouldn't just rely on the metadata refresh for updating the Tomcat metadata, in case the missing value is causing an issue in one of the webapps at startup.

    Hope this helps,

    Rob

  • 0

    That was exactly it. The sync runs now. However if I have the contact sync enabled the sync fails almost immediately and a new error message.. The sync works if I disable contact sync.

    2014-09-23/11:49:12.851/PDT [SyncEngine thread] ERROR com.sage.scrm.syncengine.exchange.engine.SynchronisationThread.run com.sage.scrm.syncengine.core.engine.error.SageSyncEngineException: com.sage.scrm.syncengine.exchange.engine.model.error.SageSDataEndpointException: com.sage.scrm.core.httpconsumer.error.SageHttpConsumerException: POST on SERVERNAME/.../$syncSource failed: 500

    com.sage.scrm.syncengine.core.engine.error.SageSyncEngineException: com.sage.scrm.syncengine.exchange.engine.model.error.SageSDataEndpointException: com.sage.scrm.core.httpconsumer.error.SageHttpConsumerException: POST on https://SERVERNAME/sdata/dbnamej/crmExchange/-/contacts/$syncSource?trackingId=d4a407bc-6b55-49fd-b3d9-95f5585ae491&count=100 failed: 500

    at com.sage.scrm.syncengine.exchange.engine.SynchronisationProcess.execute(SynchronisationProcess.java:202)

    at com.sage.scrm.syncengine.exchange.engine.SynchronisationThread.synchroniseResourceOneWay(SynchronisationThread.java:296)

    at com.sage.scrm.syncengine.exchange.engine.SynchronisationThread.synchroniseResourcesOneWay(SynchronisationThread.java:277)

    at com.sage.scrm.syncengine.exchange.engine.SynchronisationThread.run(SynchronisationThread.java:191)

    at java.lang.Thread.run(Unknown Source)

    Caused by: com.sage.scrm.syncengine.exchange.engine.model.error.SageSDataEndpointException: com.sage.scrm.core.httpconsumer.error.SageHttpConsumerException: POST on SERVERNAME/.../$syncSource failed: 500

    at com.sage.scrm.syncengine.exchange.sdata.SCRMEndpoint.getFirstSyncSourcePage(SCRMEndpoint.java:117)

    at com.sage.scrm.syncengine.exchange.engine.SynchronisationProcess.execute(SynchronisationProcess.java:139)

    ... 4 more

    Caused by: com.sage.scrm.core.httpconsumer.error.SageHttpConsumerException: POST on SERVERNAME/.../$syncSource failed: 500

    at com.sage.scrm.core.httpconsumer.HttpConsumer.doPostPut(HttpConsumer.java:904)

    at com.sage.scrm.core.httpconsumer.HttpConsumer.doPost(HttpConsumer.java:683)

    at com.sage.scrm.core.httpconsumer.HttpConsumer.doPost(HttpConsumer.java:645)

    at com.sage.scrm.syncengine.exchange.sdata.SCRMEndpoint.getFirstSyncSourcePage(SCRMEndpoint.java:109)

    ... 5 more

  • 0

    Cool! Ok, that's one fixed...

    The trick with interpreting Exchange integration errors is understanding that you're dealing with a fair number of different components communicating with each other. Once you figure out which one's having the issue, you'll be well on your way to resolving the problem.

    This is the most relevant line from your stack trace:

    com.sage.scrm.core.httpconsumer.error.SageHttpConsumerException: POST on SERVERNAME/.../$syncSource failed: 500

    From that, you can see that you're getting an error 500 (internal server error) when the synch engine POSTs a request to the CRMJ webapp (this is called dbnamej in your install). This is the method by which the synch engine gets sych data (appointments, tasks, contacts) into and out of CRM. So it's probably not the synch engine itself, but the CRMJ webapp that's having problems.

    You can't really tell what's causing the error from that stack trace - all we know is that an error happened in a component that the synch engine was talking to. You'll need to check out the logs for the CRMJ webapp. I'd start off with the crm.log (if you're on v7.2, otherwise check out what's in the SDATA log directory), and see what's getting written out there.

    Thanks,

    Rob

  • 0

    Kind of looks there is an enity that doesn't exist somewhere. But I'm not sure how to find it. I also am not sure where the SDATA log directory is. But I posted these additional errors I found in the exchangesyncengine.log and scrmstacktraces.xml file because they seem relevant and have additional clues. Also I'm on version 7.1.f

    I see this error in the SCRM directory:

    and this is from the exchangesyncengine.log:

    2014-09-24/04:33:27.588/PDT [SyncEngine thread] ERROR com.sage.scrm.core.httpconsumer.HttpConsumer.logError " href="http://schemas.sage.com/sdata/2008/1">">schemas.sage.com/.../1">

    com.sage.scrm.model.error.SageSynchronizationException: com.sage.scrm.model.error.SageDataAccessException: Data access failure.

    com.sage.scrm.view.error.SageSDataGenerationException: com.sage.scrm.model.error.SageSynchronizationException: com.sage.scrm.model.error.SageDataAccessException: Data access failure.

    at com.sage.scrm.model.store.SyncSourceSDataStore.handleSubsequentRequest(SyncSourceSDataStore.java:596)

    at com.sage.scrm.model.store.SyncSourceSDataStore.generateContent(SyncSourceSDataStore.java:337)

    at com.sage.scrm.model.store.SyncSourceSDataStore.getData(SyncSourceSDataStore.java:241)

    at com.sage.scrm.controller.AbstractSyncController.getModelAndView(AbstractSyncController.java:275)

    at com.sage.scrm.controller.AbstractSyncController.requestAction(AbstractSyncController.java:218)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    at java.lang.reflect.Method.invoke(Unknown Source)

    at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:471)

    at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:408)

    at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)

    at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)

    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)

    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)

    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)

    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    at com.sage.scrm.controller.util.AbstractSessionRequestFilter.doFilter(AbstractSessionRequestFilter.java:125)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)

    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    at com.sage.scrm.scrmcommons.controller.util.EncodingRequestFilter.doFilter(EncodingRequestFilter.java:81)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)

    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)

    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

    at java.lang.Thread.run(Unknown Source)

    Caused by: com.sage.scrm.model.error.SageSynchronizationException: com.sage.scrm.model.error.SageDataAccessException: Data access failure.

    at com.sage.scrm.model.sync.SyncSourceManagerWorker.updateSynchronizationEntries(SyncSourceManagerWorker.java:105)

    at com.sage.scrm.model.store.SyncSourceSDataStore.handleSubsequentRequest(SyncSourceSDataStore.java:519)

    ... 40 more

    Caused by: com.sage.scrm.model.error.SageDataAccessException: Data access failure.

    at com.sage.scrm.model.sync.db.SCRMAccessDB.getInsertedRecords(SCRMAccessDB.java:487)

    at com.sage.scrm.model.sync.SyncSourceManager.processSychronizationData(SyncSourceManager.java:1223)

    at com.sage.scrm.model.sync.SyncSourceManager.updateSynchronizationEntry(SyncSourceManager.java:1072)

    at com.sage.scrm.model.sync.SyncSourceManager$$FastClassByCGLIB$$91c4d5b7.invoke()

    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)

    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)

    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)

    at com.sage.scrm.model.sync.SyncSourceManagerExchange$$EnhancerByCGLIB$$6b93c97c.updateSynchronizationEntry()

    at com.sage.scrm.model.sync.SyncSourceManagerWorker.updateSynchronizationEntries(SyncSourceManagerWorker.java:96)

    ... 41 more

    Caused by: com.sage.scrm.model.metadata.error.SageEntityDoesntExistException: entityDoesntExists: light

    at com.sage.scrm.model.metadata.MetaDataStore.getEntityReadOnly(MetaDataStore.java:1219)

    at sun.reflect.GeneratedMethodAccessor351.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    at java.lang.reflect.Method.invoke(Unknown Source)

    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)

    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)

    at $Proxy38.getEntityReadOnly(Unknown Source)

    at com.sage.scrm.model.sync.db.SCRMAccessDB.createSubSelectForRelationShip(SCRMAccessDB.java:653)

    at com.sage.scrm.model.sync.db.SCRMAccessDB.createWhereClauseToGetInserts(SCRMAccessDB.java:568)

    at com.sage.scrm.model.sync.db.SCRMAccessDB.getInsertedRecords(SCRMAccessDB.java:466)

    ... 52 more

  • 0

    Hi,

    It seems to think that there's an entity called "light" in there. I'd guess that this is a table or view that's being referenced by another view on the database.

    The process to fix it is to run the statement "exec sp_refreshview" for each view and fix any errors that occur. A straightforward way of doing this is to run:

    SELECT 'exec sp_refreshview ''' + name + '''' FROM sysobjects

    WHERE UPPER(xtype) = 'V'

    order by name asc

    Copy the results of this statement into a Management Studio query pane. Execute these statements in batches of 10 or 15 deleting them if they complete

    successfully.

    This should leave you with the bad views that you need to fix or drop.

    Sometimes you'll get views that reference fields that have been dropped in the product (e.g. pers_emailaddress) - these can usually be fixed by referencing the updated views containing aliased versions of these fields, such as vPersonPE and vCompanyPE instead of the Person and Company tables.

    Hope this helps,

    Rob