what is [storeIncomingEmail.messageWrapper]?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

what is [storeIncomingEmail.messageWrapper]?

rohit
Hi,

I am trying configure email sorting in ofbiz and store emails as communication events. I believe i have to schedule the service storeIncomingEmail as a service. I tried to do that and was prompted fill the fields:

Step 2: Service Parameters
messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper).

I am not sure what to enter into this field, can someone please help me configure this. I am getting the following error in log when the service is run:

2007-04-19 05:22:31,302 (default-invoker-Thread-2) [         JobInvoker.java:211:INFO ] Invoker: default-invoker-Thread-2 received job -- 1176985293330 from poller - org.ofbiz.service.job.JobPoller@1be4777
2007-04-19 05:22:31,320 (default-invoker-Thread-2) [PersistedServiceJob.java:136:INFO ] org.ofbiz.service.job.PersistedServiceJob@334bfe[58369] -- Next runtime: -1
[Error] :2:12: cvc-elt.1: Cannot find the declaration of element 'ofbiz-ser'.
2007-04-19 05:22:31,331 (default-invoker-Thread-2) [            UtilXml.java:243:DEBUG] XML Read 0.0040s: Internal Content
2007-04-19 05:22:31,332 (default-invoker-Thread-2) [  ServiceDispatcher.java:322:ERROR]
---- exception report ----------------------------------------------------------
Incoming context (in runSync : storeIncomingEmail) does not match expected requirements
Exception: org.ofbiz.service.ServiceValidationException
Message: The following required parameter is missing: [storeIncomingEmail.messageWrapper]
---- stack trace ---------------------------------------------------------------
org.ofbiz.service.ServiceValidationException: The following required parameter is missing: [storeIncomingEmail.messageWrapper]
org.ofbiz.service.ModelService.validate(ModelService.java:452)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
java.lang.Thread.run(Thread.java:534)
--------------------------------------------------------------------------------

2007-04-19 05:22:31,333 (default-invoker-Thread-2) [  ServiceDispatcher.java:385:DEBUG] [[Sync service failed...- total:0.0,since last(Begin):0.0]] - 'JobDispatcher / storeIncomingEmail'
2007-04-19 05:22:31,333 (default-invoker-Thread-2) [  ServiceDispatcher.java:388:ERROR]
---- exception report ----------------------------------------------------------
Service [storeIncomingEmail] threw an unexpected exception/error
Exception: org.ofbiz.service.ServiceValidationException
Message: The following required parameter is missing: [storeIncomingEmail.messageWrapper]
---- stack trace ---------------------------------------------------------------
org.ofbiz.service.ServiceValidationException: The following required parameter is missing: [storeIncomingEmail.messageWrapper]
org.ofbiz.service.ModelService.validate(ModelService.java:452)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
java.lang.Thread.run(Thread.java:534)
--------------------------------------------------------------------------------

2007-04-19 05:22:31,334 (default-invoker-Thread-2) [    TransactionUtil.java:252:ERROR]
---- exception report ----------------------------------------------------------
[TransactionUtil.rollback]
Exception: java.lang.Exception
Message: Stack Trace
---- stack trace ---------------------------------------------------------------
java.lang.Exception: Stack Trace
org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:391)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
java.lang.Thread.run(Thread.java:534)
--------------------------------------------------------------------------------

2007-04-19 05:22:31,335 (default-invoker-Thread-2) [    TransactionUtil.java:262:INFO ] [TransactionUtil.rollback] transaction rolled back
2007-04-19 05:22:31,335 (default-invoker-Thread-2) [    TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not committing transaction, status is STATUS_NO_TRANSACTION
2007-04-19 05:22:31,336 (default-invoker-Thread-2) [  GenericServiceJob.java:117:ERROR]
---- exception report ----------------------------------------------------------
Async-Service failed.
Exception: org.ofbiz.service.ServiceValidationException
Message: The following required parameter is missing: [storeIncomingEmail.messageWrapper]
---- stack trace ---------------------------------------------------------------
org.ofbiz.service.ServiceValidationException: The following required parameter is missing: [storeIncomingEmail.messageWrapper]
org.ofbiz.service.ModelService.validate(ModelService.java:452)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
java.lang.Thread.run(Thread.java:534)
--------------------------------------------------------------------------------

2007-04-19 05:22:31,342 (default-invoker-Thread-2) [       SequenceUtil.java:254:INFO ] Got bank of sequenced IDs for [JobSandbox]; curSeqId=58370, maxSeqId=58380, bankSize=10
2007-04-19 05:22:31,348 (default-invoker-Thread-2) [PersistedServiceJob.java:202:INFO ] Persisted Job [58369] Failed Re-Scheduling : 1176985531339
2007-04-19 05:22:37,711 (http-0.0.0.0-7443-Processor1) [      ContextFilter.java:182:INFO ] [Request]: /webtools/control/jobList
2007-04-19 05:22:37,712 (http-0.0.0.0-7443-Processor1) [     ControlServlet.java:90 :INFO ] The character encoding of the request is: [null]. The character encoding we will use for the request and response is: [UTF-8]
2007-04-19 05:22:37,713 (http-0.0.0.0-7443-Processor1) [     ControlServlet.java:126:DEBUG] [[[jobList] Servlet Starting, doing setup- total:0.0,since last(Begin):0.0]]
2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [     ControlServlet.java:181:DEBUG] [[[jobList] Setup done, doing Event(s) and View(s)- total:0.0,since last([jobList] Servlet...):0.0]]
2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [     RequestHandler.java:266:INFO ] [Processing Request]: jobList sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
2007-04-19 05:22:37,715 (http-0.0.0.0-7443-Processor1) [     RequestManager.java:117:INFO ] [RequestManager.getRequestAttribute] Value for attribute "null" of uri "jobList" not found
2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [     RequestHandler.java:450:INFO ] [RequestHandler.doRequest]: Response is a view. sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [     RequestHandler.java:603:INFO ] servletName=control, view=jobList sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
2007-04-19 05:22:37,717 (http-0.0.0.0-7443-Processor1) [     ScreenRenderer.java:220:INFO ] Found servlet context (application) attribute that conflicts with parameter name, leaving request parameter in place for name: _REQUEST_HANDLER_
2007-04-19 05:22:37,826 (http-0.0.0.0-7443-Processor1) [  ModelScreenWidget.java:361:INFO ] In the include-screen tag the screen name was empty, ignoring include; in screen [GlobalDecorator]
2007-04-19 05:22:37,857 (http-0.0.0.0-7443-Processor1) [     ControlServlet.java:256:DEBUG] [[[jobList] Done rendering page, Servlet Finished- total:0.143,since last([jobList] Setup d...):0.143]]

Reply | Threaded
Open this post in threaded view
|

Re: what is [storeIncomingEmail.messageWrapper]?

BJ Freeman
If I understand you, you can create a view with the sorting you want.

rohit2006 sent the following on 4/19/2007 4:33 AM:

> Hi,
>
> I am trying configure email sorting in ofbiz and store emails as
> communication events. I believe i have to schedule the service
> storeIncomingEmail as a service. I tried to do that and was prompted fill
> the fields:
>
> Step 2: Service Parameters
> messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper).
>
> I am not sure what to enter into this field, can someone please help me
> configure this. I am getting the following error in log when the service is
> run
>
> 2007-04-19 05:22:31,302 (default-invoker-Thread-2) [        
> JobInvoker.java:211:INFO ] Invoker: default-invoker-Thread-2 received job --
> 1176985293330 from poller - org.ofbiz.service.job.JobPoller@1be4777
> 2007-04-19 05:22:31,320 (default-invoker-Thread-2)
> [PersistedServiceJob.java:136:INFO ]
> org.ofbiz.service.job.PersistedServiceJob@334bfe[58369] -- Next runtime: -1
> [Error] :2:12: cvc-elt.1: Cannot find the declaration of element
> 'ofbiz-ser'.
> 2007-04-19 05:22:31,331 (default-invoker-Thread-2) [          
> UtilXml.java:243:DEBUG] XML Read 0.0040s: Internal Content
> 2007-04-19 05:22:31,332 (default-invoker-Thread-2) [
> ServiceDispatcher.java:322:ERROR]
> ---- exception report
> ----------------------------------------------------------
> Incoming context (in runSync : storeIncomingEmail) does not match expected
> requirements
> Exception: org.ofbiz.service.ServiceValidationException
> Message: The following required parameter is missing:
> [storeIncomingEmail.messageWrapper]
> ---- stack trace
> ---------------------------------------------------------------
> org.ofbiz.service.ServiceValidationException: The following required
> parameter is missing: [storeIncomingEmail.messageWrapper]
> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> java.lang.Thread.run(Thread.java:534)
> --------------------------------------------------------------------------------
>
> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
> ServiceDispatcher.java:385:DEBUG] [[Sync service failed...- total:0.0,since
> last(Begin):0.0]] - 'JobDispatcher / storeIncomingEmail'
> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
> ServiceDispatcher.java:388:ERROR]
> ---- exception report
> ----------------------------------------------------------
> Service [storeIncomingEmail] threw an unexpected exception/error
> Exception: org.ofbiz.service.ServiceValidationException
> Message: The following required parameter is missing:
> [storeIncomingEmail.messageWrapper]
> ---- stack trace
> ---------------------------------------------------------------
> org.ofbiz.service.ServiceValidationException: The following required
> parameter is missing: [storeIncomingEmail.messageWrapper]
> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> java.lang.Thread.run(Thread.java:534)
> --------------------------------------------------------------------------------
>
> 2007-04-19 05:22:31,334 (default-invoker-Thread-2) [  
> TransactionUtil.java:252:ERROR]
> ---- exception report
> ----------------------------------------------------------
> [TransactionUtil.rollback]
> Exception: java.lang.Exception
> Message: Stack Trace
> ---- stack trace
> ---------------------------------------------------------------
> java.lang.Exception: Stack Trace
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:391)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> java.lang.Thread.run(Thread.java:534)
> --------------------------------------------------------------------------------
>
> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
> TransactionUtil.java:262:INFO ] [TransactionUtil.rollback] transaction
> rolled back
> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
> TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not committing
> transaction, status is STATUS_NO_TRANSACTION
> 2007-04-19 05:22:31,336 (default-invoker-Thread-2) [
> GenericServiceJob.java:117:ERROR]
> ---- exception report
> ----------------------------------------------------------
> Async-Service failed.
> Exception: org.ofbiz.service.ServiceValidationException
> Message: The following required parameter is missing:
> [storeIncomingEmail.messageWrapper]
> ---- stack trace
> ---------------------------------------------------------------
> org.ofbiz.service.ServiceValidationException: The following required
> parameter is missing: [storeIncomingEmail.messageWrapper]
> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> java.lang.Thread.run(Thread.java:534)
> --------------------------------------------------------------------------------
>
> 2007-04-19 05:22:31,342 (default-invoker-Thread-2) [      
> SequenceUtil.java:254:INFO ] Got bank of sequenced IDs for [JobSandbox];
> curSeqId=58370, maxSeqId=58380, bankSize=10
> 2007-04-19 05:22:31,348 (default-invoker-Thread-2)
> [PersistedServiceJob.java:202:INFO ] Persisted Job [58369] Failed
> Re-Scheduling : 1176985531339
> 2007-04-19 05:22:37,711 (http-0.0.0.0-7443-Processor1) [    
> ContextFilter.java:182:INFO ] [Request]: /webtools/control/jobList
> 2007-04-19 05:22:37,712 (http-0.0.0.0-7443-Processor1) [    
> ControlServlet.java:90 :INFO ] The character encoding of the request is:
> [null]. The character encoding we will use for the request and response is:
> [UTF-8]
> 2007-04-19 05:22:37,713 (http-0.0.0.0-7443-Processor1) [    
> ControlServlet.java:126:DEBUG] [[[jobList] Servlet Starting, doing setup-
> total:0.0,since last(Begin):0.0]]
> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
> ControlServlet.java:181:DEBUG] [[[jobList] Setup done, doing Event(s) and
> View(s)- total:0.0,since last([jobList] Servlet...):0.0]]
> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
> RequestHandler.java:266:INFO ] [Processing Request]: jobList
> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> 2007-04-19 05:22:37,715 (http-0.0.0.0-7443-Processor1) [    
> RequestManager.java:117:INFO ] [RequestManager.getRequestAttribute] Value
> for attribute "null" of uri "jobList" not found
> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
> RequestHandler.java:450:INFO ] [RequestHandler.doRequest]: Response is a
> view. sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
> RequestHandler.java:603:INFO ] servletName=control, view=jobList
> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> 2007-04-19 05:22:37,717 (http-0.0.0.0-7443-Processor1) [    
> ScreenRenderer.java:220:INFO ] Found servlet context (application) attribute
> that conflicts with parameter name, leaving request parameter in place for
> name: _REQUEST_HANDLER_
> 2007-04-19 05:22:37,826 (http-0.0.0.0-7443-Processor1) [
> ModelScreenWidget.java:361:INFO ] In the include-screen tag the screen name
> was empty, ignoring include; in screen [GlobalDecorator]
> 2007-04-19 05:22:37,857 (http-0.0.0.0-7443-Processor1) [    
> ControlServlet.java:256:DEBUG] [[[jobList] Done rendering page, Servlet
> Finished- total:0.143,since last([jobList] Setup d...):0.143]]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: what is [storeIncomingEmail.messageWrapper]?

rohit
i am trying to configure email sorting in ofbiz. I have followed the documentation by Si Chen, to test it. I am assuming that if email sorting is correctly configured, emails will be recorded as communication event for the related parties. For eg. after a email is received ofbiz, will try to match the "to" address, with the email associated to a party, and if a match  is found,  a communication event will be logged for the party.

I hope that i got this right?

I have followed the instruction as mentioned in documentation, and everything loads fine, but when i schedule the service storeincomingemail, i am prompted to enter the service parameter(messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper), which i have no clue about. i guess this is to do something 'MimeMessageWrapper'.

The documentation by Si Chen mentions this:

5. MCA services need to implement the mail processing interface, as in:
        <implements service="mailProcessInterface"/>
It uses a MimeMessageWrapper:
        MimeMessageWrapper wrapper = (MimeMessageWrapper) context.get("messageWrapper");
MimeMessage message = wrapper.getMessage();
with methods like message.getAllRecipients(), message.getFrom(), message.getSubject(), getAllRecipients(), getSentDate(), getReceivedDate(), etc.

Currently (20060607) there is a service called “storeIncomingEmail” which could be used to do inbound mail sorting.  This has not been fully tested yet.


I am not sure what to insert in the service parameters.

Do we need to create a view for email sorting, cause i think the mails will be visible, under the communication tab, in party manager?

Rohit


BJ Freeman wrote
If I understand you, you can create a view with the sorting you want.

rohit2006 sent the following on 4/19/2007 4:33 AM:
> Hi,
>
> I am trying configure email sorting in ofbiz and store emails as
> communication events. I believe i have to schedule the service
> storeIncomingEmail as a service. I tried to do that and was prompted fill
> the fields:
>
> Step 2: Service Parameters
> messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper).
>
> I am not sure what to enter into this field, can someone please help me
> configure this. I am getting the following error in log when the service is
> run
>
> 2007-04-19 05:22:31,302 (default-invoker-Thread-2) [        
> JobInvoker.java:211:INFO ] Invoker: default-invoker-Thread-2 received job --
> 1176985293330 from poller - org.ofbiz.service.job.JobPoller@1be4777
> 2007-04-19 05:22:31,320 (default-invoker-Thread-2)
> [PersistedServiceJob.java:136:INFO ]
> org.ofbiz.service.job.PersistedServiceJob@334bfe[58369] -- Next runtime: -1
> [Error] :2:12: cvc-elt.1: Cannot find the declaration of element
> 'ofbiz-ser'.
> 2007-04-19 05:22:31,331 (default-invoker-Thread-2) [          
> UtilXml.java:243:DEBUG] XML Read 0.0040s: Internal Content
> 2007-04-19 05:22:31,332 (default-invoker-Thread-2) [
> ServiceDispatcher.java:322:ERROR]
> ---- exception report
> ----------------------------------------------------------
> Incoming context (in runSync : storeIncomingEmail) does not match expected
> requirements
> Exception: org.ofbiz.service.ServiceValidationException
> Message: The following required parameter is missing:
> [storeIncomingEmail.messageWrapper]
> ---- stack trace
> ---------------------------------------------------------------
> org.ofbiz.service.ServiceValidationException: The following required
> parameter is missing: [storeIncomingEmail.messageWrapper]
> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> java.lang.Thread.run(Thread.java:534)
> --------------------------------------------------------------------------------
>
> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
> ServiceDispatcher.java:385:DEBUG] [[Sync service failed...- total:0.0,since
> last(Begin):0.0]] - 'JobDispatcher / storeIncomingEmail'
> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
> ServiceDispatcher.java:388:ERROR]
> ---- exception report
> ----------------------------------------------------------
> Service [storeIncomingEmail] threw an unexpected exception/error
> Exception: org.ofbiz.service.ServiceValidationException
> Message: The following required parameter is missing:
> [storeIncomingEmail.messageWrapper]
> ---- stack trace
> ---------------------------------------------------------------
> org.ofbiz.service.ServiceValidationException: The following required
> parameter is missing: [storeIncomingEmail.messageWrapper]
> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> java.lang.Thread.run(Thread.java:534)
> --------------------------------------------------------------------------------
>
> 2007-04-19 05:22:31,334 (default-invoker-Thread-2) [  
> TransactionUtil.java:252:ERROR]
> ---- exception report
> ----------------------------------------------------------
> [TransactionUtil.rollback]
> Exception: java.lang.Exception
> Message: Stack Trace
> ---- stack trace
> ---------------------------------------------------------------
> java.lang.Exception: Stack Trace
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:391)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> java.lang.Thread.run(Thread.java:534)
> --------------------------------------------------------------------------------
>
> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
> TransactionUtil.java:262:INFO ] [TransactionUtil.rollback] transaction
> rolled back
> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
> TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not committing
> transaction, status is STATUS_NO_TRANSACTION
> 2007-04-19 05:22:31,336 (default-invoker-Thread-2) [
> GenericServiceJob.java:117:ERROR]
> ---- exception report
> ----------------------------------------------------------
> Async-Service failed.
> Exception: org.ofbiz.service.ServiceValidationException
> Message: The following required parameter is missing:
> [storeIncomingEmail.messageWrapper]
> ---- stack trace
> ---------------------------------------------------------------
> org.ofbiz.service.ServiceValidationException: The following required
> parameter is missing: [storeIncomingEmail.messageWrapper]
> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> java.lang.Thread.run(Thread.java:534)
> --------------------------------------------------------------------------------
>
> 2007-04-19 05:22:31,342 (default-invoker-Thread-2) [      
> SequenceUtil.java:254:INFO ] Got bank of sequenced IDs for [JobSandbox];
> curSeqId=58370, maxSeqId=58380, bankSize=10
> 2007-04-19 05:22:31,348 (default-invoker-Thread-2)
> [PersistedServiceJob.java:202:INFO ] Persisted Job [58369] Failed
> Re-Scheduling : 1176985531339
> 2007-04-19 05:22:37,711 (http-0.0.0.0-7443-Processor1) [    
> ContextFilter.java:182:INFO ] [Request]: /webtools/control/jobList
> 2007-04-19 05:22:37,712 (http-0.0.0.0-7443-Processor1) [    
> ControlServlet.java:90 :INFO ] The character encoding of the request is:
> [null]. The character encoding we will use for the request and response is:
> [UTF-8]
> 2007-04-19 05:22:37,713 (http-0.0.0.0-7443-Processor1) [    
> ControlServlet.java:126:DEBUG] [[[jobList] Servlet Starting, doing setup-
> total:0.0,since last(Begin):0.0]]
> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
> ControlServlet.java:181:DEBUG] [[[jobList] Setup done, doing Event(s) and
> View(s)- total:0.0,since last([jobList] Servlet...):0.0]]
> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
> RequestHandler.java:266:INFO ] [Processing Request]: jobList
> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> 2007-04-19 05:22:37,715 (http-0.0.0.0-7443-Processor1) [    
> RequestManager.java:117:INFO ] [RequestManager.getRequestAttribute] Value
> for attribute "null" of uri "jobList" not found
> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
> RequestHandler.java:450:INFO ] [RequestHandler.doRequest]: Response is a
> view. sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
> RequestHandler.java:603:INFO ] servletName=control, view=jobList
> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> 2007-04-19 05:22:37,717 (http-0.0.0.0-7443-Processor1) [    
> ScreenRenderer.java:220:INFO ] Found servlet context (application) attribute
> that conflicts with parameter name, leaving request parameter in place for
> name: _REQUEST_HANDLER_
> 2007-04-19 05:22:37,826 (http-0.0.0.0-7443-Processor1) [
> ModelScreenWidget.java:361:INFO ] In the include-screen tag the screen name
> was empty, ignoring include; in screen [GlobalDecorator]
> 2007-04-19 05:22:37,857 (http-0.0.0.0-7443-Processor1) [    
> ControlServlet.java:256:DEBUG] [[[jobList] Done rendering page, Servlet
> Finished- total:0.143,since last([jobList] Setup d...):0.143]]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: what is [storeIncomingEmail.messageWrapper]?

BJ Freeman
My previous response was aimed at sorting the communication events after
they have been already loaded.

to answer your question, Yes ofbiz will try to match any email to and
from with those in the parties.
if it can not find one of the parties, usually the from, it puts the
address in comments, an marks it unknown email address.


The MCA is used to filter the emails. Like:
        <!-- will process all UPS Quantum view emails -->
        <!-- Note: email must contain a ofbiz generated reference number to
link tracking number to order-->
    <mca mail-rule-name="UPSTrackingEmailRule">
        <condition-field field-name="from" operator="matches"
value="[hidden email]"/>
        <action service="ProcessUPSTracking" mode="sync"/>
    </mca>

in the above I am rerouting the Quantum emails to a process I wrote to
input the shipping tracking number into an order.

If this is what you were meaning by sort then this is the mechanism to
to this.

you can find /framework/common/servicedef/smca_test.xml


rohit2006 sent the following on 4/19/2007 10:03 PM:

> i am trying to configure email sorting in ofbiz. I have followed the
> documentation by Si Chen, to test it. I am assuming that if email sorting is
> correctly configured, emails will be recorded as communication event for the
> related parties. For eg. after a email is received ofbiz, will try to match
> the "to" address, with the email associated to a party, and if a match  is
> found,  a communication event will be logged for the party.
>
> I hope that i got this right?
>
> I have followed the instruction as mentioned in documentation, and
> everything loads fine, but when i schedule the service storeincomingemail, i
> am prompted to enter the service parameter(messageWrapper
> (org.ofbiz.service.mail.MimeMessageWrapper), which i have no clue about. i
> guess this is to do something 'MimeMessageWrapper'.
>
> The documentation by Si Chen mentions this:
>
> 5. MCA services need to implement the mail processing interface, as in:
>         <implements service="mailProcessInterface"/>
> It uses a MimeMessageWrapper:
>         MimeMessageWrapper wrapper = (MimeMessageWrapper)
> context.get("messageWrapper");
> MimeMessage message = wrapper.getMessage();
> with methods like message.getAllRecipients(), message.getFrom(),
> message.getSubject(), getAllRecipients(), getSentDate(), getReceivedDate(),
> etc.
>
> Currently (20060607) there is a service called “storeIncomingEmail” which
> could be used to do inbound mail sorting.  This has not been fully tested
> yet.
>
>
> I am not sure what to insert in the service parameters.
>
> Do we need to create a view for email sorting, cause i think the mails will
> be visible, under the communication tab, in party manager?
>
> Rohit
>
>
>
> BJ Freeman wrote:
>> If I understand you, you can create a view with the sorting you want.
>>
>> rohit2006 sent the following on 4/19/2007 4:33 AM:
>>> Hi,
>>>
>>> I am trying configure email sorting in ofbiz and store emails as
>>> communication events. I believe i have to schedule the service
>>> storeIncomingEmail as a service. I tried to do that and was prompted fill
>>> the fields:
>>>
>>> Step 2: Service Parameters
>>> messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper).
>>>
>>> I am not sure what to enter into this field, can someone please help me
>>> configure this. I am getting the following error in log when the service
>>> is
>>> run
>>>
>>> 2007-04-19 05:22:31,302 (default-invoker-Thread-2) [        
>>> JobInvoker.java:211:INFO ] Invoker: default-invoker-Thread-2 received job
>>> --
>>> 1176985293330 from poller - org.ofbiz.service.job.JobPoller@1be4777
>>> 2007-04-19 05:22:31,320 (default-invoker-Thread-2)
>>> [PersistedServiceJob.java:136:INFO ]
>>> org.ofbiz.service.job.PersistedServiceJob@334bfe[58369] -- Next runtime:
>>> -1
>>> [Error] :2:12: cvc-elt.1: Cannot find the declaration of element
>>> 'ofbiz-ser'.
>>> 2007-04-19 05:22:31,331 (default-invoker-Thread-2) [          
>>> UtilXml.java:243:DEBUG] XML Read 0.0040s: Internal Content
>>> 2007-04-19 05:22:31,332 (default-invoker-Thread-2) [
>>> ServiceDispatcher.java:322:ERROR]
>>> ---- exception report
>>> ----------------------------------------------------------
>>> Incoming context (in runSync : storeIncomingEmail) does not match
>>> expected
>>> requirements
>>> Exception: org.ofbiz.service.ServiceValidationException
>>> Message: The following required parameter is missing:
>>> [storeIncomingEmail.messageWrapper]
>>> ---- stack trace
>>> ---------------------------------------------------------------
>>> org.ofbiz.service.ServiceValidationException: The following required
>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>> java.lang.Thread.run(Thread.java:534)
>>> --------------------------------------------------------------------------------
>>>
>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>> ServiceDispatcher.java:385:DEBUG] [[Sync service failed...-
>>> total:0.0,since
>>> last(Begin):0.0]] - 'JobDispatcher / storeIncomingEmail'
>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>> ServiceDispatcher.java:388:ERROR]
>>> ---- exception report
>>> ----------------------------------------------------------
>>> Service [storeIncomingEmail] threw an unexpected exception/error
>>> Exception: org.ofbiz.service.ServiceValidationException
>>> Message: The following required parameter is missing:
>>> [storeIncomingEmail.messageWrapper]
>>> ---- stack trace
>>> ---------------------------------------------------------------
>>> org.ofbiz.service.ServiceValidationException: The following required
>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>> java.lang.Thread.run(Thread.java:534)
>>> --------------------------------------------------------------------------------
>>>
>>> 2007-04-19 05:22:31,334 (default-invoker-Thread-2) [  
>>> TransactionUtil.java:252:ERROR]
>>> ---- exception report
>>> ----------------------------------------------------------
>>> [TransactionUtil.rollback]
>>> Exception: java.lang.Exception
>>> Message: Stack Trace
>>> ---- stack trace
>>> ---------------------------------------------------------------
>>> java.lang.Exception: Stack Trace
>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:391)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>> java.lang.Thread.run(Thread.java:534)
>>> --------------------------------------------------------------------------------
>>>
>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>> TransactionUtil.java:262:INFO ] [TransactionUtil.rollback] transaction
>>> rolled back
>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>> TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not committing
>>> transaction, status is STATUS_NO_TRANSACTION
>>> 2007-04-19 05:22:31,336 (default-invoker-Thread-2) [
>>> GenericServiceJob.java:117:ERROR]
>>> ---- exception report
>>> ----------------------------------------------------------
>>> Async-Service failed.
>>> Exception: org.ofbiz.service.ServiceValidationException
>>> Message: The following required parameter is missing:
>>> [storeIncomingEmail.messageWrapper]
>>> ---- stack trace
>>> ---------------------------------------------------------------
>>> org.ofbiz.service.ServiceValidationException: The following required
>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>> java.lang.Thread.run(Thread.java:534)
>>> --------------------------------------------------------------------------------
>>>
>>> 2007-04-19 05:22:31,342 (default-invoker-Thread-2) [      
>>> SequenceUtil.java:254:INFO ] Got bank of sequenced IDs for [JobSandbox];
>>> curSeqId=58370, maxSeqId=58380, bankSize=10
>>> 2007-04-19 05:22:31,348 (default-invoker-Thread-2)
>>> [PersistedServiceJob.java:202:INFO ] Persisted Job [58369] Failed
>>> Re-Scheduling : 1176985531339
>>> 2007-04-19 05:22:37,711 (http-0.0.0.0-7443-Processor1) [    
>>> ContextFilter.java:182:INFO ] [Request]: /webtools/control/jobList
>>> 2007-04-19 05:22:37,712 (http-0.0.0.0-7443-Processor1) [    
>>> ControlServlet.java:90 :INFO ] The character encoding of the request is:
>>> [null]. The character encoding we will use for the request and response
>>> is:
>>> [UTF-8]
>>> 2007-04-19 05:22:37,713 (http-0.0.0.0-7443-Processor1) [    
>>> ControlServlet.java:126:DEBUG] [[[jobList] Servlet Starting, doing setup-
>>> total:0.0,since last(Begin):0.0]]
>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>> ControlServlet.java:181:DEBUG] [[[jobList] Setup done, doing Event(s) and
>>> View(s)- total:0.0,since last([jobList] Servlet...):0.0]]
>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>> RequestHandler.java:266:INFO ] [Processing Request]: jobList
>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>> 2007-04-19 05:22:37,715 (http-0.0.0.0-7443-Processor1) [    
>>> RequestManager.java:117:INFO ] [RequestManager.getRequestAttribute] Value
>>> for attribute "null" of uri "jobList" not found
>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>> RequestHandler.java:450:INFO ] [RequestHandler.doRequest]: Response is a
>>> view. sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>> RequestHandler.java:603:INFO ] servletName=control, view=jobList
>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>> 2007-04-19 05:22:37,717 (http-0.0.0.0-7443-Processor1) [    
>>> ScreenRenderer.java:220:INFO ] Found servlet context (application)
>>> attribute
>>> that conflicts with parameter name, leaving request parameter in place
>>> for
>>> name: _REQUEST_HANDLER_
>>> 2007-04-19 05:22:37,826 (http-0.0.0.0-7443-Processor1) [
>>> ModelScreenWidget.java:361:INFO ] In the include-screen tag the screen
>>> name
>>> was empty, ignoring include; in screen [GlobalDecorator]
>>> 2007-04-19 05:22:37,857 (http-0.0.0.0-7443-Processor1) [    
>>> ControlServlet.java:256:DEBUG] [[[jobList] Done rendering page, Servlet
>>> Finished- total:0.143,since last([jobList] Setup d...):0.143]]
>>>
>>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: what is [storeIncomingEmail.messageWrapper]?

rohit
Thanks for the email and i am sorry if i did not put my question properly.

My real problem is configuring the service to sort emails. I have put the MCA rules in place but i am not able to configure the "sortincomingemail' service.

I understand that "sortincomingemail" has to be run at regular interval to process the email sorting.

Rohit

BJ Freeman <[hidden email]> wrote: My previous response was aimed at sorting the communication events after
they have been already loaded.

to answer your question, Yes ofbiz will try to match any email to and
from with those in the parties.
if it can not find one of the parties, usually the from, it puts the
address in comments, an marks it unknown email address.


The MCA is used to filter the emails. Like:
 
 link tracking number to order-->
   
       
value="[hidden email]"/>
       
   

in the above I am rerouting the Quantum emails to a process I wrote to
input the shipping tracking number into an order.

If this is what you were meaning by sort then this is the mechanism to
to this.

you can find /framework/common/servicedef/smca_test.xml


rohit2006 sent the following on 4/19/2007 10:03 PM:

> i am trying to configure email sorting in ofbiz. I have followed the
> documentation by Si Chen, to test it. I am assuming that if email sorting is
> correctly configured, emails will be recorded as communication event for the
> related parties. For eg. after a email is received ofbiz, will try to match
> the "to" address, with the email associated to a party, and if a match  is
> found,  a communication event will be logged for the party.
>
> I hope that i got this right?
>
> I have followed the instruction as mentioned in documentation, and
> everything loads fine, but when i schedule the service storeincomingemail, i
> am prompted to enter the service parameter(messageWrapper
> (org.ofbiz.service.mail.MimeMessageWrapper), which i have no clue about. i
> guess this is to do something 'MimeMessageWrapper'.
>
> The documentation by Si Chen mentions this:
>
> 5. MCA services need to implement the mail processing interface, as in:
>        
> It uses a MimeMessageWrapper:
>         MimeMessageWrapper wrapper = (MimeMessageWrapper)
> context.get("messageWrapper");
> MimeMessage message = wrapper.getMessage();
> with methods like message.getAllRecipients(), message.getFrom(),
> message.getSubject(), getAllRecipients(), getSentDate(), getReceivedDate(),
> etc.
>
> Currently (20060607) there is a service called “storeIncomingEmail” which
> could be used to do inbound mail sorting.  This has not been fully tested
> yet.
>
>
> I am not sure what to insert in the service parameters.
>
> Do we need to create a view for email sorting, cause i think the mails will
> be visible, under the communication tab, in party manager?
>
> Rohit
>
>
>
> BJ Freeman wrote:
>> If I understand you, you can create a view with the sorting you want.
>>
>> rohit2006 sent the following on 4/19/2007 4:33 AM:
>>> Hi,
>>>
>>> I am trying configure email sorting in ofbiz and store emails as
>>> communication events. I believe i have to schedule the service
>>> storeIncomingEmail as a service. I tried to do that and was prompted fill
>>> the fields:
>>>
>>> Step 2: Service Parameters
>>> messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper).
>>>
>>> I am not sure what to enter into this field, can someone please help me
>>> configure this. I am getting the following error in log when the service
>>> is
>>> run
>>>
>>> 2007-04-19 05:22:31,302 (default-invoker-Thread-2) [        
>>> JobInvoker.java:211:INFO ] Invoker: default-invoker-Thread-2 received job
>>> --
>>> 1176985293330 from poller - org.ofbiz.service.job.JobPoller@1be4777
>>> 2007-04-19 05:22:31,320 (default-invoker-Thread-2)
>>> [PersistedServiceJob.java:136:INFO ]
>>> org.ofbiz.service.job.PersistedServiceJob@334bfe[58369] -- Next runtime:
>>> -1
>>> [Error] :2:12: cvc-elt.1: Cannot find the declaration of element
>>> 'ofbiz-ser'.
>>> 2007-04-19 05:22:31,331 (default-invoker-Thread-2) [          
>>> UtilXml.java:243:DEBUG] XML Read 0.0040s: Internal Content
>>> 2007-04-19 05:22:31,332 (default-invoker-Thread-2) [
>>> ServiceDispatcher.java:322:ERROR]
>>> ---- exception report
>>> ----------------------------------------------------------
>>> Incoming context (in runSync : storeIncomingEmail) does not match
>>> expected
>>> requirements
>>> Exception: org.ofbiz.service.ServiceValidationException
>>> Message: The following required parameter is missing:
>>> [storeIncomingEmail.messageWrapper]
>>> ---- stack trace
>>> ---------------------------------------------------------------
>>> org.ofbiz.service.ServiceValidationException: The following required
>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>> java.lang.Thread.run(Thread.java:534)
>>> --------------------------------------------------------------------------------
>>>
>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>> ServiceDispatcher.java:385:DEBUG] [[Sync service failed...-
>>> total:0.0,since
>>> last(Begin):0.0]] - 'JobDispatcher / storeIncomingEmail'
>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>> ServiceDispatcher.java:388:ERROR]
>>> ---- exception report
>>> ----------------------------------------------------------
>>> Service [storeIncomingEmail] threw an unexpected exception/error
>>> Exception: org.ofbiz.service.ServiceValidationException
>>> Message: The following required parameter is missing:
>>> [storeIncomingEmail.messageWrapper]
>>> ---- stack trace
>>> ---------------------------------------------------------------
>>> org.ofbiz.service.ServiceValidationException: The following required
>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>> java.lang.Thread.run(Thread.java:534)
>>> --------------------------------------------------------------------------------
>>>
>>> 2007-04-19 05:22:31,334 (default-invoker-Thread-2) [  
>>> TransactionUtil.java:252:ERROR]
>>> ---- exception report
>>> ----------------------------------------------------------
>>> [TransactionUtil.rollback]
>>> Exception: java.lang.Exception
>>> Message: Stack Trace
>>> ---- stack trace
>>> ---------------------------------------------------------------
>>> java.lang.Exception: Stack Trace
>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:391)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>> java.lang.Thread.run(Thread.java:534)
>>> --------------------------------------------------------------------------------
>>>
>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>> TransactionUtil.java:262:INFO ] [TransactionUtil.rollback] transaction
>>> rolled back
>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>> TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not committing
>>> transaction, status is STATUS_NO_TRANSACTION
>>> 2007-04-19 05:22:31,336 (default-invoker-Thread-2) [
>>> GenericServiceJob.java:117:ERROR]
>>> ---- exception report
>>> ----------------------------------------------------------
>>> Async-Service failed.
>>> Exception: org.ofbiz.service.ServiceValidationException
>>> Message: The following required parameter is missing:
>>> [storeIncomingEmail.messageWrapper]
>>> ---- stack trace
>>> ---------------------------------------------------------------
>>> org.ofbiz.service.ServiceValidationException: The following required
>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>> java.lang.Thread.run(Thread.java:534)
>>> --------------------------------------------------------------------------------
>>>
>>> 2007-04-19 05:22:31,342 (default-invoker-Thread-2) [      
>>> SequenceUtil.java:254:INFO ] Got bank of sequenced IDs for [JobSandbox];
>>> curSeqId=58370, maxSeqId=58380, bankSize=10
>>> 2007-04-19 05:22:31,348 (default-invoker-Thread-2)
>>> [PersistedServiceJob.java:202:INFO ] Persisted Job [58369] Failed
>>> Re-Scheduling : 1176985531339
>>> 2007-04-19 05:22:37,711 (http-0.0.0.0-7443-Processor1) [    
>>> ContextFilter.java:182:INFO ] [Request]: /webtools/control/jobList
>>> 2007-04-19 05:22:37,712 (http-0.0.0.0-7443-Processor1) [    
>>> ControlServlet.java:90 :INFO ] The character encoding of the request is:
>>> [null]. The character encoding we will use for the request and response
>>> is:
>>> [UTF-8]
>>> 2007-04-19 05:22:37,713 (http-0.0.0.0-7443-Processor1) [    
>>> ControlServlet.java:126:DEBUG] [[[jobList] Servlet Starting, doing setup-
>>> total:0.0,since last(Begin):0.0]]
>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>> ControlServlet.java:181:DEBUG] [[[jobList] Setup done, doing Event(s) and
>>> View(s)- total:0.0,since last([jobList] Servlet...):0.0]]
>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>> RequestHandler.java:266:INFO ] [Processing Request]: jobList
>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>> 2007-04-19 05:22:37,715 (http-0.0.0.0-7443-Processor1) [    
>>> RequestManager.java:117:INFO ] [RequestManager.getRequestAttribute] Value
>>> for attribute "null" of uri "jobList" not found
>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>> RequestHandler.java:450:INFO ] [RequestHandler.doRequest]: Response is a
>>> view. sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>> RequestHandler.java:603:INFO ] servletName=control, view=jobList
>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>> 2007-04-19 05:22:37,717 (http-0.0.0.0-7443-Processor1) [    
>>> ScreenRenderer.java:220:INFO ] Found servlet context (application)
>>> attribute
>>> that conflicts with parameter name, leaving request parameter in place
>>> for
>>> name: _REQUEST_HANDLER_
>>> 2007-04-19 05:22:37,826 (http-0.0.0.0-7443-Processor1) [
>>> ModelScreenWidget.java:361:INFO ] In the include-screen tag the screen
>>> name
>>> was empty, ignoring include; in screen [GlobalDecorator]
>>> 2007-04-19 05:22:37,857 (http-0.0.0.0-7443-Processor1) [    
>>> ControlServlet.java:256:DEBUG] [[[jobList] Done rendering page, Servlet
>>> Finished- total:0.143,since last([jobList] Setup d...):0.143]]
>>>
>>>
>>
>



       
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.
Reply | Threaded
Open this post in threaded view
|

Re: what is [storeIncomingEmail.messageWrapper]?

Guido Amarilla
You should configure a JavaMail Container,  POP3 or IMAP server in
framework\base\config\ofbiz-containers.xml

I did and started to poll regularly to my server, download and sort
Emails without any other configuration.

It gave me some work to enable a Gmail account. If you use SSL, you
should make sure to import your server's certificate into your Trust
Store (check http://docs.ofbiz.org/display/OFBIZ/Google+Checkout+Integration)

This is my configuration for a Google Apps hosted domain:

<container name="javamail-container"
class="org.ofbiz.service.mail.JavaMailContainer">
        <property name="delegator-name" value="default"/>
        <property name="dispatcher-name" value="JavaMailDispatcher"/>
        <property name="run-as-user" value="system"/>
        <property name="poll-delay" value="300000"/>
        <property name="delete-mail" value="false"/>
        <property name="maxSize" value="100000"/>
        <property name="default-listener" value="store-listener">
            <property name="mail.debug" value="true"/>
            <property name="mail.store.protocol" value="pop3s"/>
            <property name="mail.host" value="pop.gmail.com"/>
            <property name="mail.port" value="995"/>
            <property name="mail.user" value="youruser@domain"/>
            <property name="mail.pass" value="yourpassword"/>
            </property>
    </container>

Hope this helps.


Guido Amarilla

2007/4/20, Rohit Sureka <[hidden email]>:

> Thanks for the email and i am sorry if i did not put my question properly.
>
> My real problem is configuring the service to sort emails. I have put the MCA rules in place but i am not able to configure the "sortincomingemail' service.
>
> I understand that "sortincomingemail" has to be run at regular interval to process the email sorting.
>
> Rohit
>
> BJ Freeman <[hidden email]> wrote: My previous response was aimed at sorting the communication events after
> they have been already loaded.
>
> to answer your question, Yes ofbiz will try to match any email to and
> from with those in the parties.
> if it can not find one of the parties, usually the from, it puts the
> address in comments, an marks it unknown email address.
>
>
> The MCA is used to filter the emails. Like:
>
>  link tracking number to order-->
>
>
> value="[hidden email]"/>
>
>
>
> in the above I am rerouting the Quantum emails to a process I wrote to
> input the shipping tracking number into an order.
>
> If this is what you were meaning by sort then this is the mechanism to
> to this.
>
> you can find /framework/common/servicedef/smca_test.xml
>
>
> rohit2006 sent the following on 4/19/2007 10:03 PM:
> > i am trying to configure email sorting in ofbiz. I have followed the
> > documentation by Si Chen, to test it. I am assuming that if email sorting is
> > correctly configured, emails will be recorded as communication event for the
> > related parties. For eg. after a email is received ofbiz, will try to match
> > the "to" address, with the email associated to a party, and if a match  is
> > found,  a communication event will be logged for the party.
> >
> > I hope that i got this right?
> >
> > I have followed the instruction as mentioned in documentation, and
> > everything loads fine, but when i schedule the service storeincomingemail, i
> > am prompted to enter the service parameter(messageWrapper
> > (org.ofbiz.service.mail.MimeMessageWrapper), which i have no clue about. i
> > guess this is to do something 'MimeMessageWrapper'.
> >
> > The documentation by Si Chen mentions this:
> >
> > 5. MCA services need to implement the mail processing interface, as in:
> >
> > It uses a MimeMessageWrapper:
> >         MimeMessageWrapper wrapper = (MimeMessageWrapper)
> > context.get("messageWrapper");
> > MimeMessage message = wrapper.getMessage();
> > with methods like message.getAllRecipients(), message.getFrom(),
> > message.getSubject(), getAllRecipients(), getSentDate(), getReceivedDate(),
> > etc.
> >
> > Currently (20060607) there is a service called "storeIncomingEmail" which
> > could be used to do inbound mail sorting.  This has not been fully tested
> > yet.
> >
> >
> > I am not sure what to insert in the service parameters.
> >
> > Do we need to create a view for email sorting, cause i think the mails will
> > be visible, under the communication tab, in party manager?
> >
> > Rohit
> >
> >
> >
> > BJ Freeman wrote:
> >> If I understand you, you can create a view with the sorting you want.
> >>
> >> rohit2006 sent the following on 4/19/2007 4:33 AM:
> >>> Hi,
> >>>
> >>> I am trying configure email sorting in ofbiz and store emails as
> >>> communication events. I believe i have to schedule the service
> >>> storeIncomingEmail as a service. I tried to do that and was prompted fill
> >>> the fields:
> >>>
> >>> Step 2: Service Parameters
> >>> messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper).
> >>>
> >>> I am not sure what to enter into this field, can someone please help me
> >>> configure this. I am getting the following error in log when the service
> >>> is
> >>> run
> >>>
> >>> 2007-04-19 05:22:31,302 (default-invoker-Thread-2) [
> >>> JobInvoker.java:211:INFO ] Invoker: default-invoker-Thread-2 received job
> >>> --
> >>> 1176985293330 from poller - org.ofbiz.service.job.JobPoller@1be4777
> >>> 2007-04-19 05:22:31,320 (default-invoker-Thread-2)
> >>> [PersistedServiceJob.java:136:INFO ]
> >>> org.ofbiz.service.job.PersistedServiceJob@334bfe[58369] -- Next runtime:
> >>> -1
> >>> [Error] :2:12: cvc-elt.1: Cannot find the declaration of element
> >>> 'ofbiz-ser'.
> >>> 2007-04-19 05:22:31,331 (default-invoker-Thread-2) [
> >>> UtilXml.java:243:DEBUG] XML Read 0.0040s: Internal Content
> >>> 2007-04-19 05:22:31,332 (default-invoker-Thread-2) [
> >>> ServiceDispatcher.java:322:ERROR]
> >>> ---- exception report
> >>> ----------------------------------------------------------
> >>> Incoming context (in runSync : storeIncomingEmail) does not match
> >>> expected
> >>> requirements
> >>> Exception: org.ofbiz.service.ServiceValidationException
> >>> Message: The following required parameter is missing:
> >>> [storeIncomingEmail.messageWrapper]
> >>> ---- stack trace
> >>> ---------------------------------------------------------------
> >>> org.ofbiz.service.ServiceValidationException: The following required
> >>> parameter is missing: [storeIncomingEmail.messageWrapper]
> >>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> >>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> >>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> >>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> >>> java.lang.Thread.run(Thread.java:534)
> >>> --------------------------------------------------------------------------------
> >>>
> >>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
> >>> ServiceDispatcher.java:385:DEBUG] [[Sync service failed...-
> >>> total:0.0,since
> >>> last(Begin):0.0]] - 'JobDispatcher / storeIncomingEmail'
> >>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
> >>> ServiceDispatcher.java:388:ERROR]
> >>> ---- exception report
> >>> ----------------------------------------------------------
> >>> Service [storeIncomingEmail] threw an unexpected exception/error
> >>> Exception: org.ofbiz.service.ServiceValidationException
> >>> Message: The following required parameter is missing:
> >>> [storeIncomingEmail.messageWrapper]
> >>> ---- stack trace
> >>> ---------------------------------------------------------------
> >>> org.ofbiz.service.ServiceValidationException: The following required
> >>> parameter is missing: [storeIncomingEmail.messageWrapper]
> >>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> >>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> >>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> >>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> >>> java.lang.Thread.run(Thread.java:534)
> >>> --------------------------------------------------------------------------------
> >>>
> >>> 2007-04-19 05:22:31,334 (default-invoker-Thread-2) [
> >>> TransactionUtil.java:252:ERROR]
> >>> ---- exception report
> >>> ----------------------------------------------------------
> >>> [TransactionUtil.rollback]
> >>> Exception: java.lang.Exception
> >>> Message: Stack Trace
> >>> ---- stack trace
> >>> ---------------------------------------------------------------
> >>> java.lang.Exception: Stack Trace
> >>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
> >>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
> >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:391)
> >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> >>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> >>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> >>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> >>> java.lang.Thread.run(Thread.java:534)
> >>> --------------------------------------------------------------------------------
> >>>
> >>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [
> >>> TransactionUtil.java:262:INFO ] [TransactionUtil.rollback] transaction
> >>> rolled back
> >>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [
> >>> TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not committing
> >>> transaction, status is STATUS_NO_TRANSACTION
> >>> 2007-04-19 05:22:31,336 (default-invoker-Thread-2) [
> >>> GenericServiceJob.java:117:ERROR]
> >>> ---- exception report
> >>> ----------------------------------------------------------
> >>> Async-Service failed.
> >>> Exception: org.ofbiz.service.ServiceValidationException
> >>> Message: The following required parameter is missing:
> >>> [storeIncomingEmail.messageWrapper]
> >>> ---- stack trace
> >>> ---------------------------------------------------------------
> >>> org.ofbiz.service.ServiceValidationException: The following required
> >>> parameter is missing: [storeIncomingEmail.messageWrapper]
> >>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> >>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> >>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> >>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> >>> java.lang.Thread.run(Thread.java:534)
> >>> --------------------------------------------------------------------------------
> >>>
> >>> 2007-04-19 05:22:31,342 (default-invoker-Thread-2) [
> >>> SequenceUtil.java:254:INFO ] Got bank of sequenced IDs for [JobSandbox];
> >>> curSeqId=58370, maxSeqId=58380, bankSize=10
> >>> 2007-04-19 05:22:31,348 (default-invoker-Thread-2)
> >>> [PersistedServiceJob.java:202:INFO ] Persisted Job [58369] Failed
> >>> Re-Scheduling : 1176985531339
> >>> 2007-04-19 05:22:37,711 (http-0.0.0.0-7443-Processor1) [
> >>> ContextFilter.java:182:INFO ] [Request]: /webtools/control/jobList
> >>> 2007-04-19 05:22:37,712 (http-0.0.0.0-7443-Processor1) [
> >>> ControlServlet.java:90 :INFO ] The character encoding of the request is:
> >>> [null]. The character encoding we will use for the request and response
> >>> is:
> >>> [UTF-8]
> >>> 2007-04-19 05:22:37,713 (http-0.0.0.0-7443-Processor1) [
> >>> ControlServlet.java:126:DEBUG] [[[jobList] Servlet Starting, doing setup-
> >>> total:0.0,since last(Begin):0.0]]
> >>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [
> >>> ControlServlet.java:181:DEBUG] [[[jobList] Setup done, doing Event(s) and
> >>> View(s)- total:0.0,since last([jobList] Servlet...):0.0]]
> >>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [
> >>> RequestHandler.java:266:INFO ] [Processing Request]: jobList
> >>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> >>> 2007-04-19 05:22:37,715 (http-0.0.0.0-7443-Processor1) [
> >>> RequestManager.java:117:INFO ] [RequestManager.getRequestAttribute] Value
> >>> for attribute "null" of uri "jobList" not found
> >>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [
> >>> RequestHandler.java:450:INFO ] [RequestHandler.doRequest]: Response is a
> >>> view. sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> >>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [
> >>> RequestHandler.java:603:INFO ] servletName=control, view=jobList
> >>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> >>> 2007-04-19 05:22:37,717 (http-0.0.0.0-7443-Processor1) [
> >>> ScreenRenderer.java:220:INFO ] Found servlet context (application)
> >>> attribute
> >>> that conflicts with parameter name, leaving request parameter in place
> >>> for
> >>> name: _REQUEST_HANDLER_
> >>> 2007-04-19 05:22:37,826 (http-0.0.0.0-7443-Processor1) [
> >>> ModelScreenWidget.java:361:INFO ] In the include-screen tag the screen
> >>> name
> >>> was empty, ignoring include; in screen [GlobalDecorator]
> >>> 2007-04-19 05:22:37,857 (http-0.0.0.0-7443-Processor1) [
> >>> ControlServlet.java:256:DEBUG] [[[jobList] Done rendering page, Servlet
> >>> Finished- total:0.143,since last([jobList] Setup d...):0.143]]
> >>>
> >>>
> >>
> >
>
>
>
>
> ---------------------------------
> Ahhh...imagining that irresistible "new car" smell?
>  Check outnew cars at Yahoo! Autos.


--
Guido Amarilla
Reply | Threaded
Open this post in threaded view
|

Re: what is [storeIncomingEmail.messageWrapper]?

Guido Amarilla
Forgot to mention that there are a couple of bugs (I think) that
throws exceptions if a mail don't have a Bcc or CC address. Please
confirm it and I´ll try to post a patch (just null checks).




2007/4/20, Guido Amarilla <[hidden email]>:

> You should configure a JavaMail Container,  POP3 or IMAP server in
> framework\base\config\ofbiz-containers.xml
>
> I did and started to poll regularly to my server, download and sort
> Emails without any other configuration.
>
> It gave me some work to enable a Gmail account. If you use SSL, you
> should make sure to import your server's certificate into your Trust
> Store (check http://docs.ofbiz.org/display/OFBIZ/Google+Checkout+Integration)
>
> This is my configuration for a Google Apps hosted domain:
>
> <container name="javamail-container"
> class="org.ofbiz.service.mail.JavaMailContainer">
>         <property name="delegator-name" value="default"/>
>         <property name="dispatcher-name" value="JavaMailDispatcher"/>
>         <property name="run-as-user" value="system"/>
>         <property name="poll-delay" value="300000"/>
>         <property name="delete-mail" value="false"/>
>         <property name="maxSize" value="100000"/>
>         <property name="default-listener" value="store-listener">
>             <property name="mail.debug" value="true"/>
>             <property name="mail.store.protocol" value="pop3s"/>
>             <property name="mail.host" value="pop.gmail.com"/>
>             <property name="mail.port" value="995"/>
>             <property name="mail.user" value="youruser@domain"/>
>             <property name="mail.pass" value="yourpassword"/>
>             </property>
>     </container>
>
> Hope this helps.
>
>
> Guido Amarilla
>
> 2007/4/20, Rohit Sureka <[hidden email]>:
> > Thanks for the email and i am sorry if i did not put my question properly.
> >
> > My real problem is configuring the service to sort emails. I have put the MCA rules in place but i am not able to configure the "sortincomingemail' service.
> >
> > I understand that "sortincomingemail" has to be run at regular interval to process the email sorting.
> >
> > Rohit
> >
> > BJ Freeman <[hidden email]> wrote: My previous response was aimed at sorting the communication events after
> > they have been already loaded.
> >
> > to answer your question, Yes ofbiz will try to match any email to and
> > from with those in the parties.
> > if it can not find one of the parties, usually the from, it puts the
> > address in comments, an marks it unknown email address.
> >
> >
> > The MCA is used to filter the emails. Like:
> >
> >  link tracking number to order-->
> >
> >
> > value="[hidden email]"/>
> >
> >
> >
> > in the above I am rerouting the Quantum emails to a process I wrote to
> > input the shipping tracking number into an order.
> >
> > If this is what you were meaning by sort then this is the mechanism to
> > to this.
> >
> > you can find /framework/common/servicedef/smca_test.xml
> >
> >
> > rohit2006 sent the following on 4/19/2007 10:03 PM:
> > > i am trying to configure email sorting in ofbiz. I have followed the
> > > documentation by Si Chen, to test it. I am assuming that if email sorting is
> > > correctly configured, emails will be recorded as communication event for the
> > > related parties. For eg. after a email is received ofbiz, will try to match
> > > the "to" address, with the email associated to a party, and if a match  is
> > > found,  a communication event will be logged for the party.
> > >
> > > I hope that i got this right?
> > >
> > > I have followed the instruction as mentioned in documentation, and
> > > everything loads fine, but when i schedule the service storeincomingemail, i
> > > am prompted to enter the service parameter(messageWrapper
> > > (org.ofbiz.service.mail.MimeMessageWrapper), which i have no clue about. i
> > > guess this is to do something 'MimeMessageWrapper'.
> > >
> > > The documentation by Si Chen mentions this:
> > >
> > > 5. MCA services need to implement the mail processing interface, as in:
> > >
> > > It uses a MimeMessageWrapper:
> > >         MimeMessageWrapper wrapper = (MimeMessageWrapper)
> > > context.get("messageWrapper");
> > > MimeMessage message = wrapper.getMessage();
> > > with methods like message.getAllRecipients(), message.getFrom(),
> > > message.getSubject(), getAllRecipients(), getSentDate(), getReceivedDate(),
> > > etc.
> > >
> > > Currently (20060607) there is a service called "storeIncomingEmail" which
> > > could be used to do inbound mail sorting.  This has not been fully tested
> > > yet.
> > >
> > >
> > > I am not sure what to insert in the service parameters.
> > >
> > > Do we need to create a view for email sorting, cause i think the mails will
> > > be visible, under the communication tab, in party manager?
> > >
> > > Rohit
> > >
> > >
> > >
> > > BJ Freeman wrote:
> > >> If I understand you, you can create a view with the sorting you want.
> > >>
> > >> rohit2006 sent the following on 4/19/2007 4:33 AM:
> > >>> Hi,
> > >>>
> > >>> I am trying configure email sorting in ofbiz and store emails as
> > >>> communication events. I believe i have to schedule the service
> > >>> storeIncomingEmail as a service. I tried to do that and was prompted fill
> > >>> the fields:
> > >>>
> > >>> Step 2: Service Parameters
> > >>> messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper).
> > >>>
> > >>> I am not sure what to enter into this field, can someone please help me
> > >>> configure this. I am getting the following error in log when the service
> > >>> is
> > >>> run
> > >>>
> > >>> 2007-04-19 05:22:31,302 (default-invoker-Thread-2) [
> > >>> JobInvoker.java:211:INFO ] Invoker: default-invoker-Thread-2 received job
> > >>> --
> > >>> 1176985293330 from poller - org.ofbiz.service.job.JobPoller@1be4777
> > >>> 2007-04-19 05:22:31,320 (default-invoker-Thread-2)
> > >>> [PersistedServiceJob.java:136:INFO ]
> > >>> org.ofbiz.service.job.PersistedServiceJob@334bfe[58369] -- Next runtime:
> > >>> -1
> > >>> [Error] :2:12: cvc-elt.1: Cannot find the declaration of element
> > >>> 'ofbiz-ser'.
> > >>> 2007-04-19 05:22:31,331 (default-invoker-Thread-2) [
> > >>> UtilXml.java:243:DEBUG] XML Read 0.0040s: Internal Content
> > >>> 2007-04-19 05:22:31,332 (default-invoker-Thread-2) [
> > >>> ServiceDispatcher.java:322:ERROR]
> > >>> ---- exception report
> > >>> ----------------------------------------------------------
> > >>> Incoming context (in runSync : storeIncomingEmail) does not match
> > >>> expected
> > >>> requirements
> > >>> Exception: org.ofbiz.service.ServiceValidationException
> > >>> Message: The following required parameter is missing:
> > >>> [storeIncomingEmail.messageWrapper]
> > >>> ---- stack trace
> > >>> ---------------------------------------------------------------
> > >>> org.ofbiz.service.ServiceValidationException: The following required
> > >>> parameter is missing: [storeIncomingEmail.messageWrapper]
> > >>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> > >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> > >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> > >>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> > >>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> > >>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> > >>> java.lang.Thread.run(Thread.java:534)
> > >>> --------------------------------------------------------------------------------
> > >>>
> > >>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
> > >>> ServiceDispatcher.java:385:DEBUG] [[Sync service failed...-
> > >>> total:0.0,since
> > >>> last(Begin):0.0]] - 'JobDispatcher / storeIncomingEmail'
> > >>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
> > >>> ServiceDispatcher.java:388:ERROR]
> > >>> ---- exception report
> > >>> ----------------------------------------------------------
> > >>> Service [storeIncomingEmail] threw an unexpected exception/error
> > >>> Exception: org.ofbiz.service.ServiceValidationException
> > >>> Message: The following required parameter is missing:
> > >>> [storeIncomingEmail.messageWrapper]
> > >>> ---- stack trace
> > >>> ---------------------------------------------------------------
> > >>> org.ofbiz.service.ServiceValidationException: The following required
> > >>> parameter is missing: [storeIncomingEmail.messageWrapper]
> > >>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> > >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> > >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> > >>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> > >>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> > >>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> > >>> java.lang.Thread.run(Thread.java:534)
> > >>> --------------------------------------------------------------------------------
> > >>>
> > >>> 2007-04-19 05:22:31,334 (default-invoker-Thread-2) [
> > >>> TransactionUtil.java:252:ERROR]
> > >>> ---- exception report
> > >>> ----------------------------------------------------------
> > >>> [TransactionUtil.rollback]
> > >>> Exception: java.lang.Exception
> > >>> Message: Stack Trace
> > >>> ---- stack trace
> > >>> ---------------------------------------------------------------
> > >>> java.lang.Exception: Stack Trace
> > >>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
> > >>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
> > >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:391)
> > >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> > >>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> > >>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> > >>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> > >>> java.lang.Thread.run(Thread.java:534)
> > >>> --------------------------------------------------------------------------------
> > >>>
> > >>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [
> > >>> TransactionUtil.java:262:INFO ] [TransactionUtil.rollback] transaction
> > >>> rolled back
> > >>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [
> > >>> TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not committing
> > >>> transaction, status is STATUS_NO_TRANSACTION
> > >>> 2007-04-19 05:22:31,336 (default-invoker-Thread-2) [
> > >>> GenericServiceJob.java:117:ERROR]
> > >>> ---- exception report
> > >>> ----------------------------------------------------------
> > >>> Async-Service failed.
> > >>> Exception: org.ofbiz.service.ServiceValidationException
> > >>> Message: The following required parameter is missing:
> > >>> [storeIncomingEmail.messageWrapper]
> > >>> ---- stack trace
> > >>> ---------------------------------------------------------------
> > >>> org.ofbiz.service.ServiceValidationException: The following required
> > >>> parameter is missing: [storeIncomingEmail.messageWrapper]
> > >>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> > >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> > >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> > >>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> > >>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> > >>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> > >>> java.lang.Thread.run(Thread.java:534)
> > >>> --------------------------------------------------------------------------------
> > >>>
> > >>> 2007-04-19 05:22:31,342 (default-invoker-Thread-2) [
> > >>> SequenceUtil.java:254:INFO ] Got bank of sequenced IDs for [JobSandbox];
> > >>> curSeqId=58370, maxSeqId=58380, bankSize=10
> > >>> 2007-04-19 05:22:31,348 (default-invoker-Thread-2)
> > >>> [PersistedServiceJob.java:202:INFO ] Persisted Job [58369] Failed
> > >>> Re-Scheduling : 1176985531339
> > >>> 2007-04-19 05:22:37,711 (http-0.0.0.0-7443-Processor1) [
> > >>> ContextFilter.java:182:INFO ] [Request]: /webtools/control/jobList
> > >>> 2007-04-19 05:22:37,712 (http-0.0.0.0-7443-Processor1) [
> > >>> ControlServlet.java:90 :INFO ] The character encoding of the request is:
> > >>> [null]. The character encoding we will use for the request and response
> > >>> is:
> > >>> [UTF-8]
> > >>> 2007-04-19 05:22:37,713 (http-0.0.0.0-7443-Processor1) [
> > >>> ControlServlet.java:126:DEBUG] [[[jobList] Servlet Starting, doing setup-
> > >>> total:0.0,since last(Begin):0.0]]
> > >>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [
> > >>> ControlServlet.java:181:DEBUG] [[[jobList] Setup done, doing Event(s) and
> > >>> View(s)- total:0.0,since last([jobList] Servlet...):0.0]]
> > >>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [
> > >>> RequestHandler.java:266:INFO ] [Processing Request]: jobList
> > >>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> > >>> 2007-04-19 05:22:37,715 (http-0.0.0.0-7443-Processor1) [
> > >>> RequestManager.java:117:INFO ] [RequestManager.getRequestAttribute] Value
> > >>> for attribute "null" of uri "jobList" not found
> > >>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [
> > >>> RequestHandler.java:450:INFO ] [RequestHandler.doRequest]: Response is a
> > >>> view. sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> > >>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [
> > >>> RequestHandler.java:603:INFO ] servletName=control, view=jobList
> > >>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> > >>> 2007-04-19 05:22:37,717 (http-0.0.0.0-7443-Processor1) [
> > >>> ScreenRenderer.java:220:INFO ] Found servlet context (application)
> > >>> attribute
> > >>> that conflicts with parameter name, leaving request parameter in place
> > >>> for
> > >>> name: _REQUEST_HANDLER_
> > >>> 2007-04-19 05:22:37,826 (http-0.0.0.0-7443-Processor1) [
> > >>> ModelScreenWidget.java:361:INFO ] In the include-screen tag the screen
> > >>> name
> > >>> was empty, ignoring include; in screen [GlobalDecorator]
> > >>> 2007-04-19 05:22:37,857 (http-0.0.0.0-7443-Processor1) [
> > >>> ControlServlet.java:256:DEBUG] [[[jobList] Done rendering page, Servlet
> > >>> Finished- total:0.143,since last([jobList] Setup d...):0.143]]
> > >>>
> > >>>
> > >>
> > >
> >
> >
> >
> >
> > ---------------------------------
> > Ahhh...imagining that irresistible "new car" smell?
> >  Check outnew cars at Yahoo! Autos.
>
>
> --
> Guido Amarilla
>


--
Guido Amarilla
Reply | Threaded
Open this post in threaded view
|

Re: what is [storeIncomingEmail.messageWrapper]?

BJ Freeman
In reply to this post by rohit
could you be more specific about what you are trying to sort?
would this be better served as a entity view?

Rohit Sureka sent the following on 4/20/2007 9:32 AM:

> Thanks for the email and i am sorry if i did not put my question properly.
>
> My real problem is configuring the service to sort emails. I have put the MCA rules in place but i am not able to configure the "sortincomingemail' service.
>
> I understand that "sortincomingemail" has to be run at regular interval to process the email sorting.
>
> Rohit
>
> BJ Freeman <[hidden email]> wrote: My previous response was aimed at sorting the communication events after
> they have been already loaded.
>
> to answer your question, Yes ofbiz will try to match any email to and
> from with those in the parties.
> if it can not find one of the parties, usually the from, it puts the
> address in comments, an marks it unknown email address.
>
>
> The MCA is used to filter the emails. Like:
>  
>  link tracking number to order-->
>    
>        
> value="[hidden email]"/>
>        
>    
>
> in the above I am rerouting the Quantum emails to a process I wrote to
> input the shipping tracking number into an order.
>
> If this is what you were meaning by sort then this is the mechanism to
> to this.
>
> you can find /framework/common/servicedef/smca_test.xml
>
>
> rohit2006 sent the following on 4/19/2007 10:03 PM:
>> i am trying to configure email sorting in ofbiz. I have followed the
>> documentation by Si Chen, to test it. I am assuming that if email sorting is
>> correctly configured, emails will be recorded as communication event for the
>> related parties. For eg. after a email is received ofbiz, will try to match
>> the "to" address, with the email associated to a party, and if a match  is
>> found,  a communication event will be logged for the party.
>>
>> I hope that i got this right?
>>
>> I have followed the instruction as mentioned in documentation, and
>> everything loads fine, but when i schedule the service storeincomingemail, i
>> am prompted to enter the service parameter(messageWrapper
>> (org.ofbiz.service.mail.MimeMessageWrapper), which i have no clue about. i
>> guess this is to do something 'MimeMessageWrapper'.
>>
>> The documentation by Si Chen mentions this:
>>
>> 5. MCA services need to implement the mail processing interface, as in:
>>        
>> It uses a MimeMessageWrapper:
>>         MimeMessageWrapper wrapper = (MimeMessageWrapper)
>> context.get("messageWrapper");
>> MimeMessage message = wrapper.getMessage();
>> with methods like message.getAllRecipients(), message.getFrom(),
>> message.getSubject(), getAllRecipients(), getSentDate(), getReceivedDate(),
>> etc.
>>
>> Currently (20060607) there is a service called “storeIncomingEmail” which
>> could be used to do inbound mail sorting.  This has not been fully tested
>> yet.
>>
>>
>> I am not sure what to insert in the service parameters.
>>
>> Do we need to create a view for email sorting, cause i think the mails will
>> be visible, under the communication tab, in party manager?
>>
>> Rohit
>>
>>
>>
>> BJ Freeman wrote:
>>> If I understand you, you can create a view with the sorting you want.
>>>
>>> rohit2006 sent the following on 4/19/2007 4:33 AM:
>>>> Hi,
>>>>
>>>> I am trying configure email sorting in ofbiz and store emails as
>>>> communication events. I believe i have to schedule the service
>>>> storeIncomingEmail as a service. I tried to do that and was prompted fill
>>>> the fields:
>>>>
>>>> Step 2: Service Parameters
>>>> messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper).
>>>>
>>>> I am not sure what to enter into this field, can someone please help me
>>>> configure this. I am getting the following error in log when the service
>>>> is
>>>> run
>>>>
>>>> 2007-04-19 05:22:31,302 (default-invoker-Thread-2) [        
>>>> JobInvoker.java:211:INFO ] Invoker: default-invoker-Thread-2 received job
>>>> --
>>>> 1176985293330 from poller - org.ofbiz.service.job.JobPoller@1be4777
>>>> 2007-04-19 05:22:31,320 (default-invoker-Thread-2)
>>>> [PersistedServiceJob.java:136:INFO ]
>>>> org.ofbiz.service.job.PersistedServiceJob@334bfe[58369] -- Next runtime:
>>>> -1
>>>> [Error] :2:12: cvc-elt.1: Cannot find the declaration of element
>>>> 'ofbiz-ser'.
>>>> 2007-04-19 05:22:31,331 (default-invoker-Thread-2) [          
>>>> UtilXml.java:243:DEBUG] XML Read 0.0040s: Internal Content
>>>> 2007-04-19 05:22:31,332 (default-invoker-Thread-2) [
>>>> ServiceDispatcher.java:322:ERROR]
>>>> ---- exception report
>>>> ----------------------------------------------------------
>>>> Incoming context (in runSync : storeIncomingEmail) does not match
>>>> expected
>>>> requirements
>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>> Message: The following required parameter is missing:
>>>> [storeIncomingEmail.messageWrapper]
>>>> ---- stack trace
>>>> ---------------------------------------------------------------
>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>> java.lang.Thread.run(Thread.java:534)
>>>> --------------------------------------------------------------------------------
>>>>
>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>>> ServiceDispatcher.java:385:DEBUG] [[Sync service failed...-
>>>> total:0.0,since
>>>> last(Begin):0.0]] - 'JobDispatcher / storeIncomingEmail'
>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>>> ServiceDispatcher.java:388:ERROR]
>>>> ---- exception report
>>>> ----------------------------------------------------------
>>>> Service [storeIncomingEmail] threw an unexpected exception/error
>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>> Message: The following required parameter is missing:
>>>> [storeIncomingEmail.messageWrapper]
>>>> ---- stack trace
>>>> ---------------------------------------------------------------
>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>> java.lang.Thread.run(Thread.java:534)
>>>> --------------------------------------------------------------------------------
>>>>
>>>> 2007-04-19 05:22:31,334 (default-invoker-Thread-2) [  
>>>> TransactionUtil.java:252:ERROR]
>>>> ---- exception report
>>>> ----------------------------------------------------------
>>>> [TransactionUtil.rollback]
>>>> Exception: java.lang.Exception
>>>> Message: Stack Trace
>>>> ---- stack trace
>>>> ---------------------------------------------------------------
>>>> java.lang.Exception: Stack Trace
>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:391)
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>> java.lang.Thread.run(Thread.java:534)
>>>> --------------------------------------------------------------------------------
>>>>
>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>>> TransactionUtil.java:262:INFO ] [TransactionUtil.rollback] transaction
>>>> rolled back
>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>>> TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not committing
>>>> transaction, status is STATUS_NO_TRANSACTION
>>>> 2007-04-19 05:22:31,336 (default-invoker-Thread-2) [
>>>> GenericServiceJob.java:117:ERROR]
>>>> ---- exception report
>>>> ----------------------------------------------------------
>>>> Async-Service failed.
>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>> Message: The following required parameter is missing:
>>>> [storeIncomingEmail.messageWrapper]
>>>> ---- stack trace
>>>> ---------------------------------------------------------------
>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>> java.lang.Thread.run(Thread.java:534)
>>>> --------------------------------------------------------------------------------
>>>>
>>>> 2007-04-19 05:22:31,342 (default-invoker-Thread-2) [      
>>>> SequenceUtil.java:254:INFO ] Got bank of sequenced IDs for [JobSandbox];
>>>> curSeqId=58370, maxSeqId=58380, bankSize=10
>>>> 2007-04-19 05:22:31,348 (default-invoker-Thread-2)
>>>> [PersistedServiceJob.java:202:INFO ] Persisted Job [58369] Failed
>>>> Re-Scheduling : 1176985531339
>>>> 2007-04-19 05:22:37,711 (http-0.0.0.0-7443-Processor1) [    
>>>> ContextFilter.java:182:INFO ] [Request]: /webtools/control/jobList
>>>> 2007-04-19 05:22:37,712 (http-0.0.0.0-7443-Processor1) [    
>>>> ControlServlet.java:90 :INFO ] The character encoding of the request is:
>>>> [null]. The character encoding we will use for the request and response
>>>> is:
>>>> [UTF-8]
>>>> 2007-04-19 05:22:37,713 (http-0.0.0.0-7443-Processor1) [    
>>>> ControlServlet.java:126:DEBUG] [[[jobList] Servlet Starting, doing setup-
>>>> total:0.0,since last(Begin):0.0]]
>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>>> ControlServlet.java:181:DEBUG] [[[jobList] Setup done, doing Event(s) and
>>>> View(s)- total:0.0,since last([jobList] Servlet...):0.0]]
>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>>> RequestHandler.java:266:INFO ] [Processing Request]: jobList
>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>> 2007-04-19 05:22:37,715 (http-0.0.0.0-7443-Processor1) [    
>>>> RequestManager.java:117:INFO ] [RequestManager.getRequestAttribute] Value
>>>> for attribute "null" of uri "jobList" not found
>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>>> RequestHandler.java:450:INFO ] [RequestHandler.doRequest]: Response is a
>>>> view. sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>>> RequestHandler.java:603:INFO ] servletName=control, view=jobList
>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>> 2007-04-19 05:22:37,717 (http-0.0.0.0-7443-Processor1) [    
>>>> ScreenRenderer.java:220:INFO ] Found servlet context (application)
>>>> attribute
>>>> that conflicts with parameter name, leaving request parameter in place
>>>> for
>>>> name: _REQUEST_HANDLER_
>>>> 2007-04-19 05:22:37,826 (http-0.0.0.0-7443-Processor1) [
>>>> ModelScreenWidget.java:361:INFO ] In the include-screen tag the screen
>>>> name
>>>> was empty, ignoring include; in screen [GlobalDecorator]
>>>> 2007-04-19 05:22:37,857 (http-0.0.0.0-7443-Processor1) [    
>>>> ControlServlet.java:256:DEBUG] [[[jobList] Done rendering page, Servlet
>>>> Finished- total:0.143,since last([jobList] Setup d...):0.143]]
>>>>
>>>>
>
>
>
>        
> ---------------------------------
> Ahhh...imagining that irresistible "new car" smell?
>  Check outnew cars at Yahoo! Autos.

Reply | Threaded
Open this post in threaded view
|

Re: what is [storeIncomingEmail.messageWrapper]?

rohit
In reply to this post by Guido Amarilla
Thanks Guido,

Your post was really helpful in getting me move forward, but there is still some error in storing the email, i have pasted the log below for your info. Please let me know, i have done something wrong.

Thanks Rohit


2007-04-20 12:44:03,137 (Thread-0) [      EmailServices.java:743:INFO ] Processing Incoming Email message from: Rohit Sureka <rohitksureka@yy.com> to: ofbiz@xx.com
2007-04-20 12:44:03,170 (Thread-0) [      EmailServices.java:933:ERROR]
---- runtime exception report --------------------------------------------------
Exception: java.lang.NullPointerException
Message: null
---- stack trace ---------------------------------------------------------------
java.lang.NullPointerException
org.ofbiz.content.email.EmailServices.storeIncomingEmail(EmailServices.java:835)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
java.util.TimerThread.mainLoop(Timer.java:432)
java.util.TimerThread.run(Timer.java:382)
--------------------------------------------------------------------------------

2007-04-20 12:44:03,171 (Thread-0) [  ServiceDispatcher.java:411:ERROR] Service Error [storeIncomingEmail]:
2007-04-20 12:44:03,172 (Thread-0) [    TransactionUtil.java:285:WARN ]
---- exception report ----------------------------------------------------------
[TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly; this stack trace shows where this is happening:
Exception: java.lang.Exception
Message: Service Error [storeIncomingEmail]:
---- stack trace ---------------------------------------------------------------
java.lang.Exception: Service Error [storeIncomingEmail]:
org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:285)
org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:235)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
java.util.TimerThread.mainLoop(Timer.java:432)
java.util.TimerThread.run(Timer.java:382)
--------------------------------------------------------------------------------

2007-04-20 12:44:03,173 (Thread-0) [         UtilCommon.java:127:ERROR] Failed to process incoming email:
2007-04-20 12:44:03,173 (Thread-0) [  ServiceDispatcher.java:411:ERROR] Service Error [crmsfa.processIncomingEmail]: Failed to process incoming email:
2007-04-20 12:44:03,174 (Thread-0) [    TransactionUtil.java:252:ERROR]
---- exception report ----------------------------------------------------------
[TransactionUtil.rollback]
Exception: java.lang.Exception
Message: Stack Trace
---- stack trace ---------------------------------------------------------------
java.lang.Exception: Stack Trace
org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
java.util.TimerThread.mainLoop(Timer.java:432)
java.util.TimerThread.run(Timer.java:382)
--------------------------------------------------------------------------------

2007-04-20 12:44:03,175 (Thread-0) [    TransactionUtil.java:262:INFO ] [TransactionUtil.rollback] transaction rolled back
2007-04-20 12:44:03,176 (Thread-0) [   ServiceMcaAction.java:60 :ERROR] Failed to process incoming email:
C: QUIT
S: +OK Logging out.


Guido Amarilla wrote
Forgot to mention that there are a couple of bugs (I think) that
throws exceptions if a mail don't have a Bcc or CC address. Please
confirm it and I´ll try to post a patch (just null checks).




2007/4/20, Guido Amarilla <gamarilla@gmail.com>:
> You should configure a JavaMail Container,  POP3 or IMAP server in
> framework\base\config\ofbiz-containers.xml
>
> I did and started to poll regularly to my server, download and sort
> Emails without any other configuration.
>
> It gave me some work to enable a Gmail account. If you use SSL, you
> should make sure to import your server's certificate into your Trust
> Store (check http://docs.ofbiz.org/display/OFBIZ/Google+Checkout+Integration)
>
> This is my configuration for a Google Apps hosted domain:
>
> <container name="javamail-container"
> class="org.ofbiz.service.mail.JavaMailContainer">
>         <property name="delegator-name" value="default"/>
>         <property name="dispatcher-name" value="JavaMailDispatcher"/>
>         <property name="run-as-user" value="system"/>
>         <property name="poll-delay" value="300000"/>
>         <property name="delete-mail" value="false"/>
>         <property name="maxSize" value="100000"/>
>         <property name="default-listener" value="store-listener">
>             <property name="mail.debug" value="true"/>
>             <property name="mail.store.protocol" value="pop3s"/>
>             <property name="mail.host" value="pop.gmail.com"/>
>             <property name="mail.port" value="995"/>
>             <property name="mail.user" value="youruser@domain"/>
>             <property name="mail.pass" value="yourpassword"/>
>             </property>
>     </container>
>
> Hope this helps.
>
>
> Guido Amarilla
>
> 2007/4/20, Rohit Sureka <rohitksureka@yahoo.com>:
> > Thanks for the email and i am sorry if i did not put my question properly.
> >
> > My real problem is configuring the service to sort emails. I have put the MCA rules in place but i am not able to configure the "sortincomingemail' service.
> >
> > I understand that "sortincomingemail" has to be run at regular interval to process the email sorting.
> >
> > Rohit
> >
> > BJ Freeman <bjfree@free-man.net> wrote: My previous response was aimed at sorting the communication events after
> > they have been already loaded.
> >
> > to answer your question, Yes ofbiz will try to match any email to and
> > from with those in the parties.
> > if it can not find one of the parties, usually the from, it puts the
> > address in comments, an marks it unknown email address.
> >
> >
> > The MCA is used to filter the emails. Like:
> >
> >  link tracking number to order-->
> >
> >
> > value="QuantumViewNotify@ups.com"/>
> >
> >
> >
> > in the above I am rerouting the Quantum emails to a process I wrote to
> > input the shipping tracking number into an order.
> >
> > If this is what you were meaning by sort then this is the mechanism to
> > to this.
> >
> > you can find /framework/common/servicedef/smca_test.xml
> >
> >
> > rohit2006 sent the following on 4/19/2007 10:03 PM:
> > > i am trying to configure email sorting in ofbiz. I have followed the
> > > documentation by Si Chen, to test it. I am assuming that if email sorting is
> > > correctly configured, emails will be recorded as communication event for the
> > > related parties. For eg. after a email is received ofbiz, will try to match
> > > the "to" address, with the email associated to a party, and if a match  is
> > > found,  a communication event will be logged for the party.
> > >
> > > I hope that i got this right?
> > >
> > > I have followed the instruction as mentioned in documentation, and
> > > everything loads fine, but when i schedule the service storeincomingemail, i
> > > am prompted to enter the service parameter(messageWrapper
> > > (org.ofbiz.service.mail.MimeMessageWrapper), which i have no clue about. i
> > > guess this is to do something 'MimeMessageWrapper'.
> > >
> > > The documentation by Si Chen mentions this:
> > >
> > > 5. MCA services need to implement the mail processing interface, as in:
> > >
> > > It uses a MimeMessageWrapper:
> > >         MimeMessageWrapper wrapper = (MimeMessageWrapper)
> > > context.get("messageWrapper");
> > > MimeMessage message = wrapper.getMessage();
> > > with methods like message.getAllRecipients(), message.getFrom(),
> > > message.getSubject(), getAllRecipients(), getSentDate(), getReceivedDate(),
> > > etc.
> > >
> > > Currently (20060607) there is a service called "storeIncomingEmail" which
> > > could be used to do inbound mail sorting.  This has not been fully tested
> > > yet.
> > >
> > >
> > > I am not sure what to insert in the service parameters.
> > >
> > > Do we need to create a view for email sorting, cause i think the mails will
> > > be visible, under the communication tab, in party manager?
> > >
> > > Rohit
> > >
> > >
> > >
> > > BJ Freeman wrote:
> > >> If I understand you, you can create a view with the sorting you want.
> > >>
> > >> rohit2006 sent the following on 4/19/2007 4:33 AM:
> > >>> Hi,
> > >>>
> > >>> I am trying configure email sorting in ofbiz and store emails as
> > >>> communication events. I believe i have to schedule the service
> > >>> storeIncomingEmail as a service. I tried to do that and was prompted fill
> > >>> the fields:
> > >>>
> > >>> Step 2: Service Parameters
> > >>> messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper).
> > >>>
> > >>> I am not sure what to enter into this field, can someone please help me
> > >>> configure this. I am getting the following error in log when the service
> > >>> is
> > >>> run
> > >>>
> > >>> 2007-04-19 05:22:31,302 (default-invoker-Thread-2) [
> > >>> JobInvoker.java:211:INFO ] Invoker: default-invoker-Thread-2 received job
> > >>> --
> > >>> 1176985293330 from poller - org.ofbiz.service.job.JobPoller@1be4777
> > >>> 2007-04-19 05:22:31,320 (default-invoker-Thread-2)
> > >>> [PersistedServiceJob.java:136:INFO ]
> > >>> org.ofbiz.service.job.PersistedServiceJob@334bfe[58369] -- Next runtime:
> > >>> -1
> > >>> [Error] :2:12: cvc-elt.1: Cannot find the declaration of element
> > >>> 'ofbiz-ser'.
> > >>> 2007-04-19 05:22:31,331 (default-invoker-Thread-2) [
> > >>> UtilXml.java:243:DEBUG] XML Read 0.0040s: Internal Content
> > >>> 2007-04-19 05:22:31,332 (default-invoker-Thread-2) [
> > >>> ServiceDispatcher.java:322:ERROR]
> > >>> ---- exception report
> > >>> ----------------------------------------------------------
> > >>> Incoming context (in runSync : storeIncomingEmail) does not match
> > >>> expected
> > >>> requirements
> > >>> Exception: org.ofbiz.service.ServiceValidationException
> > >>> Message: The following required parameter is missing:
> > >>> [storeIncomingEmail.messageWrapper]
> > >>> ---- stack trace
> > >>> ---------------------------------------------------------------
> > >>> org.ofbiz.service.ServiceValidationException: The following required
> > >>> parameter is missing: [storeIncomingEmail.messageWrapper]
> > >>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> > >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> > >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> > >>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> > >>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> > >>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> > >>> java.lang.Thread.run(Thread.java:534)
> > >>> --------------------------------------------------------------------------------
> > >>>
> > >>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
> > >>> ServiceDispatcher.java:385:DEBUG] [[Sync service failed...-
> > >>> total:0.0,since
> > >>> last(Begin):0.0]] - 'JobDispatcher / storeIncomingEmail'
> > >>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
> > >>> ServiceDispatcher.java:388:ERROR]
> > >>> ---- exception report
> > >>> ----------------------------------------------------------
> > >>> Service [storeIncomingEmail] threw an unexpected exception/error
> > >>> Exception: org.ofbiz.service.ServiceValidationException
> > >>> Message: The following required parameter is missing:
> > >>> [storeIncomingEmail.messageWrapper]
> > >>> ---- stack trace
> > >>> ---------------------------------------------------------------
> > >>> org.ofbiz.service.ServiceValidationException: The following required
> > >>> parameter is missing: [storeIncomingEmail.messageWrapper]
> > >>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> > >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> > >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> > >>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> > >>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> > >>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> > >>> java.lang.Thread.run(Thread.java:534)
> > >>> --------------------------------------------------------------------------------
> > >>>
> > >>> 2007-04-19 05:22:31,334 (default-invoker-Thread-2) [
> > >>> TransactionUtil.java:252:ERROR]
> > >>> ---- exception report
> > >>> ----------------------------------------------------------
> > >>> [TransactionUtil.rollback]
> > >>> Exception: java.lang.Exception
> > >>> Message: Stack Trace
> > >>> ---- stack trace
> > >>> ---------------------------------------------------------------
> > >>> java.lang.Exception: Stack Trace
> > >>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
> > >>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
> > >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:391)
> > >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> > >>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> > >>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> > >>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> > >>> java.lang.Thread.run(Thread.java:534)
> > >>> --------------------------------------------------------------------------------
> > >>>
> > >>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [
> > >>> TransactionUtil.java:262:INFO ] [TransactionUtil.rollback] transaction
> > >>> rolled back
> > >>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [
> > >>> TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not committing
> > >>> transaction, status is STATUS_NO_TRANSACTION
> > >>> 2007-04-19 05:22:31,336 (default-invoker-Thread-2) [
> > >>> GenericServiceJob.java:117:ERROR]
> > >>> ---- exception report
> > >>> ----------------------------------------------------------
> > >>> Async-Service failed.
> > >>> Exception: org.ofbiz.service.ServiceValidationException
> > >>> Message: The following required parameter is missing:
> > >>> [storeIncomingEmail.messageWrapper]
> > >>> ---- stack trace
> > >>> ---------------------------------------------------------------
> > >>> org.ofbiz.service.ServiceValidationException: The following required
> > >>> parameter is missing: [storeIncomingEmail.messageWrapper]
> > >>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> > >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> > >>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> > >>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> > >>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> > >>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> > >>> java.lang.Thread.run(Thread.java:534)
> > >>> --------------------------------------------------------------------------------
> > >>>
> > >>> 2007-04-19 05:22:31,342 (default-invoker-Thread-2) [
> > >>> SequenceUtil.java:254:INFO ] Got bank of sequenced IDs for [JobSandbox];
> > >>> curSeqId=58370, maxSeqId=58380, bankSize=10
> > >>> 2007-04-19 05:22:31,348 (default-invoker-Thread-2)
> > >>> [PersistedServiceJob.java:202:INFO ] Persisted Job [58369] Failed
> > >>> Re-Scheduling : 1176985531339
> > >>> 2007-04-19 05:22:37,711 (http-0.0.0.0-7443-Processor1) [
> > >>> ContextFilter.java:182:INFO ] [Request]: /webtools/control/jobList
> > >>> 2007-04-19 05:22:37,712 (http-0.0.0.0-7443-Processor1) [
> > >>> ControlServlet.java:90 :INFO ] The character encoding of the request is:
> > >>> [null]. The character encoding we will use for the request and response
> > >>> is:
> > >>> [UTF-8]
> > >>> 2007-04-19 05:22:37,713 (http-0.0.0.0-7443-Processor1) [
> > >>> ControlServlet.java:126:DEBUG] [[[jobList] Servlet Starting, doing setup-
> > >>> total:0.0,since last(Begin):0.0]]
> > >>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [
> > >>> ControlServlet.java:181:DEBUG] [[[jobList] Setup done, doing Event(s) and
> > >>> View(s)- total:0.0,since last([jobList] Servlet...):0.0]]
> > >>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [
> > >>> RequestHandler.java:266:INFO ] [Processing Request]: jobList
> > >>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> > >>> 2007-04-19 05:22:37,715 (http-0.0.0.0-7443-Processor1) [
> > >>> RequestManager.java:117:INFO ] [RequestManager.getRequestAttribute] Value
> > >>> for attribute "null" of uri "jobList" not found
> > >>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [
> > >>> RequestHandler.java:450:INFO ] [RequestHandler.doRequest]: Response is a
> > >>> view. sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> > >>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [
> > >>> RequestHandler.java:603:INFO ] servletName=control, view=jobList
> > >>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> > >>> 2007-04-19 05:22:37,717 (http-0.0.0.0-7443-Processor1) [
> > >>> ScreenRenderer.java:220:INFO ] Found servlet context (application)
> > >>> attribute
> > >>> that conflicts with parameter name, leaving request parameter in place
> > >>> for
> > >>> name: _REQUEST_HANDLER_
> > >>> 2007-04-19 05:22:37,826 (http-0.0.0.0-7443-Processor1) [
> > >>> ModelScreenWidget.java:361:INFO ] In the include-screen tag the screen
> > >>> name
> > >>> was empty, ignoring include; in screen [GlobalDecorator]
> > >>> 2007-04-19 05:22:37,857 (http-0.0.0.0-7443-Processor1) [
> > >>> ControlServlet.java:256:DEBUG] [[[jobList] Done rendering page, Servlet
> > >>> Finished- total:0.143,since last([jobList] Setup d...):0.143]]
> > >>>
> > >>>
> > >>
> > >
> >
> >
> >
> >
> > ---------------------------------
> > Ahhh...imagining that irresistible "new car" smell?
> >  Check outnew cars at Yahoo! Autos.
>
>
> --
> Guido Amarilla
>


--
Guido Amarilla
Reply | Threaded
Open this post in threaded view
|

Re: what is [storeIncomingEmail.messageWrapper]?

rohit
In reply to this post by BJ Freeman
i was just trying to record communication even when a email was received. I had done the MCA rules incorrectly, but i guess they are not set OK.

My MCA settings are:

<service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
    <mca mail-rule-name="processIncomingEmail">
       
        <condition-field field-name="to" operator="matches" value="ofbiz@xx.com"/>
        <action service="crmsfa.processIncomingEmail" mode="sync"/>
    </mca>
</service-mca>


The crmsfa.processincomingemail is defined as follows:

<service name="crmsfa.processIncomingEmail" engine="java" location="com.opensourcestrategies.crmsfa.activities.ActivitiesServices" invoke="processIncomingEmail">
        <description>Process an incoming email by calling storeIncomingEmail to create a CommunicationEvent wrapped in a WorkEffort. This WorkEffort is then
            associated with the partyIdFrom of the CommunicationEvent.</description>
        <attribute name="messageWrapper" type="org.ofbiz.service.mail.MimeMessageWrapper" mode="IN"/>
    </service>

However the incoming mails are not being processed and i am getting these errors:

2007-04-20 12:44:03,137 (Thread-0) [      EmailServices.java:743:INFO ] Processing Incoming Email message from: Rohit Sureka <rohitksureka@yy.com> to: ofbiz@xx.com
2007-04-20 12:44:03,170 (Thread-0) [      EmailServices.java:933:ERROR]
---- runtime exception report --------------------------------------------------
Exception: java.lang.NullPointerException
Message: null
---- stack trace ---------------------------------------------------------------
java.lang.NullPointerException
org.ofbiz.content.email.EmailServices.storeIncomingEmail(EmailServices.java:835)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
java.util.TimerThread.mainLoop(Timer.java:432)
java.util.TimerThread.run(Timer.java:382)
--------------------------------------------------------------------------------

2007-04-20 12:44:03,171 (Thread-0) [  ServiceDispatcher.java:411:ERROR] Service Error [storeIncomingEmail]:
2007-04-20 12:44:03,172 (Thread-0) [    TransactionUtil.java:285:WARN ]
---- exception report ----------------------------------------------------------
[TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly; this stack trace shows where this is happening:
Exception: java.lang.Exception
Message: Service Error [storeIncomingEmail]:
---- stack trace ---------------------------------------------------------------
java.lang.Exception: Service Error [storeIncomingEmail]:
org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:285)
org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:235)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
java.util.TimerThread.mainLoop(Timer.java:432)
java.util.TimerThread.run(Timer.java:382)
--------------------------------------------------------------------------------

2007-04-20 12:44:03,173 (Thread-0) [         UtilCommon.java:127:ERROR] Failed to process incoming email:
2007-04-20 12:44:03,173 (Thread-0) [  ServiceDispatcher.java:411:ERROR] Service Error [crmsfa.processIncomingEmail]: Failed to process incoming email:
2007-04-20 12:44:03,174 (Thread-0) [    TransactionUtil.java:252:ERROR]
---- exception report ----------------------------------------------------------
[TransactionUtil.rollback]
Exception: java.lang.Exception
Message: Stack Trace
---- stack trace ---------------------------------------------------------------
java.lang.Exception: Stack Trace
org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
java.util.TimerThread.mainLoop(Timer.java:432)
java.util.TimerThread.run(Timer.java:382)
--------------------------------------------------------------------------------

2007-04-20 12:44:03,175 (Thread-0) [    TransactionUtil.java:262:INFO ] [TransactionUtil.rollback] transaction rolled back
2007-04-20 12:44:03,176 (Thread-0) [   ServiceMcaAction.java:60 :ERROR] Failed to process incoming email:
C: QUIT
S: +OK Logging out.



BJ Freeman wrote
could you be more specific about what you are trying to sort?
would this be better served as a entity view?

Rohit Sureka sent the following on 4/20/2007 9:32 AM:
> Thanks for the email and i am sorry if i did not put my question properly.
>
> My real problem is configuring the service to sort emails. I have put the MCA rules in place but i am not able to configure the "sortincomingemail' service.
>
> I understand that "sortincomingemail" has to be run at regular interval to process the email sorting.
>
> Rohit
>
> BJ Freeman <bjfree@free-man.net> wrote: My previous response was aimed at sorting the communication events after
> they have been already loaded.
>
> to answer your question, Yes ofbiz will try to match any email to and
> from with those in the parties.
> if it can not find one of the parties, usually the from, it puts the
> address in comments, an marks it unknown email address.
>
>
> The MCA is used to filter the emails. Like:
>  
>  link tracking number to order-->
>    
>        
> value="QuantumViewNotify@ups.com"/>
>        
>    
>
> in the above I am rerouting the Quantum emails to a process I wrote to
> input the shipping tracking number into an order.
>
> If this is what you were meaning by sort then this is the mechanism to
> to this.
>
> you can find /framework/common/servicedef/smca_test.xml
>
>
> rohit2006 sent the following on 4/19/2007 10:03 PM:
>> i am trying to configure email sorting in ofbiz. I have followed the
>> documentation by Si Chen, to test it. I am assuming that if email sorting is
>> correctly configured, emails will be recorded as communication event for the
>> related parties. For eg. after a email is received ofbiz, will try to match
>> the "to" address, with the email associated to a party, and if a match  is
>> found,  a communication event will be logged for the party.
>>
>> I hope that i got this right?
>>
>> I have followed the instruction as mentioned in documentation, and
>> everything loads fine, but when i schedule the service storeincomingemail, i
>> am prompted to enter the service parameter(messageWrapper
>> (org.ofbiz.service.mail.MimeMessageWrapper), which i have no clue about. i
>> guess this is to do something 'MimeMessageWrapper'.
>>
>> The documentation by Si Chen mentions this:
>>
>> 5. MCA services need to implement the mail processing interface, as in:
>>        
>> It uses a MimeMessageWrapper:
>>         MimeMessageWrapper wrapper = (MimeMessageWrapper)
>> context.get("messageWrapper");
>> MimeMessage message = wrapper.getMessage();
>> with methods like message.getAllRecipients(), message.getFrom(),
>> message.getSubject(), getAllRecipients(), getSentDate(), getReceivedDate(),
>> etc.
>>
>> Currently (20060607) there is a service called “storeIncomingEmail” which
>> could be used to do inbound mail sorting.  This has not been fully tested
>> yet.
>>
>>
>> I am not sure what to insert in the service parameters.
>>
>> Do we need to create a view for email sorting, cause i think the mails will
>> be visible, under the communication tab, in party manager?
>>
>> Rohit
>>
>>
>>
>> BJ Freeman wrote:
>>> If I understand you, you can create a view with the sorting you want.
>>>
>>> rohit2006 sent the following on 4/19/2007 4:33 AM:
>>>> Hi,
>>>>
>>>> I am trying configure email sorting in ofbiz and store emails as
>>>> communication events. I believe i have to schedule the service
>>>> storeIncomingEmail as a service. I tried to do that and was prompted fill
>>>> the fields:
>>>>
>>>> Step 2: Service Parameters
>>>> messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper).
>>>>
>>>> I am not sure what to enter into this field, can someone please help me
>>>> configure this. I am getting the following error in log when the service
>>>> is
>>>> run
>>>>
>>>> 2007-04-19 05:22:31,302 (default-invoker-Thread-2) [        
>>>> JobInvoker.java:211:INFO ] Invoker: default-invoker-Thread-2 received job
>>>> --
>>>> 1176985293330 from poller - org.ofbiz.service.job.JobPoller@1be4777
>>>> 2007-04-19 05:22:31,320 (default-invoker-Thread-2)
>>>> [PersistedServiceJob.java:136:INFO ]
>>>> org.ofbiz.service.job.PersistedServiceJob@334bfe[58369] -- Next runtime:
>>>> -1
>>>> [Error] :2:12: cvc-elt.1: Cannot find the declaration of element
>>>> 'ofbiz-ser'.
>>>> 2007-04-19 05:22:31,331 (default-invoker-Thread-2) [          
>>>> UtilXml.java:243:DEBUG] XML Read 0.0040s: Internal Content
>>>> 2007-04-19 05:22:31,332 (default-invoker-Thread-2) [
>>>> ServiceDispatcher.java:322:ERROR]
>>>> ---- exception report
>>>> ----------------------------------------------------------
>>>> Incoming context (in runSync : storeIncomingEmail) does not match
>>>> expected
>>>> requirements
>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>> Message: The following required parameter is missing:
>>>> [storeIncomingEmail.messageWrapper]
>>>> ---- stack trace
>>>> ---------------------------------------------------------------
>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>> java.lang.Thread.run(Thread.java:534)
>>>> --------------------------------------------------------------------------------
>>>>
>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>>> ServiceDispatcher.java:385:DEBUG] [[Sync service failed...-
>>>> total:0.0,since
>>>> last(Begin):0.0]] - 'JobDispatcher / storeIncomingEmail'
>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>>> ServiceDispatcher.java:388:ERROR]
>>>> ---- exception report
>>>> ----------------------------------------------------------
>>>> Service [storeIncomingEmail] threw an unexpected exception/error
>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>> Message: The following required parameter is missing:
>>>> [storeIncomingEmail.messageWrapper]
>>>> ---- stack trace
>>>> ---------------------------------------------------------------
>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>> java.lang.Thread.run(Thread.java:534)
>>>> --------------------------------------------------------------------------------
>>>>
>>>> 2007-04-19 05:22:31,334 (default-invoker-Thread-2) [  
>>>> TransactionUtil.java:252:ERROR]
>>>> ---- exception report
>>>> ----------------------------------------------------------
>>>> [TransactionUtil.rollback]
>>>> Exception: java.lang.Exception
>>>> Message: Stack Trace
>>>> ---- stack trace
>>>> ---------------------------------------------------------------
>>>> java.lang.Exception: Stack Trace
>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:391)
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>> java.lang.Thread.run(Thread.java:534)
>>>> --------------------------------------------------------------------------------
>>>>
>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>>> TransactionUtil.java:262:INFO ] [TransactionUtil.rollback] transaction
>>>> rolled back
>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>>> TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not committing
>>>> transaction, status is STATUS_NO_TRANSACTION
>>>> 2007-04-19 05:22:31,336 (default-invoker-Thread-2) [
>>>> GenericServiceJob.java:117:ERROR]
>>>> ---- exception report
>>>> ----------------------------------------------------------
>>>> Async-Service failed.
>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>> Message: The following required parameter is missing:
>>>> [storeIncomingEmail.messageWrapper]
>>>> ---- stack trace
>>>> ---------------------------------------------------------------
>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>> java.lang.Thread.run(Thread.java:534)
>>>> --------------------------------------------------------------------------------
>>>>
>>>> 2007-04-19 05:22:31,342 (default-invoker-Thread-2) [      
>>>> SequenceUtil.java:254:INFO ] Got bank of sequenced IDs for [JobSandbox];
>>>> curSeqId=58370, maxSeqId=58380, bankSize=10
>>>> 2007-04-19 05:22:31,348 (default-invoker-Thread-2)
>>>> [PersistedServiceJob.java:202:INFO ] Persisted Job [58369] Failed
>>>> Re-Scheduling : 1176985531339
>>>> 2007-04-19 05:22:37,711 (http-0.0.0.0-7443-Processor1) [    
>>>> ContextFilter.java:182:INFO ] [Request]: /webtools/control/jobList
>>>> 2007-04-19 05:22:37,712 (http-0.0.0.0-7443-Processor1) [    
>>>> ControlServlet.java:90 :INFO ] The character encoding of the request is:
>>>> [null]. The character encoding we will use for the request and response
>>>> is:
>>>> [UTF-8]
>>>> 2007-04-19 05:22:37,713 (http-0.0.0.0-7443-Processor1) [    
>>>> ControlServlet.java:126:DEBUG] [[[jobList] Servlet Starting, doing setup-
>>>> total:0.0,since last(Begin):0.0]]
>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>>> ControlServlet.java:181:DEBUG] [[[jobList] Setup done, doing Event(s) and
>>>> View(s)- total:0.0,since last([jobList] Servlet...):0.0]]
>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>>> RequestHandler.java:266:INFO ] [Processing Request]: jobList
>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>> 2007-04-19 05:22:37,715 (http-0.0.0.0-7443-Processor1) [    
>>>> RequestManager.java:117:INFO ] [RequestManager.getRequestAttribute] Value
>>>> for attribute "null" of uri "jobList" not found
>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>>> RequestHandler.java:450:INFO ] [RequestHandler.doRequest]: Response is a
>>>> view. sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>>> RequestHandler.java:603:INFO ] servletName=control, view=jobList
>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>> 2007-04-19 05:22:37,717 (http-0.0.0.0-7443-Processor1) [    
>>>> ScreenRenderer.java:220:INFO ] Found servlet context (application)
>>>> attribute
>>>> that conflicts with parameter name, leaving request parameter in place
>>>> for
>>>> name: _REQUEST_HANDLER_
>>>> 2007-04-19 05:22:37,826 (http-0.0.0.0-7443-Processor1) [
>>>> ModelScreenWidget.java:361:INFO ] In the include-screen tag the screen
>>>> name
>>>> was empty, ignoring include; in screen [GlobalDecorator]
>>>> 2007-04-19 05:22:37,857 (http-0.0.0.0-7443-Processor1) [    
>>>> ControlServlet.java:256:DEBUG] [[[jobList] Done rendering page, Servlet
>>>> Finished- total:0.143,since last([jobList] Setup d...):0.143]]
>>>>
>>>>
>
>
>
>        
> ---------------------------------
> Ahhh...imagining that irresistible "new car" smell?
>  Check outnew cars at Yahoo! Autos.
Reply | Threaded
Open this post in threaded view
|

Re: what is [storeIncomingEmail.messageWrapper]?

BJ Freeman
what I see first is you are using the crmsfa.processIncomingEmail
so this is best ask in the opentaps forum.


rohit2006 sent the following on 4/20/2007 12:11 PM:

> i was just trying to record communication even when a email was received. I
> had done the MCA rules incorrectly, but i guess they are not set OK.
>
> My MCA settings are:
>
> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>     <mca mail-rule-name="processIncomingEmail">
>         <!-- the matching is a regular expression match against the email
> address.  this format seems to work for
>         both "[hidden email]" and "Mr. XYZ <[hidden email]>" -->
>         <condition-field field-name="to" operator="matches"
> value="[hidden email]"/>
>         <action service="crmsfa.processIncomingEmail" mode="sync"/>
>     </mca>
> </service-mca>
>
>
> The crmsfa.processincomingemail is defined as follows:
>
> <service name="crmsfa.processIncomingEmail" engine="java"
> location="com.opensourcestrategies.crmsfa.activities.ActivitiesServices"
> invoke="processIncomingEmail">
>         <description>Process an incoming email by calling storeIncomingEmail
> to create a CommunicationEvent wrapped in a WorkEffort. This WorkEffort is
> then
>             associated with the partyIdFrom of the
> CommunicationEvent.</description>
>         <attribute name="messageWrapper"
> type="org.ofbiz.service.mail.MimeMessageWrapper" mode="IN"/>
>     </service>
>
> However the incoming mails are not being processed and i am getting these
> errors:
>
> 2007-04-20 12:44:03,137 (Thread-0) [      EmailServices.java:743:INFO ]
> Processing Incoming Email message from: Rohit Sureka <[hidden email]>
> to: [hidden email]
> 2007-04-20 12:44:03,170 (Thread-0) [      EmailServices.java:933:ERROR]
> ---- runtime exception report
> --------------------------------------------------
> Exception: java.lang.NullPointerException
> Message: null
> ---- stack trace
> ---------------------------------------------------------------
> java.lang.NullPointerException
> org.ofbiz.content.email.EmailServices.storeIncomingEmail(EmailServices.java:835)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:324)
> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:324)
> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
> java.util.TimerThread.mainLoop(Timer.java:432)
> java.util.TimerThread.run(Timer.java:382)
> --------------------------------------------------------------------------------
>
> 2007-04-20 12:44:03,171 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
> Service Error [storeIncomingEmail]:
> 2007-04-20 12:44:03,172 (Thread-0) [    TransactionUtil.java:285:WARN ]
> ---- exception report
> ----------------------------------------------------------
> [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly; this
> stack trace shows where this is happening:
> Exception: java.lang.Exception
> Message: Service Error [storeIncomingEmail]:
> ---- stack trace
> ---------------------------------------------------------------
> java.lang.Exception: Service Error [storeIncomingEmail]:
> org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:285)
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:235)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:324)
> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
> java.util.TimerThread.mainLoop(Timer.java:432)
> java.util.TimerThread.run(Timer.java:382)
> --------------------------------------------------------------------------------
>
> 2007-04-20 12:44:03,173 (Thread-0) [         UtilCommon.java:127:ERROR]
> Failed to process incoming email:
> 2007-04-20 12:44:03,173 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
> Service Error [crmsfa.processIncomingEmail]: Failed to process incoming
> email:
> 2007-04-20 12:44:03,174 (Thread-0) [    TransactionUtil.java:252:ERROR]
> ---- exception report
> ----------------------------------------------------------
> [TransactionUtil.rollback]
> Exception: java.lang.Exception
> Message: Stack Trace
> ---- stack trace
> ---------------------------------------------------------------
> java.lang.Exception: Stack Trace
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
> java.util.TimerThread.mainLoop(Timer.java:432)
> java.util.TimerThread.run(Timer.java:382)
> --------------------------------------------------------------------------------
>
> 2007-04-20 12:44:03,175 (Thread-0) [    TransactionUtil.java:262:INFO ]
> [TransactionUtil.rollback] transaction rolled back
> 2007-04-20 12:44:03,176 (Thread-0) [   ServiceMcaAction.java:60 :ERROR]
> Failed to process incoming email:
> C: QUIT
> S: +OK Logging out.
>
>
>
>
> BJ Freeman wrote:
>> could you be more specific about what you are trying to sort?
>> would this be better served as a entity view?
>>
>> Rohit Sureka sent the following on 4/20/2007 9:32 AM:
>>> Thanks for the email and i am sorry if i did not put my question
>>> properly.
>>>
>>> My real problem is configuring the service to sort emails. I have put the
>>> MCA rules in place but i am not able to configure the "sortincomingemail'
>>> service.
>>>
>>> I understand that "sortincomingemail" has to be run at regular interval
>>> to process the email sorting.
>>>
>>> Rohit
>>>
>>> BJ Freeman <[hidden email]> wrote: My previous response was aimed at
>>> sorting the communication events after
>>> they have been already loaded.
>>>
>>> to answer your question, Yes ofbiz will try to match any email to and
>>> from with those in the parties.
>>> if it can not find one of the parties, usually the from, it puts the
>>> address in comments, an marks it unknown email address.
>>>
>>>
>>> The MCA is used to filter the emails. Like:
>>>  
>>>  link tracking number to order-->
>>>    
>>>        
>>> value="[hidden email]"/>
>>>        
>>>    
>>>
>>> in the above I am rerouting the Quantum emails to a process I wrote to
>>> input the shipping tracking number into an order.
>>>
>>> If this is what you were meaning by sort then this is the mechanism to
>>> to this.
>>>
>>> you can find /framework/common/servicedef/smca_test.xml
>>>
>>>
>>> rohit2006 sent the following on 4/19/2007 10:03 PM:
>>>> i am trying to configure email sorting in ofbiz. I have followed the
>>>> documentation by Si Chen, to test it. I am assuming that if email
>>>> sorting is
>>>> correctly configured, emails will be recorded as communication event for
>>>> the
>>>> related parties. For eg. after a email is received ofbiz, will try to
>>>> match
>>>> the "to" address, with the email associated to a party, and if a match
>>>> is
>>>> found,  a communication event will be logged for the party.
>>>>
>>>> I hope that i got this right?
>>>>
>>>> I have followed the instruction as mentioned in documentation, and
>>>> everything loads fine, but when i schedule the service
>>>> storeincomingemail, i
>>>> am prompted to enter the service parameter(messageWrapper
>>>> (org.ofbiz.service.mail.MimeMessageWrapper), which i have no clue about.
>>>> i
>>>> guess this is to do something 'MimeMessageWrapper'.
>>>>
>>>> The documentation by Si Chen mentions this:
>>>>
>>>> 5. MCA services need to implement the mail processing interface, as in:
>>>>        
>>>> It uses a MimeMessageWrapper:
>>>>         MimeMessageWrapper wrapper = (MimeMessageWrapper)
>>>> context.get("messageWrapper");
>>>> MimeMessage message = wrapper.getMessage();
>>>> with methods like message.getAllRecipients(), message.getFrom(),
>>>> message.getSubject(), getAllRecipients(), getSentDate(),
>>>> getReceivedDate(),
>>>> etc.
>>>>
>>>> Currently (20060607) there is a service called “storeIncomingEmail”
>>>> which
>>>> could be used to do inbound mail sorting.  This has not been fully
>>>> tested
>>>> yet.
>>>>
>>>>
>>>> I am not sure what to insert in the service parameters.
>>>>
>>>> Do we need to create a view for email sorting, cause i think the mails
>>>> will
>>>> be visible, under the communication tab, in party manager?
>>>>
>>>> Rohit
>>>>
>>>>
>>>>
>>>> BJ Freeman wrote:
>>>>> If I understand you, you can create a view with the sorting you want.
>>>>>
>>>>> rohit2006 sent the following on 4/19/2007 4:33 AM:
>>>>>> Hi,
>>>>>>
>>>>>> I am trying configure email sorting in ofbiz and store emails as
>>>>>> communication events. I believe i have to schedule the service
>>>>>> storeIncomingEmail as a service. I tried to do that and was prompted
>>>>>> fill
>>>>>> the fields:
>>>>>>
>>>>>> Step 2: Service Parameters
>>>>>> messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper).
>>>>>>
>>>>>> I am not sure what to enter into this field, can someone please help
>>>>>> me
>>>>>> configure this. I am getting the following error in log when the
>>>>>> service
>>>>>> is
>>>>>> run
>>>>>>
>>>>>> 2007-04-19 05:22:31,302 (default-invoker-Thread-2) [        
>>>>>> JobInvoker.java:211:INFO ] Invoker: default-invoker-Thread-2 received
>>>>>> job
>>>>>> --
>>>>>> 1176985293330 from poller - org.ofbiz.service.job.JobPoller@1be4777
>>>>>> 2007-04-19 05:22:31,320 (default-invoker-Thread-2)
>>>>>> [PersistedServiceJob.java:136:INFO ]
>>>>>> org.ofbiz.service.job.PersistedServiceJob@334bfe[58369] -- Next
>>>>>> runtime:
>>>>>> -1
>>>>>> [Error] :2:12: cvc-elt.1: Cannot find the declaration of element
>>>>>> 'ofbiz-ser'.
>>>>>> 2007-04-19 05:22:31,331 (default-invoker-Thread-2) [          
>>>>>> UtilXml.java:243:DEBUG] XML Read 0.0040s: Internal Content
>>>>>> 2007-04-19 05:22:31,332 (default-invoker-Thread-2) [
>>>>>> ServiceDispatcher.java:322:ERROR]
>>>>>> ---- exception report
>>>>>> ----------------------------------------------------------
>>>>>> Incoming context (in runSync : storeIncomingEmail) does not match
>>>>>> expected
>>>>>> requirements
>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>> Message: The following required parameter is missing:
>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>> ---- stack trace
>>>>>> ---------------------------------------------------------------
>>>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>> --------------------------------------------------------------------------------
>>>>>>
>>>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>>>>> ServiceDispatcher.java:385:DEBUG] [[Sync service failed...-
>>>>>> total:0.0,since
>>>>>> last(Begin):0.0]] - 'JobDispatcher / storeIncomingEmail'
>>>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>>>>> ServiceDispatcher.java:388:ERROR]
>>>>>> ---- exception report
>>>>>> ----------------------------------------------------------
>>>>>> Service [storeIncomingEmail] threw an unexpected exception/error
>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>> Message: The following required parameter is missing:
>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>> ---- stack trace
>>>>>> ---------------------------------------------------------------
>>>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>> --------------------------------------------------------------------------------
>>>>>>
>>>>>> 2007-04-19 05:22:31,334 (default-invoker-Thread-2) [  
>>>>>> TransactionUtil.java:252:ERROR]
>>>>>> ---- exception report
>>>>>> ----------------------------------------------------------
>>>>>> [TransactionUtil.rollback]
>>>>>> Exception: java.lang.Exception
>>>>>> Message: Stack Trace
>>>>>> ---- stack trace
>>>>>> ---------------------------------------------------------------
>>>>>> java.lang.Exception: Stack Trace
>>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
>>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:391)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>> --------------------------------------------------------------------------------
>>>>>>
>>>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>>>>> TransactionUtil.java:262:INFO ] [TransactionUtil.rollback] transaction
>>>>>> rolled back
>>>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>>>>> TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not
>>>>>> committing
>>>>>> transaction, status is STATUS_NO_TRANSACTION
>>>>>> 2007-04-19 05:22:31,336 (default-invoker-Thread-2) [
>>>>>> GenericServiceJob.java:117:ERROR]
>>>>>> ---- exception report
>>>>>> ----------------------------------------------------------
>>>>>> Async-Service failed.
>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>> Message: The following required parameter is missing:
>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>> ---- stack trace
>>>>>> ---------------------------------------------------------------
>>>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>> --------------------------------------------------------------------------------
>>>>>>
>>>>>> 2007-04-19 05:22:31,342 (default-invoker-Thread-2) [      
>>>>>> SequenceUtil.java:254:INFO ] Got bank of sequenced IDs for
>>>>>> [JobSandbox];
>>>>>> curSeqId=58370, maxSeqId=58380, bankSize=10
>>>>>> 2007-04-19 05:22:31,348 (default-invoker-Thread-2)
>>>>>> [PersistedServiceJob.java:202:INFO ] Persisted Job [58369] Failed
>>>>>> Re-Scheduling : 1176985531339
>>>>>> 2007-04-19 05:22:37,711 (http-0.0.0.0-7443-Processor1) [    
>>>>>> ContextFilter.java:182:INFO ] [Request]: /webtools/control/jobList
>>>>>> 2007-04-19 05:22:37,712 (http-0.0.0.0-7443-Processor1) [    
>>>>>> ControlServlet.java:90 :INFO ] The character encoding of the request
>>>>>> is:
>>>>>> [null]. The character encoding we will use for the request and
>>>>>> response
>>>>>> is:
>>>>>> [UTF-8]
>>>>>> 2007-04-19 05:22:37,713 (http-0.0.0.0-7443-Processor1) [    
>>>>>> ControlServlet.java:126:DEBUG] [[[jobList] Servlet Starting, doing
>>>>>> setup-
>>>>>> total:0.0,since last(Begin):0.0]]
>>>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>>>>> ControlServlet.java:181:DEBUG] [[[jobList] Setup done, doing Event(s)
>>>>>> and
>>>>>> View(s)- total:0.0,since last([jobList] Servlet...):0.0]]
>>>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>>>>> RequestHandler.java:266:INFO ] [Processing Request]: jobList
>>>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>> 2007-04-19 05:22:37,715 (http-0.0.0.0-7443-Processor1) [    
>>>>>> RequestManager.java:117:INFO ] [RequestManager.getRequestAttribute]
>>>>>> Value
>>>>>> for attribute "null" of uri "jobList" not found
>>>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>>>>> RequestHandler.java:450:INFO ] [RequestHandler.doRequest]: Response is
>>>>>> a
>>>>>> view. sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>>>>> RequestHandler.java:603:INFO ] servletName=control, view=jobList
>>>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>> 2007-04-19 05:22:37,717 (http-0.0.0.0-7443-Processor1) [    
>>>>>> ScreenRenderer.java:220:INFO ] Found servlet context (application)
>>>>>> attribute
>>>>>> that conflicts with parameter name, leaving request parameter in place
>>>>>> for
>>>>>> name: _REQUEST_HANDLER_
>>>>>> 2007-04-19 05:22:37,826 (http-0.0.0.0-7443-Processor1) [
>>>>>> ModelScreenWidget.java:361:INFO ] In the include-screen tag the screen
>>>>>> name
>>>>>> was empty, ignoring include; in screen [GlobalDecorator]
>>>>>> 2007-04-19 05:22:37,857 (http-0.0.0.0-7443-Processor1) [    
>>>>>> ControlServlet.java:256:DEBUG] [[[jobList] Done rendering page,
>>>>>> Servlet
>>>>>> Finished- total:0.143,since last([jobList] Setup d...):0.143]]
>>>>>>
>>>>>>
>>>
>>>
>>>        
>>> ---------------------------------
>>> Ahhh...imagining that irresistible "new car" smell?
>>>  Check outnew cars at Yahoo! Autos.
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: what is [storeIncomingEmail.messageWrapper]?

Guido Amarilla
Actually emails that come without a cc or bcc generate that
nullPointerException. If it is solved in crmsfa then a new exception
is thrown in OFBiz, buy it can´t be reproduced, if it isn`t patched in
crmsfa
This is a quick and dirty null check in EmailService.java. The same
should be done in crmsfa (check Request ID 1704671 in CRMSFA bug
tracker)

Check OFBIZ-912 for the patch.

References
http://sourceforge.net/tracker/index.php?func=detail&aid=1704671&group_id=145855&atid=763271
https://issues.apache.org/jira/browse/OFBIZ-912

 These patchs are just to make this work. I don´t have enough
knowledge of this services to be sure if this is the right way to
solve this problems.


Guido Amarilla


2007/4/20, BJ Freeman <[hidden email]>:

> what I see first is you are using the crmsfa.processIncomingEmail
> so this is best ask in the opentaps forum.
>
>
> rohit2006 sent the following on 4/20/2007 12:11 PM:
> > i was just trying to record communication even when a email was received. I
> > had done the MCA rules incorrectly, but i guess they are not set OK.
> >
> > My MCA settings are:
> >
> > <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >
> > xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
> >     <mca mail-rule-name="processIncomingEmail">
> >         <!-- the matching is a regular expression match against the email
> > address.  this format seems to work for
> >         both "[hidden email]" and "Mr. XYZ <[hidden email]>" -->
> >         <condition-field field-name="to" operator="matches"
> > value="[hidden email]"/>
> >         <action service="crmsfa.processIncomingEmail" mode="sync"/>
> >     </mca>
> > </service-mca>
> >
> >
> > The crmsfa.processincomingemail is defined as follows:
> >
> > <service name="crmsfa.processIncomingEmail" engine="java"
> > location="com.opensourcestrategies.crmsfa.activities.ActivitiesServices"
> > invoke="processIncomingEmail">
> >         <description>Process an incoming email by calling storeIncomingEmail
> > to create a CommunicationEvent wrapped in a WorkEffort. This WorkEffort is
> > then
> >             associated with the partyIdFrom of the
> > CommunicationEvent.</description>
> >         <attribute name="messageWrapper"
> > type="org.ofbiz.service.mail.MimeMessageWrapper" mode="IN"/>
> >     </service>
> >
> > However the incoming mails are not being processed and i am getting these
> > errors:
> >
> > 2007-04-20 12:44:03,137 (Thread-0) [      EmailServices.java:743:INFO ]
> > Processing Incoming Email message from: Rohit Sureka <[hidden email]>
> > to: [hidden email]
> > 2007-04-20 12:44:03,170 (Thread-0) [      EmailServices.java:933:ERROR]
> > ---- runtime exception report
> > --------------------------------------------------
> > Exception: java.lang.NullPointerException
> > Message: null
> > ---- stack trace
> > ---------------------------------------------------------------
> > java.lang.NullPointerException
> > org.ofbiz.content.email.EmailServices.storeIncomingEmail(EmailServices.java:835)
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > java.lang.reflect.Method.invoke(Method.java:324)
> > org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
> > org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> > org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> > com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > java.lang.reflect.Method.invoke(Method.java:324)
> > org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
> > org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> > org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> > org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
> > org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
> > org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
> > org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
> > org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
> > org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
> > java.util.TimerThread.mainLoop(Timer.java:432)
> > java.util.TimerThread.run(Timer.java:382)
> > --------------------------------------------------------------------------------
> >
> > 2007-04-20 12:44:03,171 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
> > Service Error [storeIncomingEmail]:
> > 2007-04-20 12:44:03,172 (Thread-0) [    TransactionUtil.java:285:WARN ]
> > ---- exception report
> > ----------------------------------------------------------
> > [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly; this
> > stack trace shows where this is happening:
> > Exception: java.lang.Exception
> > Message: Service Error [storeIncomingEmail]:
> > ---- stack trace
> > ---------------------------------------------------------------
> > java.lang.Exception: Service Error [storeIncomingEmail]:
> > org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:285)
> > org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:235)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> > org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> > com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > java.lang.reflect.Method.invoke(Method.java:324)
> > org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
> > org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> > org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> > org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
> > org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
> > org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
> > org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
> > org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
> > org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
> > java.util.TimerThread.mainLoop(Timer.java:432)
> > java.util.TimerThread.run(Timer.java:382)
> > --------------------------------------------------------------------------------
> >
> > 2007-04-20 12:44:03,173 (Thread-0) [         UtilCommon.java:127:ERROR]
> > Failed to process incoming email:
> > 2007-04-20 12:44:03,173 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
> > Service Error [crmsfa.processIncomingEmail]: Failed to process incoming
> > email:
> > 2007-04-20 12:44:03,174 (Thread-0) [    TransactionUtil.java:252:ERROR]
> > ---- exception report
> > ----------------------------------------------------------
> > [TransactionUtil.rollback]
> > Exception: java.lang.Exception
> > Message: Stack Trace
> > ---- stack trace
> > ---------------------------------------------------------------
> > java.lang.Exception: Stack Trace
> > org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
> > org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> > org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> > org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
> > org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
> > org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
> > org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
> > org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
> > org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
> > java.util.TimerThread.mainLoop(Timer.java:432)
> > java.util.TimerThread.run(Timer.java:382)
> > --------------------------------------------------------------------------------
> >
> > 2007-04-20 12:44:03,175 (Thread-0) [    TransactionUtil.java:262:INFO ]
> > [TransactionUtil.rollback] transaction rolled back
> > 2007-04-20 12:44:03,176 (Thread-0) [   ServiceMcaAction.java:60 :ERROR]
> > Failed to process incoming email:
> > C: QUIT
> > S: +OK Logging out.
> >
> >
> >
> >
> > BJ Freeman wrote:
> >> could you be more specific about what you are trying to sort?
> >> would this be better served as a entity view?
> >>
> >> Rohit Sureka sent the following on 4/20/2007 9:32 AM:
> >>> Thanks for the email and i am sorry if i did not put my question
> >>> properly.
> >>>
> >>> My real problem is configuring the service to sort emails. I have put the
> >>> MCA rules in place but i am not able to configure the "sortincomingemail'
> >>> service.
> >>>
> >>> I understand that "sortincomingemail" has to be run at regular interval
> >>> to process the email sorting.
> >>>
> >>> Rohit
> >>>
> >>> BJ Freeman <[hidden email]> wrote: My previous response was aimed at
> >>> sorting the communication events after
> >>> they have been already loaded.
> >>>
> >>> to answer your question, Yes ofbiz will try to match any email to and
> >>> from with those in the parties.
> >>> if it can not find one of the parties, usually the from, it puts the
> >>> address in comments, an marks it unknown email address.
> >>>
> >>>
> >>> The MCA is used to filter the emails. Like:
> >>>
> >>>  link tracking number to order-->
> >>>
> >>>
> >>> value="[hidden email]"/>
> >>>
> >>>
> >>>
> >>> in the above I am rerouting the Quantum emails to a process I wrote to
> >>> input the shipping tracking number into an order.
> >>>
> >>> If this is what you were meaning by sort then this is the mechanism to
> >>> to this.
> >>>
> >>> you can find /framework/common/servicedef/smca_test.xml
> >>>
> >>>
> >>> rohit2006 sent the following on 4/19/2007 10:03 PM:
> >>>> i am trying to configure email sorting in ofbiz. I have followed the
> >>>> documentation by Si Chen, to test it. I am assuming that if email
> >>>> sorting is
> >>>> correctly configured, emails will be recorded as communication event for
> >>>> the
> >>>> related parties. For eg. after a email is received ofbiz, will try to
> >>>> match
> >>>> the "to" address, with the email associated to a party, and if a match
> >>>> is
> >>>> found,  a communication event will be logged for the party.
> >>>>
> >>>> I hope that i got this right?
> >>>>
> >>>> I have followed the instruction as mentioned in documentation, and
> >>>> everything loads fine, but when i schedule the service
> >>>> storeincomingemail, i
> >>>> am prompted to enter the service parameter(messageWrapper
> >>>> (org.ofbiz.service.mail.MimeMessageWrapper), which i have no clue about.
> >>>> i
> >>>> guess this is to do something 'MimeMessageWrapper'.
> >>>>
> >>>> The documentation by Si Chen mentions this:
> >>>>
> >>>> 5. MCA services need to implement the mail processing interface, as in:
> >>>>
> >>>> It uses a MimeMessageWrapper:
> >>>>         MimeMessageWrapper wrapper = (MimeMessageWrapper)
> >>>> context.get("messageWrapper");
> >>>> MimeMessage message = wrapper.getMessage();
> >>>> with methods like message.getAllRecipients(), message.getFrom(),
> >>>> message.getSubject(), getAllRecipients(), getSentDate(),
> >>>> getReceivedDate(),
> >>>> etc.
> >>>>
> >>>> Currently (20060607) there is a service called “storeIncomingEmail”
> >>>> which
> >>>> could be used to do inbound mail sorting.  This has not been fully
> >>>> tested
> >>>> yet.
> >>>>
> >>>>
> >>>> I am not sure what to insert in the service parameters.
> >>>>
> >>>> Do we need to create a view for email sorting, cause i think the mails
> >>>> will
> >>>> be visible, under the communication tab, in party manager?
> >>>>
> >>>> Rohit
> >>>>
> >>>>
> >>>>
> >>>> BJ Freeman wrote:
> >>>>> If I understand you, you can create a view with the sorting you want.
> >>>>>
> >>>>> rohit2006 sent the following on 4/19/2007 4:33 AM:
> >>>>>> Hi,
> >>>>>>
> >>>>>> I am trying configure email sorting in ofbiz and store emails as
> >>>>>> communication events. I believe i have to schedule the service
> >>>>>> storeIncomingEmail as a service. I tried to do that and was prompted
> >>>>>> fill
> >>>>>> the fields:
> >>>>>>
> >>>>>> Step 2: Service Parameters
> >>>>>> messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper).
> >>>>>>
> >>>>>> I am not sure what to enter into this field, can someone please help
> >>>>>> me
> >>>>>> configure this. I am getting the following error in log when the
> >>>>>> service
> >>>>>> is
> >>>>>> run
> >>>>>>
> >>>>>> 2007-04-19 05:22:31,302 (default-invoker-Thread-2) [
> >>>>>> JobInvoker.java:211:INFO ] Invoker: default-invoker-Thread-2 received
> >>>>>> job
> >>>>>> --
> >>>>>> 1176985293330 from poller - org.ofbiz.service.job.JobPoller@1be4777
> >>>>>> 2007-04-19 05:22:31,320 (default-invoker-Thread-2)
> >>>>>> [PersistedServiceJob.java:136:INFO ]
> >>>>>> org.ofbiz.service.job.PersistedServiceJob@334bfe[58369] -- Next
> >>>>>> runtime:
> >>>>>> -1
> >>>>>> [Error] :2:12: cvc-elt.1: Cannot find the declaration of element
> >>>>>> 'ofbiz-ser'.
> >>>>>> 2007-04-19 05:22:31,331 (default-invoker-Thread-2) [
> >>>>>> UtilXml.java:243:DEBUG] XML Read 0.0040s: Internal Content
> >>>>>> 2007-04-19 05:22:31,332 (default-invoker-Thread-2) [
> >>>>>> ServiceDispatcher.java:322:ERROR]
> >>>>>> ---- exception report
> >>>>>> ----------------------------------------------------------
> >>>>>> Incoming context (in runSync : storeIncomingEmail) does not match
> >>>>>> expected
> >>>>>> requirements
> >>>>>> Exception: org.ofbiz.service.ServiceValidationException
> >>>>>> Message: The following required parameter is missing:
> >>>>>> [storeIncomingEmail.messageWrapper]
> >>>>>> ---- stack trace
> >>>>>> ---------------------------------------------------------------
> >>>>>> org.ofbiz.service.ServiceValidationException: The following required
> >>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
> >>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> >>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> >>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> >>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> >>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> >>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> >>>>>> java.lang.Thread.run(Thread.java:534)
> >>>>>> --------------------------------------------------------------------------------
> >>>>>>
> >>>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
> >>>>>> ServiceDispatcher.java:385:DEBUG] [[Sync service failed...-
> >>>>>> total:0.0,since
> >>>>>> last(Begin):0.0]] - 'JobDispatcher / storeIncomingEmail'
> >>>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
> >>>>>> ServiceDispatcher.java:388:ERROR]
> >>>>>> ---- exception report
> >>>>>> ----------------------------------------------------------
> >>>>>> Service [storeIncomingEmail] threw an unexpected exception/error
> >>>>>> Exception: org.ofbiz.service.ServiceValidationException
> >>>>>> Message: The following required parameter is missing:
> >>>>>> [storeIncomingEmail.messageWrapper]
> >>>>>> ---- stack trace
> >>>>>> ---------------------------------------------------------------
> >>>>>> org.ofbiz.service.ServiceValidationException: The following required
> >>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
> >>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> >>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> >>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> >>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> >>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> >>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> >>>>>> java.lang.Thread.run(Thread.java:534)
> >>>>>> --------------------------------------------------------------------------------
> >>>>>>
> >>>>>> 2007-04-19 05:22:31,334 (default-invoker-Thread-2) [
> >>>>>> TransactionUtil.java:252:ERROR]
> >>>>>> ---- exception report
> >>>>>> ----------------------------------------------------------
> >>>>>> [TransactionUtil.rollback]
> >>>>>> Exception: java.lang.Exception
> >>>>>> Message: Stack Trace
> >>>>>> ---- stack trace
> >>>>>> ---------------------------------------------------------------
> >>>>>> java.lang.Exception: Stack Trace
> >>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
> >>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
> >>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:391)
> >>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> >>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> >>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> >>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> >>>>>> java.lang.Thread.run(Thread.java:534)
> >>>>>> --------------------------------------------------------------------------------
> >>>>>>
> >>>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [
> >>>>>> TransactionUtil.java:262:INFO ] [TransactionUtil.rollback] transaction
> >>>>>> rolled back
> >>>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [
> >>>>>> TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not
> >>>>>> committing
> >>>>>> transaction, status is STATUS_NO_TRANSACTION
> >>>>>> 2007-04-19 05:22:31,336 (default-invoker-Thread-2) [
> >>>>>> GenericServiceJob.java:117:ERROR]
> >>>>>> ---- exception report
> >>>>>> ----------------------------------------------------------
> >>>>>> Async-Service failed.
> >>>>>> Exception: org.ofbiz.service.ServiceValidationException
> >>>>>> Message: The following required parameter is missing:
> >>>>>> [storeIncomingEmail.messageWrapper]
> >>>>>> ---- stack trace
> >>>>>> ---------------------------------------------------------------
> >>>>>> org.ofbiz.service.ServiceValidationException: The following required
> >>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
> >>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> >>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> >>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> >>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> >>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> >>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> >>>>>> java.lang.Thread.run(Thread.java:534)
> >>>>>> --------------------------------------------------------------------------------
> >>>>>>
> >>>>>> 2007-04-19 05:22:31,342 (default-invoker-Thread-2) [
> >>>>>> SequenceUtil.java:254:INFO ] Got bank of sequenced IDs for
> >>>>>> [JobSandbox];
> >>>>>> curSeqId=58370, maxSeqId=58380, bankSize=10
> >>>>>> 2007-04-19 05:22:31,348 (default-invoker-Thread-2)
> >>>>>> [PersistedServiceJob.java:202:INFO ] Persisted Job [58369] Failed
> >>>>>> Re-Scheduling : 1176985531339
> >>>>>> 2007-04-19 05:22:37,711 (http-0.0.0.0-7443-Processor1) [
> >>>>>> ContextFilter.java:182:INFO ] [Request]: /webtools/control/jobList
> >>>>>> 2007-04-19 05:22:37,712 (http-0.0.0.0-7443-Processor1) [
> >>>>>> ControlServlet.java:90 :INFO ] The character encoding of the request
> >>>>>> is:
> >>>>>> [null]. The character encoding we will use for the request and
> >>>>>> response
> >>>>>> is:
> >>>>>> [UTF-8]
> >>>>>> 2007-04-19 05:22:37,713 (http-0.0.0.0-7443-Processor1) [
> >>>>>> ControlServlet.java:126:DEBUG] [[[jobList] Servlet Starting, doing
> >>>>>> setup-
> >>>>>> total:0.0,since last(Begin):0.0]]
> >>>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [
> >>>>>> ControlServlet.java:181:DEBUG] [[[jobList] Setup done, doing Event(s)
> >>>>>> and
> >>>>>> View(s)- total:0.0,since last([jobList] Servlet...):0.0]]
> >>>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [
> >>>>>> RequestHandler.java:266:INFO ] [Processing Request]: jobList
> >>>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> >>>>>> 2007-04-19 05:22:37,715 (http-0.0.0.0-7443-Processor1) [
> >>>>>> RequestManager.java:117:INFO ] [RequestManager.getRequestAttribute]
> >>>>>> Value
> >>>>>> for attribute "null" of uri "jobList" not found
> >>>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [
> >>>>>> RequestHandler.java:450:INFO ] [RequestHandler.doRequest]: Response is
> >>>>>> a
> >>>>>> view. sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> >>>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [
> >>>>>> RequestHandler.java:603:INFO ] servletName=control, view=jobList
> >>>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> >>>>>> 2007-04-19 05:22:37,717 (http-0.0.0.0-7443-Processor1) [
> >>>>>> ScreenRenderer.java:220:INFO ] Found servlet context (application)
> >>>>>> attribute
> >>>>>> that conflicts with parameter name, leaving request parameter in place
> >>>>>> for
> >>>>>> name: _REQUEST_HANDLER_
> >>>>>> 2007-04-19 05:22:37,826 (http-0.0.0.0-7443-Processor1) [
> >>>>>> ModelScreenWidget.java:361:INFO ] In the include-screen tag the screen
> >>>>>> name
> >>>>>> was empty, ignoring include; in screen [GlobalDecorator]
> >>>>>> 2007-04-19 05:22:37,857 (http-0.0.0.0-7443-Processor1) [
> >>>>>> ControlServlet.java:256:DEBUG] [[[jobList] Done rendering page,
> >>>>>> Servlet
> >>>>>> Finished- total:0.143,since last([jobList] Setup d...):0.143]]
> >>>>>>
> >>>>>>
> >>>
> >>>
> >>>
> >>> ---------------------------------
> >>> Ahhh...imagining that irresistible "new car" smell?
> >>>  Check outnew cars at Yahoo! Autos.
> >>
> >>
> >
>
>


--
Guido Amarilla
Reply | Threaded
Open this post in threaded view
|

Re: what is [storeIncomingEmail.messageWrapper]?

rohit
In reply to this post by BJ Freeman
i have changed the service to use the ofbiz service 'storeIncomingEmail', but that didn't help either. And as suspected by 'Guido Amarilla' i also included 'CC' in my test emails, but that did not work either.

I can see that ofbiz reads the mail properly, but is not able to store the email.

My javamail configuration is:

   
   
   
    <container name="javamail-container" class="org.ofbiz.service.mail.JavaMailContainer">
        <property name="delegator-name" value="default"/>
        <property name="dispatcher-name" value="JavaMailDispatcher"/>
        <property name="run-as-user" value="system"/>
        <property name="poll-delay" value="300000"/>
        <property name="delete-mail" value="false"/>
        <property name="maxSize" value="100000"/>
        <property name="default-listener" value="store-listener">
            <property name="mail.store.protocol" value="pop3"/>
            <property name="mail.host" value="localhost"/>
            <property name="mail.user" value="userID"/>
            <property name="mail.pass" value="password"/>
            <property name="mail.debug" value="true"/>
        </property>
    </container>
   
ERROR LOG -----------------

 "2007-04-20 20:59:18,079 (Thread-0) [      EmailServices.java:743:INFO ] Processing Incoming Email message from: Rohit Sureka <rohitksureka@gmail.com> to: ofbiz@tamannaa.com
2007-04-20 20:59:18,154 (Thread-0) [            UtilXml.java:243:DEBUG] XML Read 0.047s: file:/var/www/html/tamannaa.com/ofbiz/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml
2007-04-20 20:59:18,253 (Thread-0) [  ServiceDispatcher.java:459:DEBUG] Sync service [JavaMailDispatcher/executeFind] finished in [79] milliseconds
2007-04-20 20:59:18,254 (Thread-0) [  ServiceDispatcher.java:459:DEBUG] Sync service [JavaMailDispatcher/performFindItem] finished in [83] milliseconds
2007-04-20 20:59:18,272 (Thread-0) [  ServiceDispatcher.java:459:DEBUG] Sync service [JavaMailDispatcher/findPartyFromEmailAddress] finished in [192] milliseconds
2007-04-20 20:59:18,354 (Thread-0) [      EmailServices.java:933:ERROR]
---- runtime exception report --------------------------------------------------
Exception: java.lang.NullPointerException
Message: null
---- stack trace ---------------------------------------------------------------
java.lang.NullPointerException
org.ofbiz.content.email.EmailServices.storeIncomingEmail(EmailServices.java:835)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
java.util.TimerThread.mainLoop(Timer.java:432)
java.util.TimerThread.run(Timer.java:382)
--------------------------------------------------------------------------------

2007-04-20 20:59:18,355 (Thread-0) [  ServiceDispatcher.java:411:ERROR] Service Error [storeIncomingEmail]:
2007-04-20 20:59:18,356 (Thread-0) [    TransactionUtil.java:252:ERROR]
---- exception report ----------------------------------------------------------
[TransactionUtil.rollback]
Exception: java.lang.Exception
Message: Stack Trace
---- stack trace ---------------------------------------------------------------
java.lang.Exception: Stack Trace
org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
java.util.TimerThread.mainLoop(Timer.java:432)
java.util.TimerThread.run(Timer.java:382)
--------------------------------------------------------------------------------

2007-04-20 20:59:18,357 (Thread-0) [    TransactionUtil.java:262:INFO ] [TransactionUtil.rollback] transaction rolled back
2007-04-20 20:59:18,358 (Thread-0) [  ServiceDispatcher.java:459:DEBUG] Sync service [JavaMailDispatcher/storeIncomingEmail] finished in [303] milliseconds
2007-04-20 20:59:18,358 (Thread-0) [   ServiceMcaAction.java:60 :ERROR]


BJ Freeman wrote
what I see first is you are using the crmsfa.processIncomingEmail
so this is best ask in the opentaps forum.


rohit2006 sent the following on 4/20/2007 12:11 PM:
> i was just trying to record communication even when a email was received. I
> had done the MCA rules incorrectly, but i guess they are not set OK.
>
> My MCA settings are:
>
> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>       
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>     <mca mail-rule-name="processIncomingEmail">
>        
>         <condition-field field-name="to" operator="matches"
> value="ofbiz@xx.com"/>
>         <action service="crmsfa.processIncomingEmail" mode="sync"/>
>     </mca>
> </service-mca>
>
>
> The crmsfa.processincomingemail is defined as follows:
>
> <service name="crmsfa.processIncomingEmail" engine="java"
> location="com.opensourcestrategies.crmsfa.activities.ActivitiesServices"
> invoke="processIncomingEmail">
>         <description>Process an incoming email by calling storeIncomingEmail
> to create a CommunicationEvent wrapped in a WorkEffort. This WorkEffort is
> then
>             associated with the partyIdFrom of the
> CommunicationEvent.</description>
>         <attribute name="messageWrapper"
> type="org.ofbiz.service.mail.MimeMessageWrapper" mode="IN"/>
>     </service>
>
> However the incoming mails are not being processed and i am getting these
> errors:
>
> 2007-04-20 12:44:03,137 (Thread-0) [      EmailServices.java:743:INFO ]
> Processing Incoming Email message from: Rohit Sureka <rohitksureka@yy.com>
> to: ofbiz@xx.com
> 2007-04-20 12:44:03,170 (Thread-0) [      EmailServices.java:933:ERROR]
> ---- runtime exception report
> --------------------------------------------------
> Exception: java.lang.NullPointerException
> Message: null
> ---- stack trace
> ---------------------------------------------------------------
> java.lang.NullPointerException
> org.ofbiz.content.email.EmailServices.storeIncomingEmail(EmailServices.java:835)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:324)
> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:324)
> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
> java.util.TimerThread.mainLoop(Timer.java:432)
> java.util.TimerThread.run(Timer.java:382)
> --------------------------------------------------------------------------------
>
> 2007-04-20 12:44:03,171 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
> Service Error [storeIncomingEmail]:
> 2007-04-20 12:44:03,172 (Thread-0) [    TransactionUtil.java:285:WARN ]
> ---- exception report
> ----------------------------------------------------------
> [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly; this
> stack trace shows where this is happening:
> Exception: java.lang.Exception
> Message: Service Error [storeIncomingEmail]:
> ---- stack trace
> ---------------------------------------------------------------
> java.lang.Exception: Service Error [storeIncomingEmail]:
> org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:285)
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:235)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:324)
> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
> java.util.TimerThread.mainLoop(Timer.java:432)
> java.util.TimerThread.run(Timer.java:382)
> --------------------------------------------------------------------------------
>
> 2007-04-20 12:44:03,173 (Thread-0) [         UtilCommon.java:127:ERROR]
> Failed to process incoming email:
> 2007-04-20 12:44:03,173 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
> Service Error [crmsfa.processIncomingEmail]: Failed to process incoming
> email:
> 2007-04-20 12:44:03,174 (Thread-0) [    TransactionUtil.java:252:ERROR]
> ---- exception report
> ----------------------------------------------------------
> [TransactionUtil.rollback]
> Exception: java.lang.Exception
> Message: Stack Trace
> ---- stack trace
> ---------------------------------------------------------------
> java.lang.Exception: Stack Trace
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
> java.util.TimerThread.mainLoop(Timer.java:432)
> java.util.TimerThread.run(Timer.java:382)
> --------------------------------------------------------------------------------
>
> 2007-04-20 12:44:03,175 (Thread-0) [    TransactionUtil.java:262:INFO ]
> [TransactionUtil.rollback] transaction rolled back
> 2007-04-20 12:44:03,176 (Thread-0) [   ServiceMcaAction.java:60 :ERROR]
> Failed to process incoming email:
> C: QUIT
> S: +OK Logging out.
>
>
>
>
> BJ Freeman wrote:
>> could you be more specific about what you are trying to sort?
>> would this be better served as a entity view?
>>
>> Rohit Sureka sent the following on 4/20/2007 9:32 AM:
>>> Thanks for the email and i am sorry if i did not put my question
>>> properly.
>>>
>>> My real problem is configuring the service to sort emails. I have put the
>>> MCA rules in place but i am not able to configure the "sortincomingemail'
>>> service.
>>>
>>> I understand that "sortincomingemail" has to be run at regular interval
>>> to process the email sorting.
>>>
>>> Rohit
>>>
>>> BJ Freeman <bjfree@free-man.net> wrote: My previous response was aimed at
>>> sorting the communication events after
>>> they have been already loaded.
>>>
>>> to answer your question, Yes ofbiz will try to match any email to and
>>> from with those in the parties.
>>> if it can not find one of the parties, usually the from, it puts the
>>> address in comments, an marks it unknown email address.
>>>
>>>
>>> The MCA is used to filter the emails. Like:
>>>  
>>>  link tracking number to order-->
>>>    
>>>        
>>> value="QuantumViewNotify@ups.com"/>
>>>        
>>>    
>>>
>>> in the above I am rerouting the Quantum emails to a process I wrote to
>>> input the shipping tracking number into an order.
>>>
>>> If this is what you were meaning by sort then this is the mechanism to
>>> to this.
>>>
>>> you can find /framework/common/servicedef/smca_test.xml
>>>
>>>
>>> rohit2006 sent the following on 4/19/2007 10:03 PM:
>>>> i am trying to configure email sorting in ofbiz. I have followed the
>>>> documentation by Si Chen, to test it. I am assuming that if email
>>>> sorting is
>>>> correctly configured, emails will be recorded as communication event for
>>>> the
>>>> related parties. For eg. after a email is received ofbiz, will try to
>>>> match
>>>> the "to" address, with the email associated to a party, and if a match
>>>> is
>>>> found,  a communication event will be logged for the party.
>>>>
>>>> I hope that i got this right?
>>>>
>>>> I have followed the instruction as mentioned in documentation, and
>>>> everything loads fine, but when i schedule the service
>>>> storeincomingemail, i
>>>> am prompted to enter the service parameter(messageWrapper
>>>> (org.ofbiz.service.mail.MimeMessageWrapper), which i have no clue about.
>>>> i
>>>> guess this is to do something 'MimeMessageWrapper'.
>>>>
>>>> The documentation by Si Chen mentions this:
>>>>
>>>> 5. MCA services need to implement the mail processing interface, as in:
>>>>        
>>>> It uses a MimeMessageWrapper:
>>>>         MimeMessageWrapper wrapper = (MimeMessageWrapper)
>>>> context.get("messageWrapper");
>>>> MimeMessage message = wrapper.getMessage();
>>>> with methods like message.getAllRecipients(), message.getFrom(),
>>>> message.getSubject(), getAllRecipients(), getSentDate(),
>>>> getReceivedDate(),
>>>> etc.
>>>>
>>>> Currently (20060607) there is a service called “storeIncomingEmail”
>>>> which
>>>> could be used to do inbound mail sorting.  This has not been fully
>>>> tested
>>>> yet.
>>>>
>>>>
>>>> I am not sure what to insert in the service parameters.
>>>>
>>>> Do we need to create a view for email sorting, cause i think the mails
>>>> will
>>>> be visible, under the communication tab, in party manager?
>>>>
>>>> Rohit
>>>>
>>>>
>>>>
>>>> BJ Freeman wrote:
>>>>> If I understand you, you can create a view with the sorting you want.
>>>>>
>>>>> rohit2006 sent the following on 4/19/2007 4:33 AM:
>>>>>> Hi,
>>>>>>
>>>>>> I am trying configure email sorting in ofbiz and store emails as
>>>>>> communication events. I believe i have to schedule the service
>>>>>> storeIncomingEmail as a service. I tried to do that and was prompted
>>>>>> fill
>>>>>> the fields:
>>>>>>
>>>>>> Step 2: Service Parameters
>>>>>> messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper).
>>>>>>
>>>>>> I am not sure what to enter into this field, can someone please help
>>>>>> me
>>>>>> configure this. I am getting the following error in log when the
>>>>>> service
>>>>>> is
>>>>>> run
>>>>>>
>>>>>> 2007-04-19 05:22:31,302 (default-invoker-Thread-2) [        
>>>>>> JobInvoker.java:211:INFO ] Invoker: default-invoker-Thread-2 received
>>>>>> job
>>>>>> --
>>>>>> 1176985293330 from poller - org.ofbiz.service.job.JobPoller@1be4777
>>>>>> 2007-04-19 05:22:31,320 (default-invoker-Thread-2)
>>>>>> [PersistedServiceJob.java:136:INFO ]
>>>>>> org.ofbiz.service.job.PersistedServiceJob@334bfe[58369] -- Next
>>>>>> runtime:
>>>>>> -1
>>>>>> [Error] :2:12: cvc-elt.1: Cannot find the declaration of element
>>>>>> 'ofbiz-ser'.
>>>>>> 2007-04-19 05:22:31,331 (default-invoker-Thread-2) [          
>>>>>> UtilXml.java:243:DEBUG] XML Read 0.0040s: Internal Content
>>>>>> 2007-04-19 05:22:31,332 (default-invoker-Thread-2) [
>>>>>> ServiceDispatcher.java:322:ERROR]
>>>>>> ---- exception report
>>>>>> ----------------------------------------------------------
>>>>>> Incoming context (in runSync : storeIncomingEmail) does not match
>>>>>> expected
>>>>>> requirements
>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>> Message: The following required parameter is missing:
>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>> ---- stack trace
>>>>>> ---------------------------------------------------------------
>>>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>> --------------------------------------------------------------------------------
>>>>>>
>>>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>>>>> ServiceDispatcher.java:385:DEBUG] [[Sync service failed...-
>>>>>> total:0.0,since
>>>>>> last(Begin):0.0]] - 'JobDispatcher / storeIncomingEmail'
>>>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>>>>> ServiceDispatcher.java:388:ERROR]
>>>>>> ---- exception report
>>>>>> ----------------------------------------------------------
>>>>>> Service [storeIncomingEmail] threw an unexpected exception/error
>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>> Message: The following required parameter is missing:
>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>> ---- stack trace
>>>>>> ---------------------------------------------------------------
>>>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>> --------------------------------------------------------------------------------
>>>>>>
>>>>>> 2007-04-19 05:22:31,334 (default-invoker-Thread-2) [  
>>>>>> TransactionUtil.java:252:ERROR]
>>>>>> ---- exception report
>>>>>> ----------------------------------------------------------
>>>>>> [TransactionUtil.rollback]
>>>>>> Exception: java.lang.Exception
>>>>>> Message: Stack Trace
>>>>>> ---- stack trace
>>>>>> ---------------------------------------------------------------
>>>>>> java.lang.Exception: Stack Trace
>>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
>>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:391)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>> --------------------------------------------------------------------------------
>>>>>>
>>>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>>>>> TransactionUtil.java:262:INFO ] [TransactionUtil.rollback] transaction
>>>>>> rolled back
>>>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>>>>> TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not
>>>>>> committing
>>>>>> transaction, status is STATUS_NO_TRANSACTION
>>>>>> 2007-04-19 05:22:31,336 (default-invoker-Thread-2) [
>>>>>> GenericServiceJob.java:117:ERROR]
>>>>>> ---- exception report
>>>>>> ----------------------------------------------------------
>>>>>> Async-Service failed.
>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>> Message: The following required parameter is missing:
>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>> ---- stack trace
>>>>>> ---------------------------------------------------------------
>>>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>> --------------------------------------------------------------------------------
>>>>>>
>>>>>> 2007-04-19 05:22:31,342 (default-invoker-Thread-2) [      
>>>>>> SequenceUtil.java:254:INFO ] Got bank of sequenced IDs for
>>>>>> [JobSandbox];
>>>>>> curSeqId=58370, maxSeqId=58380, bankSize=10
>>>>>> 2007-04-19 05:22:31,348 (default-invoker-Thread-2)
>>>>>> [PersistedServiceJob.java:202:INFO ] Persisted Job [58369] Failed
>>>>>> Re-Scheduling : 1176985531339
>>>>>> 2007-04-19 05:22:37,711 (http-0.0.0.0-7443-Processor1) [    
>>>>>> ContextFilter.java:182:INFO ] [Request]: /webtools/control/jobList
>>>>>> 2007-04-19 05:22:37,712 (http-0.0.0.0-7443-Processor1) [    
>>>>>> ControlServlet.java:90 :INFO ] The character encoding of the request
>>>>>> is:
>>>>>> [null]. The character encoding we will use for the request and
>>>>>> response
>>>>>> is:
>>>>>> [UTF-8]
>>>>>> 2007-04-19 05:22:37,713 (http-0.0.0.0-7443-Processor1) [    
>>>>>> ControlServlet.java:126:DEBUG] [[[jobList] Servlet Starting, doing
>>>>>> setup-
>>>>>> total:0.0,since last(Begin):0.0]]
>>>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>>>>> ControlServlet.java:181:DEBUG] [[[jobList] Setup done, doing Event(s)
>>>>>> and
>>>>>> View(s)- total:0.0,since last([jobList] Servlet...):0.0]]
>>>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>>>>> RequestHandler.java:266:INFO ] [Processing Request]: jobList
>>>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>> 2007-04-19 05:22:37,715 (http-0.0.0.0-7443-Processor1) [    
>>>>>> RequestManager.java:117:INFO ] [RequestManager.getRequestAttribute]
>>>>>> Value
>>>>>> for attribute "null" of uri "jobList" not found
>>>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>>>>> RequestHandler.java:450:INFO ] [RequestHandler.doRequest]: Response is
>>>>>> a
>>>>>> view. sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>>>>> RequestHandler.java:603:INFO ] servletName=control, view=jobList
>>>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>> 2007-04-19 05:22:37,717 (http-0.0.0.0-7443-Processor1) [    
>>>>>> ScreenRenderer.java:220:INFO ] Found servlet context (application)
>>>>>> attribute
>>>>>> that conflicts with parameter name, leaving request parameter in place
>>>>>> for
>>>>>> name: _REQUEST_HANDLER_
>>>>>> 2007-04-19 05:22:37,826 (http-0.0.0.0-7443-Processor1) [
>>>>>> ModelScreenWidget.java:361:INFO ] In the include-screen tag the screen
>>>>>> name
>>>>>> was empty, ignoring include; in screen [GlobalDecorator]
>>>>>> 2007-04-19 05:22:37,857 (http-0.0.0.0-7443-Processor1) [    
>>>>>> ControlServlet.java:256:DEBUG] [[[jobList] Done rendering page,
>>>>>> Servlet
>>>>>> Finished- total:0.143,since last([jobList] Setup d...):0.143]]
>>>>>>
>>>>>>
>>>
>>>
>>>        
>>> ---------------------------------
>>> Ahhh...imagining that irresistible "new car" smell?
>>>  Check outnew cars at Yahoo! Autos.
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: what is [storeIncomingEmail.messageWrapper]?

rohit
In reply to this post by BJ Freeman
i am not sure if there is an issue with JAVAMAIL, but i am pasting the log, if it helps


2007-04-20 20:54:17,678 (main) [  GenericDispatcher.java:58 :INFO ] Creating new dispatcher [JavaMailDispatcher] (main)
2007-04-20 20:54:17,678 (main) [  ServiceDispatcher.java:167:INFO ] Registered dispatcher: JavaMailDispatcher
2007-04-20 20:54:17,679 (main) [  GenericDispatcher.java:128:INFO ] [LocalDispatcher] : Created Dispatcher for: JavaMailDispatcher
2007-04-20 20:54:17,833 (main) [            UtilXml.java:243:DEBUG] XML Read 0.034s: /var/www/html/tamannaa.com/ofbiz/framework/common/servicedef/smcas_test.xml
2007-04-20 20:54:17,844 (main) [     ServiceMcaUtil.java:102:INFO ] Loaded 1 Service MCA definitions from file:/var/www/html/tamannaa.com/ofbiz/framework/common/servicedef/smcas_test.xml
2007-04-20 20:54:17,854 (main) [            UtilXml.java:243:DEBUG] XML Read 0.0060s: /var/www/html/tamannaa.com/ofbiz/hot-deploy/crmsfa/servicedef/smcas.xml
2007-04-20 20:54:17,856 (main) [     ServiceMcaUtil.java:102:INFO ] Loaded 1 Service MCA definitions from file:/var/www/html/tamannaa.com/ofbiz/hot-deploy/crmsfa/servicedef/smcas.xml
DEBUG: JavaMail version 1.4ea
DEBUG: java.io.FileNotFoundException: /usr/lib/j2sdk1.4.2_13/jre/lib/javamail.providers (No such file or directory)
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.providers
DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}
DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.address.map
DEBUG: java.io.FileNotFoundException: /usr/lib/j2sdk1.4.2_13/jre/lib/javamail.address.map (No such file or directory)
DEBUG: getProvider() returning javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]
DEBUG: getProvider() returning javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]
DEBUG POP3: connecting to host "localhost", port 110, isSSL false
S: +OK Dovecot ready.
C: USER userID
S: +OK
C: PASS mypassword
S: +OK Logged in.
C: QUIT
S: +OK Logging out.

BJ Freeman wrote
what I see first is you are using the crmsfa.processIncomingEmail
so this is best ask in the opentaps forum.


rohit2006 sent the following on 4/20/2007 12:11 PM:
> i was just trying to record communication even when a email was received. I
> had done the MCA rules incorrectly, but i guess they are not set OK.
>
> My MCA settings are:
>
> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>       
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>     <mca mail-rule-name="processIncomingEmail">
>        
>         <condition-field field-name="to" operator="matches"
> value="ofbiz@xx.com"/>
>         <action service="crmsfa.processIncomingEmail" mode="sync"/>
>     </mca>
> </service-mca>
>
>
> The crmsfa.processincomingemail is defined as follows:
>
> <service name="crmsfa.processIncomingEmail" engine="java"
> location="com.opensourcestrategies.crmsfa.activities.ActivitiesServices"
> invoke="processIncomingEmail">
>         <description>Process an incoming email by calling storeIncomingEmail
> to create a CommunicationEvent wrapped in a WorkEffort. This WorkEffort is
> then
>             associated with the partyIdFrom of the
> CommunicationEvent.</description>
>         <attribute name="messageWrapper"
> type="org.ofbiz.service.mail.MimeMessageWrapper" mode="IN"/>
>     </service>
>
> However the incoming mails are not being processed and i am getting these
> errors:
>
> 2007-04-20 12:44:03,137 (Thread-0) [      EmailServices.java:743:INFO ]
> Processing Incoming Email message from: Rohit Sureka <rohitksureka@yy.com>
> to: ofbiz@xx.com
> 2007-04-20 12:44:03,170 (Thread-0) [      EmailServices.java:933:ERROR]
> ---- runtime exception report
> --------------------------------------------------
> Exception: java.lang.NullPointerException
> Message: null
> ---- stack trace
> ---------------------------------------------------------------
> java.lang.NullPointerException
> org.ofbiz.content.email.EmailServices.storeIncomingEmail(EmailServices.java:835)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:324)
> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:324)
> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
> java.util.TimerThread.mainLoop(Timer.java:432)
> java.util.TimerThread.run(Timer.java:382)
> --------------------------------------------------------------------------------
>
> 2007-04-20 12:44:03,171 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
> Service Error [storeIncomingEmail]:
> 2007-04-20 12:44:03,172 (Thread-0) [    TransactionUtil.java:285:WARN ]
> ---- exception report
> ----------------------------------------------------------
> [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly; this
> stack trace shows where this is happening:
> Exception: java.lang.Exception
> Message: Service Error [storeIncomingEmail]:
> ---- stack trace
> ---------------------------------------------------------------
> java.lang.Exception: Service Error [storeIncomingEmail]:
> org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:285)
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:235)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:324)
> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
> java.util.TimerThread.mainLoop(Timer.java:432)
> java.util.TimerThread.run(Timer.java:382)
> --------------------------------------------------------------------------------
>
> 2007-04-20 12:44:03,173 (Thread-0) [         UtilCommon.java:127:ERROR]
> Failed to process incoming email:
> 2007-04-20 12:44:03,173 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
> Service Error [crmsfa.processIncomingEmail]: Failed to process incoming
> email:
> 2007-04-20 12:44:03,174 (Thread-0) [    TransactionUtil.java:252:ERROR]
> ---- exception report
> ----------------------------------------------------------
> [TransactionUtil.rollback]
> Exception: java.lang.Exception
> Message: Stack Trace
> ---- stack trace
> ---------------------------------------------------------------
> java.lang.Exception: Stack Trace
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
> java.util.TimerThread.mainLoop(Timer.java:432)
> java.util.TimerThread.run(Timer.java:382)
> --------------------------------------------------------------------------------
>
> 2007-04-20 12:44:03,175 (Thread-0) [    TransactionUtil.java:262:INFO ]
> [TransactionUtil.rollback] transaction rolled back
> 2007-04-20 12:44:03,176 (Thread-0) [   ServiceMcaAction.java:60 :ERROR]
> Failed to process incoming email:
> C: QUIT
> S: +OK Logging out.
>
>
>
>
> BJ Freeman wrote:
>> could you be more specific about what you are trying to sort?
>> would this be better served as a entity view?
>>
>> Rohit Sureka sent the following on 4/20/2007 9:32 AM:
>>> Thanks for the email and i am sorry if i did not put my question
>>> properly.
>>>
>>> My real problem is configuring the service to sort emails. I have put the
>>> MCA rules in place but i am not able to configure the "sortincomingemail'
>>> service.
>>>
>>> I understand that "sortincomingemail" has to be run at regular interval
>>> to process the email sorting.
>>>
>>> Rohit
>>>
>>> BJ Freeman <bjfree@free-man.net> wrote: My previous response was aimed at
>>> sorting the communication events after
>>> they have been already loaded.
>>>
>>> to answer your question, Yes ofbiz will try to match any email to and
>>> from with those in the parties.
>>> if it can not find one of the parties, usually the from, it puts the
>>> address in comments, an marks it unknown email address.
>>>
>>>
>>> The MCA is used to filter the emails. Like:
>>>  
>>>  link tracking number to order-->
>>>    
>>>        
>>> value="QuantumViewNotify@ups.com"/>
>>>        
>>>    
>>>
>>> in the above I am rerouting the Quantum emails to a process I wrote to
>>> input the shipping tracking number into an order.
>>>
>>> If this is what you were meaning by sort then this is the mechanism to
>>> to this.
>>>
>>> you can find /framework/common/servicedef/smca_test.xml
>>>
>>>
>>> rohit2006 sent the following on 4/19/2007 10:03 PM:
>>>> i am trying to configure email sorting in ofbiz. I have followed the
>>>> documentation by Si Chen, to test it. I am assuming that if email
>>>> sorting is
>>>> correctly configured, emails will be recorded as communication event for
>>>> the
>>>> related parties. For eg. after a email is received ofbiz, will try to
>>>> match
>>>> the "to" address, with the email associated to a party, and if a match
>>>> is
>>>> found,  a communication event will be logged for the party.
>>>>
>>>> I hope that i got this right?
>>>>
>>>> I have followed the instruction as mentioned in documentation, and
>>>> everything loads fine, but when i schedule the service
>>>> storeincomingemail, i
>>>> am prompted to enter the service parameter(messageWrapper
>>>> (org.ofbiz.service.mail.MimeMessageWrapper), which i have no clue about.
>>>> i
>>>> guess this is to do something 'MimeMessageWrapper'.
>>>>
>>>> The documentation by Si Chen mentions this:
>>>>
>>>> 5. MCA services need to implement the mail processing interface, as in:
>>>>        
>>>> It uses a MimeMessageWrapper:
>>>>         MimeMessageWrapper wrapper = (MimeMessageWrapper)
>>>> context.get("messageWrapper");
>>>> MimeMessage message = wrapper.getMessage();
>>>> with methods like message.getAllRecipients(), message.getFrom(),
>>>> message.getSubject(), getAllRecipients(), getSentDate(),
>>>> getReceivedDate(),
>>>> etc.
>>>>
>>>> Currently (20060607) there is a service called “storeIncomingEmail”
>>>> which
>>>> could be used to do inbound mail sorting.  This has not been fully
>>>> tested
>>>> yet.
>>>>
>>>>
>>>> I am not sure what to insert in the service parameters.
>>>>
>>>> Do we need to create a view for email sorting, cause i think the mails
>>>> will
>>>> be visible, under the communication tab, in party manager?
>>>>
>>>> Rohit
>>>>
>>>>
>>>>
>>>> BJ Freeman wrote:
>>>>> If I understand you, you can create a view with the sorting you want.
>>>>>
>>>>> rohit2006 sent the following on 4/19/2007 4:33 AM:
>>>>>> Hi,
>>>>>>
>>>>>> I am trying configure email sorting in ofbiz and store emails as
>>>>>> communication events. I believe i have to schedule the service
>>>>>> storeIncomingEmail as a service. I tried to do that and was prompted
>>>>>> fill
>>>>>> the fields:
>>>>>>
>>>>>> Step 2: Service Parameters
>>>>>> messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper).
>>>>>>
>>>>>> I am not sure what to enter into this field, can someone please help
>>>>>> me
>>>>>> configure this. I am getting the following error in log when the
>>>>>> service
>>>>>> is
>>>>>> run
>>>>>>
>>>>>> 2007-04-19 05:22:31,302 (default-invoker-Thread-2) [        
>>>>>> JobInvoker.java:211:INFO ] Invoker: default-invoker-Thread-2 received
>>>>>> job
>>>>>> --
>>>>>> 1176985293330 from poller - org.ofbiz.service.job.JobPoller@1be4777
>>>>>> 2007-04-19 05:22:31,320 (default-invoker-Thread-2)
>>>>>> [PersistedServiceJob.java:136:INFO ]
>>>>>> org.ofbiz.service.job.PersistedServiceJob@334bfe[58369] -- Next
>>>>>> runtime:
>>>>>> -1
>>>>>> [Error] :2:12: cvc-elt.1: Cannot find the declaration of element
>>>>>> 'ofbiz-ser'.
>>>>>> 2007-04-19 05:22:31,331 (default-invoker-Thread-2) [          
>>>>>> UtilXml.java:243:DEBUG] XML Read 0.0040s: Internal Content
>>>>>> 2007-04-19 05:22:31,332 (default-invoker-Thread-2) [
>>>>>> ServiceDispatcher.java:322:ERROR]
>>>>>> ---- exception report
>>>>>> ----------------------------------------------------------
>>>>>> Incoming context (in runSync : storeIncomingEmail) does not match
>>>>>> expected
>>>>>> requirements
>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>> Message: The following required parameter is missing:
>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>> ---- stack trace
>>>>>> ---------------------------------------------------------------
>>>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>> --------------------------------------------------------------------------------
>>>>>>
>>>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>>>>> ServiceDispatcher.java:385:DEBUG] [[Sync service failed...-
>>>>>> total:0.0,since
>>>>>> last(Begin):0.0]] - 'JobDispatcher / storeIncomingEmail'
>>>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>>>>> ServiceDispatcher.java:388:ERROR]
>>>>>> ---- exception report
>>>>>> ----------------------------------------------------------
>>>>>> Service [storeIncomingEmail] threw an unexpected exception/error
>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>> Message: The following required parameter is missing:
>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>> ---- stack trace
>>>>>> ---------------------------------------------------------------
>>>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>> --------------------------------------------------------------------------------
>>>>>>
>>>>>> 2007-04-19 05:22:31,334 (default-invoker-Thread-2) [  
>>>>>> TransactionUtil.java:252:ERROR]
>>>>>> ---- exception report
>>>>>> ----------------------------------------------------------
>>>>>> [TransactionUtil.rollback]
>>>>>> Exception: java.lang.Exception
>>>>>> Message: Stack Trace
>>>>>> ---- stack trace
>>>>>> ---------------------------------------------------------------
>>>>>> java.lang.Exception: Stack Trace
>>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
>>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:391)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>> --------------------------------------------------------------------------------
>>>>>>
>>>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>>>>> TransactionUtil.java:262:INFO ] [TransactionUtil.rollback] transaction
>>>>>> rolled back
>>>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>>>>> TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not
>>>>>> committing
>>>>>> transaction, status is STATUS_NO_TRANSACTION
>>>>>> 2007-04-19 05:22:31,336 (default-invoker-Thread-2) [
>>>>>> GenericServiceJob.java:117:ERROR]
>>>>>> ---- exception report
>>>>>> ----------------------------------------------------------
>>>>>> Async-Service failed.
>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>> Message: The following required parameter is missing:
>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>> ---- stack trace
>>>>>> ---------------------------------------------------------------
>>>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>> --------------------------------------------------------------------------------
>>>>>>
>>>>>> 2007-04-19 05:22:31,342 (default-invoker-Thread-2) [      
>>>>>> SequenceUtil.java:254:INFO ] Got bank of sequenced IDs for
>>>>>> [JobSandbox];
>>>>>> curSeqId=58370, maxSeqId=58380, bankSize=10
>>>>>> 2007-04-19 05:22:31,348 (default-invoker-Thread-2)
>>>>>> [PersistedServiceJob.java:202:INFO ] Persisted Job [58369] Failed
>>>>>> Re-Scheduling : 1176985531339
>>>>>> 2007-04-19 05:22:37,711 (http-0.0.0.0-7443-Processor1) [    
>>>>>> ContextFilter.java:182:INFO ] [Request]: /webtools/control/jobList
>>>>>> 2007-04-19 05:22:37,712 (http-0.0.0.0-7443-Processor1) [    
>>>>>> ControlServlet.java:90 :INFO ] The character encoding of the request
>>>>>> is:
>>>>>> [null]. The character encoding we will use for the request and
>>>>>> response
>>>>>> is:
>>>>>> [UTF-8]
>>>>>> 2007-04-19 05:22:37,713 (http-0.0.0.0-7443-Processor1) [    
>>>>>> ControlServlet.java:126:DEBUG] [[[jobList] Servlet Starting, doing
>>>>>> setup-
>>>>>> total:0.0,since last(Begin):0.0]]
>>>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>>>>> ControlServlet.java:181:DEBUG] [[[jobList] Setup done, doing Event(s)
>>>>>> and
>>>>>> View(s)- total:0.0,since last([jobList] Servlet...):0.0]]
>>>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>>>>> RequestHandler.java:266:INFO ] [Processing Request]: jobList
>>>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>> 2007-04-19 05:22:37,715 (http-0.0.0.0-7443-Processor1) [    
>>>>>> RequestManager.java:117:INFO ] [RequestManager.getRequestAttribute]
>>>>>> Value
>>>>>> for attribute "null" of uri "jobList" not found
>>>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>>>>> RequestHandler.java:450:INFO ] [RequestHandler.doRequest]: Response is
>>>>>> a
>>>>>> view. sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>>>>> RequestHandler.java:603:INFO ] servletName=control, view=jobList
>>>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>> 2007-04-19 05:22:37,717 (http-0.0.0.0-7443-Processor1) [    
>>>>>> ScreenRenderer.java:220:INFO ] Found servlet context (application)
>>>>>> attribute
>>>>>> that conflicts with parameter name, leaving request parameter in place
>>>>>> for
>>>>>> name: _REQUEST_HANDLER_
>>>>>> 2007-04-19 05:22:37,826 (http-0.0.0.0-7443-Processor1) [
>>>>>> ModelScreenWidget.java:361:INFO ] In the include-screen tag the screen
>>>>>> name
>>>>>> was empty, ignoring include; in screen [GlobalDecorator]
>>>>>> 2007-04-19 05:22:37,857 (http-0.0.0.0-7443-Processor1) [    
>>>>>> ControlServlet.java:256:DEBUG] [[[jobList] Done rendering page,
>>>>>> Servlet
>>>>>> Finished- total:0.143,since last([jobList] Setup d...):0.143]]
>>>>>>
>>>>>>
>>>
>>>
>>>        
>>> ---------------------------------
>>> Ahhh...imagining that irresistible "new car" smell?
>>>  Check outnew cars at Yahoo! Autos.
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: what is [storeIncomingEmail.messageWrapper]?

BJ Freeman
In reply to this post by rohit
do you have a "[hidden email]" in one of the parties in ofbiz

rohit2006 sent the following on 4/20/2007 8:13 PM:

> i have changed the service to use the ofbiz service 'storeIncomingEmail', but
> that didn't help either. And as suspected by 'Guido Amarilla' i also
> included 'CC' in my test emails, but that did not work either.
>
> I can see that ofbiz reads the mail properly, but is not able to store the
> email.
>
> My javamail configuration is:
>
>     <!-- JavaMail Listener Container - Triggers MCA Rules -->
>     <!-- if delete-mail is set to true, will delete messages after fetching
> them. otherwise, will try to mark them as seen
>          mail.store.protocol supports both imap and pop3, but pop3 will not
> be able to mark messages as seen, so you would need to delete them -->
>     <!-- To use the mail listerner just uncomment and go... -->
>     <container name="javamail-container"
> class="org.ofbiz.service.mail.JavaMailContainer">
>         <property name="delegator-name" value="default"/>
>         <property name="dispatcher-name" value="JavaMailDispatcher"/>
>         <property name="run-as-user" value="system"/>
>         <property name="poll-delay" value="300000"/>
>         <property name="delete-mail" value="false"/>
>         <property name="maxSize" value="100000"/>
>         <property name="default-listener" value="store-listener">
>             <property name="mail.store.protocol" value="pop3"/>
>             <property name="mail.host" value="localhost"/>
>             <property name="mail.user" value="userID"/>
>             <property name="mail.pass" value="password"/>
>             <property name="mail.debug" value="true"/>
>         </property>
>     </container>
>    
> ERROR LOG -----------------
>
>  "2007-04-20 20:59:18,079 (Thread-0) [      EmailServices.java:743:INFO ]
> Processing Incoming Email message from: Rohit Sureka
> <[hidden email]> to: [hidden email]
> 2007-04-20 20:59:18,154 (Thread-0) [            UtilXml.java:243:DEBUG] XML
> Read 0.047s:
> file:/var/www/html/tamannaa.com/ofbiz/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml
> 2007-04-20 20:59:18,253 (Thread-0) [  ServiceDispatcher.java:459:DEBUG] Sync
> service [JavaMailDispatcher/executeFind] finished in [79] milliseconds
> 2007-04-20 20:59:18,254 (Thread-0) [  ServiceDispatcher.java:459:DEBUG] Sync
> service [JavaMailDispatcher/performFindItem] finished in [83] milliseconds
> 2007-04-20 20:59:18,272 (Thread-0) [  ServiceDispatcher.java:459:DEBUG] Sync
> service [JavaMailDispatcher/findPartyFromEmailAddress] finished in [192]
> milliseconds
> 2007-04-20 20:59:18,354 (Thread-0) [      EmailServices.java:933:ERROR]
> ---- runtime exception report
> --------------------------------------------------
> Exception: java.lang.NullPointerException
> Message: null
> ---- stack trace
> ---------------------------------------------------------------
> java.lang.NullPointerException
> org.ofbiz.content.email.EmailServices.storeIncomingEmail(EmailServices.java:835)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:324)
> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
> java.util.TimerThread.mainLoop(Timer.java:432)
> java.util.TimerThread.run(Timer.java:382)
> --------------------------------------------------------------------------------
>
> 2007-04-20 20:59:18,355 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
> Service Error [storeIncomingEmail]:
> 2007-04-20 20:59:18,356 (Thread-0) [    TransactionUtil.java:252:ERROR]
> ---- exception report
> ----------------------------------------------------------
> [TransactionUtil.rollback]
> Exception: java.lang.Exception
> Message: Stack Trace
> ---- stack trace
> ---------------------------------------------------------------
> java.lang.Exception: Stack Trace
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
> java.util.TimerThread.mainLoop(Timer.java:432)
> java.util.TimerThread.run(Timer.java:382)
> --------------------------------------------------------------------------------
>
> 2007-04-20 20:59:18,357 (Thread-0) [    TransactionUtil.java:262:INFO ]
> [TransactionUtil.rollback] transaction rolled back
> 2007-04-20 20:59:18,358 (Thread-0) [  ServiceDispatcher.java:459:DEBUG] Sync
> service [JavaMailDispatcher/storeIncomingEmail] finished in [303]
> milliseconds
> 2007-04-20 20:59:18,358 (Thread-0) [   ServiceMcaAction.java:60 :ERROR]
>
>
>
> BJ Freeman wrote:
>> what I see first is you are using the crmsfa.processIncomingEmail
>> so this is best ask in the opentaps forum.
>>
>>
>> rohit2006 sent the following on 4/20/2007 12:11 PM:
>>> i was just trying to record communication even when a email was received.
>>> I
>>> had done the MCA rules incorrectly, but i guess they are not set OK.
>>>
>>> My MCA settings are:
>>>
>>> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>        
>>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>>>     <mca mail-rule-name="processIncomingEmail">
>>>         <!-- the matching is a regular expression match against the email
>>> address.  this format seems to work for
>>>         both "[hidden email]" and "Mr. XYZ <[hidden email]>" -->
>>>         <condition-field field-name="to" operator="matches"
>>> value="[hidden email]"/>
>>>         <action service="crmsfa.processIncomingEmail" mode="sync"/>
>>>     </mca>
>>> </service-mca>
>>>
>>>
>>> The crmsfa.processincomingemail is defined as follows:
>>>
>>> <service name="crmsfa.processIncomingEmail" engine="java"
>>> location="com.opensourcestrategies.crmsfa.activities.ActivitiesServices"
>>> invoke="processIncomingEmail">
>>>         <description>Process an incoming email by calling
>>> storeIncomingEmail
>>> to create a CommunicationEvent wrapped in a WorkEffort. This WorkEffort
>>> is
>>> then
>>>             associated with the partyIdFrom of the
>>> CommunicationEvent.</description>
>>>         <attribute name="messageWrapper"
>>> type="org.ofbiz.service.mail.MimeMessageWrapper" mode="IN"/>
>>>     </service>
>>>
>>> However the incoming mails are not being processed and i am getting these
>>> errors:
>>>
>>> 2007-04-20 12:44:03,137 (Thread-0) [      EmailServices.java:743:INFO ]
>>> Processing Incoming Email message from: Rohit Sureka
>>> <[hidden email]>
>>> to: [hidden email]
>>> 2007-04-20 12:44:03,170 (Thread-0) [      EmailServices.java:933:ERROR]
>>> ---- runtime exception report
>>> --------------------------------------------------
>>> Exception: java.lang.NullPointerException
>>> Message: null
>>> ---- stack trace
>>> ---------------------------------------------------------------
>>> java.lang.NullPointerException
>>> org.ofbiz.content.email.EmailServices.storeIncomingEmail(EmailServices.java:835)
>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> java.lang.reflect.Method.invoke(Method.java:324)
>>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
>>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> java.lang.reflect.Method.invoke(Method.java:324)
>>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
>>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>> java.util.TimerThread.run(Timer.java:382)
>>> --------------------------------------------------------------------------------
>>>
>>> 2007-04-20 12:44:03,171 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
>>> Service Error [storeIncomingEmail]:
>>> 2007-04-20 12:44:03,172 (Thread-0) [    TransactionUtil.java:285:WARN ]
>>> ---- exception report
>>> ----------------------------------------------------------
>>> [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly;
>>> this
>>> stack trace shows where this is happening:
>>> Exception: java.lang.Exception
>>> Message: Service Error [storeIncomingEmail]:
>>> ---- stack trace
>>> ---------------------------------------------------------------
>>> java.lang.Exception: Service Error [storeIncomingEmail]:
>>> org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:285)
>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:235)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> java.lang.reflect.Method.invoke(Method.java:324)
>>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
>>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>> java.util.TimerThread.run(Timer.java:382)
>>> --------------------------------------------------------------------------------
>>>
>>> 2007-04-20 12:44:03,173 (Thread-0) [         UtilCommon.java:127:ERROR]
>>> Failed to process incoming email:
>>> 2007-04-20 12:44:03,173 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
>>> Service Error [crmsfa.processIncomingEmail]: Failed to process incoming
>>> email:
>>> 2007-04-20 12:44:03,174 (Thread-0) [    TransactionUtil.java:252:ERROR]
>>> ---- exception report
>>> ----------------------------------------------------------
>>> [TransactionUtil.rollback]
>>> Exception: java.lang.Exception
>>> Message: Stack Trace
>>> ---- stack trace
>>> ---------------------------------------------------------------
>>> java.lang.Exception: Stack Trace
>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>> java.util.TimerThread.run(Timer.java:382)
>>> --------------------------------------------------------------------------------
>>>
>>> 2007-04-20 12:44:03,175 (Thread-0) [    TransactionUtil.java:262:INFO ]
>>> [TransactionUtil.rollback] transaction rolled back
>>> 2007-04-20 12:44:03,176 (Thread-0) [   ServiceMcaAction.java:60 :ERROR]
>>> Failed to process incoming email:
>>> C: QUIT
>>> S: +OK Logging out.
>>>
>>>
>>>
>>>
>>> BJ Freeman wrote:
>>>> could you be more specific about what you are trying to sort?
>>>> would this be better served as a entity view?
>>>>
>>>> Rohit Sureka sent the following on 4/20/2007 9:32 AM:
>>>>> Thanks for the email and i am sorry if i did not put my question
>>>>> properly.
>>>>>
>>>>> My real problem is configuring the service to sort emails. I have put
>>>>> the
>>>>> MCA rules in place but i am not able to configure the
>>>>> "sortincomingemail'
>>>>> service.
>>>>>
>>>>> I understand that "sortincomingemail" has to be run at regular interval
>>>>> to process the email sorting.
>>>>>
>>>>> Rohit
>>>>>
>>>>> BJ Freeman <[hidden email]> wrote: My previous response was aimed
>>>>> at
>>>>> sorting the communication events after
>>>>> they have been already loaded.
>>>>>
>>>>> to answer your question, Yes ofbiz will try to match any email to and
>>>>> from with those in the parties.
>>>>> if it can not find one of the parties, usually the from, it puts the
>>>>> address in comments, an marks it unknown email address.
>>>>>
>>>>>
>>>>> The MCA is used to filter the emails. Like:
>>>>>  
>>>>>  link tracking number to order-->
>>>>>    
>>>>>        
>>>>> value="[hidden email]"/>
>>>>>        
>>>>>    
>>>>>
>>>>> in the above I am rerouting the Quantum emails to a process I wrote to
>>>>> input the shipping tracking number into an order.
>>>>>
>>>>> If this is what you were meaning by sort then this is the mechanism to
>>>>> to this.
>>>>>
>>>>> you can find /framework/common/servicedef/smca_test.xml
>>>>>
>>>>>
>>>>> rohit2006 sent the following on 4/19/2007 10:03 PM:
>>>>>> i am trying to configure email sorting in ofbiz. I have followed the
>>>>>> documentation by Si Chen, to test it. I am assuming that if email
>>>>>> sorting is
>>>>>> correctly configured, emails will be recorded as communication event
>>>>>> for
>>>>>> the
>>>>>> related parties. For eg. after a email is received ofbiz, will try to
>>>>>> match
>>>>>> the "to" address, with the email associated to a party, and if a match
>>>>>> is
>>>>>> found,  a communication event will be logged for the party.
>>>>>>
>>>>>> I hope that i got this right?
>>>>>>
>>>>>> I have followed the instruction as mentioned in documentation, and
>>>>>> everything loads fine, but when i schedule the service
>>>>>> storeincomingemail, i
>>>>>> am prompted to enter the service parameter(messageWrapper
>>>>>> (org.ofbiz.service.mail.MimeMessageWrapper), which i have no clue
>>>>>> about.
>>>>>> i
>>>>>> guess this is to do something 'MimeMessageWrapper'.
>>>>>>
>>>>>> The documentation by Si Chen mentions this:
>>>>>>
>>>>>> 5. MCA services need to implement the mail processing interface, as
>>>>>> in:
>>>>>>        
>>>>>> It uses a MimeMessageWrapper:
>>>>>>         MimeMessageWrapper wrapper = (MimeMessageWrapper)
>>>>>> context.get("messageWrapper");
>>>>>> MimeMessage message = wrapper.getMessage();
>>>>>> with methods like message.getAllRecipients(), message.getFrom(),
>>>>>> message.getSubject(), getAllRecipients(), getSentDate(),
>>>>>> getReceivedDate(),
>>>>>> etc.
>>>>>>
>>>>>> Currently (20060607) there is a service called
>>>>>> “storeIncomingEmail”
>>>>>> which
>>>>>> could be used to do inbound mail sorting.  This has not been fully
>>>>>> tested
>>>>>> yet.
>>>>>>
>>>>>>
>>>>>> I am not sure what to insert in the service parameters.
>>>>>>
>>>>>> Do we need to create a view for email sorting, cause i think the mails
>>>>>> will
>>>>>> be visible, under the communication tab, in party manager?
>>>>>>
>>>>>> Rohit
>>>>>>
>>>>>>
>>>>>>
>>>>>> BJ Freeman wrote:
>>>>>>> If I understand you, you can create a view with the sorting you want.
>>>>>>>
>>>>>>> rohit2006 sent the following on 4/19/2007 4:33 AM:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I am trying configure email sorting in ofbiz and store emails as
>>>>>>>> communication events. I believe i have to schedule the service
>>>>>>>> storeIncomingEmail as a service. I tried to do that and was prompted
>>>>>>>> fill
>>>>>>>> the fields:
>>>>>>>>
>>>>>>>> Step 2: Service Parameters
>>>>>>>> messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper).
>>>>>>>>
>>>>>>>> I am not sure what to enter into this field, can someone please help
>>>>>>>> me
>>>>>>>> configure this. I am getting the following error in log when the
>>>>>>>> service
>>>>>>>> is
>>>>>>>> run
>>>>>>>>
>>>>>>>> 2007-04-19 05:22:31,302 (default-invoker-Thread-2) [        
>>>>>>>> JobInvoker.java:211:INFO ] Invoker: default-invoker-Thread-2
>>>>>>>> received
>>>>>>>> job
>>>>>>>> --
>>>>>>>> 1176985293330 from poller - org.ofbiz.service.job.JobPoller@1be4777
>>>>>>>> 2007-04-19 05:22:31,320 (default-invoker-Thread-2)
>>>>>>>> [PersistedServiceJob.java:136:INFO ]
>>>>>>>> org.ofbiz.service.job.PersistedServiceJob@334bfe[58369] -- Next
>>>>>>>> runtime:
>>>>>>>> -1
>>>>>>>> [Error] :2:12: cvc-elt.1: Cannot find the declaration of element
>>>>>>>> 'ofbiz-ser'.
>>>>>>>> 2007-04-19 05:22:31,331 (default-invoker-Thread-2) [          
>>>>>>>> UtilXml.java:243:DEBUG] XML Read 0.0040s: Internal Content
>>>>>>>> 2007-04-19 05:22:31,332 (default-invoker-Thread-2) [
>>>>>>>> ServiceDispatcher.java:322:ERROR]
>>>>>>>> ---- exception report
>>>>>>>> ----------------------------------------------------------
>>>>>>>> Incoming context (in runSync : storeIncomingEmail) does not match
>>>>>>>> expected
>>>>>>>> requirements
>>>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>>>> Message: The following required parameter is missing:
>>>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>>>> ---- stack trace
>>>>>>>> ---------------------------------------------------------------
>>>>>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>
>>>>>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>>>>>>> ServiceDispatcher.java:385:DEBUG] [[Sync service failed...-
>>>>>>>> total:0.0,since
>>>>>>>> last(Begin):0.0]] - 'JobDispatcher / storeIncomingEmail'
>>>>>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>>>>>>> ServiceDispatcher.java:388:ERROR]
>>>>>>>> ---- exception report
>>>>>>>> ----------------------------------------------------------
>>>>>>>> Service [storeIncomingEmail] threw an unexpected exception/error
>>>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>>>> Message: The following required parameter is missing:
>>>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>>>> ---- stack trace
>>>>>>>> ---------------------------------------------------------------
>>>>>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>
>>>>>>>> 2007-04-19 05:22:31,334 (default-invoker-Thread-2) [  
>>>>>>>> TransactionUtil.java:252:ERROR]
>>>>>>>> ---- exception report
>>>>>>>> ----------------------------------------------------------
>>>>>>>> [TransactionUtil.rollback]
>>>>>>>> Exception: java.lang.Exception
>>>>>>>> Message: Stack Trace
>>>>>>>> ---- stack trace
>>>>>>>> ---------------------------------------------------------------
>>>>>>>> java.lang.Exception: Stack Trace
>>>>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
>>>>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:391)
>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>
>>>>>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>>>>>>> TransactionUtil.java:262:INFO ] [TransactionUtil.rollback]
>>>>>>>> transaction
>>>>>>>> rolled back
>>>>>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>>>>>>> TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not
>>>>>>>> committing
>>>>>>>> transaction, status is STATUS_NO_TRANSACTION
>>>>>>>> 2007-04-19 05:22:31,336 (default-invoker-Thread-2) [
>>>>>>>> GenericServiceJob.java:117:ERROR]
>>>>>>>> ---- exception report
>>>>>>>> ----------------------------------------------------------
>>>>>>>> Async-Service failed.
>>>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>>>> Message: The following required parameter is missing:
>>>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>>>> ---- stack trace
>>>>>>>> ---------------------------------------------------------------
>>>>>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>
>>>>>>>> 2007-04-19 05:22:31,342 (default-invoker-Thread-2) [      
>>>>>>>> SequenceUtil.java:254:INFO ] Got bank of sequenced IDs for
>>>>>>>> [JobSandbox];
>>>>>>>> curSeqId=58370, maxSeqId=58380, bankSize=10
>>>>>>>> 2007-04-19 05:22:31,348 (default-invoker-Thread-2)
>>>>>>>> [PersistedServiceJob.java:202:INFO ] Persisted Job [58369] Failed
>>>>>>>> Re-Scheduling : 1176985531339
>>>>>>>> 2007-04-19 05:22:37,711 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>> ContextFilter.java:182:INFO ] [Request]: /webtools/control/jobList
>>>>>>>> 2007-04-19 05:22:37,712 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>> ControlServlet.java:90 :INFO ] The character encoding of the request
>>>>>>>> is:
>>>>>>>> [null]. The character encoding we will use for the request and
>>>>>>>> response
>>>>>>>> is:
>>>>>>>> [UTF-8]
>>>>>>>> 2007-04-19 05:22:37,713 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>> ControlServlet.java:126:DEBUG] [[[jobList] Servlet Starting, doing
>>>>>>>> setup-
>>>>>>>> total:0.0,since last(Begin):0.0]]
>>>>>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>> ControlServlet.java:181:DEBUG] [[[jobList] Setup done, doing
>>>>>>>> Event(s)
>>>>>>>> and
>>>>>>>> View(s)- total:0.0,since last([jobList] Servlet...):0.0]]
>>>>>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>> RequestHandler.java:266:INFO ] [Processing Request]: jobList
>>>>>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>>>> 2007-04-19 05:22:37,715 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>> RequestManager.java:117:INFO ] [RequestManager.getRequestAttribute]
>>>>>>>> Value
>>>>>>>> for attribute "null" of uri "jobList" not found
>>>>>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>> RequestHandler.java:450:INFO ] [RequestHandler.doRequest]: Response
>>>>>>>> is
>>>>>>>> a
>>>>>>>> view. sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>> RequestHandler.java:603:INFO ] servletName=control, view=jobList
>>>>>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>>>> 2007-04-19 05:22:37,717 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>> ScreenRenderer.java:220:INFO ] Found servlet context (application)
>>>>>>>> attribute
>>>>>>>> that conflicts with parameter name, leaving request parameter in
>>>>>>>> place
>>>>>>>> for
>>>>>>>> name: _REQUEST_HANDLER_
>>>>>>>> 2007-04-19 05:22:37,826 (http-0.0.0.0-7443-Processor1) [
>>>>>>>> ModelScreenWidget.java:361:INFO ] In the include-screen tag the
>>>>>>>> screen
>>>>>>>> name
>>>>>>>> was empty, ignoring include; in screen [GlobalDecorator]
>>>>>>>> 2007-04-19 05:22:37,857 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>> ControlServlet.java:256:DEBUG] [[[jobList] Done rendering page,
>>>>>>>> Servlet
>>>>>>>> Finished- total:0.143,since last([jobList] Setup d...):0.143]]
>>>>>>>>
>>>>>>>>
>>>>>
>>>>>        
>>>>> ---------------------------------
>>>>> Ahhh...imagining that irresistible "new car" smell?
>>>>>  Check outnew cars at Yahoo! Autos.
>>>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: what is [storeIncomingEmail.messageWrapper]?

rohit
Yes, i have added ofbiz@xx.com as email address of one of the parties.

BJ Freeman wrote
do you have a "ofbiz@xx.com" in one of the parties in ofbiz

rohit2006 sent the following on 4/20/2007 8:13 PM:
> i have changed the service to use the ofbiz service 'storeIncomingEmail', but
> that didn't help either. And as suspected by 'Guido Amarilla' i also
> included 'CC' in my test emails, but that did not work either.
>
> I can see that ofbiz reads the mail properly, but is not able to store the
> email.
>
> My javamail configuration is:
>
>    
>    
>    
>     <container name="javamail-container"
> class="org.ofbiz.service.mail.JavaMailContainer">
>         <property name="delegator-name" value="default"/>
>         <property name="dispatcher-name" value="JavaMailDispatcher"/>
>         <property name="run-as-user" value="system"/>
>         <property name="poll-delay" value="300000"/>
>         <property name="delete-mail" value="false"/>
>         <property name="maxSize" value="100000"/>
>         <property name="default-listener" value="store-listener">
>             <property name="mail.store.protocol" value="pop3"/>
>             <property name="mail.host" value="localhost"/>
>             <property name="mail.user" value="userID"/>
>             <property name="mail.pass" value="password"/>
>             <property name="mail.debug" value="true"/>
>         </property>
>     </container>
>    
> ERROR LOG -----------------
>
>  "2007-04-20 20:59:18,079 (Thread-0) [      EmailServices.java:743:INFO ]
> Processing Incoming Email message from: Rohit Sureka
> <rohitksureka@gmail.com> to: ofbiz@xx.com
> 2007-04-20 20:59:18,154 (Thread-0) [            UtilXml.java:243:DEBUG] XML
> Read 0.047s:
> /ofbiz/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml
> 2007-04-20 20:59:18,253 (Thread-0) [  ServiceDispatcher.java:459:DEBUG] Sync
> service [JavaMailDispatcher/executeFind] finished in [79] milliseconds
> 2007-04-20 20:59:18,254 (Thread-0) [  ServiceDispatcher.java:459:DEBUG] Sync
> service [JavaMailDispatcher/performFindItem] finished in [83] milliseconds
> 2007-04-20 20:59:18,272 (Thread-0) [  ServiceDispatcher.java:459:DEBUG] Sync
> service [JavaMailDispatcher/findPartyFromEmailAddress] finished in [192]
> milliseconds
> 2007-04-20 20:59:18,354 (Thread-0) [      EmailServices.java:933:ERROR]
> ---- runtime exception report
> --------------------------------------------------
> Exception: java.lang.NullPointerException
> Message: null
> ---- stack trace
> ---------------------------------------------------------------
> java.lang.NullPointerException
> org.ofbiz.content.email.EmailServices.storeIncomingEmail(EmailServices.java:835)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:324)
> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
> java.util.TimerThread.mainLoop(Timer.java:432)
> java.util.TimerThread.run(Timer.java:382)
> --------------------------------------------------------------------------------
>
> 2007-04-20 20:59:18,355 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
> Service Error [storeIncomingEmail]:
> 2007-04-20 20:59:18,356 (Thread-0) [    TransactionUtil.java:252:ERROR]
> ---- exception report
> ----------------------------------------------------------
> [TransactionUtil.rollback]
> Exception: java.lang.Exception
> Message: Stack Trace
> ---- stack trace
> ---------------------------------------------------------------
> java.lang.Exception: Stack Trace
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
> java.util.TimerThread.mainLoop(Timer.java:432)
> java.util.TimerThread.run(Timer.java:382)
> --------------------------------------------------------------------------------
>
> 2007-04-20 20:59:18,357 (Thread-0) [    TransactionUtil.java:262:INFO ]
> [TransactionUtil.rollback] transaction rolled back
> 2007-04-20 20:59:18,358 (Thread-0) [  ServiceDispatcher.java:459:DEBUG] Sync
> service [JavaMailDispatcher/storeIncomingEmail] finished in [303]
> milliseconds
> 2007-04-20 20:59:18,358 (Thread-0) [   ServiceMcaAction.java:60 :ERROR]
>
>
>
> BJ Freeman wrote:
>> what I see first is you are using the crmsfa.processIncomingEmail
>> so this is best ask in the opentaps forum.
>>
>>
>> rohit2006 sent the following on 4/20/2007 12:11 PM:
>>> i was just trying to record communication even when a email was received.
>>> I
>>> had done the MCA rules incorrectly, but i guess they are not set OK.
>>>
>>> My MCA settings are:
>>>
>>> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>        
>>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>>>     <mca mail-rule-name="processIncomingEmail">
>>>        
>>>         <condition-field field-name="to" operator="matches"
>>> value="ofbiz@xx.com"/>
>>>         <action service="crmsfa.processIncomingEmail" mode="sync"/>
>>>     </mca>
>>> </service-mca>
>>>
>>>
>>> The crmsfa.processincomingemail is defined as follows:
>>>
>>> <service name="crmsfa.processIncomingEmail" engine="java"
>>> location="com.opensourcestrategies.crmsfa.activities.ActivitiesServices"
>>> invoke="processIncomingEmail">
>>>         <description>Process an incoming email by calling
>>> storeIncomingEmail
>>> to create a CommunicationEvent wrapped in a WorkEffort. This WorkEffort
>>> is
>>> then
>>>             associated with the partyIdFrom of the
>>> CommunicationEvent.</description>
>>>         <attribute name="messageWrapper"
>>> type="org.ofbiz.service.mail.MimeMessageWrapper" mode="IN"/>
>>>     </service>
>>>
>>> However the incoming mails are not being processed and i am getting these
>>> errors:
>>>
>>> 2007-04-20 12:44:03,137 (Thread-0) [      EmailServices.java:743:INFO ]
>>> Processing Incoming Email message from: Rohit Sureka
>>> <rohitksureka@yy.com>
>>> to: ofbiz@xx.com
>>> 2007-04-20 12:44:03,170 (Thread-0) [      EmailServices.java:933:ERROR]
>>> ---- runtime exception report
>>> --------------------------------------------------
>>> Exception: java.lang.NullPointerException
>>> Message: null
>>> ---- stack trace
>>> ---------------------------------------------------------------
>>> java.lang.NullPointerException
>>> org.ofbiz.content.email.EmailServices.storeIncomingEmail(EmailServices.java:835)
>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> java.lang.reflect.Method.invoke(Method.java:324)
>>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
>>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> java.lang.reflect.Method.invoke(Method.java:324)
>>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
>>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>> java.util.TimerThread.run(Timer.java:382)
>>> --------------------------------------------------------------------------------
>>>
>>> 2007-04-20 12:44:03,171 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
>>> Service Error [storeIncomingEmail]:
>>> 2007-04-20 12:44:03,172 (Thread-0) [    TransactionUtil.java:285:WARN ]
>>> ---- exception report
>>> ----------------------------------------------------------
>>> [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly;
>>> this
>>> stack trace shows where this is happening:
>>> Exception: java.lang.Exception
>>> Message: Service Error [storeIncomingEmail]:
>>> ---- stack trace
>>> ---------------------------------------------------------------
>>> java.lang.Exception: Service Error [storeIncomingEmail]:
>>> org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:285)
>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:235)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> java.lang.reflect.Method.invoke(Method.java:324)
>>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
>>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>> java.util.TimerThread.run(Timer.java:382)
>>> --------------------------------------------------------------------------------
>>>
>>> 2007-04-20 12:44:03,173 (Thread-0) [         UtilCommon.java:127:ERROR]
>>> Failed to process incoming email:
>>> 2007-04-20 12:44:03,173 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
>>> Service Error [crmsfa.processIncomingEmail]: Failed to process incoming
>>> email:
>>> 2007-04-20 12:44:03,174 (Thread-0) [    TransactionUtil.java:252:ERROR]
>>> ---- exception report
>>> ----------------------------------------------------------
>>> [TransactionUtil.rollback]
>>> Exception: java.lang.Exception
>>> Message: Stack Trace
>>> ---- stack trace
>>> ---------------------------------------------------------------
>>> java.lang.Exception: Stack Trace
>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>> java.util.TimerThread.run(Timer.java:382)
>>> --------------------------------------------------------------------------------
>>>
>>> 2007-04-20 12:44:03,175 (Thread-0) [    TransactionUtil.java:262:INFO ]
>>> [TransactionUtil.rollback] transaction rolled back
>>> 2007-04-20 12:44:03,176 (Thread-0) [   ServiceMcaAction.java:60 :ERROR]
>>> Failed to process incoming email:
>>> C: QUIT
>>> S: +OK Logging out.
>>>
>>>
>>>
>>>
>>> BJ Freeman wrote:
>>>> could you be more specific about what you are trying to sort?
>>>> would this be better served as a entity view?
>>>>
>>>> Rohit Sureka sent the following on 4/20/2007 9:32 AM:
>>>>> Thanks for the email and i am sorry if i did not put my question
>>>>> properly.
>>>>>
>>>>> My real problem is configuring the service to sort emails. I have put
>>>>> the
>>>>> MCA rules in place but i am not able to configure the
>>>>> "sortincomingemail'
>>>>> service.
>>>>>
>>>>> I understand that "sortincomingemail" has to be run at regular interval
>>>>> to process the email sorting.
>>>>>
>>>>> Rohit
>>>>>
>>>>> BJ Freeman <bjfree@free-man.net> wrote: My previous response was aimed
>>>>> at
>>>>> sorting the communication events after
>>>>> they have been already loaded.
>>>>>
>>>>> to answer your question, Yes ofbiz will try to match any email to and
>>>>> from with those in the parties.
>>>>> if it can not find one of the parties, usually the from, it puts the
>>>>> address in comments, an marks it unknown email address.
>>>>>
>>>>>
>>>>> The MCA is used to filter the emails. Like:
>>>>>  
>>>>>  link tracking number to order-->
>>>>>    
>>>>>        
>>>>> value="QuantumViewNotify@ups.com"/>
>>>>>        
>>>>>    
>>>>>
>>>>> in the above I am rerouting the Quantum emails to a process I wrote to
>>>>> input the shipping tracking number into an order.
>>>>>
>>>>> If this is what you were meaning by sort then this is the mechanism to
>>>>> to this.
>>>>>
>>>>> you can find /framework/common/servicedef/smca_test.xml
>>>>>
>>>>>
>>>>> rohit2006 sent the following on 4/19/2007 10:03 PM:
>>>>>> i am trying to configure email sorting in ofbiz. I have followed the
>>>>>> documentation by Si Chen, to test it. I am assuming that if email
>>>>>> sorting is
>>>>>> correctly configured, emails will be recorded as communication event
>>>>>> for
>>>>>> the
>>>>>> related parties. For eg. after a email is received ofbiz, will try to
>>>>>> match
>>>>>> the "to" address, with the email associated to a party, and if a match
>>>>>> is
>>>>>> found,  a communication event will be logged for the party.
>>>>>>
>>>>>> I hope that i got this right?
>>>>>>
>>>>>> I have followed the instruction as mentioned in documentation, and
>>>>>> everything loads fine, but when i schedule the service
>>>>>> storeincomingemail, i
>>>>>> am prompted to enter the service parameter(messageWrapper
>>>>>> (org.ofbiz.service.mail.MimeMessageWrapper), which i have no clue
>>>>>> about.
>>>>>> i
>>>>>> guess this is to do something 'MimeMessageWrapper'.
>>>>>>
>>>>>> The documentation by Si Chen mentions this:
>>>>>>
>>>>>> 5. MCA services need to implement the mail processing interface, as
>>>>>> in:
>>>>>>        
>>>>>> It uses a MimeMessageWrapper:
>>>>>>         MimeMessageWrapper wrapper = (MimeMessageWrapper)
>>>>>> context.get("messageWrapper");
>>>>>> MimeMessage message = wrapper.getMessage();
>>>>>> with methods like message.getAllRecipients(), message.getFrom(),
>>>>>> message.getSubject(), getAllRecipients(), getSentDate(),
>>>>>> getReceivedDate(),
>>>>>> etc.
>>>>>>
>>>>>> Currently (20060607) there is a service called
>>>>>> “storeIncomingEmail”
>>>>>> which
>>>>>> could be used to do inbound mail sorting.  This has not been fully
>>>>>> tested
>>>>>> yet.
>>>>>>
>>>>>>
>>>>>> I am not sure what to insert in the service parameters.
>>>>>>
>>>>>> Do we need to create a view for email sorting, cause i think the mails
>>>>>> will
>>>>>> be visible, under the communication tab, in party manager?
>>>>>>
>>>>>> Rohit
>>>>>>
>>>>>>
>>>>>>
>>>>>> BJ Freeman wrote:
>>>>>>> If I understand you, you can create a view with the sorting you want.
>>>>>>>
>>>>>>> rohit2006 sent the following on 4/19/2007 4:33 AM:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I am trying configure email sorting in ofbiz and store emails as
>>>>>>>> communication events. I believe i have to schedule the service
>>>>>>>> storeIncomingEmail as a service. I tried to do that and was prompted
>>>>>>>> fill
>>>>>>>> the fields:
>>>>>>>>
>>>>>>>> Step 2: Service Parameters
>>>>>>>> messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper).
>>>>>>>>
>>>>>>>> I am not sure what to enter into this field, can someone please help
>>>>>>>> me
>>>>>>>> configure this. I am getting the following error in log when the
>>>>>>>> service
>>>>>>>> is
>>>>>>>> run
>>>>>>>>
>>>>>>>> 2007-04-19 05:22:31,302 (default-invoker-Thread-2) [        
>>>>>>>> JobInvoker.java:211:INFO ] Invoker: default-invoker-Thread-2
>>>>>>>> received
>>>>>>>> job
>>>>>>>> --
>>>>>>>> 1176985293330 from poller - org.ofbiz.service.job.JobPoller@1be4777
>>>>>>>> 2007-04-19 05:22:31,320 (default-invoker-Thread-2)
>>>>>>>> [PersistedServiceJob.java:136:INFO ]
>>>>>>>> org.ofbiz.service.job.PersistedServiceJob@334bfe[58369] -- Next
>>>>>>>> runtime:
>>>>>>>> -1
>>>>>>>> [Error] :2:12: cvc-elt.1: Cannot find the declaration of element
>>>>>>>> 'ofbiz-ser'.
>>>>>>>> 2007-04-19 05:22:31,331 (default-invoker-Thread-2) [          
>>>>>>>> UtilXml.java:243:DEBUG] XML Read 0.0040s: Internal Content
>>>>>>>> 2007-04-19 05:22:31,332 (default-invoker-Thread-2) [
>>>>>>>> ServiceDispatcher.java:322:ERROR]
>>>>>>>> ---- exception report
>>>>>>>> ----------------------------------------------------------
>>>>>>>> Incoming context (in runSync : storeIncomingEmail) does not match
>>>>>>>> expected
>>>>>>>> requirements
>>>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>>>> Message: The following required parameter is missing:
>>>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>>>> ---- stack trace
>>>>>>>> ---------------------------------------------------------------
>>>>>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>
>>>>>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>>>>>>> ServiceDispatcher.java:385:DEBUG] [[Sync service failed...-
>>>>>>>> total:0.0,since
>>>>>>>> last(Begin):0.0]] - 'JobDispatcher / storeIncomingEmail'
>>>>>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>>>>>>> ServiceDispatcher.java:388:ERROR]
>>>>>>>> ---- exception report
>>>>>>>> ----------------------------------------------------------
>>>>>>>> Service [storeIncomingEmail] threw an unexpected exception/error
>>>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>>>> Message: The following required parameter is missing:
>>>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>>>> ---- stack trace
>>>>>>>> ---------------------------------------------------------------
>>>>>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>
>>>>>>>> 2007-04-19 05:22:31,334 (default-invoker-Thread-2) [  
>>>>>>>> TransactionUtil.java:252:ERROR]
>>>>>>>> ---- exception report
>>>>>>>> ----------------------------------------------------------
>>>>>>>> [TransactionUtil.rollback]
>>>>>>>> Exception: java.lang.Exception
>>>>>>>> Message: Stack Trace
>>>>>>>> ---- stack trace
>>>>>>>> ---------------------------------------------------------------
>>>>>>>> java.lang.Exception: Stack Trace
>>>>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
>>>>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:391)
>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>
>>>>>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>>>>>>> TransactionUtil.java:262:INFO ] [TransactionUtil.rollback]
>>>>>>>> transaction
>>>>>>>> rolled back
>>>>>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>>>>>>> TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not
>>>>>>>> committing
>>>>>>>> transaction, status is STATUS_NO_TRANSACTION
>>>>>>>> 2007-04-19 05:22:31,336 (default-invoker-Thread-2) [
>>>>>>>> GenericServiceJob.java:117:ERROR]
>>>>>>>> ---- exception report
>>>>>>>> ----------------------------------------------------------
>>>>>>>> Async-Service failed.
>>>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>>>> Message: The following required parameter is missing:
>>>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>>>> ---- stack trace
>>>>>>>> ---------------------------------------------------------------
>>>>>>>> org.ofbiz.service.ServiceValidationException: The following required
>>>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>
>>>>>>>> 2007-04-19 05:22:31,342 (default-invoker-Thread-2) [      
>>>>>>>> SequenceUtil.java:254:INFO ] Got bank of sequenced IDs for
>>>>>>>> [JobSandbox];
>>>>>>>> curSeqId=58370, maxSeqId=58380, bankSize=10
>>>>>>>> 2007-04-19 05:22:31,348 (default-invoker-Thread-2)
>>>>>>>> [PersistedServiceJob.java:202:INFO ] Persisted Job [58369] Failed
>>>>>>>> Re-Scheduling : 1176985531339
>>>>>>>> 2007-04-19 05:22:37,711 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>> ContextFilter.java:182:INFO ] [Request]: /webtools/control/jobList
>>>>>>>> 2007-04-19 05:22:37,712 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>> ControlServlet.java:90 :INFO ] The character encoding of the request
>>>>>>>> is:
>>>>>>>> [null]. The character encoding we will use for the request and
>>>>>>>> response
>>>>>>>> is:
>>>>>>>> [UTF-8]
>>>>>>>> 2007-04-19 05:22:37,713 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>> ControlServlet.java:126:DEBUG] [[[jobList] Servlet Starting, doing
>>>>>>>> setup-
>>>>>>>> total:0.0,since last(Begin):0.0]]
>>>>>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>> ControlServlet.java:181:DEBUG] [[[jobList] Setup done, doing
>>>>>>>> Event(s)
>>>>>>>> and
>>>>>>>> View(s)- total:0.0,since last([jobList] Servlet...):0.0]]
>>>>>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>> RequestHandler.java:266:INFO ] [Processing Request]: jobList
>>>>>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>>>> 2007-04-19 05:22:37,715 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>> RequestManager.java:117:INFO ] [RequestManager.getRequestAttribute]
>>>>>>>> Value
>>>>>>>> for attribute "null" of uri "jobList" not found
>>>>>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>> RequestHandler.java:450:INFO ] [RequestHandler.doRequest]: Response
>>>>>>>> is
>>>>>>>> a
>>>>>>>> view. sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>> RequestHandler.java:603:INFO ] servletName=control, view=jobList
>>>>>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>>>> 2007-04-19 05:22:37,717 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>> ScreenRenderer.java:220:INFO ] Found servlet context (application)
>>>>>>>> attribute
>>>>>>>> that conflicts with parameter name, leaving request parameter in
>>>>>>>> place
>>>>>>>> for
>>>>>>>> name: _REQUEST_HANDLER_
>>>>>>>> 2007-04-19 05:22:37,826 (http-0.0.0.0-7443-Processor1) [
>>>>>>>> ModelScreenWidget.java:361:INFO ] In the include-screen tag the
>>>>>>>> screen
>>>>>>>> name
>>>>>>>> was empty, ignoring include; in screen [GlobalDecorator]
>>>>>>>> 2007-04-19 05:22:37,857 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>> ControlServlet.java:256:DEBUG] [[[jobList] Done rendering page,
>>>>>>>> Servlet
>>>>>>>> Finished- total:0.143,since last([jobList] Setup d...):0.143]]
>>>>>>>>
>>>>>>>>
>>>>>
>>>>>        
>>>>> ---------------------------------
>>>>> Ahhh...imagining that irresistible "new car" smell?
>>>>>  Check outnew cars at Yahoo! Autos.
>>>>
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: what is [storeIncomingEmail.messageWrapper]?

BJ Freeman
org.ofbiz.content.email.EmailServices.storeIncomingEmail(EmailServices.java:835)
I am using the version for a few weeks ago.
EmailServices.java:835 code refers to Content type.

I vaguely remember putting in some code to have this fixed.
just have to find the patch.



rohit2006 sent the following on 4/21/2007 12:24 AM:

> Yes, i have added [hidden email] as email address of one of the parties.
>
>
> BJ Freeman wrote:
>> do you have a "[hidden email]" in one of the parties in ofbiz
>>
>> rohit2006 sent the following on 4/20/2007 8:13 PM:
>>> i have changed the service to use the ofbiz service 'storeIncomingEmail',
>>> but
>>> that didn't help either. And as suspected by 'Guido Amarilla' i also
>>> included 'CC' in my test emails, but that did not work either.
>>>
>>> I can see that ofbiz reads the mail properly, but is not able to store
>>> the
>>> email.
>>>
>>> My javamail configuration is:
>>>
>>>     <!-- JavaMail Listener Container - Triggers MCA Rules -->
>>>     <!-- if delete-mail is set to true, will delete messages after
>>> fetching
>>> them. otherwise, will try to mark them as seen
>>>          mail.store.protocol supports both imap and pop3, but pop3 will
>>> not
>>> be able to mark messages as seen, so you would need to delete them -->
>>>     <!-- To use the mail listerner just uncomment and go... -->
>>>     <container name="javamail-container"
>>> class="org.ofbiz.service.mail.JavaMailContainer">
>>>         <property name="delegator-name" value="default"/>
>>>         <property name="dispatcher-name" value="JavaMailDispatcher"/>
>>>         <property name="run-as-user" value="system"/>
>>>         <property name="poll-delay" value="300000"/>
>>>         <property name="delete-mail" value="false"/>
>>>         <property name="maxSize" value="100000"/>
>>>         <property name="default-listener" value="store-listener">
>>>             <property name="mail.store.protocol" value="pop3"/>
>>>             <property name="mail.host" value="localhost"/>
>>>             <property name="mail.user" value="userID"/>
>>>             <property name="mail.pass" value="password"/>
>>>             <property name="mail.debug" value="true"/>
>>>         </property>
>>>     </container>
>>>    
>>> ERROR LOG -----------------
>>>
>>>  "2007-04-20 20:59:18,079 (Thread-0) [      EmailServices.java:743:INFO ]
>>> Processing Incoming Email message from: Rohit Sureka
>>> <[hidden email]> to: [hidden email]
>>> 2007-04-20 20:59:18,154 (Thread-0) [            UtilXml.java:243:DEBUG]
>>> XML
>>> Read 0.047s:
>>> /ofbiz/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml
>>> 2007-04-20 20:59:18,253 (Thread-0) [  ServiceDispatcher.java:459:DEBUG]
>>> Sync
>>> service [JavaMailDispatcher/executeFind] finished in [79] milliseconds
>>> 2007-04-20 20:59:18,254 (Thread-0) [  ServiceDispatcher.java:459:DEBUG]
>>> Sync
>>> service [JavaMailDispatcher/performFindItem] finished in [83]
>>> milliseconds
>>> 2007-04-20 20:59:18,272 (Thread-0) [  ServiceDispatcher.java:459:DEBUG]
>>> Sync
>>> service [JavaMailDispatcher/findPartyFromEmailAddress] finished in [192]
>>> milliseconds
>>> 2007-04-20 20:59:18,354 (Thread-0) [      EmailServices.java:933:ERROR]
>>> ---- runtime exception report
>>> --------------------------------------------------
>>> Exception: java.lang.NullPointerException
>>> Message: null
>>> ---- stack trace
>>> ---------------------------------------------------------------
>>> java.lang.NullPointerException
>>> org.ofbiz.content.email.EmailServices.storeIncomingEmail(EmailServices.java:835)
>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> java.lang.reflect.Method.invoke(Method.java:324)
>>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
>>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>> java.util.TimerThread.run(Timer.java:382)
>>> --------------------------------------------------------------------------------
>>>
>>> 2007-04-20 20:59:18,355 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
>>> Service Error [storeIncomingEmail]:
>>> 2007-04-20 20:59:18,356 (Thread-0) [    TransactionUtil.java:252:ERROR]
>>> ---- exception report
>>> ----------------------------------------------------------
>>> [TransactionUtil.rollback]
>>> Exception: java.lang.Exception
>>> Message: Stack Trace
>>> ---- stack trace
>>> ---------------------------------------------------------------
>>> java.lang.Exception: Stack Trace
>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>> java.util.TimerThread.run(Timer.java:382)
>>> --------------------------------------------------------------------------------
>>>
>>> 2007-04-20 20:59:18,357 (Thread-0) [    TransactionUtil.java:262:INFO ]
>>> [TransactionUtil.rollback] transaction rolled back
>>> 2007-04-20 20:59:18,358 (Thread-0) [  ServiceDispatcher.java:459:DEBUG]
>>> Sync
>>> service [JavaMailDispatcher/storeIncomingEmail] finished in [303]
>>> milliseconds
>>> 2007-04-20 20:59:18,358 (Thread-0) [   ServiceMcaAction.java:60 :ERROR]
>>>
>>>
>>>
>>> BJ Freeman wrote:
>>>> what I see first is you are using the crmsfa.processIncomingEmail
>>>> so this is best ask in the opentaps forum.
>>>>
>>>>
>>>> rohit2006 sent the following on 4/20/2007 12:11 PM:
>>>>> i was just trying to record communication even when a email was
>>>>> received.
>>>>> I
>>>>> had done the MCA rules incorrectly, but i guess they are not set OK.
>>>>>
>>>>> My MCA settings are:
>>>>>
>>>>> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>        
>>>>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>>>>>     <mca mail-rule-name="processIncomingEmail">
>>>>>         <!-- the matching is a regular expression match against the
>>>>> email
>>>>> address.  this format seems to work for
>>>>>         both "[hidden email]" and "Mr. XYZ <[hidden email]>" -->
>>>>>         <condition-field field-name="to" operator="matches"
>>>>> value="[hidden email]"/>
>>>>>         <action service="crmsfa.processIncomingEmail" mode="sync"/>
>>>>>     </mca>
>>>>> </service-mca>
>>>>>
>>>>>
>>>>> The crmsfa.processincomingemail is defined as follows:
>>>>>
>>>>> <service name="crmsfa.processIncomingEmail" engine="java"
>>>>> location="com.opensourcestrategies.crmsfa.activities.ActivitiesServices"
>>>>> invoke="processIncomingEmail">
>>>>>         <description>Process an incoming email by calling
>>>>> storeIncomingEmail
>>>>> to create a CommunicationEvent wrapped in a WorkEffort. This WorkEffort
>>>>> is
>>>>> then
>>>>>             associated with the partyIdFrom of the
>>>>> CommunicationEvent.</description>
>>>>>         <attribute name="messageWrapper"
>>>>> type="org.ofbiz.service.mail.MimeMessageWrapper" mode="IN"/>
>>>>>     </service>
>>>>>
>>>>> However the incoming mails are not being processed and i am getting
>>>>> these
>>>>> errors:
>>>>>
>>>>> 2007-04-20 12:44:03,137 (Thread-0) [      EmailServices.java:743:INFO ]
>>>>> Processing Incoming Email message from: Rohit Sureka
>>>>> <[hidden email]>
>>>>> to: [hidden email]
>>>>> 2007-04-20 12:44:03,170 (Thread-0) [      EmailServices.java:933:ERROR]
>>>>> ---- runtime exception report
>>>>> --------------------------------------------------
>>>>> Exception: java.lang.NullPointerException
>>>>> Message: null
>>>>> ---- stack trace
>>>>> ---------------------------------------------------------------
>>>>> java.lang.NullPointerException
>>>>> org.ofbiz.content.email.EmailServices.storeIncomingEmail(EmailServices.java:835)
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>> java.lang.reflect.Method.invoke(Method.java:324)
>>>>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
>>>>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>> com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>> java.lang.reflect.Method.invoke(Method.java:324)
>>>>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
>>>>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>>>> java.util.TimerThread.run(Timer.java:382)
>>>>> --------------------------------------------------------------------------------
>>>>>
>>>>> 2007-04-20 12:44:03,171 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
>>>>> Service Error [storeIncomingEmail]:
>>>>> 2007-04-20 12:44:03,172 (Thread-0) [    TransactionUtil.java:285:WARN ]
>>>>> ---- exception report
>>>>> ----------------------------------------------------------
>>>>> [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly;
>>>>> this
>>>>> stack trace shows where this is happening:
>>>>> Exception: java.lang.Exception
>>>>> Message: Service Error [storeIncomingEmail]:
>>>>> ---- stack trace
>>>>> ---------------------------------------------------------------
>>>>> java.lang.Exception: Service Error [storeIncomingEmail]:
>>>>> org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:285)
>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:235)
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>> com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>> java.lang.reflect.Method.invoke(Method.java:324)
>>>>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
>>>>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>>>> java.util.TimerThread.run(Timer.java:382)
>>>>> --------------------------------------------------------------------------------
>>>>>
>>>>> 2007-04-20 12:44:03,173 (Thread-0) [         UtilCommon.java:127:ERROR]
>>>>> Failed to process incoming email:
>>>>> 2007-04-20 12:44:03,173 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
>>>>> Service Error [crmsfa.processIncomingEmail]: Failed to process incoming
>>>>> email:
>>>>> 2007-04-20 12:44:03,174 (Thread-0) [    TransactionUtil.java:252:ERROR]
>>>>> ---- exception report
>>>>> ----------------------------------------------------------
>>>>> [TransactionUtil.rollback]
>>>>> Exception: java.lang.Exception
>>>>> Message: Stack Trace
>>>>> ---- stack trace
>>>>> ---------------------------------------------------------------
>>>>> java.lang.Exception: Stack Trace
>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>>>> java.util.TimerThread.run(Timer.java:382)
>>>>> --------------------------------------------------------------------------------
>>>>>
>>>>> 2007-04-20 12:44:03,175 (Thread-0) [    TransactionUtil.java:262:INFO ]
>>>>> [TransactionUtil.rollback] transaction rolled back
>>>>> 2007-04-20 12:44:03,176 (Thread-0) [   ServiceMcaAction.java:60 :ERROR]
>>>>> Failed to process incoming email:
>>>>> C: QUIT
>>>>> S: +OK Logging out.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> BJ Freeman wrote:
>>>>>> could you be more specific about what you are trying to sort?
>>>>>> would this be better served as a entity view?
>>>>>>
>>>>>> Rohit Sureka sent the following on 4/20/2007 9:32 AM:
>>>>>>> Thanks for the email and i am sorry if i did not put my question
>>>>>>> properly.
>>>>>>>
>>>>>>> My real problem is configuring the service to sort emails. I have put
>>>>>>> the
>>>>>>> MCA rules in place but i am not able to configure the
>>>>>>> "sortincomingemail'
>>>>>>> service.
>>>>>>>
>>>>>>> I understand that "sortincomingemail" has to be run at regular
>>>>>>> interval
>>>>>>> to process the email sorting.
>>>>>>>
>>>>>>> Rohit
>>>>>>>
>>>>>>> BJ Freeman <[hidden email]> wrote: My previous response was
>>>>>>> aimed
>>>>>>> at
>>>>>>> sorting the communication events after
>>>>>>> they have been already loaded.
>>>>>>>
>>>>>>> to answer your question, Yes ofbiz will try to match any email to and
>>>>>>> from with those in the parties.
>>>>>>> if it can not find one of the parties, usually the from, it puts the
>>>>>>> address in comments, an marks it unknown email address.
>>>>>>>
>>>>>>>
>>>>>>> The MCA is used to filter the emails. Like:
>>>>>>>  
>>>>>>>  link tracking number to order-->
>>>>>>>    
>>>>>>>        
>>>>>>> value="[hidden email]"/>
>>>>>>>        
>>>>>>>    
>>>>>>>
>>>>>>> in the above I am rerouting the Quantum emails to a process I wrote
>>>>>>> to
>>>>>>> input the shipping tracking number into an order.
>>>>>>>
>>>>>>> If this is what you were meaning by sort then this is the mechanism
>>>>>>> to
>>>>>>> to this.
>>>>>>>
>>>>>>> you can find /framework/common/servicedef/smca_test.xml
>>>>>>>
>>>>>>>
>>>>>>> rohit2006 sent the following on 4/19/2007 10:03 PM:
>>>>>>>> i am trying to configure email sorting in ofbiz. I have followed the
>>>>>>>> documentation by Si Chen, to test it. I am assuming that if email
>>>>>>>> sorting is
>>>>>>>> correctly configured, emails will be recorded as communication event
>>>>>>>> for
>>>>>>>> the
>>>>>>>> related parties. For eg. after a email is received ofbiz, will try
>>>>>>>> to
>>>>>>>> match
>>>>>>>> the "to" address, with the email associated to a party, and if a
>>>>>>>> match
>>>>>>>> is
>>>>>>>> found,  a communication event will be logged for the party.
>>>>>>>>
>>>>>>>> I hope that i got this right?
>>>>>>>>
>>>>>>>> I have followed the instruction as mentioned in documentation, and
>>>>>>>> everything loads fine, but when i schedule the service
>>>>>>>> storeincomingemail, i
>>>>>>>> am prompted to enter the service parameter(messageWrapper
>>>>>>>> (org.ofbiz.service.mail.MimeMessageWrapper), which i have no clue
>>>>>>>> about.
>>>>>>>> i
>>>>>>>> guess this is to do something 'MimeMessageWrapper'.
>>>>>>>>
>>>>>>>> The documentation by Si Chen mentions this:
>>>>>>>>
>>>>>>>> 5. MCA services need to implement the mail processing interface, as
>>>>>>>> in:
>>>>>>>>        
>>>>>>>> It uses a MimeMessageWrapper:
>>>>>>>>         MimeMessageWrapper wrapper = (MimeMessageWrapper)
>>>>>>>> context.get("messageWrapper");
>>>>>>>> MimeMessage message = wrapper.getMessage();
>>>>>>>> with methods like message.getAllRecipients(), message.getFrom(),
>>>>>>>> message.getSubject(), getAllRecipients(), getSentDate(),
>>>>>>>> getReceivedDate(),
>>>>>>>> etc.
>>>>>>>>
>>>>>>>> Currently (20060607) there is a service called
>>>>>>>> “storeIncomingEmail”
>>>>>>>> which
>>>>>>>> could be used to do inbound mail sorting.  This has not been fully
>>>>>>>> tested
>>>>>>>> yet.
>>>>>>>>
>>>>>>>>
>>>>>>>> I am not sure what to insert in the service parameters.
>>>>>>>>
>>>>>>>> Do we need to create a view for email sorting, cause i think the
>>>>>>>> mails
>>>>>>>> will
>>>>>>>> be visible, under the communication tab, in party manager?
>>>>>>>>
>>>>>>>> Rohit
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> BJ Freeman wrote:
>>>>>>>>> If I understand you, you can create a view with the sorting you
>>>>>>>>> want.
>>>>>>>>>
>>>>>>>>> rohit2006 sent the following on 4/19/2007 4:33 AM:
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> I am trying configure email sorting in ofbiz and store emails as
>>>>>>>>>> communication events. I believe i have to schedule the service
>>>>>>>>>> storeIncomingEmail as a service. I tried to do that and was
>>>>>>>>>> prompted
>>>>>>>>>> fill
>>>>>>>>>> the fields:
>>>>>>>>>>
>>>>>>>>>> Step 2: Service Parameters
>>>>>>>>>> messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper).
>>>>>>>>>>
>>>>>>>>>> I am not sure what to enter into this field, can someone please
>>>>>>>>>> help
>>>>>>>>>> me
>>>>>>>>>> configure this. I am getting the following error in log when the
>>>>>>>>>> service
>>>>>>>>>> is
>>>>>>>>>> run
>>>>>>>>>>
>>>>>>>>>> 2007-04-19 05:22:31,302 (default-invoker-Thread-2) [        
>>>>>>>>>> JobInvoker.java:211:INFO ] Invoker: default-invoker-Thread-2
>>>>>>>>>> received
>>>>>>>>>> job
>>>>>>>>>> --
>>>>>>>>>> 1176985293330 from poller -
>>>>>>>>>> org.ofbiz.service.job.JobPoller@1be4777
>>>>>>>>>> 2007-04-19 05:22:31,320 (default-invoker-Thread-2)
>>>>>>>>>> [PersistedServiceJob.java:136:INFO ]
>>>>>>>>>> org.ofbiz.service.job.PersistedServiceJob@334bfe[58369] -- Next
>>>>>>>>>> runtime:
>>>>>>>>>> -1
>>>>>>>>>> [Error] :2:12: cvc-elt.1: Cannot find the declaration of element
>>>>>>>>>> 'ofbiz-ser'.
>>>>>>>>>> 2007-04-19 05:22:31,331 (default-invoker-Thread-2) [          
>>>>>>>>>> UtilXml.java:243:DEBUG] XML Read 0.0040s: Internal Content
>>>>>>>>>> 2007-04-19 05:22:31,332 (default-invoker-Thread-2) [
>>>>>>>>>> ServiceDispatcher.java:322:ERROR]
>>>>>>>>>> ---- exception report
>>>>>>>>>> ----------------------------------------------------------
>>>>>>>>>> Incoming context (in runSync : storeIncomingEmail) does not match
>>>>>>>>>> expected
>>>>>>>>>> requirements
>>>>>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>>>>>> Message: The following required parameter is missing:
>>>>>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>>>>>> ---- stack trace
>>>>>>>>>> ---------------------------------------------------------------
>>>>>>>>>> org.ofbiz.service.ServiceValidationException: The following
>>>>>>>>>> required
>>>>>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>>>
>>>>>>>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>>>>>>>>> ServiceDispatcher.java:385:DEBUG] [[Sync service failed...-
>>>>>>>>>> total:0.0,since
>>>>>>>>>> last(Begin):0.0]] - 'JobDispatcher / storeIncomingEmail'
>>>>>>>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>>>>>>>>> ServiceDispatcher.java:388:ERROR]
>>>>>>>>>> ---- exception report
>>>>>>>>>> ----------------------------------------------------------
>>>>>>>>>> Service [storeIncomingEmail] threw an unexpected exception/error
>>>>>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>>>>>> Message: The following required parameter is missing:
>>>>>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>>>>>> ---- stack trace
>>>>>>>>>> ---------------------------------------------------------------
>>>>>>>>>> org.ofbiz.service.ServiceValidationException: The following
>>>>>>>>>> required
>>>>>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>>>
>>>>>>>>>> 2007-04-19 05:22:31,334 (default-invoker-Thread-2) [  
>>>>>>>>>> TransactionUtil.java:252:ERROR]
>>>>>>>>>> ---- exception report
>>>>>>>>>> ----------------------------------------------------------
>>>>>>>>>> [TransactionUtil.rollback]
>>>>>>>>>> Exception: java.lang.Exception
>>>>>>>>>> Message: Stack Trace
>>>>>>>>>> ---- stack trace
>>>>>>>>>> ---------------------------------------------------------------
>>>>>>>>>> java.lang.Exception: Stack Trace
>>>>>>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
>>>>>>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:391)
>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>>>
>>>>>>>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>>>>>>>>> TransactionUtil.java:262:INFO ] [TransactionUtil.rollback]
>>>>>>>>>> transaction
>>>>>>>>>> rolled back
>>>>>>>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>>>>>>>>> TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not
>>>>>>>>>> committing
>>>>>>>>>> transaction, status is STATUS_NO_TRANSACTION
>>>>>>>>>> 2007-04-19 05:22:31,336 (default-invoker-Thread-2) [
>>>>>>>>>> GenericServiceJob.java:117:ERROR]
>>>>>>>>>> ---- exception report
>>>>>>>>>> ----------------------------------------------------------
>>>>>>>>>> Async-Service failed.
>>>>>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>>>>>> Message: The following required parameter is missing:
>>>>>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>>>>>> ---- stack trace
>>>>>>>>>> ---------------------------------------------------------------
>>>>>>>>>> org.ofbiz.service.ServiceValidationException: The following
>>>>>>>>>> required
>>>>>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>>>
>>>>>>>>>> 2007-04-19 05:22:31,342 (default-invoker-Thread-2) [      
>>>>>>>>>> SequenceUtil.java:254:INFO ] Got bank of sequenced IDs for
>>>>>>>>>> [JobSandbox];
>>>>>>>>>> curSeqId=58370, maxSeqId=58380, bankSize=10
>>>>>>>>>> 2007-04-19 05:22:31,348 (default-invoker-Thread-2)
>>>>>>>>>> [PersistedServiceJob.java:202:INFO ] Persisted Job [58369] Failed
>>>>>>>>>> Re-Scheduling : 1176985531339
>>>>>>>>>> 2007-04-19 05:22:37,711 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>> ContextFilter.java:182:INFO ] [Request]: /webtools/control/jobList
>>>>>>>>>> 2007-04-19 05:22:37,712 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>> ControlServlet.java:90 :INFO ] The character encoding of the
>>>>>>>>>> request
>>>>>>>>>> is:
>>>>>>>>>> [null]. The character encoding we will use for the request and
>>>>>>>>>> response
>>>>>>>>>> is:
>>>>>>>>>> [UTF-8]
>>>>>>>>>> 2007-04-19 05:22:37,713 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>> ControlServlet.java:126:DEBUG] [[[jobList] Servlet Starting, doing
>>>>>>>>>> setup-
>>>>>>>>>> total:0.0,since last(Begin):0.0]]
>>>>>>>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>> ControlServlet.java:181:DEBUG] [[[jobList] Setup done, doing
>>>>>>>>>> Event(s)
>>>>>>>>>> and
>>>>>>>>>> View(s)- total:0.0,since last([jobList] Servlet...):0.0]]
>>>>>>>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>> RequestHandler.java:266:INFO ] [Processing Request]: jobList
>>>>>>>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>>>>>> 2007-04-19 05:22:37,715 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>> RequestManager.java:117:INFO ]
>>>>>>>>>> [RequestManager.getRequestAttribute]
>>>>>>>>>> Value
>>>>>>>>>> for attribute "null" of uri "jobList" not found
>>>>>>>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>> RequestHandler.java:450:INFO ] [RequestHandler.doRequest]:
>>>>>>>>>> Response
>>>>>>>>>> is
>>>>>>>>>> a
>>>>>>>>>> view. sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>>>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>> RequestHandler.java:603:INFO ] servletName=control, view=jobList
>>>>>>>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>>>>>> 2007-04-19 05:22:37,717 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>> ScreenRenderer.java:220:INFO ] Found servlet context (application)
>>>>>>>>>> attribute
>>>>>>>>>> that conflicts with parameter name, leaving request parameter in
>>>>>>>>>> place
>>>>>>>>>> for
>>>>>>>>>> name: _REQUEST_HANDLER_
>>>>>>>>>> 2007-04-19 05:22:37,826 (http-0.0.0.0-7443-Processor1) [
>>>>>>>>>> ModelScreenWidget.java:361:INFO ] In the include-screen tag the
>>>>>>>>>> screen
>>>>>>>>>> name
>>>>>>>>>> was empty, ignoring include; in screen [GlobalDecorator]
>>>>>>>>>> 2007-04-19 05:22:37,857 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>> ControlServlet.java:256:DEBUG] [[[jobList] Done rendering page,
>>>>>>>>>> Servlet
>>>>>>>>>> Finished- total:0.143,since last([jobList] Setup d...):0.143]]
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>        
>>>>>>> ---------------------------------
>>>>>>> Ahhh...imagining that irresistible "new car" smell?
>>>>>>>  Check outnew cars at Yahoo! Autos.
>>>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: what is [storeIncomingEmail.messageWrapper]?

BJ Freeman
In reply to this post by rohit
here is the code as it is now
           // get the content(type) part
            if (contentType.startsWith("text")) {
                commEventMap.put("content", message.getContent());
                commEventMap.put("contentMimeTypeId", contentType);
            } else if (contentType.startsWith("multipart") ||
contentType.startsWith("Multipart")) {
                contentIndex = "";
                commEventMap = addMessageBody(commEventMap, (Multipart)
message.getContent());
            }

Here is the code as I patched it. this was put in, apparently it was
removed.

    int contentIndex = -1;
                        Multipart multipart = null;
    if (contentType.startsWith("text")) {
    content = (String)message.getContent();
        commEventMap.put("contentMimeTypeId", contentType);
    } else if (contentType.startsWith("multipart")) {
    multipart = (Multipart)message.getContent();
    int multipartCount = multipart.getCount();
    for (int i=0; i < multipartCount; i++) {
    Part part = multipart.getBodyPart(i);
    String thisContentTypeRaw = part.getContentType();
               int idx2 = thisContentTypeRaw.indexOf(";");
               String thisContentType =
thisContentTypeRaw.substring(0, idx2);
    String disposition = part.getDisposition();
   
    // See this case where the disposition of the inline text is null
    if ((disposition == null) && (i == 0) &&
thisContentType.startsWith("text"))
    {
    content = (String)part.getContent();
    if (UtilValidate.isNotEmpty(content)) {
    contentIndex = i;
    commEventMap.put("contentMimeTypeId", thisContentType);
    break;
    }
        } else if ((disposition != null)
    && (disposition.equals(Part.ATTACHMENT) ||
disposition.equals(Part.INLINE))
        && thisContentType.startsWith("text"))
        {
        content = (String)part.getContent();
        contentIndex = i;
        commEventMap.put("contentMimeTypeId", thisContentType);
        break;
        }
    }    
    }
    commEventMap.put("content", content);




rohit2006 sent the following on 4/21/2007 12:24 AM:

> Yes, i have added [hidden email] as email address of one of the parties.
>
>
> BJ Freeman wrote:
>> do you have a "[hidden email]" in one of the parties in ofbiz
>>
>> rohit2006 sent the following on 4/20/2007 8:13 PM:
>>> i have changed the service to use the ofbiz service 'storeIncomingEmail',
>>> but
>>> that didn't help either. And as suspected by 'Guido Amarilla' i also
>>> included 'CC' in my test emails, but that did not work either.
>>>
>>> I can see that ofbiz reads the mail properly, but is not able to store
>>> the
>>> email.
>>>
>>> My javamail configuration is:
>>>
>>>     <!-- JavaMail Listener Container - Triggers MCA Rules -->
>>>     <!-- if delete-mail is set to true, will delete messages after
>>> fetching
>>> them. otherwise, will try to mark them as seen
>>>          mail.store.protocol supports both imap and pop3, but pop3 will
>>> not
>>> be able to mark messages as seen, so you would need to delete them -->
>>>     <!-- To use the mail listerner just uncomment and go... -->
>>>     <container name="javamail-container"
>>> class="org.ofbiz.service.mail.JavaMailContainer">
>>>         <property name="delegator-name" value="default"/>
>>>         <property name="dispatcher-name" value="JavaMailDispatcher"/>
>>>         <property name="run-as-user" value="system"/>
>>>         <property name="poll-delay" value="300000"/>
>>>         <property name="delete-mail" value="false"/>
>>>         <property name="maxSize" value="100000"/>
>>>         <property name="default-listener" value="store-listener">
>>>             <property name="mail.store.protocol" value="pop3"/>
>>>             <property name="mail.host" value="localhost"/>
>>>             <property name="mail.user" value="userID"/>
>>>             <property name="mail.pass" value="password"/>
>>>             <property name="mail.debug" value="true"/>
>>>         </property>
>>>     </container>
>>>    
>>> ERROR LOG -----------------
>>>
>>>  "2007-04-20 20:59:18,079 (Thread-0) [      EmailServices.java:743:INFO ]
>>> Processing Incoming Email message from: Rohit Sureka
>>> <[hidden email]> to: [hidden email]
>>> 2007-04-20 20:59:18,154 (Thread-0) [            UtilXml.java:243:DEBUG]
>>> XML
>>> Read 0.047s:
>>> /ofbiz/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml
>>> 2007-04-20 20:59:18,253 (Thread-0) [  ServiceDispatcher.java:459:DEBUG]
>>> Sync
>>> service [JavaMailDispatcher/executeFind] finished in [79] milliseconds
>>> 2007-04-20 20:59:18,254 (Thread-0) [  ServiceDispatcher.java:459:DEBUG]
>>> Sync
>>> service [JavaMailDispatcher/performFindItem] finished in [83]
>>> milliseconds
>>> 2007-04-20 20:59:18,272 (Thread-0) [  ServiceDispatcher.java:459:DEBUG]
>>> Sync
>>> service [JavaMailDispatcher/findPartyFromEmailAddress] finished in [192]
>>> milliseconds
>>> 2007-04-20 20:59:18,354 (Thread-0) [      EmailServices.java:933:ERROR]
>>> ---- runtime exception report
>>> --------------------------------------------------
>>> Exception: java.lang.NullPointerException
>>> Message: null
>>> ---- stack trace
>>> ---------------------------------------------------------------
>>> java.lang.NullPointerException
>>> org.ofbiz.content.email.EmailServices.storeIncomingEmail(EmailServices.java:835)
>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>> java.lang.reflect.Method.invoke(Method.java:324)
>>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
>>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>> java.util.TimerThread.run(Timer.java:382)
>>> --------------------------------------------------------------------------------
>>>
>>> 2007-04-20 20:59:18,355 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
>>> Service Error [storeIncomingEmail]:
>>> 2007-04-20 20:59:18,356 (Thread-0) [    TransactionUtil.java:252:ERROR]
>>> ---- exception report
>>> ----------------------------------------------------------
>>> [TransactionUtil.rollback]
>>> Exception: java.lang.Exception
>>> Message: Stack Trace
>>> ---- stack trace
>>> ---------------------------------------------------------------
>>> java.lang.Exception: Stack Trace
>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>> java.util.TimerThread.run(Timer.java:382)
>>> --------------------------------------------------------------------------------
>>>
>>> 2007-04-20 20:59:18,357 (Thread-0) [    TransactionUtil.java:262:INFO ]
>>> [TransactionUtil.rollback] transaction rolled back
>>> 2007-04-20 20:59:18,358 (Thread-0) [  ServiceDispatcher.java:459:DEBUG]
>>> Sync
>>> service [JavaMailDispatcher/storeIncomingEmail] finished in [303]
>>> milliseconds
>>> 2007-04-20 20:59:18,358 (Thread-0) [   ServiceMcaAction.java:60 :ERROR]
>>>
>>>
>>>
>>> BJ Freeman wrote:
>>>> what I see first is you are using the crmsfa.processIncomingEmail
>>>> so this is best ask in the opentaps forum.
>>>>
>>>>
>>>> rohit2006 sent the following on 4/20/2007 12:11 PM:
>>>>> i was just trying to record communication even when a email was
>>>>> received.
>>>>> I
>>>>> had done the MCA rules incorrectly, but i guess they are not set OK.
>>>>>
>>>>> My MCA settings are:
>>>>>
>>>>> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>        
>>>>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>>>>>     <mca mail-rule-name="processIncomingEmail">
>>>>>         <!-- the matching is a regular expression match against the
>>>>> email
>>>>> address.  this format seems to work for
>>>>>         both "[hidden email]" and "Mr. XYZ <[hidden email]>" -->
>>>>>         <condition-field field-name="to" operator="matches"
>>>>> value="[hidden email]"/>
>>>>>         <action service="crmsfa.processIncomingEmail" mode="sync"/>
>>>>>     </mca>
>>>>> </service-mca>
>>>>>
>>>>>
>>>>> The crmsfa.processincomingemail is defined as follows:
>>>>>
>>>>> <service name="crmsfa.processIncomingEmail" engine="java"
>>>>> location="com.opensourcestrategies.crmsfa.activities.ActivitiesServices"
>>>>> invoke="processIncomingEmail">
>>>>>         <description>Process an incoming email by calling
>>>>> storeIncomingEmail
>>>>> to create a CommunicationEvent wrapped in a WorkEffort. This WorkEffort
>>>>> is
>>>>> then
>>>>>             associated with the partyIdFrom of the
>>>>> CommunicationEvent.</description>
>>>>>         <attribute name="messageWrapper"
>>>>> type="org.ofbiz.service.mail.MimeMessageWrapper" mode="IN"/>
>>>>>     </service>
>>>>>
>>>>> However the incoming mails are not being processed and i am getting
>>>>> these
>>>>> errors:
>>>>>
>>>>> 2007-04-20 12:44:03,137 (Thread-0) [      EmailServices.java:743:INFO ]
>>>>> Processing Incoming Email message from: Rohit Sureka
>>>>> <[hidden email]>
>>>>> to: [hidden email]
>>>>> 2007-04-20 12:44:03,170 (Thread-0) [      EmailServices.java:933:ERROR]
>>>>> ---- runtime exception report
>>>>> --------------------------------------------------
>>>>> Exception: java.lang.NullPointerException
>>>>> Message: null
>>>>> ---- stack trace
>>>>> ---------------------------------------------------------------
>>>>> java.lang.NullPointerException
>>>>> org.ofbiz.content.email.EmailServices.storeIncomingEmail(EmailServices.java:835)
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>> java.lang.reflect.Method.invoke(Method.java:324)
>>>>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
>>>>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>> com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>> java.lang.reflect.Method.invoke(Method.java:324)
>>>>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
>>>>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>>>> java.util.TimerThread.run(Timer.java:382)
>>>>> --------------------------------------------------------------------------------
>>>>>
>>>>> 2007-04-20 12:44:03,171 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
>>>>> Service Error [storeIncomingEmail]:
>>>>> 2007-04-20 12:44:03,172 (Thread-0) [    TransactionUtil.java:285:WARN ]
>>>>> ---- exception report
>>>>> ----------------------------------------------------------
>>>>> [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly;
>>>>> this
>>>>> stack trace shows where this is happening:
>>>>> Exception: java.lang.Exception
>>>>> Message: Service Error [storeIncomingEmail]:
>>>>> ---- stack trace
>>>>> ---------------------------------------------------------------
>>>>> java.lang.Exception: Service Error [storeIncomingEmail]:
>>>>> org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:285)
>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:235)
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>> com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>> java.lang.reflect.Method.invoke(Method.java:324)
>>>>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
>>>>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>>>> java.util.TimerThread.run(Timer.java:382)
>>>>> --------------------------------------------------------------------------------
>>>>>
>>>>> 2007-04-20 12:44:03,173 (Thread-0) [         UtilCommon.java:127:ERROR]
>>>>> Failed to process incoming email:
>>>>> 2007-04-20 12:44:03,173 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
>>>>> Service Error [crmsfa.processIncomingEmail]: Failed to process incoming
>>>>> email:
>>>>> 2007-04-20 12:44:03,174 (Thread-0) [    TransactionUtil.java:252:ERROR]
>>>>> ---- exception report
>>>>> ----------------------------------------------------------
>>>>> [TransactionUtil.rollback]
>>>>> Exception: java.lang.Exception
>>>>> Message: Stack Trace
>>>>> ---- stack trace
>>>>> ---------------------------------------------------------------
>>>>> java.lang.Exception: Stack Trace
>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>>>> java.util.TimerThread.run(Timer.java:382)
>>>>> --------------------------------------------------------------------------------
>>>>>
>>>>> 2007-04-20 12:44:03,175 (Thread-0) [    TransactionUtil.java:262:INFO ]
>>>>> [TransactionUtil.rollback] transaction rolled back
>>>>> 2007-04-20 12:44:03,176 (Thread-0) [   ServiceMcaAction.java:60 :ERROR]
>>>>> Failed to process incoming email:
>>>>> C: QUIT
>>>>> S: +OK Logging out.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> BJ Freeman wrote:
>>>>>> could you be more specific about what you are trying to sort?
>>>>>> would this be better served as a entity view?
>>>>>>
>>>>>> Rohit Sureka sent the following on 4/20/2007 9:32 AM:
>>>>>>> Thanks for the email and i am sorry if i did not put my question
>>>>>>> properly.
>>>>>>>
>>>>>>> My real problem is configuring the service to sort emails. I have put
>>>>>>> the
>>>>>>> MCA rules in place but i am not able to configure the
>>>>>>> "sortincomingemail'
>>>>>>> service.
>>>>>>>
>>>>>>> I understand that "sortincomingemail" has to be run at regular
>>>>>>> interval
>>>>>>> to process the email sorting.
>>>>>>>
>>>>>>> Rohit
>>>>>>>
>>>>>>> BJ Freeman <[hidden email]> wrote: My previous response was
>>>>>>> aimed
>>>>>>> at
>>>>>>> sorting the communication events after
>>>>>>> they have been already loaded.
>>>>>>>
>>>>>>> to answer your question, Yes ofbiz will try to match any email to and
>>>>>>> from with those in the parties.
>>>>>>> if it can not find one of the parties, usually the from, it puts the
>>>>>>> address in comments, an marks it unknown email address.
>>>>>>>
>>>>>>>
>>>>>>> The MCA is used to filter the emails. Like:
>>>>>>>  
>>>>>>>  link tracking number to order-->
>>>>>>>    
>>>>>>>        
>>>>>>> value="[hidden email]"/>
>>>>>>>        
>>>>>>>    
>>>>>>>
>>>>>>> in the above I am rerouting the Quantum emails to a process I wrote
>>>>>>> to
>>>>>>> input the shipping tracking number into an order.
>>>>>>>
>>>>>>> If this is what you were meaning by sort then this is the mechanism
>>>>>>> to
>>>>>>> to this.
>>>>>>>
>>>>>>> you can find /framework/common/servicedef/smca_test.xml
>>>>>>>
>>>>>>>
>>>>>>> rohit2006 sent the following on 4/19/2007 10:03 PM:
>>>>>>>> i am trying to configure email sorting in ofbiz. I have followed the
>>>>>>>> documentation by Si Chen, to test it. I am assuming that if email
>>>>>>>> sorting is
>>>>>>>> correctly configured, emails will be recorded as communication event
>>>>>>>> for
>>>>>>>> the
>>>>>>>> related parties. For eg. after a email is received ofbiz, will try
>>>>>>>> to
>>>>>>>> match
>>>>>>>> the "to" address, with the email associated to a party, and if a
>>>>>>>> match
>>>>>>>> is
>>>>>>>> found,  a communication event will be logged for the party.
>>>>>>>>
>>>>>>>> I hope that i got this right?
>>>>>>>>
>>>>>>>> I have followed the instruction as mentioned in documentation, and
>>>>>>>> everything loads fine, but when i schedule the service
>>>>>>>> storeincomingemail, i
>>>>>>>> am prompted to enter the service parameter(messageWrapper
>>>>>>>> (org.ofbiz.service.mail.MimeMessageWrapper), which i have no clue
>>>>>>>> about.
>>>>>>>> i
>>>>>>>> guess this is to do something 'MimeMessageWrapper'.
>>>>>>>>
>>>>>>>> The documentation by Si Chen mentions this:
>>>>>>>>
>>>>>>>> 5. MCA services need to implement the mail processing interface, as
>>>>>>>> in:
>>>>>>>>        
>>>>>>>> It uses a MimeMessageWrapper:
>>>>>>>>         MimeMessageWrapper wrapper = (MimeMessageWrapper)
>>>>>>>> context.get("messageWrapper");
>>>>>>>> MimeMessage message = wrapper.getMessage();
>>>>>>>> with methods like message.getAllRecipients(), message.getFrom(),
>>>>>>>> message.getSubject(), getAllRecipients(), getSentDate(),
>>>>>>>> getReceivedDate(),
>>>>>>>> etc.
>>>>>>>>
>>>>>>>> Currently (20060607) there is a service called
>>>>>>>> “storeIncomingEmail”
>>>>>>>> which
>>>>>>>> could be used to do inbound mail sorting.  This has not been fully
>>>>>>>> tested
>>>>>>>> yet.
>>>>>>>>
>>>>>>>>
>>>>>>>> I am not sure what to insert in the service parameters.
>>>>>>>>
>>>>>>>> Do we need to create a view for email sorting, cause i think the
>>>>>>>> mails
>>>>>>>> will
>>>>>>>> be visible, under the communication tab, in party manager?
>>>>>>>>
>>>>>>>> Rohit
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> BJ Freeman wrote:
>>>>>>>>> If I understand you, you can create a view with the sorting you
>>>>>>>>> want.
>>>>>>>>>
>>>>>>>>> rohit2006 sent the following on 4/19/2007 4:33 AM:
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> I am trying configure email sorting in ofbiz and store emails as
>>>>>>>>>> communication events. I believe i have to schedule the service
>>>>>>>>>> storeIncomingEmail as a service. I tried to do that and was
>>>>>>>>>> prompted
>>>>>>>>>> fill
>>>>>>>>>> the fields:
>>>>>>>>>>
>>>>>>>>>> Step 2: Service Parameters
>>>>>>>>>> messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper).
>>>>>>>>>>
>>>>>>>>>> I am not sure what to enter into this field, can someone please
>>>>>>>>>> help
>>>>>>>>>> me
>>>>>>>>>> configure this. I am getting the following error in log when the
>>>>>>>>>> service
>>>>>>>>>> is
>>>>>>>>>> run
>>>>>>>>>>
>>>>>>>>>> 2007-04-19 05:22:31,302 (default-invoker-Thread-2) [        
>>>>>>>>>> JobInvoker.java:211:INFO ] Invoker: default-invoker-Thread-2
>>>>>>>>>> received
>>>>>>>>>> job
>>>>>>>>>> --
>>>>>>>>>> 1176985293330 from poller -
>>>>>>>>>> org.ofbiz.service.job.JobPoller@1be4777
>>>>>>>>>> 2007-04-19 05:22:31,320 (default-invoker-Thread-2)
>>>>>>>>>> [PersistedServiceJob.java:136:INFO ]
>>>>>>>>>> org.ofbiz.service.job.PersistedServiceJob@334bfe[58369] -- Next
>>>>>>>>>> runtime:
>>>>>>>>>> -1
>>>>>>>>>> [Error] :2:12: cvc-elt.1: Cannot find the declaration of element
>>>>>>>>>> 'ofbiz-ser'.
>>>>>>>>>> 2007-04-19 05:22:31,331 (default-invoker-Thread-2) [          
>>>>>>>>>> UtilXml.java:243:DEBUG] XML Read 0.0040s: Internal Content
>>>>>>>>>> 2007-04-19 05:22:31,332 (default-invoker-Thread-2) [
>>>>>>>>>> ServiceDispatcher.java:322:ERROR]
>>>>>>>>>> ---- exception report
>>>>>>>>>> ----------------------------------------------------------
>>>>>>>>>> Incoming context (in runSync : storeIncomingEmail) does not match
>>>>>>>>>> expected
>>>>>>>>>> requirements
>>>>>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>>>>>> Message: The following required parameter is missing:
>>>>>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>>>>>> ---- stack trace
>>>>>>>>>> ---------------------------------------------------------------
>>>>>>>>>> org.ofbiz.service.ServiceValidationException: The following
>>>>>>>>>> required
>>>>>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>>>
>>>>>>>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>>>>>>>>> ServiceDispatcher.java:385:DEBUG] [[Sync service failed...-
>>>>>>>>>> total:0.0,since
>>>>>>>>>> last(Begin):0.0]] - 'JobDispatcher / storeIncomingEmail'
>>>>>>>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>>>>>>>>> ServiceDispatcher.java:388:ERROR]
>>>>>>>>>> ---- exception report
>>>>>>>>>> ----------------------------------------------------------
>>>>>>>>>> Service [storeIncomingEmail] threw an unexpected exception/error
>>>>>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>>>>>> Message: The following required parameter is missing:
>>>>>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>>>>>> ---- stack trace
>>>>>>>>>> ---------------------------------------------------------------
>>>>>>>>>> org.ofbiz.service.ServiceValidationException: The following
>>>>>>>>>> required
>>>>>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>>>
>>>>>>>>>> 2007-04-19 05:22:31,334 (default-invoker-Thread-2) [  
>>>>>>>>>> TransactionUtil.java:252:ERROR]
>>>>>>>>>> ---- exception report
>>>>>>>>>> ----------------------------------------------------------
>>>>>>>>>> [TransactionUtil.rollback]
>>>>>>>>>> Exception: java.lang.Exception
>>>>>>>>>> Message: Stack Trace
>>>>>>>>>> ---- stack trace
>>>>>>>>>> ---------------------------------------------------------------
>>>>>>>>>> java.lang.Exception: Stack Trace
>>>>>>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
>>>>>>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:391)
>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>>>
>>>>>>>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>>>>>>>>> TransactionUtil.java:262:INFO ] [TransactionUtil.rollback]
>>>>>>>>>> transaction
>>>>>>>>>> rolled back
>>>>>>>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>>>>>>>>> TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not
>>>>>>>>>> committing
>>>>>>>>>> transaction, status is STATUS_NO_TRANSACTION
>>>>>>>>>> 2007-04-19 05:22:31,336 (default-invoker-Thread-2) [
>>>>>>>>>> GenericServiceJob.java:117:ERROR]
>>>>>>>>>> ---- exception report
>>>>>>>>>> ----------------------------------------------------------
>>>>>>>>>> Async-Service failed.
>>>>>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>>>>>> Message: The following required parameter is missing:
>>>>>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>>>>>> ---- stack trace
>>>>>>>>>> ---------------------------------------------------------------
>>>>>>>>>> org.ofbiz.service.ServiceValidationException: The following
>>>>>>>>>> required
>>>>>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>>>
>>>>>>>>>> 2007-04-19 05:22:31,342 (default-invoker-Thread-2) [      
>>>>>>>>>> SequenceUtil.java:254:INFO ] Got bank of sequenced IDs for
>>>>>>>>>> [JobSandbox];
>>>>>>>>>> curSeqId=58370, maxSeqId=58380, bankSize=10
>>>>>>>>>> 2007-04-19 05:22:31,348 (default-invoker-Thread-2)
>>>>>>>>>> [PersistedServiceJob.java:202:INFO ] Persisted Job [58369] Failed
>>>>>>>>>> Re-Scheduling : 1176985531339
>>>>>>>>>> 2007-04-19 05:22:37,711 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>> ContextFilter.java:182:INFO ] [Request]: /webtools/control/jobList
>>>>>>>>>> 2007-04-19 05:22:37,712 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>> ControlServlet.java:90 :INFO ] The character encoding of the
>>>>>>>>>> request
>>>>>>>>>> is:
>>>>>>>>>> [null]. The character encoding we will use for the request and
>>>>>>>>>> response
>>>>>>>>>> is:
>>>>>>>>>> [UTF-8]
>>>>>>>>>> 2007-04-19 05:22:37,713 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>> ControlServlet.java:126:DEBUG] [[[jobList] Servlet Starting, doing
>>>>>>>>>> setup-
>>>>>>>>>> total:0.0,since last(Begin):0.0]]
>>>>>>>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>> ControlServlet.java:181:DEBUG] [[[jobList] Setup done, doing
>>>>>>>>>> Event(s)
>>>>>>>>>> and
>>>>>>>>>> View(s)- total:0.0,since last([jobList] Servlet...):0.0]]
>>>>>>>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>> RequestHandler.java:266:INFO ] [Processing Request]: jobList
>>>>>>>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>>>>>> 2007-04-19 05:22:37,715 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>> RequestManager.java:117:INFO ]
>>>>>>>>>> [RequestManager.getRequestAttribute]
>>>>>>>>>> Value
>>>>>>>>>> for attribute "null" of uri "jobList" not found
>>>>>>>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>> RequestHandler.java:450:INFO ] [RequestHandler.doRequest]:
>>>>>>>>>> Response
>>>>>>>>>> is
>>>>>>>>>> a
>>>>>>>>>> view. sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>>>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>> RequestHandler.java:603:INFO ] servletName=control, view=jobList
>>>>>>>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>>>>>> 2007-04-19 05:22:37,717 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>> ScreenRenderer.java:220:INFO ] Found servlet context (application)
>>>>>>>>>> attribute
>>>>>>>>>> that conflicts with parameter name, leaving request parameter in
>>>>>>>>>> place
>>>>>>>>>> for
>>>>>>>>>> name: _REQUEST_HANDLER_
>>>>>>>>>> 2007-04-19 05:22:37,826 (http-0.0.0.0-7443-Processor1) [
>>>>>>>>>> ModelScreenWidget.java:361:INFO ] In the include-screen tag the
>>>>>>>>>> screen
>>>>>>>>>> name
>>>>>>>>>> was empty, ignoring include; in screen [GlobalDecorator]
>>>>>>>>>> 2007-04-19 05:22:37,857 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>> ControlServlet.java:256:DEBUG] [[[jobList] Done rendering page,
>>>>>>>>>> Servlet
>>>>>>>>>> Finished- total:0.143,since last([jobList] Setup d...):0.143]]
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>        
>>>>>>> ---------------------------------
>>>>>>> Ahhh...imagining that irresistible "new car" smell?
>>>>>>>  Check outnew cars at Yahoo! Autos.
>>>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: what is [storeIncomingEmail.messageWrapper]?

BJ Freeman
here is the jira about it
https://issues.apache.org/jira/browse/OFBIZ-70

BJ Freeman sent the following on 4/21/2007 1:18 AM:

> here is the code as it is now
>            // get the content(type) part
>             if (contentType.startsWith("text")) {
>                 commEventMap.put("content", message.getContent());
>                 commEventMap.put("contentMimeTypeId", contentType);
>             } else if (contentType.startsWith("multipart") ||
> contentType.startsWith("Multipart")) {
>                 contentIndex = "";
>                 commEventMap = addMessageBody(commEventMap, (Multipart)
> message.getContent());
>             }
>
> Here is the code as I patched it. this was put in, apparently it was
> removed.
>
>     int contentIndex = -1;
> Multipart multipart = null;
>     if (contentType.startsWith("text")) {
>     content = (String)message.getContent();
>         commEventMap.put("contentMimeTypeId", contentType);
>     } else if (contentType.startsWith("multipart")) {
>     multipart = (Multipart)message.getContent();
>     int multipartCount = multipart.getCount();
>     for (int i=0; i < multipartCount; i++) {
>     Part part = multipart.getBodyPart(i);
>     String thisContentTypeRaw = part.getContentType();
>                int idx2 = thisContentTypeRaw.indexOf(";");
>                String thisContentType =
> thisContentTypeRaw.substring(0, idx2);
>     String disposition = part.getDisposition();
>    
>     // See this case where the disposition of the inline text is null
>     if ((disposition == null) && (i == 0) &&
> thisContentType.startsWith("text"))
>     {
>     content = (String)part.getContent();
>     if (UtilValidate.isNotEmpty(content)) {
>     contentIndex = i;
>     commEventMap.put("contentMimeTypeId", thisContentType);
>     break;
>     }
>         } else if ((disposition != null)
>     && (disposition.equals(Part.ATTACHMENT) ||
> disposition.equals(Part.INLINE))
>         && thisContentType.startsWith("text"))
>         {
>         content = (String)part.getContent();
>         contentIndex = i;
>         commEventMap.put("contentMimeTypeId", thisContentType);
>         break;
>         }
>     }    
>     }
>     commEventMap.put("content", content);
>
>
>
>
> rohit2006 sent the following on 4/21/2007 12:24 AM:
>> Yes, i have added [hidden email] as email address of one of the parties.
>>
>>
>> BJ Freeman wrote:
>>> do you have a "[hidden email]" in one of the parties in ofbiz
>>>
>>> rohit2006 sent the following on 4/20/2007 8:13 PM:
>>>> i have changed the service to use the ofbiz service 'storeIncomingEmail',
>>>> but
>>>> that didn't help either. And as suspected by 'Guido Amarilla' i also
>>>> included 'CC' in my test emails, but that did not work either.
>>>>
>>>> I can see that ofbiz reads the mail properly, but is not able to store
>>>> the
>>>> email.
>>>>
>>>> My javamail configuration is:
>>>>
>>>>     <!-- JavaMail Listener Container - Triggers MCA Rules -->
>>>>     <!-- if delete-mail is set to true, will delete messages after
>>>> fetching
>>>> them. otherwise, will try to mark them as seen
>>>>          mail.store.protocol supports both imap and pop3, but pop3 will
>>>> not
>>>> be able to mark messages as seen, so you would need to delete them -->
>>>>     <!-- To use the mail listerner just uncomment and go... -->
>>>>     <container name="javamail-container"
>>>> class="org.ofbiz.service.mail.JavaMailContainer">
>>>>         <property name="delegator-name" value="default"/>
>>>>         <property name="dispatcher-name" value="JavaMailDispatcher"/>
>>>>         <property name="run-as-user" value="system"/>
>>>>         <property name="poll-delay" value="300000"/>
>>>>         <property name="delete-mail" value="false"/>
>>>>         <property name="maxSize" value="100000"/>
>>>>         <property name="default-listener" value="store-listener">
>>>>             <property name="mail.store.protocol" value="pop3"/>
>>>>             <property name="mail.host" value="localhost"/>
>>>>             <property name="mail.user" value="userID"/>
>>>>             <property name="mail.pass" value="password"/>
>>>>             <property name="mail.debug" value="true"/>
>>>>         </property>
>>>>     </container>
>>>>    
>>>> ERROR LOG -----------------
>>>>
>>>>  "2007-04-20 20:59:18,079 (Thread-0) [      EmailServices.java:743:INFO ]
>>>> Processing Incoming Email message from: Rohit Sureka
>>>> <[hidden email]> to: [hidden email]
>>>> 2007-04-20 20:59:18,154 (Thread-0) [            UtilXml.java:243:DEBUG]
>>>> XML
>>>> Read 0.047s:
>>>> /ofbiz/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml
>>>> 2007-04-20 20:59:18,253 (Thread-0) [  ServiceDispatcher.java:459:DEBUG]
>>>> Sync
>>>> service [JavaMailDispatcher/executeFind] finished in [79] milliseconds
>>>> 2007-04-20 20:59:18,254 (Thread-0) [  ServiceDispatcher.java:459:DEBUG]
>>>> Sync
>>>> service [JavaMailDispatcher/performFindItem] finished in [83]
>>>> milliseconds
>>>> 2007-04-20 20:59:18,272 (Thread-0) [  ServiceDispatcher.java:459:DEBUG]
>>>> Sync
>>>> service [JavaMailDispatcher/findPartyFromEmailAddress] finished in [192]
>>>> milliseconds
>>>> 2007-04-20 20:59:18,354 (Thread-0) [      EmailServices.java:933:ERROR]
>>>> ---- runtime exception report
>>>> --------------------------------------------------
>>>> Exception: java.lang.NullPointerException
>>>> Message: null
>>>> ---- stack trace
>>>> ---------------------------------------------------------------
>>>> java.lang.NullPointerException
>>>> org.ofbiz.content.email.EmailServices.storeIncomingEmail(EmailServices.java:835)
>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>> java.lang.reflect.Method.invoke(Method.java:324)
>>>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
>>>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>>> java.util.TimerThread.run(Timer.java:382)
>>>> --------------------------------------------------------------------------------
>>>>
>>>> 2007-04-20 20:59:18,355 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
>>>> Service Error [storeIncomingEmail]:
>>>> 2007-04-20 20:59:18,356 (Thread-0) [    TransactionUtil.java:252:ERROR]
>>>> ---- exception report
>>>> ----------------------------------------------------------
>>>> [TransactionUtil.rollback]
>>>> Exception: java.lang.Exception
>>>> Message: Stack Trace
>>>> ---- stack trace
>>>> ---------------------------------------------------------------
>>>> java.lang.Exception: Stack Trace
>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>>> java.util.TimerThread.run(Timer.java:382)
>>>> --------------------------------------------------------------------------------
>>>>
>>>> 2007-04-20 20:59:18,357 (Thread-0) [    TransactionUtil.java:262:INFO ]
>>>> [TransactionUtil.rollback] transaction rolled back
>>>> 2007-04-20 20:59:18,358 (Thread-0) [  ServiceDispatcher.java:459:DEBUG]
>>>> Sync
>>>> service [JavaMailDispatcher/storeIncomingEmail] finished in [303]
>>>> milliseconds
>>>> 2007-04-20 20:59:18,358 (Thread-0) [   ServiceMcaAction.java:60 :ERROR]
>>>>
>>>>
>>>>
>>>> BJ Freeman wrote:
>>>>> what I see first is you are using the crmsfa.processIncomingEmail
>>>>> so this is best ask in the opentaps forum.
>>>>>
>>>>>
>>>>> rohit2006 sent the following on 4/20/2007 12:11 PM:
>>>>>> i was just trying to record communication even when a email was
>>>>>> received.
>>>>>> I
>>>>>> had done the MCA rules incorrectly, but i guess they are not set OK.
>>>>>>
>>>>>> My MCA settings are:
>>>>>>
>>>>>> <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>>        
>>>>>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
>>>>>>     <mca mail-rule-name="processIncomingEmail">
>>>>>>         <!-- the matching is a regular expression match against the
>>>>>> email
>>>>>> address.  this format seems to work for
>>>>>>         both "[hidden email]" and "Mr. XYZ <[hidden email]>" -->
>>>>>>         <condition-field field-name="to" operator="matches"
>>>>>> value="[hidden email]"/>
>>>>>>         <action service="crmsfa.processIncomingEmail" mode="sync"/>
>>>>>>     </mca>
>>>>>> </service-mca>
>>>>>>
>>>>>>
>>>>>> The crmsfa.processincomingemail is defined as follows:
>>>>>>
>>>>>> <service name="crmsfa.processIncomingEmail" engine="java"
>>>>>> location="com.opensourcestrategies.crmsfa.activities.ActivitiesServices"
>>>>>> invoke="processIncomingEmail">
>>>>>>         <description>Process an incoming email by calling
>>>>>> storeIncomingEmail
>>>>>> to create a CommunicationEvent wrapped in a WorkEffort. This WorkEffort
>>>>>> is
>>>>>> then
>>>>>>             associated with the partyIdFrom of the
>>>>>> CommunicationEvent.</description>
>>>>>>         <attribute name="messageWrapper"
>>>>>> type="org.ofbiz.service.mail.MimeMessageWrapper" mode="IN"/>
>>>>>>     </service>
>>>>>>
>>>>>> However the incoming mails are not being processed and i am getting
>>>>>> these
>>>>>> errors:
>>>>>>
>>>>>> 2007-04-20 12:44:03,137 (Thread-0) [      EmailServices.java:743:INFO ]
>>>>>> Processing Incoming Email message from: Rohit Sureka
>>>>>> <[hidden email]>
>>>>>> to: [hidden email]
>>>>>> 2007-04-20 12:44:03,170 (Thread-0) [      EmailServices.java:933:ERROR]
>>>>>> ---- runtime exception report
>>>>>> --------------------------------------------------
>>>>>> Exception: java.lang.NullPointerException
>>>>>> Message: null
>>>>>> ---- stack trace
>>>>>> ---------------------------------------------------------------
>>>>>> java.lang.NullPointerException
>>>>>> org.ofbiz.content.email.EmailServices.storeIncomingEmail(EmailServices.java:835)
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>>> java.lang.reflect.Method.invoke(Method.java:324)
>>>>>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
>>>>>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>> com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>>> java.lang.reflect.Method.invoke(Method.java:324)
>>>>>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
>>>>>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>>>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>>>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>>>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>>>>> java.util.TimerThread.run(Timer.java:382)
>>>>>> --------------------------------------------------------------------------------
>>>>>>
>>>>>> 2007-04-20 12:44:03,171 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
>>>>>> Service Error [storeIncomingEmail]:
>>>>>> 2007-04-20 12:44:03,172 (Thread-0) [    TransactionUtil.java:285:WARN ]
>>>>>> ---- exception report
>>>>>> ----------------------------------------------------------
>>>>>> [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly;
>>>>>> this
>>>>>> stack trace shows where this is happening:
>>>>>> Exception: java.lang.Exception
>>>>>> Message: Service Error [storeIncomingEmail]:
>>>>>> ---- stack trace
>>>>>> ---------------------------------------------------------------
>>>>>> java.lang.Exception: Service Error [storeIncomingEmail]:
>>>>>> org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:285)
>>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:235)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>> com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>>>> java.lang.reflect.Method.invoke(Method.java:324)
>>>>>> org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
>>>>>> org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>>>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>>>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>>>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>>>>> java.util.TimerThread.run(Timer.java:382)
>>>>>> --------------------------------------------------------------------------------
>>>>>>
>>>>>> 2007-04-20 12:44:03,173 (Thread-0) [         UtilCommon.java:127:ERROR]
>>>>>> Failed to process incoming email:
>>>>>> 2007-04-20 12:44:03,173 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
>>>>>> Service Error [crmsfa.processIncomingEmail]: Failed to process incoming
>>>>>> email:
>>>>>> 2007-04-20 12:44:03,174 (Thread-0) [    TransactionUtil.java:252:ERROR]
>>>>>> ---- exception report
>>>>>> ----------------------------------------------------------
>>>>>> [TransactionUtil.rollback]
>>>>>> Exception: java.lang.Exception
>>>>>> Message: Stack Trace
>>>>>> ---- stack trace
>>>>>> ---------------------------------------------------------------
>>>>>> java.lang.Exception: Stack Trace
>>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
>>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>> org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
>>>>>> org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
>>>>>> org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
>>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
>>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
>>>>>> org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
>>>>>> java.util.TimerThread.mainLoop(Timer.java:432)
>>>>>> java.util.TimerThread.run(Timer.java:382)
>>>>>> --------------------------------------------------------------------------------
>>>>>>
>>>>>> 2007-04-20 12:44:03,175 (Thread-0) [    TransactionUtil.java:262:INFO ]
>>>>>> [TransactionUtil.rollback] transaction rolled back
>>>>>> 2007-04-20 12:44:03,176 (Thread-0) [   ServiceMcaAction.java:60 :ERROR]
>>>>>> Failed to process incoming email:
>>>>>> C: QUIT
>>>>>> S: +OK Logging out.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> BJ Freeman wrote:
>>>>>>> could you be more specific about what you are trying to sort?
>>>>>>> would this be better served as a entity view?
>>>>>>>
>>>>>>> Rohit Sureka sent the following on 4/20/2007 9:32 AM:
>>>>>>>> Thanks for the email and i am sorry if i did not put my question
>>>>>>>> properly.
>>>>>>>>
>>>>>>>> My real problem is configuring the service to sort emails. I have put
>>>>>>>> the
>>>>>>>> MCA rules in place but i am not able to configure the
>>>>>>>> "sortincomingemail'
>>>>>>>> service.
>>>>>>>>
>>>>>>>> I understand that "sortincomingemail" has to be run at regular
>>>>>>>> interval
>>>>>>>> to process the email sorting.
>>>>>>>>
>>>>>>>> Rohit
>>>>>>>>
>>>>>>>> BJ Freeman <[hidden email]> wrote: My previous response was
>>>>>>>> aimed
>>>>>>>> at
>>>>>>>> sorting the communication events after
>>>>>>>> they have been already loaded.
>>>>>>>>
>>>>>>>> to answer your question, Yes ofbiz will try to match any email to and
>>>>>>>> from with those in the parties.
>>>>>>>> if it can not find one of the parties, usually the from, it puts the
>>>>>>>> address in comments, an marks it unknown email address.
>>>>>>>>
>>>>>>>>
>>>>>>>> The MCA is used to filter the emails. Like:
>>>>>>>>  
>>>>>>>>  link tracking number to order-->
>>>>>>>>    
>>>>>>>>        
>>>>>>>> value="[hidden email]"/>
>>>>>>>>        
>>>>>>>>    
>>>>>>>>
>>>>>>>> in the above I am rerouting the Quantum emails to a process I wrote
>>>>>>>> to
>>>>>>>> input the shipping tracking number into an order.
>>>>>>>>
>>>>>>>> If this is what you were meaning by sort then this is the mechanism
>>>>>>>> to
>>>>>>>> to this.
>>>>>>>>
>>>>>>>> you can find /framework/common/servicedef/smca_test.xml
>>>>>>>>
>>>>>>>>
>>>>>>>> rohit2006 sent the following on 4/19/2007 10:03 PM:
>>>>>>>>> i am trying to configure email sorting in ofbiz. I have followed the
>>>>>>>>> documentation by Si Chen, to test it. I am assuming that if email
>>>>>>>>> sorting is
>>>>>>>>> correctly configured, emails will be recorded as communication event
>>>>>>>>> for
>>>>>>>>> the
>>>>>>>>> related parties. For eg. after a email is received ofbiz, will try
>>>>>>>>> to
>>>>>>>>> match
>>>>>>>>> the "to" address, with the email associated to a party, and if a
>>>>>>>>> match
>>>>>>>>> is
>>>>>>>>> found,  a communication event will be logged for the party.
>>>>>>>>>
>>>>>>>>> I hope that i got this right?
>>>>>>>>>
>>>>>>>>> I have followed the instruction as mentioned in documentation, and
>>>>>>>>> everything loads fine, but when i schedule the service
>>>>>>>>> storeincomingemail, i
>>>>>>>>> am prompted to enter the service parameter(messageWrapper
>>>>>>>>> (org.ofbiz.service.mail.MimeMessageWrapper), which i have no clue
>>>>>>>>> about.
>>>>>>>>> i
>>>>>>>>> guess this is to do something 'MimeMessageWrapper'.
>>>>>>>>>
>>>>>>>>> The documentation by Si Chen mentions this:
>>>>>>>>>
>>>>>>>>> 5. MCA services need to implement the mail processing interface, as
>>>>>>>>> in:
>>>>>>>>>        
>>>>>>>>> It uses a MimeMessageWrapper:
>>>>>>>>>         MimeMessageWrapper wrapper = (MimeMessageWrapper)
>>>>>>>>> context.get("messageWrapper");
>>>>>>>>> MimeMessage message = wrapper.getMessage();
>>>>>>>>> with methods like message.getAllRecipients(), message.getFrom(),
>>>>>>>>> message.getSubject(), getAllRecipients(), getSentDate(),
>>>>>>>>> getReceivedDate(),
>>>>>>>>> etc.
>>>>>>>>>
>>>>>>>>> Currently (20060607) there is a service called
>>>>>>>>> “storeIncomingEmail”
>>>>>>>>> which
>>>>>>>>> could be used to do inbound mail sorting.  This has not been fully
>>>>>>>>> tested
>>>>>>>>> yet.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> I am not sure what to insert in the service parameters.
>>>>>>>>>
>>>>>>>>> Do we need to create a view for email sorting, cause i think the
>>>>>>>>> mails
>>>>>>>>> will
>>>>>>>>> be visible, under the communication tab, in party manager?
>>>>>>>>>
>>>>>>>>> Rohit
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> BJ Freeman wrote:
>>>>>>>>>> If I understand you, you can create a view with the sorting you
>>>>>>>>>> want.
>>>>>>>>>>
>>>>>>>>>> rohit2006 sent the following on 4/19/2007 4:33 AM:
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> I am trying configure email sorting in ofbiz and store emails as
>>>>>>>>>>> communication events. I believe i have to schedule the service
>>>>>>>>>>> storeIncomingEmail as a service. I tried to do that and was
>>>>>>>>>>> prompted
>>>>>>>>>>> fill
>>>>>>>>>>> the fields:
>>>>>>>>>>>
>>>>>>>>>>> Step 2: Service Parameters
>>>>>>>>>>> messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper).
>>>>>>>>>>>
>>>>>>>>>>> I am not sure what to enter into this field, can someone please
>>>>>>>>>>> help
>>>>>>>>>>> me
>>>>>>>>>>> configure this. I am getting the following error in log when the
>>>>>>>>>>> service
>>>>>>>>>>> is
>>>>>>>>>>> run
>>>>>>>>>>>
>>>>>>>>>>> 2007-04-19 05:22:31,302 (default-invoker-Thread-2) [        
>>>>>>>>>>> JobInvoker.java:211:INFO ] Invoker: default-invoker-Thread-2
>>>>>>>>>>> received
>>>>>>>>>>> job
>>>>>>>>>>> --
>>>>>>>>>>> 1176985293330 from poller -
>>>>>>>>>>> org.ofbiz.service.job.JobPoller@1be4777
>>>>>>>>>>> 2007-04-19 05:22:31,320 (default-invoker-Thread-2)
>>>>>>>>>>> [PersistedServiceJob.java:136:INFO ]
>>>>>>>>>>> org.ofbiz.service.job.PersistedServiceJob@334bfe[58369] -- Next
>>>>>>>>>>> runtime:
>>>>>>>>>>> -1
>>>>>>>>>>> [Error] :2:12: cvc-elt.1: Cannot find the declaration of element
>>>>>>>>>>> 'ofbiz-ser'.
>>>>>>>>>>> 2007-04-19 05:22:31,331 (default-invoker-Thread-2) [          
>>>>>>>>>>> UtilXml.java:243:DEBUG] XML Read 0.0040s: Internal Content
>>>>>>>>>>> 2007-04-19 05:22:31,332 (default-invoker-Thread-2) [
>>>>>>>>>>> ServiceDispatcher.java:322:ERROR]
>>>>>>>>>>> ---- exception report
>>>>>>>>>>> ----------------------------------------------------------
>>>>>>>>>>> Incoming context (in runSync : storeIncomingEmail) does not match
>>>>>>>>>>> expected
>>>>>>>>>>> requirements
>>>>>>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>>>>>>> Message: The following required parameter is missing:
>>>>>>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>>>>>>> ---- stack trace
>>>>>>>>>>> ---------------------------------------------------------------
>>>>>>>>>>> org.ofbiz.service.ServiceValidationException: The following
>>>>>>>>>>> required
>>>>>>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>>>>
>>>>>>>>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>>>>>>>>>> ServiceDispatcher.java:385:DEBUG] [[Sync service failed...-
>>>>>>>>>>> total:0.0,since
>>>>>>>>>>> last(Begin):0.0]] - 'JobDispatcher / storeIncomingEmail'
>>>>>>>>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
>>>>>>>>>>> ServiceDispatcher.java:388:ERROR]
>>>>>>>>>>> ---- exception report
>>>>>>>>>>> ----------------------------------------------------------
>>>>>>>>>>> Service [storeIncomingEmail] threw an unexpected exception/error
>>>>>>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>>>>>>> Message: The following required parameter is missing:
>>>>>>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>>>>>>> ---- stack trace
>>>>>>>>>>> ---------------------------------------------------------------
>>>>>>>>>>> org.ofbiz.service.ServiceValidationException: The following
>>>>>>>>>>> required
>>>>>>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>>>>
>>>>>>>>>>> 2007-04-19 05:22:31,334 (default-invoker-Thread-2) [  
>>>>>>>>>>> TransactionUtil.java:252:ERROR]
>>>>>>>>>>> ---- exception report
>>>>>>>>>>> ----------------------------------------------------------
>>>>>>>>>>> [TransactionUtil.rollback]
>>>>>>>>>>> Exception: java.lang.Exception
>>>>>>>>>>> Message: Stack Trace
>>>>>>>>>>> ---- stack trace
>>>>>>>>>>> ---------------------------------------------------------------
>>>>>>>>>>> java.lang.Exception: Stack Trace
>>>>>>>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
>>>>>>>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
>>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:391)
>>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>>>>
>>>>>>>>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>>>>>>>>>> TransactionUtil.java:262:INFO ] [TransactionUtil.rollback]
>>>>>>>>>>> transaction
>>>>>>>>>>> rolled back
>>>>>>>>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [  
>>>>>>>>>>> TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not
>>>>>>>>>>> committing
>>>>>>>>>>> transaction, status is STATUS_NO_TRANSACTION
>>>>>>>>>>> 2007-04-19 05:22:31,336 (default-invoker-Thread-2) [
>>>>>>>>>>> GenericServiceJob.java:117:ERROR]
>>>>>>>>>>> ---- exception report
>>>>>>>>>>> ----------------------------------------------------------
>>>>>>>>>>> Async-Service failed.
>>>>>>>>>>> Exception: org.ofbiz.service.ServiceValidationException
>>>>>>>>>>> Message: The following required parameter is missing:
>>>>>>>>>>> [storeIncomingEmail.messageWrapper]
>>>>>>>>>>> ---- stack trace
>>>>>>>>>>> ---------------------------------------------------------------
>>>>>>>>>>> org.ofbiz.service.ServiceValidationException: The following
>>>>>>>>>>> required
>>>>>>>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
>>>>>>>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
>>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
>>>>>>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
>>>>>>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
>>>>>>>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
>>>>>>>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
>>>>>>>>>>> java.lang.Thread.run(Thread.java:534)
>>>>>>>>>>> --------------------------------------------------------------------------------
>>>>>>>>>>>
>>>>>>>>>>> 2007-04-19 05:22:31,342 (default-invoker-Thread-2) [      
>>>>>>>>>>> SequenceUtil.java:254:INFO ] Got bank of sequenced IDs for
>>>>>>>>>>> [JobSandbox];
>>>>>>>>>>> curSeqId=58370, maxSeqId=58380, bankSize=10
>>>>>>>>>>> 2007-04-19 05:22:31,348 (default-invoker-Thread-2)
>>>>>>>>>>> [PersistedServiceJob.java:202:INFO ] Persisted Job [58369] Failed
>>>>>>>>>>> Re-Scheduling : 1176985531339
>>>>>>>>>>> 2007-04-19 05:22:37,711 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>>> ContextFilter.java:182:INFO ] [Request]: /webtools/control/jobList
>>>>>>>>>>> 2007-04-19 05:22:37,712 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>>> ControlServlet.java:90 :INFO ] The character encoding of the
>>>>>>>>>>> request
>>>>>>>>>>> is:
>>>>>>>>>>> [null]. The character encoding we will use for the request and
>>>>>>>>>>> response
>>>>>>>>>>> is:
>>>>>>>>>>> [UTF-8]
>>>>>>>>>>> 2007-04-19 05:22:37,713 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>>> ControlServlet.java:126:DEBUG] [[[jobList] Servlet Starting, doing
>>>>>>>>>>> setup-
>>>>>>>>>>> total:0.0,since last(Begin):0.0]]
>>>>>>>>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>>> ControlServlet.java:181:DEBUG] [[[jobList] Setup done, doing
>>>>>>>>>>> Event(s)
>>>>>>>>>>> and
>>>>>>>>>>> View(s)- total:0.0,since last([jobList] Servlet...):0.0]]
>>>>>>>>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>>> RequestHandler.java:266:INFO ] [Processing Request]: jobList
>>>>>>>>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>>>>>>> 2007-04-19 05:22:37,715 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>>> RequestManager.java:117:INFO ]
>>>>>>>>>>> [RequestManager.getRequestAttribute]
>>>>>>>>>>> Value
>>>>>>>>>>> for attribute "null" of uri "jobList" not found
>>>>>>>>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>>> RequestHandler.java:450:INFO ] [RequestHandler.doRequest]:
>>>>>>>>>>> Response
>>>>>>>>>>> is
>>>>>>>>>>> a
>>>>>>>>>>> view. sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>>>>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>>> RequestHandler.java:603:INFO ] servletName=control, view=jobList
>>>>>>>>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
>>>>>>>>>>> 2007-04-19 05:22:37,717 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>>> ScreenRenderer.java:220:INFO ] Found servlet context (application)
>>>>>>>>>>> attribute
>>>>>>>>>>> that conflicts with parameter name, leaving request parameter in
>>>>>>>>>>> place
>>>>>>>>>>> for
>>>>>>>>>>> name: _REQUEST_HANDLER_
>>>>>>>>>>> 2007-04-19 05:22:37,826 (http-0.0.0.0-7443-Processor1) [
>>>>>>>>>>> ModelScreenWidget.java:361:INFO ] In the include-screen tag the
>>>>>>>>>>> screen
>>>>>>>>>>> name
>>>>>>>>>>> was empty, ignoring include; in screen [GlobalDecorator]
>>>>>>>>>>> 2007-04-19 05:22:37,857 (http-0.0.0.0-7443-Processor1) [    
>>>>>>>>>>> ControlServlet.java:256:DEBUG] [[[jobList] Done rendering page,
>>>>>>>>>>> Servlet
>>>>>>>>>>> Finished- total:0.143,since last([jobList] Setup d...):0.143]]
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>        
>>>>>>>> ---------------------------------
>>>>>>>> Ahhh...imagining that irresistible "new car" smell?
>>>>>>>>  Check outnew cars at Yahoo! Autos.
>>>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: what is [storeIncomingEmail.messageWrapper]?

rohit
In reply to this post by Guido Amarilla
Hi Guido,

your patch was commited by sometime today, I have updated my code with SVN and it has addressed the issue. The mails are now being recorded as communication event.

thanks a lot, for helping out.

rohit

Guido Amarilla wrote
Actually emails that come without a cc or bcc generate that
nullPointerException. If it is solved in crmsfa then a new exception
is thrown in OFBiz, buy it can´t be reproduced, if it isn`t patched in
crmsfa
This is a quick and dirty null check in EmailService.java. The same
should be done in crmsfa (check Request ID 1704671 in CRMSFA bug
tracker)

Check OFBIZ-912 for the patch.

References
http://sourceforge.net/tracker/index.php?func=detail&aid=1704671&group_id=145855&atid=763271
https://issues.apache.org/jira/browse/OFBIZ-912

 These patchs are just to make this work. I don´t have enough
knowledge of this services to be sure if this is the right way to
solve this problems.


Guido Amarilla


2007/4/20, BJ Freeman <bjfree@free-man.net>:
> what I see first is you are using the crmsfa.processIncomingEmail
> so this is best ask in the opentaps forum.
>
>
> rohit2006 sent the following on 4/20/2007 12:11 PM:
> > i was just trying to record communication even when a email was received. I
> > had done the MCA rules incorrectly, but i guess they are not set OK.
> >
> > My MCA settings are:
> >
> > <service-mca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >
> > xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/service-mca.xsd">
> >     <mca mail-rule-name="processIncomingEmail">
> >        
> >         <condition-field field-name="to" operator="matches"
> > value="ofbiz@xx.com"/>
> >         <action service="crmsfa.processIncomingEmail" mode="sync"/>
> >     </mca>
> > </service-mca>
> >
> >
> > The crmsfa.processincomingemail is defined as follows:
> >
> > <service name="crmsfa.processIncomingEmail" engine="java"
> > location="com.opensourcestrategies.crmsfa.activities.ActivitiesServices"
> > invoke="processIncomingEmail">
> >         <description>Process an incoming email by calling storeIncomingEmail
> > to create a CommunicationEvent wrapped in a WorkEffort. This WorkEffort is
> > then
> >             associated with the partyIdFrom of the
> > CommunicationEvent.</description>
> >         <attribute name="messageWrapper"
> > type="org.ofbiz.service.mail.MimeMessageWrapper" mode="IN"/>
> >     </service>
> >
> > However the incoming mails are not being processed and i am getting these
> > errors:
> >
> > 2007-04-20 12:44:03,137 (Thread-0) [      EmailServices.java:743:INFO ]
> > Processing Incoming Email message from: Rohit Sureka <rohitksureka@yy.com>
> > to: ofbiz@xx.com
> > 2007-04-20 12:44:03,170 (Thread-0) [      EmailServices.java:933:ERROR]
> > ---- runtime exception report
> > --------------------------------------------------
> > Exception: java.lang.NullPointerException
> > Message: null
> > ---- stack trace
> > ---------------------------------------------------------------
> > java.lang.NullPointerException
> > org.ofbiz.content.email.EmailServices.storeIncomingEmail(EmailServices.java:835)
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > java.lang.reflect.Method.invoke(Method.java:324)
> > org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
> > org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> > org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> > com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > java.lang.reflect.Method.invoke(Method.java:324)
> > org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
> > org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> > org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> > org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
> > org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
> > org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
> > org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
> > org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
> > org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
> > java.util.TimerThread.mainLoop(Timer.java:432)
> > java.util.TimerThread.run(Timer.java:382)
> > --------------------------------------------------------------------------------
> >
> > 2007-04-20 12:44:03,171 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
> > Service Error [storeIncomingEmail]:
> > 2007-04-20 12:44:03,172 (Thread-0) [    TransactionUtil.java:285:WARN ]
> > ---- exception report
> > ----------------------------------------------------------
> > [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly; this
> > stack trace shows where this is happening:
> > Exception: java.lang.Exception
> > Message: Service Error [storeIncomingEmail]:
> > ---- stack trace
> > ---------------------------------------------------------------
> > java.lang.Exception: Service Error [storeIncomingEmail]:
> > org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:285)
> > org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:235)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> > org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> > com.opensourcestrategies.crmsfa.activities.ActivitiesServices.processIncomingEmail(ActivitiesServices.java:309)
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > java.lang.reflect.Method.invoke(Method.java:324)
> > org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:91)
> > org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:53)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:336)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> > org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> > org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
> > org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
> > org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
> > org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
> > org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
> > org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
> > java.util.TimerThread.mainLoop(Timer.java:432)
> > java.util.TimerThread.run(Timer.java:382)
> > --------------------------------------------------------------------------------
> >
> > 2007-04-20 12:44:03,173 (Thread-0) [         UtilCommon.java:127:ERROR]
> > Failed to process incoming email:
> > 2007-04-20 12:44:03,173 (Thread-0) [  ServiceDispatcher.java:411:ERROR]
> > Service Error [crmsfa.processIncomingEmail]: Failed to process incoming
> > email:
> > 2007-04-20 12:44:03,174 (Thread-0) [    TransactionUtil.java:252:ERROR]
> > ---- exception report
> > ----------------------------------------------------------
> > [TransactionUtil.rollback]
> > Exception: java.lang.Exception
> > Message: Stack Trace
> > ---- stack trace
> > ---------------------------------------------------------------
> > java.lang.Exception: Stack Trace
> > org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
> > org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:415)
> > org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> > org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> > org.ofbiz.service.mail.ServiceMcaAction.runAction(ServiceMcaAction.java:58)
> > org.ofbiz.service.mail.ServiceMcaRule.eval(ServiceMcaRule.java:97)
> > org.ofbiz.service.mail.ServiceMcaUtil.evalRules(ServiceMcaUtil.java:120)
> > org.ofbiz.service.mail.JavaMailContainer$PollerTask.processMessage(JavaMailContainer.java:334)
> > org.ofbiz.service.mail.JavaMailContainer$PollerTask.checkMessages(JavaMailContainer.java:313)
> > org.ofbiz.service.mail.JavaMailContainer$PollerTask.run(JavaMailContainer.java:262)
> > java.util.TimerThread.mainLoop(Timer.java:432)
> > java.util.TimerThread.run(Timer.java:382)
> > --------------------------------------------------------------------------------
> >
> > 2007-04-20 12:44:03,175 (Thread-0) [    TransactionUtil.java:262:INFO ]
> > [TransactionUtil.rollback] transaction rolled back
> > 2007-04-20 12:44:03,176 (Thread-0) [   ServiceMcaAction.java:60 :ERROR]
> > Failed to process incoming email:
> > C: QUIT
> > S: +OK Logging out.
> >
> >
> >
> >
> > BJ Freeman wrote:
> >> could you be more specific about what you are trying to sort?
> >> would this be better served as a entity view?
> >>
> >> Rohit Sureka sent the following on 4/20/2007 9:32 AM:
> >>> Thanks for the email and i am sorry if i did not put my question
> >>> properly.
> >>>
> >>> My real problem is configuring the service to sort emails. I have put the
> >>> MCA rules in place but i am not able to configure the "sortincomingemail'
> >>> service.
> >>>
> >>> I understand that "sortincomingemail" has to be run at regular interval
> >>> to process the email sorting.
> >>>
> >>> Rohit
> >>>
> >>> BJ Freeman <bjfree@free-man.net> wrote: My previous response was aimed at
> >>> sorting the communication events after
> >>> they have been already loaded.
> >>>
> >>> to answer your question, Yes ofbiz will try to match any email to and
> >>> from with those in the parties.
> >>> if it can not find one of the parties, usually the from, it puts the
> >>> address in comments, an marks it unknown email address.
> >>>
> >>>
> >>> The MCA is used to filter the emails. Like:
> >>>
> >>>  link tracking number to order-->
> >>>
> >>>
> >>> value="QuantumViewNotify@ups.com"/>
> >>>
> >>>
> >>>
> >>> in the above I am rerouting the Quantum emails to a process I wrote to
> >>> input the shipping tracking number into an order.
> >>>
> >>> If this is what you were meaning by sort then this is the mechanism to
> >>> to this.
> >>>
> >>> you can find /framework/common/servicedef/smca_test.xml
> >>>
> >>>
> >>> rohit2006 sent the following on 4/19/2007 10:03 PM:
> >>>> i am trying to configure email sorting in ofbiz. I have followed the
> >>>> documentation by Si Chen, to test it. I am assuming that if email
> >>>> sorting is
> >>>> correctly configured, emails will be recorded as communication event for
> >>>> the
> >>>> related parties. For eg. after a email is received ofbiz, will try to
> >>>> match
> >>>> the "to" address, with the email associated to a party, and if a match
> >>>> is
> >>>> found,  a communication event will be logged for the party.
> >>>>
> >>>> I hope that i got this right?
> >>>>
> >>>> I have followed the instruction as mentioned in documentation, and
> >>>> everything loads fine, but when i schedule the service
> >>>> storeincomingemail, i
> >>>> am prompted to enter the service parameter(messageWrapper
> >>>> (org.ofbiz.service.mail.MimeMessageWrapper), which i have no clue about.
> >>>> i
> >>>> guess this is to do something 'MimeMessageWrapper'.
> >>>>
> >>>> The documentation by Si Chen mentions this:
> >>>>
> >>>> 5. MCA services need to implement the mail processing interface, as in:
> >>>>
> >>>> It uses a MimeMessageWrapper:
> >>>>         MimeMessageWrapper wrapper = (MimeMessageWrapper)
> >>>> context.get("messageWrapper");
> >>>> MimeMessage message = wrapper.getMessage();
> >>>> with methods like message.getAllRecipients(), message.getFrom(),
> >>>> message.getSubject(), getAllRecipients(), getSentDate(),
> >>>> getReceivedDate(),
> >>>> etc.
> >>>>
> >>>> Currently (20060607) there is a service called “storeIncomingEmail”
> >>>> which
> >>>> could be used to do inbound mail sorting.  This has not been fully
> >>>> tested
> >>>> yet.
> >>>>
> >>>>
> >>>> I am not sure what to insert in the service parameters.
> >>>>
> >>>> Do we need to create a view for email sorting, cause i think the mails
> >>>> will
> >>>> be visible, under the communication tab, in party manager?
> >>>>
> >>>> Rohit
> >>>>
> >>>>
> >>>>
> >>>> BJ Freeman wrote:
> >>>>> If I understand you, you can create a view with the sorting you want.
> >>>>>
> >>>>> rohit2006 sent the following on 4/19/2007 4:33 AM:
> >>>>>> Hi,
> >>>>>>
> >>>>>> I am trying configure email sorting in ofbiz and store emails as
> >>>>>> communication events. I believe i have to schedule the service
> >>>>>> storeIncomingEmail as a service. I tried to do that and was prompted
> >>>>>> fill
> >>>>>> the fields:
> >>>>>>
> >>>>>> Step 2: Service Parameters
> >>>>>> messageWrapper (org.ofbiz.service.mail.MimeMessageWrapper).
> >>>>>>
> >>>>>> I am not sure what to enter into this field, can someone please help
> >>>>>> me
> >>>>>> configure this. I am getting the following error in log when the
> >>>>>> service
> >>>>>> is
> >>>>>> run
> >>>>>>
> >>>>>> 2007-04-19 05:22:31,302 (default-invoker-Thread-2) [
> >>>>>> JobInvoker.java:211:INFO ] Invoker: default-invoker-Thread-2 received
> >>>>>> job
> >>>>>> --
> >>>>>> 1176985293330 from poller - org.ofbiz.service.job.JobPoller@1be4777
> >>>>>> 2007-04-19 05:22:31,320 (default-invoker-Thread-2)
> >>>>>> [PersistedServiceJob.java:136:INFO ]
> >>>>>> org.ofbiz.service.job.PersistedServiceJob@334bfe[58369] -- Next
> >>>>>> runtime:
> >>>>>> -1
> >>>>>> [Error] :2:12: cvc-elt.1: Cannot find the declaration of element
> >>>>>> 'ofbiz-ser'.
> >>>>>> 2007-04-19 05:22:31,331 (default-invoker-Thread-2) [
> >>>>>> UtilXml.java:243:DEBUG] XML Read 0.0040s: Internal Content
> >>>>>> 2007-04-19 05:22:31,332 (default-invoker-Thread-2) [
> >>>>>> ServiceDispatcher.java:322:ERROR]
> >>>>>> ---- exception report
> >>>>>> ----------------------------------------------------------
> >>>>>> Incoming context (in runSync : storeIncomingEmail) does not match
> >>>>>> expected
> >>>>>> requirements
> >>>>>> Exception: org.ofbiz.service.ServiceValidationException
> >>>>>> Message: The following required parameter is missing:
> >>>>>> [storeIncomingEmail.messageWrapper]
> >>>>>> ---- stack trace
> >>>>>> ---------------------------------------------------------------
> >>>>>> org.ofbiz.service.ServiceValidationException: The following required
> >>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
> >>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> >>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> >>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> >>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> >>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> >>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> >>>>>> java.lang.Thread.run(Thread.java:534)
> >>>>>> --------------------------------------------------------------------------------
> >>>>>>
> >>>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
> >>>>>> ServiceDispatcher.java:385:DEBUG] [[Sync service failed...-
> >>>>>> total:0.0,since
> >>>>>> last(Begin):0.0]] - 'JobDispatcher / storeIncomingEmail'
> >>>>>> 2007-04-19 05:22:31,333 (default-invoker-Thread-2) [
> >>>>>> ServiceDispatcher.java:388:ERROR]
> >>>>>> ---- exception report
> >>>>>> ----------------------------------------------------------
> >>>>>> Service [storeIncomingEmail] threw an unexpected exception/error
> >>>>>> Exception: org.ofbiz.service.ServiceValidationException
> >>>>>> Message: The following required parameter is missing:
> >>>>>> [storeIncomingEmail.messageWrapper]
> >>>>>> ---- stack trace
> >>>>>> ---------------------------------------------------------------
> >>>>>> org.ofbiz.service.ServiceValidationException: The following required
> >>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
> >>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> >>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> >>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> >>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> >>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> >>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> >>>>>> java.lang.Thread.run(Thread.java:534)
> >>>>>> --------------------------------------------------------------------------------
> >>>>>>
> >>>>>> 2007-04-19 05:22:31,334 (default-invoker-Thread-2) [
> >>>>>> TransactionUtil.java:252:ERROR]
> >>>>>> ---- exception report
> >>>>>> ----------------------------------------------------------
> >>>>>> [TransactionUtil.rollback]
> >>>>>> Exception: java.lang.Exception
> >>>>>> Message: Stack Trace
> >>>>>> ---- stack trace
> >>>>>> ---------------------------------------------------------------
> >>>>>> java.lang.Exception: Stack Trace
> >>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:251)
> >>>>>> org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:233)
> >>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:391)
> >>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> >>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> >>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> >>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> >>>>>> java.lang.Thread.run(Thread.java:534)
> >>>>>> --------------------------------------------------------------------------------
> >>>>>>
> >>>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [
> >>>>>> TransactionUtil.java:262:INFO ] [TransactionUtil.rollback] transaction
> >>>>>> rolled back
> >>>>>> 2007-04-19 05:22:31,335 (default-invoker-Thread-2) [
> >>>>>> TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not
> >>>>>> committing
> >>>>>> transaction, status is STATUS_NO_TRANSACTION
> >>>>>> 2007-04-19 05:22:31,336 (default-invoker-Thread-2) [
> >>>>>> GenericServiceJob.java:117:ERROR]
> >>>>>> ---- exception report
> >>>>>> ----------------------------------------------------------
> >>>>>> Async-Service failed.
> >>>>>> Exception: org.ofbiz.service.ServiceValidationException
> >>>>>> Message: The following required parameter is missing:
> >>>>>> [storeIncomingEmail.messageWrapper]
> >>>>>> ---- stack trace
> >>>>>> ---------------------------------------------------------------
> >>>>>> org.ofbiz.service.ServiceValidationException: The following required
> >>>>>> parameter is missing: [storeIncomingEmail.messageWrapper]
> >>>>>> org.ofbiz.service.ModelService.validate(ModelService.java:452)
> >>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:320)
> >>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:211)
> >>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:136)
> >>>>>> org.ofbiz.service.job.GenericServiceJob.exec(GenericServiceJob.java:70)
> >>>>>> org.ofbiz.service.job.JobInvoker.run(JobInvoker.java:221)
> >>>>>> java.lang.Thread.run(Thread.java:534)
> >>>>>> --------------------------------------------------------------------------------
> >>>>>>
> >>>>>> 2007-04-19 05:22:31,342 (default-invoker-Thread-2) [
> >>>>>> SequenceUtil.java:254:INFO ] Got bank of sequenced IDs for
> >>>>>> [JobSandbox];
> >>>>>> curSeqId=58370, maxSeqId=58380, bankSize=10
> >>>>>> 2007-04-19 05:22:31,348 (default-invoker-Thread-2)
> >>>>>> [PersistedServiceJob.java:202:INFO ] Persisted Job [58369] Failed
> >>>>>> Re-Scheduling : 1176985531339
> >>>>>> 2007-04-19 05:22:37,711 (http-0.0.0.0-7443-Processor1) [
> >>>>>> ContextFilter.java:182:INFO ] [Request]: /webtools/control/jobList
> >>>>>> 2007-04-19 05:22:37,712 (http-0.0.0.0-7443-Processor1) [
> >>>>>> ControlServlet.java:90 :INFO ] The character encoding of the request
> >>>>>> is:
> >>>>>> [null]. The character encoding we will use for the request and
> >>>>>> response
> >>>>>> is:
> >>>>>> [UTF-8]
> >>>>>> 2007-04-19 05:22:37,713 (http-0.0.0.0-7443-Processor1) [
> >>>>>> ControlServlet.java:126:DEBUG] [[[jobList] Servlet Starting, doing
> >>>>>> setup-
> >>>>>> total:0.0,since last(Begin):0.0]]
> >>>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [
> >>>>>> ControlServlet.java:181:DEBUG] [[[jobList] Setup done, doing Event(s)
> >>>>>> and
> >>>>>> View(s)- total:0.0,since last([jobList] Servlet...):0.0]]
> >>>>>> 2007-04-19 05:22:37,714 (http-0.0.0.0-7443-Processor1) [
> >>>>>> RequestHandler.java:266:INFO ] [Processing Request]: jobList
> >>>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> >>>>>> 2007-04-19 05:22:37,715 (http-0.0.0.0-7443-Processor1) [
> >>>>>> RequestManager.java:117:INFO ] [RequestManager.getRequestAttribute]
> >>>>>> Value
> >>>>>> for attribute "null" of uri "jobList" not found
> >>>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [
> >>>>>> RequestHandler.java:450:INFO ] [RequestHandler.doRequest]: Response is
> >>>>>> a
> >>>>>> view. sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> >>>>>> 2007-04-19 05:22:37,716 (http-0.0.0.0-7443-Processor1) [
> >>>>>> RequestHandler.java:603:INFO ] servletName=control, view=jobList
> >>>>>> sessionId=1508B221763B3DC07A253921591B5DA1.jvm1
> >>>>>> 2007-04-19 05:22:37,717 (http-0.0.0.0-7443-Processor1) [
> >>>>>> ScreenRenderer.java:220:INFO ] Found servlet context (application)
> >>>>>> attribute
> >>>>>> that conflicts with parameter name, leaving request parameter in place
> >>>>>> for
> >>>>>> name: _REQUEST_HANDLER_
> >>>>>> 2007-04-19 05:22:37,826 (http-0.0.0.0-7443-Processor1) [
> >>>>>> ModelScreenWidget.java:361:INFO ] In the include-screen tag the screen
> >>>>>> name
> >>>>>> was empty, ignoring include; in screen [GlobalDecorator]
> >>>>>> 2007-04-19 05:22:37,857 (http-0.0.0.0-7443-Processor1) [
> >>>>>> ControlServlet.java:256:DEBUG] [[[jobList] Done rendering page,
> >>>>>> Servlet
> >>>>>> Finished- total:0.143,since last([jobList] Setup d...):0.143]]
> >>>>>>
> >>>>>>
> >>>
> >>>
> >>>
> >>> ---------------------------------
> >>> Ahhh...imagining that irresistible "new car" smell?
> >>>  Check outnew cars at Yahoo! Autos.
> >>
> >>
> >
>
>


--
Guido Amarilla