Hi All,
Got this error when trying to create a PDF file for an Invoice. Target exception:... is repeated four times in the actual error, seems like it's failing on some iteration but I can't nail it down. Thanks for any help. Tom org.ofbiz.base.util.GeneralException: Error rendering screen [component://accounting/widget/AccountingPrintForms.xml#InvoicePDF]: org.ofbiz.base.util.GeneralException: Error running BSH script at location [component://accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh]: org.ofbiz.base.util.GeneralException: Error running BSH script at [component://accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh], line [89]: Sourced file: component://accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh : Method Invocation invoice.getRelated : at Line: 89 : in file: component://accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh : invoice .getRelated ( "InvoiceTerm" ) Target exception: org.ofbiz.entity.transaction.GenericTransactionException: The current transaction is marked for rollback, not beginning a new transaction and aborting current operation; the rollbackOnly was caused by: Failure in findByCondition operation for entity [InvoiceItem]: org.ofbiz.entity.GenericDataSourceException: SQL Exception while executing the following:SELECT INVOICE_ID, INVOICE_ITEM_SEQ_ID, INVOICE_ITEM_TYPE_ID, OVERRIDE_GL_ACCOUNT_ID, INVENTORY_ITEM_ID, PRODUCT_ID, PRODUCT_FEATURE_ID, PARENT_INVOICE_ID, PARENT_INVOICE_ITEM_SEQ_ID, UOM_ID, TAXABLE_FLAG, QUANTITY, AMOUNT, DESCRIPTION, TAX_AUTH_PARTY_ID, TAX_AUTH_GEO_ID, TAX_AUTHORITY_RATE_SEQ_ID, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP FROM public.INVOICE_ITEM WHERE (INVOICE_ID = ? AND INVOICE_ITEM_TYPE_ID IN ()) (ERROR: syntax error at or near ")"). Rolling back transaction.org.ofbiz.entity.GenericDataSourceException: SQL Exception while executing the following:SELECT INVOICE_ID, INVOICE_ITEM_SEQ_ID, INVOICE_ITEM_TYPE_ID, OVERRIDE_GL_ACCOUNT_ID, INVENTORY_ITEM_ID, PRODUCT_ID, PRODUCT_FEATURE_ID, PARENT_INVOICE_ID, PARENT_INVOICE_ITEM_SEQ_ID, UOM_ID, TAXABLE_FLAG, QUANTITY, AMOUNT, DESCRIPTION, TAX_AUTH_PARTY_ID, TAX_AUTH_GEO_ID, TAX_AUTHORITY_RATE_SEQ_ID, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP FROM public.INVOICE_ITEM WHERE (INVOICE_ID = ? AND INVOICE_ITEM_TYPE_ID IN ()) (ERROR: syntax error at or near ")") (SQL Exception while executing the following:SELECT INVOICE_ID, INVOICE_ITEM_SEQ_ID, INVOICE_ITEM_TYPE_ID, OVERRIDE_GL_ACCOUNT_ID, INVENTORY_ITEM_ID, PRODUCT_ID, PRODUCT_FEATURE_ID, PARENT_INVOICE_ID, PARENT_INVOICE_ITEM_SEQ_ID, UOM_ID, TAXABLE_FLAG, QUANTITY, AMOUNT, DESCRIPTION, TAX_AUTH_PARTY_ID, TAX_AUTH_GEO_ID, TAX_AUTHORITY_RATE_SEQ_ID, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP FROM public.INVOICE_ITEM WHERE (INVOICE_ID = ? AND INVOICE_ITEM_TYPE_ID IN ()) (ERROR: syntax error at or near ")")) (Sourced file: component://accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh : Method Invocation invoice.getRelated) (Error running BSH script at [component://accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh], line [89]: Sourced file: component://accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh : Method Invocation invoice.getRelated : at Line: 89 : in file: component://accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh : invoice .getRelated ( "InvoiceTerm" ) |
Tom,
Is this standard OFBiz code and data? I just did a clean download, build and test and the invoice PDF came up OK. Maybe you could furnish a few more details like OFBiz version, platform, DB and most useful if you can reproduce using the default data what products did you add to your order? Ray Brettonwoods wrote: > Hi All, > > Got this error when trying to create a PDF file for an Invoice. > Target exception:... is repeated four times in the actual error, seems like > it's failing on some iteration but I can't nail it down. > > Thanks for any help. > > Tom > > org.ofbiz.base.util.GeneralException: Error rendering screen > [component://accounting/widget/AccountingPrintForms.xml#InvoicePDF]: > org.ofbiz.base.util.GeneralException: Error running BSH script at location > [component://accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh]: > org.ofbiz.base.util.GeneralException: Error running BSH script at > [component://accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh], > line [89]: Sourced file: > > |
In reply to this post by Tom
Ray,
The code I am working with is a fresh compile "svn update / ant clean-all / ant" as of today. The problem is manifest on two systems that are independent of one another, a desktop and notebook. The common element is that the invoices were created in the work effort module from time-sheets. To try to reproduce, create a time sheet, add an entry, from the time sheet view, enter a Bill From Party and Bill To Party then select 'Add Work Effort Time To New Invoice'. Select the Accounting Tab > Show All Invoices > Click on the last invoice in the Invoice Id column. Click the 'PDF' button. Under some condition the PDF creation will fail (and under others it will succeed, as I am finding out). It's getting late, I'll do some more testing in the morning. Thanks for taking a look, Tom ----- Original Message ---- From: Ray Barlow <[hidden email]> To: [hidden email] Sent: Friday, March 23, 2007 3:39:14 PM Subject: Re: Invoice PDF Error Tom, Is this standard OFBiz code and data? I just did a clean download, build and test and the invoice PDF came up OK. Maybe you could furnish a few more details like OFBiz version, platform, DB and most useful if you can reproduce using the default data what products did you add to your order? Ray Brettonwoods wrote: > Hi All, > > Got this error when trying to create a PDF file for an Invoice. > Target exception:... is repeated four times in the actual error, seems like > it's failing on some iteration but I can't nail it down. > > Thanks for any help. > > Tom > > org.ofbiz.base.util.GeneralException: Error rendering screen > [component://accounting/widget/AccountingPrintForms.xml#InvoicePDF]: > org.ofbiz.base.util.GeneralException: Error running BSH script at location > [component://accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh]: > org.ofbiz.base.util.GeneralException: Error running BSH script at > [component://accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh], > line [89]: Sourced file: > > |
In reply to this post by Tom
This is an interesting error and brings up a lower level issue. When there is an IN operator and an empty set passed to it, what should we do? I would say this should always result in a "false". Should we change the entity engine to somehow always represent this as a FALSE? I'm looking at doing this right now to avoid this problem, but if anyone has any opinions please let me know... -David On Mar 23, 2007, at 11:21 AM, Brettonwoods wrote: > > Hi All, > > Got this error when trying to create a PDF file for an Invoice. > Target exception:... is repeated four times in the actual error, > seems like > it's failing on some iteration but I can't nail it down. > > Thanks for any help. > > Tom > > org.ofbiz.base.util.GeneralException: Error rendering screen > [component://accounting/widget/AccountingPrintForms.xml#InvoicePDF]: > org.ofbiz.base.util.GeneralException: Error running BSH script at > location > [component://accounting/webapp/accounting/WEB-INF/actions/invoice/ > editInvoice.bsh]: > org.ofbiz.base.util.GeneralException: Error running BSH script at > [component://accounting/webapp/accounting/WEB-INF/actions/invoice/ > editInvoice.bsh], > line [89]: Sourced file: > component://accounting/webapp/accounting/WEB-INF/actions/invoice/ > editInvoice.bsh > : Method Invocation invoice.getRelated : at Line: 89 : in file: > component://accounting/webapp/accounting/WEB-INF/actions/invoice/ > editInvoice.bsh > : invoice .getRelated ( "InvoiceTerm" ) > > Target exception: > org.ofbiz.entity.transaction.GenericTransactionException: > The current transaction is marked for rollback, not beginning a new > transaction and aborting current operation; the rollbackOnly was > caused by: > Failure in findByCondition operation for entity [InvoiceItem]: > org.ofbiz.entity.GenericDataSourceException: SQL Exception while > executing > the following:SELECT INVOICE_ID, INVOICE_ITEM_SEQ_ID, > INVOICE_ITEM_TYPE_ID, > OVERRIDE_GL_ACCOUNT_ID, INVENTORY_ITEM_ID, PRODUCT_ID, > PRODUCT_FEATURE_ID, > PARENT_INVOICE_ID, PARENT_INVOICE_ITEM_SEQ_ID, UOM_ID, TAXABLE_FLAG, > QUANTITY, AMOUNT, DESCRIPTION, TAX_AUTH_PARTY_ID, TAX_AUTH_GEO_ID, > TAX_AUTHORITY_RATE_SEQ_ID, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, > CREATED_STAMP, CREATED_TX_STAMP FROM public.INVOICE_ITEM WHERE > (INVOICE_ID = > ? AND INVOICE_ITEM_TYPE_ID IN ()) (ERROR: syntax error at or near > ")"). > Rolling back > transaction.org.ofbiz.entity.GenericDataSourceException: SQL > Exception while executing the following:SELECT INVOICE_ID, > INVOICE_ITEM_SEQ_ID, INVOICE_ITEM_TYPE_ID, OVERRIDE_GL_ACCOUNT_ID, > INVENTORY_ITEM_ID, PRODUCT_ID, PRODUCT_FEATURE_ID, PARENT_INVOICE_ID, > PARENT_INVOICE_ITEM_SEQ_ID, UOM_ID, TAXABLE_FLAG, QUANTITY, AMOUNT, > DESCRIPTION, TAX_AUTH_PARTY_ID, TAX_AUTH_GEO_ID, > TAX_AUTHORITY_RATE_SEQ_ID, > LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, > CREATED_TX_STAMP > FROM public.INVOICE_ITEM WHERE (INVOICE_ID = ? AND > INVOICE_ITEM_TYPE_ID IN > ()) (ERROR: syntax error at or near ")") (SQL Exception while > executing the > following:SELECT INVOICE_ID, INVOICE_ITEM_SEQ_ID, > INVOICE_ITEM_TYPE_ID, > OVERRIDE_GL_ACCOUNT_ID, INVENTORY_ITEM_ID, PRODUCT_ID, > PRODUCT_FEATURE_ID, > PARENT_INVOICE_ID, PARENT_INVOICE_ITEM_SEQ_ID, UOM_ID, TAXABLE_FLAG, > QUANTITY, AMOUNT, DESCRIPTION, TAX_AUTH_PARTY_ID, TAX_AUTH_GEO_ID, > TAX_AUTHORITY_RATE_SEQ_ID, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, > CREATED_STAMP, CREATED_TX_STAMP FROM public.INVOICE_ITEM WHERE > (INVOICE_ID = > ? AND INVOICE_ITEM_TYPE_ID IN ()) (ERROR: syntax error at or near > ")")) > (Sourced file: > component://accounting/webapp/accounting/WEB-INF/actions/invoice/ > editInvoice.bsh > : Method Invocation invoice.getRelated) (Error running BSH script at > [component://accounting/webapp/accounting/WEB-INF/actions/invoice/ > editInvoice.bsh], > line [89]: Sourced file: > component://accounting/webapp/accounting/WEB-INF/actions/invoice/ > editInvoice.bsh > : Method Invocation invoice.getRelated : at Line: 89 : in file: > component://accounting/webapp/accounting/WEB-INF/actions/invoice/ > editInvoice.bsh > : invoice .getRelated ( "InvoiceTerm" ) > > -- > View this message in context: http://www.nabble.com/Invoice-PDF- > Error-tf3455217.html#a9639466 > Sent from the OFBiz - User mailing list archive at Nabble.com. > smime.p7s (3K) Download Attachment |
In reply to this post by Tom
Tom,
The extra reproduction information helps a lot and I did manage to create an invoice that crashed. It looks like a different error for me (see below), maybe related to a null currency but certainly some more debugging required around the invoice creation and possibly null pointer checks in the PDF code. That said though I'm not likely to dig any further into this over the next couple of days as other commitments have me diverted. Ray 2007-03-24 07:47:33,236 (http-0.0.0.0-8443-Processor2) [ ServiceDispatcher.java:459:DEBUG] [[Sync service finished- total:0.15,since last(Begin):0.15]] - 'accounting / getPartyNameForDate' 2007-03-24 07:47:33,576 (http-0.0.0.0-8443-Processor2) [ ModelScreen.java:137:ERROR] Error rendering screen [component://accounting/widget/AccountingPrintForms.xml#InvoicePDF]: java.lang.NumberFormatException: For input string: "freemarker.template.GeneralPurposeNothing@1eb1dbd". Rolling back transaction. 2007-03-24 07:47:33,592 (http-0.0.0.0-8443-Processor2) [ 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.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:140) org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:105) org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:90) org.ofbiz.widget.screen.ScreenFopViewHandler.render(ScreenFopViewHandler.java:67) org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:607) org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:391) org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:189) javax.servlet.http.HttpServlet.service(HttpServlet.java:595) javax.servlet.http.HttpServlet.service(HttpServlet.java:688) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:248) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) java.lang.Thread.run(Thread.java:595) -------------------------------------------------------------------------------- 2007-03-24 07:47:33,594 (http-0.0.0.0-8443-Processor2) [ TransactionUtil.java:262:INFO ] [TransactionUtil.rollback] transaction rolled back 2007-03-24 07:47:33,596 (http-0.0.0.0-8443-Processor2) [ TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not committing transaction, status is STATUS_NO_TRANSACTION 2007-03-24 07:47:33,601 (http-0.0.0.0-8443-Processor2) [ ControlServlet.java:192:ERROR] ---- exception report ---------------------------------------------------------- Error in request handler: Exception: org.ofbiz.base.util.GeneralException Message: Error rendering screen [component://accounting/widget/AccountingPrintForms.xml#InvoicePDF]: java.lang.NumberFormatException: For input string: "freemarker.template.GeneralPurposeNothing@1eb1dbd" (For input string: "freemarker.template.GeneralPurposeNothing@1eb1dbd") ---- stack trace --------------------------------------------------------------- org.ofbiz.base.util.GeneralException: Error rendering screen [component://accounting/widget/AccountingPrintForms.xml#InvoicePDF]: java.lang.NumberFormatException: For input string: "freemarker.template.GeneralPurposeNothing@1eb1dbd" (For input string: "freemarker.template.GeneralPurposeNothing@1eb1dbd") org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:145) org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:105) org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:90) org.ofbiz.widget.screen.ScreenFopViewHandler.render(ScreenFopViewHandler.java:67) org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:607) org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:391) org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:189) javax.servlet.http.HttpServlet.service(HttpServlet.java:595) javax.servlet.http.HttpServlet.service(HttpServlet.java:688) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:248) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) java.lang.Thread.run(Thread.java:595) java.lang.NumberFormatException: For input string: "freemarker.template.GeneralPurposeNothing@1eb1dbd" sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1224) java.lang.Double.valueOf(Double.java:447) java.lang.Double.<init>(Double.java:539) org.ofbiz.webapp.ftl.OfbizCurrencyTransform.getAmount(OfbizCurrencyTransform.java:88) org.ofbiz.webapp.ftl.OfbizCurrencyTransform.getWriter(OfbizCurrencyTransform.java:96) freemarker.core.Environment.visit(Environment.java:220) freemarker.core.UnifiedCall.accept(UnifiedCall.java:116) Tom Burns wrote: > Ray, > > The code I am working with is a fresh compile "svn update / ant clean-all / ant" as of today. The problem is manifest on two systems that are independent of one another, a desktop and notebook. > > The common element is that the invoices were created in the work effort module from time-sheets. To try to reproduce, create a time sheet, add an entry, from the time sheet view, enter a Bill From Party and Bill To Party then select 'Add Work Effort Time To New Invoice'. > > Select the Accounting Tab > Show All Invoices > Click on the last invoice in the Invoice Id column. Click the 'PDF' button. Under some condition the PDF creation will fail (and under others it will succeed, as I am finding out). It's getting late, I'll do some more testing in the morning. > > Thanks for taking a look, > > Tom > > |
In reply to this post by Tom
Ray,
A little additional testing revealed that the Invoice PDF generation will fail if the Amount value in a line item is empty (it will succeed if the amount is '0'). The business scenario that led to the error was the use the Workeffort Timesheet feature as a reporting tool to track a workers time on a task. If a rate is not assigned to the worker in the Party module then the amount is empty in the Invoice. In this case an attempt was made to use the Invoice as a report on a workers hours and there was no interest in cost or billing. If this is perceived as a defect there are several places in the code where it could be addressed: At the Party level have a default value of 0 for Party Rate At Invoice creation in Edit Time-sheet default the invoice line item amount to 0 At PDF creation default the invoice line item amount to 0 Alert the user to empty amounts, prompt for an amount or cancel the operation All of the above Any thoughts? Tom ----- Original Message ---- From: Tom Burns <[hidden email]> To: [hidden email] Sent: Friday, March 23, 2007 9:38:36 PM Subject: Re: Invoice PDF Error Ray, The code I am working with is a fresh compile "svn update / ant clean-all / ant" as of today. The problem is manifest on two systems that are independent of one another, a desktop and notebook. The common element is that the invoices were created in the work effort module from time-sheets. To try to reproduce, create a time sheet, add an entry, from the time sheet view, enter a Bill From Party and Bill To Party then select 'Add Work Effort Time To New Invoice'. Select the Accounting Tab > Show All Invoices > Click on the last invoice in the Invoice Id column. Click the 'PDF' button. Under some condition the PDF creation will fail (and under others it will succeed, as I am finding out). It's getting late, I'll do some more testing in the morning. Thanks for taking a look, Tom ----- Original Message ---- From: Ray Barlow <[hidden email]> To: [hidden email] Sent: Friday, March 23, 2007 3:39:14 PM Subject: Re: Invoice PDF Error Tom, Is this standard OFBiz code and data? I just did a clean download, build and test and the invoice PDF came up OK. Maybe you could furnish a few more details like OFBiz version, platform, DB and most useful if you can reproduce using the default data what products did you add to your order? Ray Brettonwoods wrote: > Hi All, > > Got this error when trying to create a PDF file for an Invoice. > Target exception:... is repeated four times in the actual error, seems like > it's failing on some iteration but I can't nail it down. > > Thanks for any help. > > Tom > > org.ofbiz.base.util.GeneralException: Error rendering screen > [component://accounting/widget/AccountingPrintForms.xml#InvoicePDF]: > org.ofbiz.base.util.GeneralException: Error running BSH script at location > [component://accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh]: > org.ofbiz.base.util.GeneralException: Error running BSH script at > [component://accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh], > line [89]: Sourced file: > > |
Since you're not addressing cost in your scenario, I would imagine you
would want to leave the underlying data as null if your time sheet isn't addressing rate. When printing to pdf or to html, you probably want handle it as "N/A", "-", or check if the variable has content before printing, or something similar. The reason for this is that if you ever did address cost, your calculations would be incorrect for assuming a value of 0. --- Tom Burns <[hidden email]> wrote: > Ray, > > A little additional testing revealed that the Invoice PDF generation > will fail if the Amount value in a line item is empty (it will > succeed if the amount is '0'). > > The business scenario that led to the error was the use the > Workeffort Timesheet feature as a reporting tool to track a workers > time on a task. If a rate is not assigned to the worker in the Party > module then the amount is empty in the Invoice. > > In this case an attempt was made to use the Invoice as a report on a > workers hours and there was no interest in cost or billing. > > > If this is perceived as a defect there are several places in the code > where it could be addressed: > At the Party level have a default value of 0 for Party Rate > At Invoice creation in Edit Time-sheet default the invoice line item > amount to 0 > At PDF creation default the invoice line item amount to 0 > Alert the user to empty amounts, prompt for an amount or cancel the > operation > All of the above > Any thoughts? > > Tom > > ----- Original Message ---- > From: Tom Burns <[hidden email]> > To: [hidden email] > Sent: Friday, March 23, 2007 9:38:36 PM > Subject: Re: Invoice PDF Error > > > Ray, > > The code I am working with is a fresh compile "svn update / ant > clean-all / ant" as of today. The problem is manifest on two systems > that are independent of one another, a desktop and notebook. > > The common element is that the invoices were created in the work > effort module from time-sheets. To try to reproduce, create a time > sheet, add an entry, from the time sheet view, enter a Bill From > Party and Bill To Party then select 'Add Work Effort Time To New > Invoice'. > > Select the Accounting Tab > Show All Invoices > Click on the last > invoice in the Invoice Id column. Click the 'PDF' button. Under some > condition the PDF creation will fail (and under others it will > succeed, as I am finding out). It's getting late, I'll do some more > testing in the morning. > > Thanks for taking a look, > > Tom > > > ----- Original Message ---- > From: Ray Barlow <[hidden email]> > To: [hidden email] > Sent: Friday, March 23, 2007 3:39:14 PM > Subject: Re: Invoice PDF Error > > > Tom, > > Is this standard OFBiz code and data? I just did a clean download, > build > and test and the invoice PDF came up OK. > > Maybe you could furnish a few more details like OFBiz version, > platform, > DB and most useful if you can reproduce using the default data what > products did you add to your order? > > Ray > > > Brettonwoods wrote: > > Hi All, > > > > Got this error when trying to create a PDF file for an Invoice. > > Target exception:... is repeated four times in the actual error, > seems like > > it's failing on some iteration but I can't nail it down. > > > > Thanks for any help. > > > > Tom > > > > org.ofbiz.base.util.GeneralException: Error rendering screen > > > [component://accounting/widget/AccountingPrintForms.xml#InvoicePDF]: > > org.ofbiz.base.util.GeneralException: Error running BSH script at > location > > > > > org.ofbiz.base.util.GeneralException: Error running BSH script at > > > [component://accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh], > > line [89]: Sourced file: > > > > |
In reply to this post by Tom
Ray,
I also receive a different error. On my notebook, which was loaded with run-install, I get only: :ERROR MESSAGE: org.ofbiz.base.util.GeneralException: Error rendering screen [component://accounting/widget/AccountingPrintForms.xml#InvoicePDF]: java.lang.NumberFormatException: For input string: "freemarker.template.GeneralPurposeNothing@16e7212" (For input string: freemarker.template.GeneralPurposeNothing@16e7212) I havn't fooled with the debug settings so I tryed to turn verbose on in Web Tools > Debug Levels to see it that made any difference. I clicked the Verbose checkbox and Update but nothing happened. The page never refreshed and the Update button remained in a grayed out state. I was logged on Admin / ofbiz. Tom ----- Original Message ---- From: Ray Barlow <[hidden email]> To: [hidden email] Sent: Saturday, March 24, 2007 3:55:54 AM Subject: Re: Invoice PDF Error Tom, The extra reproduction information helps a lot and I did manage to create an invoice that crashed. It looks like a different error for me (see below), maybe related to a null currency but certainly some more debugging required around the invoice creation and possibly null pointer checks in the PDF code. That said though I'm not likely to dig any further into this over the next couple of days as other commitments have me diverted. Ray 2007-03-24 07:47:33,236 (http-0.0.0.0-8443-Processor2) [ ServiceDispatcher.java:459:DEBUG] [[Sync service finished- total:0.15,since last(Begin):0.15]] - 'accounting / getPartyNameForDate' 2007-03-24 07:47:33,576 (http-0.0.0.0-8443-Processor2) [ ModelScreen.java:137:ERROR] Error rendering screen [component://accounting/widget/AccountingPrintForms.xml#InvoicePDF]: java.lang.NumberFormatException: For input string: "freemarker.template.GeneralPurposeNothing@1eb1dbd". Rolling back transaction. 2007-03-24 07:47:33,592 (http-0.0.0.0-8443-Processor2) [ 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.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:140) org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:105) org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:90) org.ofbiz.widget.screen.ScreenFopViewHandler.render(ScreenFopViewHandler.java:67) org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:607) org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:391) org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:189) javax.servlet.http.HttpServlet.service(HttpServlet.java:595) javax.servlet.http.HttpServlet.service(HttpServlet.java:688) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:248) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) java.lang.Thread.run(Thread.java:595) -------------------------------------------------------------------------------- 2007-03-24 07:47:33,594 (http-0.0.0.0-8443-Processor2) [ TransactionUtil.java:262:INFO ] [TransactionUtil.rollback] transaction rolled back 2007-03-24 07:47:33,596 (http-0.0.0.0-8443-Processor2) [ TransactionUtil.java:189:INFO ] [TransactionUtil.commit] Not committing transaction, status is STATUS_NO_TRANSACTION 2007-03-24 07:47:33,601 (http-0.0.0.0-8443-Processor2) [ ControlServlet.java:192:ERROR] ---- exception report ---------------------------------------------------------- Error in request handler: Exception: org.ofbiz.base.util.GeneralException Message: Error rendering screen [component://accounting/widget/AccountingPrintForms.xml#InvoicePDF]: java.lang.NumberFormatException: For input string: "freemarker.template.GeneralPurposeNothing@1eb1dbd" (For input string: "freemarker.template.GeneralPurposeNothing@1eb1dbd") ---- stack trace --------------------------------------------------------------- org.ofbiz.base.util.GeneralException: Error rendering screen [component://accounting/widget/AccountingPrintForms.xml#InvoicePDF]: java.lang.NumberFormatException: For input string: "freemarker.template.GeneralPurposeNothing@1eb1dbd" (For input string: "freemarker.template.GeneralPurposeNothing@1eb1dbd") org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:145) org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:105) org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:90) org.ofbiz.widget.screen.ScreenFopViewHandler.render(ScreenFopViewHandler.java:67) org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:607) org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:391) org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:189) javax.servlet.http.HttpServlet.service(HttpServlet.java:595) javax.servlet.http.HttpServlet.service(HttpServlet.java:688) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:248) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) java.lang.Thread.run(Thread.java:595) java.lang.NumberFormatException: For input string: "freemarker.template.GeneralPurposeNothing@1eb1dbd" sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1224) java.lang.Double.valueOf(Double.java:447) java.lang.Double.<init>(Double.java:539) org.ofbiz.webapp.ftl.OfbizCurrencyTransform.getAmount(OfbizCurrencyTransform.java:88) org.ofbiz.webapp.ftl.OfbizCurrencyTransform.getWriter(OfbizCurrencyTransform.java:96) freemarker.core.Environment.visit(Environment.java:220) freemarker.core.UnifiedCall.accept(UnifiedCall.java:116) Tom Burns wrote: > Ray, > > The code I am working with is a fresh compile "svn update / ant clean-all / ant" as of today. The problem is manifest on two systems that are independent of one another, a desktop and notebook. > > The common element is that the invoices were created in the work effort module from time-sheets. To try to reproduce, create a time sheet, add an entry, from the time sheet view, enter a Bill From Party and Bill To Party then select 'Add Work Effort Time To New Invoice'. > > Select the Accounting Tab > Show All Invoices > Click on the last invoice in the Invoice Id column. Click the 'PDF' button. Under some condition the PDF creation will fail (and under others it will succeed, as I am finding out). It's getting late, I'll do some more testing in the morning. > > Thanks for taking a look, > > Tom > > |
In reply to this post by Tom
Chris,
Thanks for the thought. Zero would work OK for me. The amount in the invoice is the amount the customer is being charged and you may want to show non billable hours on an invoice. As a general principal I don't like showing alpha characters in numeric fields. What I would like to do, if I do anything at all, is add to the feature in the MyTime page that creates a time sheet for a week. I would like it to also create standard M-F / 9 to5 Time Entries. Then the user would not have to select and populate all the date fields. It would also streamline data entry if on the creation of a time sheet the user could select a Purpose or Scope or some attribute to limit the choice of Work Effort Id's in a drop down control. This would make an end run around using the Pop up work effort filter, which you don't want to present to your average user. The last thing would be a couple of reports. One for the user and another for management that aggregates Worker / Time / Work Effort. Tom ----- Original Message ---- From: Chris Howe <[hidden email]> To: [hidden email] Sent: Saturday, March 24, 2007 10:40:52 AM Subject: Re: Invoice PDF Error Since you're not addressing cost in your scenario, I would imagine you would want to leave the underlying data as null if your time sheet isn't addressing rate. When printing to pdf or to html, you probably want handle it as "N/A", "-", or check if the variable has content before printing, or something similar. The reason for this is that if you ever did address cost, your calculations would be incorrect for assuming a value of 0. --- Tom Burns <[hidden email]> wrote: > Ray, > > A little additional testing revealed that the Invoice PDF generation > will fail if the Amount value in a line item is empty (it will > succeed if the amount is '0'). > > The business scenario that led to the error was the use the > Workeffort Timesheet feature as a reporting tool to track a workers > time on a task. If a rate is not assigned to the worker in the Party > module then the amount is empty in the Invoice. > > In this case an attempt was made to use the Invoice as a report on a > workers hours and there was no interest in cost or billing. > > > If this is perceived as a defect there are several places in the code > where it could be addressed: > At the Party level have a default value of 0 for Party Rate > At Invoice creation in Edit Time-sheet default the invoice line item > amount to 0 > At PDF creation default the invoice line item amount to 0 > Alert the user to empty amounts, prompt for an amount or cancel the > operation > All of the above > Any thoughts? > > Tom > > ----- Original Message ---- > From: Tom Burns <[hidden email]> > To: [hidden email] > Sent: Friday, March 23, 2007 9:38:36 PM > Subject: Re: Invoice PDF Error > > > Ray, > > The code I am working with is a fresh compile "svn update / ant > clean-all / ant" as of today. The problem is manifest on two systems > that are independent of one another, a desktop and notebook. > > The common element is that the invoices were created in the work > effort module from time-sheets. To try to reproduce, create a time > sheet, add an entry, from the time sheet view, enter a Bill From > Party and Bill To Party then select 'Add Work Effort Time To New > Invoice'. > > Select the Accounting Tab > Show All Invoices > Click on the last > invoice in the Invoice Id column. Click the 'PDF' button. Under some > condition the PDF creation will fail (and under others it will > succeed, as I am finding out). It's getting late, I'll do some more > testing in the morning. > > Thanks for taking a look, > > Tom > > > ----- Original Message ---- > From: Ray Barlow <[hidden email]> > To: [hidden email] > Sent: Friday, March 23, 2007 3:39:14 PM > Subject: Re: Invoice PDF Error > > > Tom, > > Is this standard OFBiz code and data? I just did a clean download, > build > and test and the invoice PDF came up OK. > > Maybe you could furnish a few more details like OFBiz version, > platform, > DB and most useful if you can reproduce using the default data what > products did you add to your order? > > Ray > > > Brettonwoods wrote: > > Hi All, > > > > Got this error when trying to create a PDF file for an Invoice. > > Target exception:... is repeated four times in the actual error, > seems like > > it's failing on some iteration but I can't nail it down. > > > > Thanks for any help. > > > > Tom > > > > org.ofbiz.base.util.GeneralException: Error rendering screen > > > [component://accounting/widget/AccountingPrintForms.xml#InvoicePDF]: > > org.ofbiz.base.util.GeneralException: Error running BSH script at > location > > > > > org.ofbiz.base.util.GeneralException: Error running BSH script at > > > [component://accounting/webapp/accounting/WEB-INF/actions/invoice/editInvoice.bsh], > > line [89]: Sourced file: > > > > |
Administrator
|
David E. J. has made a fix (with a question though) for that. Did you
read his mail and try updating since his fix ? Jacques ----- Message d'origine ----- De : "Tom Burns" <[hidden email]> À : <[hidden email]> Envoyé : samedi 24 mars 2007 16:32 Objet : Re: Invoice PDF Error > Chris, > > Thanks for the thought. Zero would work OK for me. The amount in the invoice is the amount the customer is being charged and you may want to show non billable hours on an invoice. As a general principal I don't like showing alpha characters in numeric fields. > > What I would like to do, if I do anything at all, is add to the feature in the MyTime page that creates a time sheet for a week. I would like it to also create standard M-F / 9 to5 Time Entries. Then the user would not have to select and populate all the date fields. > > It would also streamline data entry if on the creation of a time sheet the user could select a Purpose or Scope or some attribute to limit the choice of Work Effort Id's in a drop down control. This would make an end run around using the Pop up work effort filter, which you don't want to present to your average user. > > The last thing would be a couple of reports. One for the user and another for management that aggregates Worker / Time / Work Effort. > > Tom > > ----- Original Message ---- > From: Chris Howe <[hidden email]> > To: [hidden email] > Sent: Saturday, March 24, 2007 10:40:52 AM > Subject: Re: Invoice PDF Error > > > Since you're not addressing cost in your scenario, I would imagine you > would want to leave the underlying data as null if your time sheet > isn't addressing rate. When printing to pdf or to html, you probably > want handle it as "N/A", "-", or check if the variable has content > before printing, or something similar. > > The reason for this is that if you ever did address cost, your > calculations would be incorrect for assuming a value of 0. > > --- Tom Burns <[hidden email]> wrote: > > > Ray, > > > > A little additional testing revealed that the Invoice PDF generation > > will fail if the Amount value in a line item is empty (it will > > succeed if the amount is '0'). > > > > The business scenario that led to the error was the use the > > Workeffort Timesheet feature as a reporting tool to track a workers > > time on a task. If a rate is not assigned to the worker in the Party > > module then the amount is empty in the Invoice. > > > > In this case an attempt was made to use the Invoice as a report on a > > workers hours and there was no interest in cost or billing. > > > > > > If this is perceived as a defect there are several places in the > > where it could be addressed: > > At the Party level have a default value of 0 for Party Rate > > At Invoice creation in Edit Time-sheet default the invoice line item > > amount to 0 > > At PDF creation default the invoice line item amount to 0 > > Alert the user to empty amounts, prompt for an amount or cancel the > > operation > > All of the above > > Any thoughts? > > > > Tom > > > > ----- Original Message ---- > > From: Tom Burns <[hidden email]> > > To: [hidden email] > > Sent: Friday, March 23, 2007 9:38:36 PM > > Subject: Re: Invoice PDF Error > > > > > > Ray, > > > > The code I am working with is a fresh compile "svn update / ant > > clean-all / ant" as of today. The problem is manifest on two systems > > that are independent of one another, a desktop and notebook. > > > > The common element is that the invoices were created in the work > > effort module from time-sheets. To try to reproduce, create a time > > sheet, add an entry, from the time sheet view, enter a Bill From > > Party and Bill To Party then select 'Add Work Effort Time To New > > Invoice'. > > > > Select the Accounting Tab > Show All Invoices > Click on the last > > invoice in the Invoice Id column. Click the 'PDF' button. Under some > > condition the PDF creation will fail (and under others it will > > succeed, as I am finding out). It's getting late, I'll do some more > > testing in the morning. > > > > Thanks for taking a look, > > > > Tom > > > > > > ----- Original Message ---- > > From: Ray Barlow <[hidden email]> > > To: [hidden email] > > Sent: Friday, March 23, 2007 3:39:14 PM > > Subject: Re: Invoice PDF Error > > > > > > Tom, > > > > Is this standard OFBiz code and data? I just did a clean download, > > build > > and test and the invoice PDF came up OK. > > > > Maybe you could furnish a few more details like OFBiz version, > > platform, > > DB and most useful if you can reproduce using the default data what > > products did you add to your order? > > > > Ray > > > > > > Brettonwoods wrote: > > > Hi All, > > > > > > Got this error when trying to create a PDF file for an Invoice. > > > Target exception:... is repeated four times in the actual error, > > seems like > > > it's failing on some iteration but I can't nail it down. > > > > > > Thanks for any help. > > > > > > Tom > > > > > > org.ofbiz.base.util.GeneralException: Error rendering screen > > > > > [component://accounting/widget/AccountingPrintForms.xml#InvoicePDF]: > > > org.ofbiz.base.util.GeneralException: Error running BSH script at > > location > > > > > > voice.bsh]: > > > org.ofbiz.base.util.GeneralException: Error running BSH script at > > > > > > [component://accounting/webapp/accounting/WEB-INF/actions/invoice/editIn voice.bsh], > > > line [89]: Sourced file: > > > > > > |
Free forum by Nabble | Edit this page |