title: How to fix java.lang.NoClassDefFoundError from barcode4j-2.1.jar on jasperReports?
body: <p>I'm trying to print barcode using Java (Web application)
  and Using Jaspoersoft iReport Designer 4.5.0</p>
  
  <p>Here is my Java code : </p>
  
  <pre><code>public String onBtnPrintClick() throws JRException, IOException {
      Integer pos_number = getMst_posService().getPosById((Integer) getSession().get("pos_id")).getPos_number();
      Date dateNow = new Date();
      SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
      Integer total_paid = getPaidCard() + getPaidCash();
  
  //      Bill printing   
  
  
      View_transactionprod_pos transactionProdToBill = new View_transactionprod_pos();
      transactionProdToBill.setTransaction_id(getTransactionIdFromMakeSale());
  
      listProdToBill = getView_transactionprod_posService().getViewTransactionProdPosListByModel(transactionProdToBill);
  
      Map&lt;String, Object&gt; parameters = new HashMap&lt;String,Object&gt;();
      parameters.put("transaction_id", getTransactionIdFromMakeSale());
      parameters.put("pos_number", pos_number);
      parameters.put("transaction_date", dateFormatter.format(dateNow));
      parameters.put("total_price", getTotalPriceToSell());
      parameters.put("total_paid", total_paid);
      parameters.put("change", getChange());
      parameters.put("barcode", getTransactionIdFromMakeSale());
  
      return "pdf";
  }
  </code></pre>
  
  <p>xml : </p>
  
  <pre><code>    &lt;action name="MakeSalePrint" class="MakeSaleS" method="onBtnPrintClick"&gt;
          &lt;result name="input"&gt;/WEB-INF/jsp/makesale.jsp&lt;/result&gt;
          &lt;result name="success" type="json"&gt;/WEB-INF/jsp/makesale.jsp&lt;/result&gt;
          &lt;result name="pdf" type="jasper"&gt;
              &lt;param name="location"&gt;/WEB-INF/report/Bill.jasper&lt;/param&gt;
              &lt;param name="dataSource"&gt;listProdToBill&lt;/param&gt;
              &lt;param name="format"&gt;PDF&lt;/param&gt;
              &lt;param name="documentName"&gt;reportDetail&lt;/param&gt;
              &lt;param name="reportParameters"&gt;parameters&lt;/param&gt;
          &lt;/result&gt;
      &lt;/action&gt;
  </code></pre>
  
  <p>When click print button It calls <code>onBtnPrintClick()</code> method.
  I've imported some jars and added it to my project : </p>
  
  <p><img src="https://i.stack.imgur.com/fAOwm.png" alt="Added to my project from myproject/src/main/webapp/lib"></p>
  
  <p>in jrxml file barcode is <em>code128</em> and language is java</p>
  
  <p><strong>Without the barcode it prints..</strong></p>
  
  <p>I can't get that error class not found from barcode4j-2.1.jar </p>
  
  <p>Error : </p>
  
  <pre><code>HTTP Status 500 - Filter execution threw an exception
  
  javax.servlet.ServletException: Filter execution threw an exception
  java.lang.NoClassDefFoundError: org/krysalis/barcode4j/HumanReadablePlacement
  java.lang.Class.getDeclaredMethods0(Native Method)
  java.lang.Class.privateGetDeclaredMethods(Class.java:2521)
  java.lang.Class.getDeclaredMethod(Class.java:1992)
  java.io.ObjectStreamClass.getPrivateMethod(ObjectStreamClass.java:1431)
  java.io.ObjectStreamClass.access$1700(ObjectStreamClass.java:72)
  java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:494)
  java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:468)
  java.security.AccessController.doPrivileged(Native Method)
  java.io.ObjectStreamClass.&lt;init&gt;(ObjectStreamClass.java:468)
  java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:365)
  java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:602)
  java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1620)
  java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515)
  java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1620)
  java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515)
  java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769)
  java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
  java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)
  java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913)
  java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
  java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
  java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
  java.util.ArrayList.readObject(ArrayList.java:733)
  sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  java.lang.reflect.Method.invoke(Method.java:606)
  java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
  java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1891)
  java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
  java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
  java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)
  java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913)
  java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
  java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
  java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)
  java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:499)
  net.sf.jasperreports.engine.base.JRBaseReport.readObject(JRBaseReport.java:729)
  sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  java.lang.reflect.Method.invoke(Method.java:606)
  java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
  java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1891)
  java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)
  java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
  java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
  net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:110)
  net.sf.jasperreports.engine.util.JRLoader.loadObjectFromFile(JRLoader.java:86)
  net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:77)
  org.apache.struts2.views.jasperreports.JasperReportsResult.doExecute(JasperReportsResult.java:323)
  org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
  com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:371)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:275)
  com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167)
  com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  org.apache.struts2.json.JSONValidationInterceptor.doIntercept(JSONValidationInterceptor.java:116)
  com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
  org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
  com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:254)
  com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:139)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
  com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  org.interceptor.SecurityInterceptor.intercept(SecurityInterceptor.java:180)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  org.apache.struts2.interceptor.DeprecationInterceptor.intercept(DeprecationInterceptor.java:41)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:254)
  com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:254)
  com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
  com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189)
  com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
  org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
  org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:562)
  org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
  org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
  org.leco.filter.LecoDispatcher.doFilter(LecoDispatcher.java:26)
  </code></pre>
  
  <p>I can't solve that 
  Help me..
  Thank you.</p>
  
  <p>EDITED..</p>