• Welcome to KonaKart Community Forum. Please login or sign up.
 

Unable to create the PDF invoice

Started by ByDcc, April 15, 2013, 11:24:13 pm

Previous topic - Next topic

ByDcc

   Hi,
   I'm getting this error when a client try to download an invoice.

   Next code is not working for me:

Quoteprivate PdfResult createInvoice(KKAppEng kkAppEng, OrderIf order) throws Exception
    {

        int langId = kkAppEng.getLangId();

        PdfOptions options = new PdfOptions();
        options.setId(order.getId());
        options.setType(KKConstants.HTML_ORDER_INVOICE);
        options.setLanguageId(langId);
        options.setReturnFileName(false);
        options.setReturnBytes(true);
        options.setCreateFile(false);

        PdfResult pdfResult = (PdfResult) kkAppEng.getEng()
                .getPdf(kkAppEng.getSessionId(), options);

        return pdfResult;
    }


   In my case PdfResult is null.
   lang is 3 and the order id exists.

   The invoice is resquested from private area of the client.

SELECT configuration.configuration_id, configuration.configuration_key, configuration.configuration_value, configuration.last_modified FROM configuration WHERE configuration.configuration_key='CLIENT_CONFIG_CACHE_CHECK_FLAG'
15-abr 23:59:24 DEBUG (?:getConfiguration:?) Configuration for key CLIENT_CONFIG_CACHE_CHECK_FLAG = Configuration: id=87 key=CLIENT_CONFIG_CACHE_CHECK_FLAG value=true
15-abr 23:59:32 ERROR (BaseAction.java:handleException:300) A customer has received the following exception message: : Exception Name = com.konakart.al.KKAppException : Exception Message = Unable to create the PDF invoice [6.5.0.0] : Exception Stack Trace =  :    at com.konakart.actions.DownloadInvoiceAction.execute(DownloadInvoiceAction.java:170) :    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) :    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) :    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) :    at java.lang.reflect.Method.invoke(Method.java:601) :    at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453) :    at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:292) :    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:255) :    at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) :    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) :    at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) :    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) :    at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211) :    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) :    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) :    at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211) :    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) :    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) :    at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190) :    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) :    at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) :    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) :    at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90) :    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) :    at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243) :    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) :    at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) :    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) :    at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) :    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) :    at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145) :    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) :    at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171) :    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) :    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) :    at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176) :    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) :    at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) :    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) :    at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:192) :    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) :    at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187) :    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) :    at org.apache.struts2.json.JSONInterceptor.intercept(JSONInterceptor.java:172) :    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) :    at com.konakart.actions.interceptors.LoggingInterceptor.intercept(Unknown Source) :    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) :    at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) :    at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:511) :    at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) :    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) :    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) :    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) :    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) :    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) :    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) :    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) :    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) :    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936) :    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) :    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) :    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004) :    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) :    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) :    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) :    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) :    at java.lang.Thread.run(Thread.java:722)<br>The full exception is:
com.konakart.al.KKAppException: Unable to create the PDF invoice [6.5.0.0]
at com.konakart.actions.DownloadInvoiceAction.execute(DownloadInvoiceAction.java:170)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:453)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:292)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:255)
at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211)


   Could someone give a clue about where I could see or what's the problem?
   Thank you in advance.

ByDcc

I saw this funcionality could be available in enterprise edition only.
http://www.konakart.com/product/community-or-enterprise

PDF invoices can be created and sent to customers as email attachments and downloaded from the store-front application. The created PDF invoices can be stored on disk for archiving purposes or created dynamically whenever they are required.




ByDcc

   I'm not able to find where disable buttons: Invoice, Export and Export for shiping.
   Could you tell me what panel allows disable these buttons?

ming

Yes, PDF invoicing is Enterprise only

ming

In the Admin App, go to the Panel where you define the Privileges for the role.

Look at the Orders panel line.

Float your mouse over the Cust1, Cust2, Cust3, Cust4 fields which will tell you what each one defines.    These are the fields you need to set.

ByDcc

   I couldn't imagine these buttons were special. Now I see they have a background green and the tooltip.
   Thank you for your help.