title: CQ5 how to use external jars in custom plugins
body: <p>I have to create my own plugin to parse xml and do other stuff. I've created my own bundle plugin that will contain my parser class, pom.xml below:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  &lt;groupId&gt;pl.mycompany.myproject&lt;/groupId&gt;
  &lt;artifactId&gt;core&lt;/artifactId&gt;
  &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;bundle&lt;/packaging&gt;
  
  &lt;name&gt;core&lt;/name&gt;
  &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.5&lt;/source&gt;
                  &lt;target&gt;1.5&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
              &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.4.3&lt;/version&gt;
              &lt;extensions&gt;true&lt;/extensions&gt;
              &lt;configuration&gt;
                  &lt;instructions&gt;
                      &lt;Export-Package&gt;pl.mycompany.myproject.page.components.*;version=${pom.version}&lt;/Export-Package&gt;
                  &lt;/instructions&gt;
              &lt;/configuration&gt;                
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  
  &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;version&gt;3.8.1&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.day.cq.wcm&lt;/groupId&gt;
          &lt;artifactId&gt;cq-wcm-api&lt;/artifactId&gt;
          &lt;version&gt;5.6.4&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.day.cq&lt;/groupId&gt;
          &lt;artifactId&gt;cq-commons&lt;/artifactId&gt;
          &lt;version&gt;5.6.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.sling&lt;/groupId&gt;
          &lt;artifactId&gt;org.apache.sling.api&lt;/artifactId&gt;
          &lt;version&gt;2.0.4-incubator&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.sling&lt;/groupId&gt;
          &lt;artifactId&gt;org.apache.sling.commons.json&lt;/artifactId&gt;
          &lt;version&gt;2.0.6&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
          &lt;artifactId&gt;commons-lang3&lt;/artifactId&gt;
          &lt;version&gt;3.0.1&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;xerces&lt;/groupId&gt;
          &lt;artifactId&gt;xercesImpl&lt;/artifactId&gt;
          &lt;version&gt;2.9.0&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p></p>
  
  <p>After that I want to create class that will parse xml and I want to use org.apache.xerces package.</p>
  
  <p>I've also created other bundle that contains org.apache.xerces jar and I've installed it and it is active in <a href="http://myhost.com:4502/system/console/bundles" rel="nofollow">http://myhost.com:4502/system/console/bundles</a>.</p>
  
  <p>When I want to declare DOMParser variable in Java class in core plugin (pom.xml above):</p>
  
  <pre><code>package pl.mycompany.myproject.page.components;
  import java.util.Date;
  import org.apache.sling.api.resource.Resource;
  import org.apache.xerces.parsers.DOMParser;
  enter code here
  public class EqAndSpecParser {
  
  private Resource resource;
  
  public EqAndSpecParser(Resource resource) {
      this.resource = resource;
  }
  
  public void checkIfNeedToUpdate(Date lastModifiedDate, String lastGenerationDate, String xmlCode) {
      try {
          DOMParser parser = new DOMParser();
          parser.parse(xmlCode);
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  
  public Resource getResource() {
      return resource;
  }
  
  public void setResource(Resource resource) {
      this.resource = resource;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Then I get error in /crx-quickstart/logs/:</p>
  
  <pre><code>FULL EXCEPTION:
  org.apache.sling.api.scripting.ScriptEvaluationException: An exception occurred processing JSP page /apps/myproject/components/specifications-and-equipment/specifications-and-equipment.jsp at line 16
  at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:388)
  at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:171)
  at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:463)
  at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:508)
  at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:45)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:64)
  at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilterWithErrorHandling(WCMDebugFilter.java:184)
  at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:151)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
  at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:244)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
  at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:254)
  at org.apache.sling.engine.impl.SlingRequestProcessorImpl.dispatchRequest(SlingRequestProcessorImpl.java:294)
  at org.apache.sling.engine.impl.request.SlingRequestDispatcher.dispatch(SlingRequestDispatcher.java:216)
  at org.apache.sling.engine.impl.request.SlingRequestDispatcher.include(SlingRequestDispatcher.java:103)
  at com.day.cq.wcm.core.impl.WCMComponentFilter$ForwardRequestDispatcher.include(WCMComponentFilter.java:406)
  at org.apache.sling.scripting.jsp.taglib.IncludeTagHandler.dispatch(IncludeTagHandler.java:49)
  at org.apache.sling.scripting.jsp.taglib.AbstractDispatcherTagHandler.doEndTag(AbstractDispatcherTagHandler.java:129)
  at org.apache.jsp.libs.foundation.components.parsys.parsys_jsp._jspService(parsys_jsp.java:313)
  at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
  at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:502)
  at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:449)
  at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java:241)
  at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.java:86)
  at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:441)
  at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:361)
  at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:171)
  at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:463)
  at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:508)
  at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:45)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:64)
  at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilterWithErrorHandling(WCMDebugFilter.java:184)
  at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:151)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
  at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:244)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
  at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:254)
  at org.apache.sling.engine.impl.SlingRequestProcessorImpl.dispatchRequest(SlingRequestProcessorImpl.java:294)
  at org.apache.sling.engine.impl.request.SlingRequestDispatcher.dispatch(SlingRequestDispatcher.java:216)
  at org.apache.sling.engine.impl.request.SlingRequestDispatcher.include(SlingRequestDispatcher.java:103)
  at com.day.cq.wcm.core.impl.WCMComponentFilter$ForwardRequestDispatcher.include(WCMComponentFilter.java:406)
  at com.day.cq.wcm.tags.IncludeTag.includeResource(IncludeTag.java:224)
  at com.day.cq.wcm.tags.IncludeTag.doEndTag(IncludeTag.java:91)
  at org.apache.jsp.apps.myproject.components.contentpage_002d100_002d20_002d60_002d20.content_jsp._jspx_meth_cq_005finclude_005f3(content_jsp.java:276)
  at org.apache.jsp.apps.myproject.components.contentpage_002d100_002d20_002d60_002d20.content_jsp._jspService(content_jsp.java:174)
  at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
  at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:502)
  at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:449)
  at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java:241)
  at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.java:86)
  at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:441)
  at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:361)
  at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:171)
  at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:463)
  at com.day.cq.wcm.tags.IncludeTag.includeScript(IncludeTag.java:167)
  at com.day.cq.wcm.tags.IncludeTag.doEndTag(IncludeTag.java:87)
  at org.apache.jsp.apps.myproject.components.page.body_jsp._jspx_meth_cq_005finclude_005f2(body_jsp.java:308)
  at org.apache.jsp.apps.myproject.components.page.body_jsp._jspService(body_jsp.java:228)
  at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
  at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:502)
  at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:449)
  at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java:241)
  at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.java:86)
  at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:441)
  at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:361)
  at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:171)
  at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:463)
  at com.day.cq.wcm.tags.IncludeTag.includeScript(IncludeTag.java:167)
  at com.day.cq.wcm.tags.IncludeTag.doEndTag(IncludeTag.java:87)
  at org.apache.jsp.libs.foundation.components.page.page_jsp._jspx_meth_cq_005finclude_005f1(page_jsp.java:207)
  at org.apache.jsp.libs.foundation.components.page.page_jsp._jspService(page_jsp.java:161)
  at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
  at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:502)
  at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:449)
  at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java:241)
  at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.java:86)
  at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:441)
  at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:361)
  at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:171)
  at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:463)
  at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:508)
  at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:45)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:64)
  at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilterWithErrorHandling(WCMDebugFilter.java:184)
  at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:151)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
  at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:244)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
  at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:254)
  at org.apache.sling.engine.impl.SlingRequestProcessorImpl.dispatchRequest(SlingRequestProcessorImpl.java:294)
  at org.apache.sling.engine.impl.request.SlingRequestDispatcher.dispatch(SlingRequestDispatcher.java:216)
  at org.apache.sling.engine.impl.request.SlingRequestDispatcher.include(SlingRequestDispatcher.java:103)
  at com.day.cq.wcm.core.impl.WCMComponentFilter$ForwardRequestDispatcher.include(WCMComponentFilter.java:406)
  at org.apache.jsp.libs.foundation.components.primary.cq.Page.Page_jsp._jspService(Page_jsp.java:106)
  at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
  at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:502)
  at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:449)
  at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java:241)
  at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.java:86)
  at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:441)
  at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:361)
  at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:171)
  at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:463)
  at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:508)
  at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:45)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:64)
  at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:148)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
  at com.day.cq.wcm.core.impl.WCMComponentFilter.filterRootInclude(WCMComponentFilter.java:333)
  at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:160)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
  at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:254)
  at org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChain.java:49)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:64)
  at com.day.cq.wcm.core.impl.warp.TimeWarpFilter.doFilter(TimeWarpFilter.java:106)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
  at com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter.doFilter(RedirectFilter.java:290)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
  at org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter.doFilter(RequestProgressTrackerLogFilter.java:59)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
  at com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet.doFilter(FormsHandlingServlet.java:220)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
  at com.day.cq.theme.impl.ThemeResolverFilter.doFilter(ThemeResolverFilter.java:76)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
  at com.adobe.granite.optout.impl.OptOutFilter.doFilter(OptOutFilter.java:74)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
  at com.day.cq.wcm.core.impl.WCMRequestFilter.doFilter(WCMRequestFilter.java:90)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
  at com.day.cq.wcm.designimporter.CanvasPageDeleteRequestFilter.doFilter(CanvasPageDeleteRequestFilter.java:87)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
  at org.apache.sling.rewriter.impl.RewriterFilter.doFilter(RewriterFilter.java:83)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
  at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:127)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
  at org.apache.sling.bgservlets.impl.BackgroundServletStarterFilter.doFilter(BackgroundServletStarterFilter.java:135)
  at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
  at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processRequest(SlingRequestProcessorImpl.java:151)
  at org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:206)
  at org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:96)
  at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:79)
  at org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java:42)
  at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:49)
  at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
  at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:127)
  at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)
  at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)
  at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
  at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
  at com.adobe.granite.license.impl.LicenseCheckFilter.doFilter(LicenseCheckFilter.java:179)
  at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)
  at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)
  at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
  at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
  at org.apache.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:259)
  at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)
  at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)
  at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
  at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
  at org.apache.felix.http.sslfilter.internal.SslFilter.doFilter(SslFilter.java:55)
  at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)
  at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)
  at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
  at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
  at org.apache.sling.engine.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:75)
  at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)
  at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)
  at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
  at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
  at org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java:48)
  at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:39)
  at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:67)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
  at com.day.j2ee.servletengine.ServletRuntimeEnvironment.service(ServletRuntimeEnvironment.java:250)
  at com.day.j2ee.servletengine.RequestDispatcherImpl.doFilter(RequestDispatcherImpl.java:321)
  at com.day.j2ee.servletengine.RequestDispatcherImpl.service(RequestDispatcherImpl.java:340)
  at com.day.j2ee.servletengine.RequestDispatcherImpl.service(RequestDispatcherImpl.java:383)
  at com.day.j2ee.servletengine.ServletHandlerImpl.process(ServletHandlerImpl.java:360)
  at com.day.j2ee.servletengine.HttpListener$Worker.run(HttpListener.java:644)
  at java.lang.Thread.run(Unknown Source)
  Caused by: org.apache.sling.api.SlingException: An exception occurred processing JSP page /apps/myproject/components/specifications-and-equipment/specifications-and-equipment.jsp at line 16
  at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspExceptionInternal(JspServletWrapper.java:683)
  at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:608)
  at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:525)
  at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:449)
  at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java:241)
  at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.java:86)
  at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:441)
  at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:361)
  ... 183 more
  Caused by: java.lang.NoClassDefFoundError: org/apache/xerces/parsers/DOMParser
  at org.apache.jsp.apps.myproject.components.specifications_002dand_002dequipment.specifications_002dand_002dequipment_jsp._jspService(specifications_002dand_002dequipment_jsp.java:165)
  at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
  at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:502)
  ... 188 more
  Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.DOMParser not found by pl.mycompany.myproject.core [291]
  at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1499)
  at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
  at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1882)
  at java.lang.ClassLoader.loadClass(Unknown Source)
  ... 192 more
  </code></pre>
  
  <p>DOMParser is just example class that I want to use. In my project I will need to use external jars from the other providers, that is just POC. The main question is: How to use external jars in CQ5? How to install them into CQ that all custom plugins would use these jars?</p>
  
  <p>When I changed xerces dependency to</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;xerces&lt;/groupId&gt;
      &lt;artifactId&gt;xercesImpl&lt;/artifactId&gt;
      &lt;version&gt;2.9.0&lt;/version&gt;
      &lt;scope&gt;compile&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>and I added <code>&lt;Embed-Dependency&gt;xercesImpl;scope=compile&lt;/Embed-Dependency&gt;
  </code> now I get error like:</p>
  
  <pre><code>25.09.2013 11:15:49.206 *INFO* [JcrInstaller.1]
  org.apache.sling.installer.provider.jcr.impl.JcrInstaller Registering resource with OSGi installer: [InstallableResource, priority=200, id=/apps/myproject/install/core-1.0.0-SNAPSHOT.jar]
  25.09.2013 11:15:49.231 *INFO* [OsgiInstallerImpl] pl.mycompany.myproject.core BundleEvent UNRESOLVED
  25.09.2013 11:15:49.231 *INFO* [OsgiInstallerImpl] pl.mycompany.myproject.core BundleEvent UPDATED
  25.09.2013 11:15:49.233 *INFO* [OsgiInstallerImpl] org.apache.sling.audit.osgi.installer Updated bundle pl.mycompany.myproject.core [291] from resource TaskResource(url=jcrinstall:/apps/myproject/install/core-1.0.0-SNAPSHOT.jar, entity=bundle:pl.mycompany.myproject.core, state=INSTALL, attributes=[org.apache.sling.installer.api.tasks.ResourceTransformer=:50:16:, Bundle-SymbolicName=pl.mycompany.myproject.core, Bundle-Version=1.0.0.SNAPSHOT], digest=1380100548768)
  25.09.2013 11:15:49.234 *INFO* [OsgiInstallerImpl] org.apache.sling.audit.osgi.installer Refreshing 1 bundles: [pl.mycompany.myproject.core [291]]
  25.09.2013 11:15:49.234 *INFO* [OsgiInstallerImpl] org.apache.sling.audit.osgi.installer Waiting up to 90 seconds for bundles refresh
  25.09.2013 11:15:49.234 *INFO* [OsgiInstallerImpl] org.apache.sling.audit.osgi.installer Done refreshing 1 bundles
  25.09.2013 11:15:49.234 *INFO* [FelixDispatchQueue] org.apache.felix.framework FrameworkEvent PACKAGES REFRESHED
  25.09.2013 11:15:49.235 *INFO* [FelixDispatchQueue] org.apache.felix.framework FrameworkEvent PACKAGES REFRESHED
  25.09.2013 11:15:49.235 *INFO* [OsgiInstallerImpl] org.apache.sling.installer.core.impl.tasks.BundleStartTask Could not start bundle pl.mycompany.myproject.core [291]. Reason: org.osgi.framework.BundleException: Unresolved constraint in bundle pl.mycompany.myproject.core [291]: Unable to resolve 291.34: missing requirement [291.34] osgi.wiring.package; (osgi.wiring.package=org.apache.xml.resolver). Will retry.
  25.09.2013 11:15:49.235 *INFO* [OsgiInstallerImpl] org.apache.sling.installer.core.impl.tasks.RestartActiveBundlesTask Unable to start bundle pl.mycompany.myproject.core [291] : Unresolved constraint in bundle pl.mycompany.myproject.core [291]: Unable to resolve 291.34: missing requirement [291.34] osgi.wiring.package; (osgi.wiring.package=org.apache.xml.resolver)
  25.09.2013 11:15:49.248 *INFO* [OsgiInstallerImpl] org.apache.sling.installer.core.impl.tasks.BundleStartTask Could not start bundle pl.mycompany.myproject.core [291]. Reason: org.osgi.framework.BundleException: Unresolved constraint in bundle pl.mycompany.myproject.core [291]: Unable to resolve 291.34: missing requirement [291.34] osgi.wiring.package; (osgi.wiring.package=org.apache.xml.resolver). Will retry.
  25.09.2013 11:15:49.249 *INFO* [OsgiInstallerImpl] org.apache.sling.installer.core.impl.tasks.RestartActiveBundlesTask Unable to start bundle pl.mycompany.myproject.core [291] : Unresolved constraint in bundle pl.mycompany.myproject.core [291]: Unable to resolve 291.34: missing requirement [291.34] osgi.wiring.package; (osgi.wiring.package=org.apache.xml.resolver)
  </code></pre>