[jira] [Commented] (OFBIZ-5016) createCommContentDataResource service error
[ https://issues.apache.org/jira/browse/OFBIZ-5016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13438515#comment-13438515 ] Jacques Le Roux commented on OFBIZ-5016: Hi Eric, Could you reproduce on trunk or rather (trunk data are swipped everyday) give here all the elements/steps/specificities of your order? > createCommContentDataResource service error > --- > > Key: OFBIZ-5016 > URL: https://issues.apache.org/jira/browse/OFBIZ-5016 > Project: OFBiz > Issue Type: Bug > Components: ALL APPLICATIONS >Affects Versions: SVN trunk > Environment: trunk 1374736, database : Derby on Debian >Reporter: Eric de Maulde >Priority: Minor > > Hi, > When I process an order ("Submit order") on page "Final Checkout Review", > there is a "createCommContentDataResource" service return error, > in order to send an order email : > 2012-08-21 02:25:46,457 (OFBiz-JobQueue-0) [ ModelService.java:571:ERROR] > [ModelService.validate] : {createCommContentDataResource} : (OUT) Required > test error: org.ofbiz.service.ServiceValidationException: Unknown parameter > found: [createCommContentDataResource.success] > So the complete order email is sent several times ... > I've searched but I haven't found the OUT parameter "success", instead of > "successMessage". > Eric -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (OFBIZ-5016) createCommContentDataResource service error
[ https://issues.apache.org/jira/browse/OFBIZ-5016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13438537#comment-13438537 ] Eric de Maulde commented on OFBIZ-5016: --- This error appears on demo trunk server too : https://demo-trunk.ofbiz.apache.org:8443/ecommerce I created the order id : WSCO10003 The full error is : 2012-08-21 09:39:06,237 (OFBiz-JobQueue-0) [ ModelService.java:571:ERROR] [ModelService.validate] : {createCommContentDataResource} : (OUT) Required test error: org.ofbiz.service.ServiceValidationException: Unknown parameter found: [createCommContentDataResource.success] 2012-08-21 09:39:06,238 (OFBiz-JobQueue-0) [ ServiceDispatcher.java:492:INFO ] [[Sync service failed...- total:0.0,since last(Begin):0.0]] - 'default / createCommContentDataResource' 2012-08-21 09:39:06,239 (OFBiz-JobQueue-0) [ TransactionUtil.java:379:WARN ] exception report -- [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly; this stack trace shows where this is happening: Exception: java.lang.Exception Message: Service [createCommContentDataResource] threw an unexpected exception/error stack trace --- java.lang.Exception: Service [createCommContentDataResource] threw an unexpected exception/error org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:379) org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:320) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:497) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:215) org.ofbiz.service.GenericDispatcherFactory$GenericDispatcher.runSync(GenericDispatcherFactory.java:83) org.ofbiz.party.communication.CommunicationEventServices.createAttachmentContent(CommunicationEventServices.java:1022) org.ofbiz.party.communication.CommunicationEventServices.updateCommEventAfterEmail(CommunicationEventServices.java:648) 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:597) org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:100) org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:57) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:380) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:215) org.ofbiz.service.GenericDispatcherFactory$GenericDispatcher.runSync(GenericDispatcherFactory.java:83) org.ofbiz.service.eca.ServiceEcaAction.runAction(ServiceEcaAction.java:138) org.ofbiz.service.eca.ServiceEcaRule.eval(ServiceEcaRule.java:159) org.ofbiz.service.eca.ServiceEcaUtil.evalRules(ServiceEcaUtil.java:188) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:477) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:215) org.ofbiz.service.GenericDispatcherFactory$GenericDispatcher.runSync(GenericDispatcherFactory.java:83) org.ofbiz.common.email.EmailServices.sendMailFromScreen(EmailServices.java:582) 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:597) org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:100) org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:57) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:380) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:215) org.ofbiz.service.GenericDispatcherFactory$GenericDispatcher.runSync(GenericDispatcherFactory.java:83) org.ofbiz.order.order.OrderServices.sendOrderNotificationScreen(OrderServices.java:2622) org.ofbiz.order.order.OrderServices.sendOrderConfirmNotification(OrderServices.java:2469) 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:597) org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:100) org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:57) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:380) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:215) org.ofbiz.service.GenericDispatcherFactory$GenericDispatcher.runSync(GenericDispatcherFactory.java:83) org.ofbiz.service.job.GenericServiceJob.exec(GenericServi
[jira] [Comment Edited] (OFBIZ-5016) createCommContentDataResource service error
[ https://issues.apache.org/jira/browse/OFBIZ-5016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13438537#comment-13438537 ] Eric de Maulde edited comment on OFBIZ-5016 at 8/21/12 7:45 PM: This error appears on demo trunk server too : https://demo-trunk.ofbiz.apache.org:8443/ecommerce I created the order id : WSCO10003 The full error is : 2012-08-21 09:39:06,237 (OFBiz-JobQueue-0) [ ModelService.java:571:ERROR] [ModelService.validate] : {createCommContentDataResource} : (OUT) Required test error: org.ofbiz.service.ServiceValidationException: Unknown parameter found: [createCommContentDataResource.success] 2012-08-21 09:39:06,238 (OFBiz-JobQueue-0) [ ServiceDispatcher.java:492:INFO ] [[Sync service failed...- total:0.0,since last(Begin):0.0]] - 'default / createCommContentDataResource' 2012-08-21 09:39:06,239 (OFBiz-JobQueue-0) [ TransactionUtil.java:379:WARN ] exception report -- [TransactionUtil.setRollbackOnly] Calling transaction setRollbackOnly; this stack trace shows where this is happening: Exception: java.lang.Exception Message: Service [createCommContentDataResource] threw an unexpected exception/error stack trace --- java.lang.Exception: Service [createCommContentDataResource] threw an unexpected exception/error org.ofbiz.entity.transaction.TransactionUtil.setRollbackOnly(TransactionUtil.java:379) org.ofbiz.entity.transaction.TransactionUtil.rollback(TransactionUtil.java:320) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:497) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:215) org.ofbiz.service.GenericDispatcherFactory$GenericDispatcher.runSync(GenericDispatcherFactory.java:83) org.ofbiz.party.communication.CommunicationEventServices.createAttachmentContent(CommunicationEventServices.java:1022) org.ofbiz.party.communication.CommunicationEventServices.updateCommEventAfterEmail(CommunicationEventServices.java:648) 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:597) org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:100) org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:57) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:380) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:215) org.ofbiz.service.GenericDispatcherFactory$GenericDispatcher.runSync(GenericDispatcherFactory.java:83) org.ofbiz.service.eca.ServiceEcaAction.runAction(ServiceEcaAction.java:138) org.ofbiz.service.eca.ServiceEcaRule.eval(ServiceEcaRule.java:159) org.ofbiz.service.eca.ServiceEcaUtil.evalRules(ServiceEcaUtil.java:188) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:477) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:215) org.ofbiz.service.GenericDispatcherFactory$GenericDispatcher.runSync(GenericDispatcherFactory.java:83) org.ofbiz.common.email.EmailServices.sendMailFromScreen(EmailServices.java:582) 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:597) org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:100) org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:57) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:380) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:215) org.ofbiz.service.GenericDispatcherFactory$GenericDispatcher.runSync(GenericDispatcherFactory.java:83) org.ofbiz.order.order.OrderServices.sendOrderNotificationScreen(OrderServices.java:2622) org.ofbiz.order.order.OrderServices.sendOrderConfirmNotification(OrderServices.java:2469) 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:597) org.ofbiz.service.engine.StandardJavaEngine.serviceInvoker(StandardJavaEngine.java:100) org.ofbiz.service.engine.StandardJavaEngine.runSync(StandardJavaEngine.java:57) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:380) org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:215) org.ofbiz.service.GenericDispatcherFactory$GenericDispatcher.runSync(GenericDispatcherFactory.java:83) org.ofbi
[jira] [Updated] (OFBIZ-5011) Complete French traduction for accounting component
[ https://issues.apache.org/jira/browse/OFBIZ-5011?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux updated OFBIZ-5011: --- Attachment: OFBIZ-5011.patch.patch OFBIZ-5011.patch Nicolas, Erwan, Voici les différences sur le patch (OFBIZ-5011.patch.patch) ainsi que le patch retouché. > Complete French traduction for accounting component > --- > > Key: OFBIZ-5011 > URL: https://issues.apache.org/jira/browse/OFBIZ-5011 > Project: OFBiz > Issue Type: Improvement > Components: accounting >Affects Versions: SVN trunk >Reporter: Nicolas Malin >Assignee: Erwan de FERRIERES >Priority: Trivial > Attachments: OFBIZ-5011.patch, OFBIZ-5011.patch, > OFBIZ-5011.patch.patch > > > all in title ;) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (OFBIZ-5011) Complete French traduction for accounting component
[ https://issues.apache.org/jira/browse/OFBIZ-5011?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13438809#comment-13438809 ] Jacques Le Roux commented on OFBIZ-5011: I mean, Nicolas, Erwan, here is the diff on the intial patch and the amended patch attached :) > Complete French traduction for accounting component > --- > > Key: OFBIZ-5011 > URL: https://issues.apache.org/jira/browse/OFBIZ-5011 > Project: OFBiz > Issue Type: Improvement > Components: accounting >Affects Versions: SVN trunk >Reporter: Nicolas Malin >Assignee: Erwan de FERRIERES >Priority: Trivial > Attachments: OFBIZ-5011.patch, OFBIZ-5011.patch, > OFBIZ-5011.patch.patch > > > all in title ;) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (OFBIZ-5015) Update Lucene 3.5 to 4.0
[ https://issues.apache.org/jira/browse/OFBIZ-5015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13439003#comment-13439003 ] Jacques Le Roux commented on OFBIZ-5015: Not sure what other commiters think, but I'm not too keen to go with alpha libs... > Update Lucene 3.5 to 4.0 > > > Key: OFBIZ-5015 > URL: https://issues.apache.org/jira/browse/OFBIZ-5015 > Project: OFBiz > Issue Type: Improvement > Components: content >Affects Versions: SVN trunk >Reporter: Mirko Vogelsmeier > Attachments: lucene-4.0.patch, > lucene-analyzers-common-4.0.0-ALPHA.jar, lucene-core-4.0.0-ALPHA.jar, > lucene-queryparser-4.0.0-ALPHA.jar > > > Hi, > i did update from lucene-3.5 to lucene-4.0. > As soime Objects are now seperated into another packages, i had to add 2 more > libs. > Just add the libs to application/content/lib and apply the patch. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (OFBIZ-5004) Warning in GenericEntity.get unnecessarily clutters logs
[ https://issues.apache.org/jira/browse/OFBIZ-5004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13439005#comment-13439005 ] Jacques Le Roux commented on OFBIZ-5004: +1 to let this pop up and let developpers handle it > Warning in GenericEntity.get unnecessarily clutters logs > > > Key: OFBIZ-5004 > URL: https://issues.apache.org/jira/browse/OFBIZ-5004 > Project: OFBiz > Issue Type: Bug > Components: framework >Affects Versions: SVN trunk >Reporter: Christoph Neuroth > > This code in GenericEntity.java: > {code}Debug.logWarning("The field name (or key) [" + name + "] is not valid > for entity [" + this.getEntityName() + "], printing IllegalArgumentException > instead of throwing it because Map interface specification does not allow > throwing that exception.", module); > {code} > is really annoying and IMHO it is wrong. > First, it does not print an exception, it only prints that string with no > stacktrace (I think that was changed at some point). > Second, IllegalArgument is a RuntimeException so the interface doesn't really > need to allow it to be thrown, right? > Personally, I think the warning is not even justified. We sometimes don't > know exactly what kind of entity we're dealing with and just check if it has > that field or not. With this code, to prevent excessive log clutter, we have > to wrap each call with a "if (it.containsKey())". A java map will just return > null silently as well, and this behavior is documented in the Map interface. > If anyone is really worried about accessing fields wrong (your tests should > catch that error), there could be an extra method "getOrThrow" or something, > but get should just return the value or null. > Otherwise, at least throw the exception. Log warnings are usually found while > monitoring production logs, developers will find this much earlier otherwise. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (OFBIZ-5004) Warning in GenericEntity.get unnecessarily clutters logs
[ https://issues.apache.org/jira/browse/OFBIZ-5004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13439102#comment-13439102 ] Adrian Crum commented on OFBIZ-5004: Jacques, I don't understand. Are you saying we should continue to log pointless warnings that a perfectly legitimate Map method was invoked? > Warning in GenericEntity.get unnecessarily clutters logs > > > Key: OFBIZ-5004 > URL: https://issues.apache.org/jira/browse/OFBIZ-5004 > Project: OFBiz > Issue Type: Bug > Components: framework >Affects Versions: SVN trunk >Reporter: Christoph Neuroth > > This code in GenericEntity.java: > {code}Debug.logWarning("The field name (or key) [" + name + "] is not valid > for entity [" + this.getEntityName() + "], printing IllegalArgumentException > instead of throwing it because Map interface specification does not allow > throwing that exception.", module); > {code} > is really annoying and IMHO it is wrong. > First, it does not print an exception, it only prints that string with no > stacktrace (I think that was changed at some point). > Second, IllegalArgument is a RuntimeException so the interface doesn't really > need to allow it to be thrown, right? > Personally, I think the warning is not even justified. We sometimes don't > know exactly what kind of entity we're dealing with and just check if it has > that field or not. With this code, to prevent excessive log clutter, we have > to wrap each call with a "if (it.containsKey())". A java map will just return > null silently as well, and this behavior is documented in the Map interface. > If anyone is really worried about accessing fields wrong (your tests should > catch that error), there could be an extra method "getOrThrow" or something, > but get should just return the value or null. > Otherwise, at least throw the exception. Log warnings are usually found while > monitoring production logs, developers will find this much earlier otherwise. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (OFBIZ-5004) Warning in GenericEntity.get unnecessarily clutters logs
[ https://issues.apache.org/jira/browse/OFBIZ-5004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13439112#comment-13439112 ] Adrian Crum commented on OFBIZ-5004: To be absolutely clear, executing this code: {code} Object someValue = someMap.get("thisKeyDoesNotExist"); {code} does not generate any warnings in any Map implementation EXCEPT GenericEntity. And we are proposing that GenericEntity follow the Map convention. > Warning in GenericEntity.get unnecessarily clutters logs > > > Key: OFBIZ-5004 > URL: https://issues.apache.org/jira/browse/OFBIZ-5004 > Project: OFBiz > Issue Type: Bug > Components: framework >Affects Versions: SVN trunk >Reporter: Christoph Neuroth > > This code in GenericEntity.java: > {code}Debug.logWarning("The field name (or key) [" + name + "] is not valid > for entity [" + this.getEntityName() + "], printing IllegalArgumentException > instead of throwing it because Map interface specification does not allow > throwing that exception.", module); > {code} > is really annoying and IMHO it is wrong. > First, it does not print an exception, it only prints that string with no > stacktrace (I think that was changed at some point). > Second, IllegalArgument is a RuntimeException so the interface doesn't really > need to allow it to be thrown, right? > Personally, I think the warning is not even justified. We sometimes don't > know exactly what kind of entity we're dealing with and just check if it has > that field or not. With this code, to prevent excessive log clutter, we have > to wrap each call with a "if (it.containsKey())". A java map will just return > null silently as well, and this behavior is documented in the Map interface. > If anyone is really worried about accessing fields wrong (your tests should > catch that error), there could be an extra method "getOrThrow" or something, > but get should just return the value or null. > Otherwise, at least throw the exception. Log warnings are usually found while > monitoring production logs, developers will find this much earlier otherwise. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (OFBIZ-5004) Warning in GenericEntity.get unnecessarily clutters logs
[ https://issues.apache.org/jira/browse/OFBIZ-5004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13439112#comment-13439112 ] Adrian Crum edited comment on OFBIZ-5004 at 8/22/12 9:31 AM: - To be absolutely clear, executing this code: {code} Object someValue = someMap.get("thisKeyDoesNotExist"); {code} does not generate any warnings in any Map implementation EXCEPT GenericEntity. And we are proposing that GenericEntity follow the Map convention. was (Author: adri...@hlmksw.com): To be absolutely clear, executing this code: {code} Object someValue = someMap.get("thisKeyDoesNotExist"); {code} does not generate any warnings in any Map implementation EXCEPT GenericEntity. And we are proposing that GenericEntity follow the Map convention. > Warning in GenericEntity.get unnecessarily clutters logs > > > Key: OFBIZ-5004 > URL: https://issues.apache.org/jira/browse/OFBIZ-5004 > Project: OFBiz > Issue Type: Bug > Components: framework >Affects Versions: SVN trunk >Reporter: Christoph Neuroth > > This code in GenericEntity.java: > {code}Debug.logWarning("The field name (or key) [" + name + "] is not valid > for entity [" + this.getEntityName() + "], printing IllegalArgumentException > instead of throwing it because Map interface specification does not allow > throwing that exception.", module); > {code} > is really annoying and IMHO it is wrong. > First, it does not print an exception, it only prints that string with no > stacktrace (I think that was changed at some point). > Second, IllegalArgument is a RuntimeException so the interface doesn't really > need to allow it to be thrown, right? > Personally, I think the warning is not even justified. We sometimes don't > know exactly what kind of entity we're dealing with and just check if it has > that field or not. With this code, to prevent excessive log clutter, we have > to wrap each call with a "if (it.containsKey())". A java map will just return > null silently as well, and this behavior is documented in the Map interface. > If anyone is really worried about accessing fields wrong (your tests should > catch that error), there could be an extra method "getOrThrow" or something, > but get should just return the value or null. > Otherwise, at least throw the exception. Log warnings are usually found while > monitoring production logs, developers will find this much earlier otherwise. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (OFBIZ-5004) Warning in GenericEntity.get unnecessarily clutters logs
[ https://issues.apache.org/jira/browse/OFBIZ-5004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13439208#comment-13439208 ] Scott Gray commented on OFBIZ-5004: --- The warnings are not by any means pointless. Reason to remove: "I'm dealing with an unknown entity and the warnings fill my logs" Solution: Use GenericEntity.getEntityName() or (GenericEntity.getModelEntity().isField(String) *do not* use GenericEntity.containsKey(String) because GenericEntity can carry a partially populated value that will return false for valid fields. Doing a set or a get without knowing that it is a valid operation for the given entity sounds like a terrible practice to me. Reason to keep: Typos are easy to make and there's no build-time protection available, I've located issues in production numerous times because of this logging and that's exactly why it exists, to warn developers when they do something they shouldn't. The only reason it doesn't actually throw the exception is because the Map spec doesn't allow it. Please don't change this, the risks far outweigh the benefits here. > Warning in GenericEntity.get unnecessarily clutters logs > > > Key: OFBIZ-5004 > URL: https://issues.apache.org/jira/browse/OFBIZ-5004 > Project: OFBiz > Issue Type: Bug > Components: framework >Affects Versions: SVN trunk >Reporter: Christoph Neuroth > > This code in GenericEntity.java: > {code}Debug.logWarning("The field name (or key) [" + name + "] is not valid > for entity [" + this.getEntityName() + "], printing IllegalArgumentException > instead of throwing it because Map interface specification does not allow > throwing that exception.", module); > {code} > is really annoying and IMHO it is wrong. > First, it does not print an exception, it only prints that string with no > stacktrace (I think that was changed at some point). > Second, IllegalArgument is a RuntimeException so the interface doesn't really > need to allow it to be thrown, right? > Personally, I think the warning is not even justified. We sometimes don't > know exactly what kind of entity we're dealing with and just check if it has > that field or not. With this code, to prevent excessive log clutter, we have > to wrap each call with a "if (it.containsKey())". A java map will just return > null silently as well, and this behavior is documented in the Map interface. > If anyone is really worried about accessing fields wrong (your tests should > catch that error), there could be an extra method "getOrThrow" or something, > but get should just return the value or null. > Otherwise, at least throw the exception. Log warnings are usually found while > monitoring production logs, developers will find this much earlier otherwise. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (OFBIZ-5004) Warning in GenericEntity.get unnecessarily clutters logs
[ https://issues.apache.org/jira/browse/OFBIZ-5004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13439300#comment-13439300 ] Christoph Neuroth commented on OFBIZ-5004: -- {quote}Typos are easy to make and there's no build-time protection available{quote} Actually there is: Running your tests during the build. {quote}The only reason it doesn't actually throw the exception is because the Map spec doesn't allow it.{quote} Again, it doesn't have to: This is a perfectly valid case to throw an IllegalArgumentException which is a RuntimeException and as such doesn't have to be explicitly allowed by the interface. Developers do not read logs during development. They read logs when things break in production. > Warning in GenericEntity.get unnecessarily clutters logs > > > Key: OFBIZ-5004 > URL: https://issues.apache.org/jira/browse/OFBIZ-5004 > Project: OFBiz > Issue Type: Bug > Components: framework >Affects Versions: SVN trunk >Reporter: Christoph Neuroth > > This code in GenericEntity.java: > {code}Debug.logWarning("The field name (or key) [" + name + "] is not valid > for entity [" + this.getEntityName() + "], printing IllegalArgumentException > instead of throwing it because Map interface specification does not allow > throwing that exception.", module); > {code} > is really annoying and IMHO it is wrong. > First, it does not print an exception, it only prints that string with no > stacktrace (I think that was changed at some point). > Second, IllegalArgument is a RuntimeException so the interface doesn't really > need to allow it to be thrown, right? > Personally, I think the warning is not even justified. We sometimes don't > know exactly what kind of entity we're dealing with and just check if it has > that field or not. With this code, to prevent excessive log clutter, we have > to wrap each call with a "if (it.containsKey())". A java map will just return > null silently as well, and this behavior is documented in the Map interface. > If anyone is really worried about accessing fields wrong (your tests should > catch that error), there could be an extra method "getOrThrow" or something, > but get should just return the value or null. > Otherwise, at least throw the exception. Log warnings are usually found while > monitoring production logs, developers will find this much earlier otherwise. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira