title: using library in java servlet netbean
body: <p>i'am using a library have structure below</p>
  
  <p><img src="https://i.stack.imgur.com/hzvpN.png" alt="enter image description here"></p>
  
  <p>i am adding <code>vn.hus.nlp.tokenizer-4.1.1.jar</code> file into libraries by <code>Add JAR/Folder</code> and copy the rest into my project. it work when i using java application. but when i try servlet, i got problem when using this library.</p>
  
  <p>My project</p>
  
  <p><img src="https://i.stack.imgur.com/LsjIJ.png" alt="enter image description here"></p>
  
  <p>Servlet: class <code>Filter</code> extends HttpServlet</p>
  
  <pre><code>try {          
         VietTokenizer v = new VietTokenizer(); // error here !
         JSONObject jso=new JSONObject();
         jso.put("status","A");
         jso.put("label","true");
         out.print(jso);
      } finally {            
          out.close();
      }
  </code></pre>
  
  <p>log</p>
  
  <pre><code>SEVERE: Servlet.service() for servlet [Filter] in context with path [/BadwordFilter] threw exception [Servlet execution threw an exception] with root cause
  java.lang.ClassNotFoundException: org.apache.commons.cli.ParseException
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
      at badword.filter.Filter.processRequest(Filter.java:51)
      at badword.filter.Filter.doGet(Filter.java:74)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
      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:225)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
      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:999)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)
  </code></pre>
  
  <p><strong><code>json-simple-1.1.1.jar is work well.</code></strong>
  thank you!</p>