title: Dependent library ClassNotFoundException
body: <p>I have an <code>EJB</code> project and i'm using <code>Primefaces</code> this is how I include Primefaces 6.1 into my <code>pom.xml</code>:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.primefaces&lt;/groupId&gt;
      &lt;artifactId&gt;primefaces&lt;/artifactId&gt;
      &lt;version&gt;6.1&lt;/version&gt;
      &lt;scope&gt;compile&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>I can deploy my app to <code>WebLogic 12c</code> and my application is start running but when I try to invoke any method it throws this exception:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: org/primefaces/model/UploadedFile
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
      at java.lang.Class.privateGetPublicMethods(Class.java:2902)
      at java.lang.Class.getMethods(Class.java:1615)
      at weblogic.iiop.IDLUtils.isAbstractInterface(IDLUtils.java:486)
      at weblogic.iiop.Utils.isAbstractInterface(Utils.java:533)
      at weblogic.corba.rmic.StubGenerator.genWriteParam(StubGenerator.java:376)
      at weblogic.corba.rmic.StubGenerator.genMarshalingCode(StubGenerator.java:334)
      at weblogic.corba.rmic.StubGenerator.generateInnerTryCatch(StubGenerator.java:291)
      at weblogic.corba.rmic.StubGenerator.generateOuterTryCatch(StubGenerator.java:270)
      at weblogic.corba.rmic.StubGenerator.getCodeForMethod(StubGenerator.java:257)
      at weblogic.corba.rmic.StubGenerator.addMethod(StubGenerator.java:251)
      at weblogic.corba.rmic.StubGenerator.addMethods(StubGenerator.java:225)
      at weblogic.corba.rmic.StubGenerator.&lt;init&gt;(StubGenerator.java:74)
      at weblogic.corba.utils.RemoteInfo.createStubs(RemoteInfo.java:314)
      at weblogic.servlet.ClasspathServlet.getIIOPStubClassSource(ClasspathServlet.java:578)
      at weblogic.servlet.ClasspathServlet.getGeneratedClassSource(ClasspathServlet.java:504)
      at weblogic.servlet.ClasspathServlet.findSourceFromApplicationContainer(ClasspathServlet.java:462)
      at weblogic.servlet.ClasspathServlet.findResource(ClasspathServlet.java:367)
      at weblogic.servlet.ClasspathServlet.doGet(ClasspathServlet.java:224)
      at weblogic.servlet.ClasspathServlet.service(ClasspathServlet.java:209)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:346)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:243)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3432)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3402)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
      at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
      at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2285)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2201)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1572)
      at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:255)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)
  Caused By: java.lang.ClassNotFoundException: org.primefaces.model.UploadedFile
      at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:357)
      at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:318)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:186)
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
      at java.lang.Class.privateGetPublicMethods(Class.java:2902)
      at java.lang.Class.getMethods(Class.java:1615)
      at weblogic.iiop.IDLUtils.isAbstractInterface(IDLUtils.java:486)
      at weblogic.iiop.Utils.isAbstractInterface(Utils.java:533)
      at weblogic.corba.rmic.StubGenerator.genWriteParam(StubGenerator.java:376)
      at weblogic.corba.rmic.StubGenerator.genMarshalingCode(StubGenerator.java:334)
      at weblogic.corba.rmic.StubGenerator.generateInnerTryCatch(StubGenerator.java:291)
      at weblogic.corba.rmic.StubGenerator.generateOuterTryCatch(StubGenerator.java:270)
      at weblogic.corba.rmic.StubGenerator.getCodeForMethod(StubGenerator.java:257)
      at weblogic.corba.rmic.StubGenerator.addMethod(StubGenerator.java:251)
      at weblogic.corba.rmic.StubGenerator.addMethods(StubGenerator.java:225)
      at weblogic.corba.rmic.StubGenerator.&lt;init&gt;(StubGenerator.java:74)
      at weblogic.corba.utils.RemoteInfo.createStubs(RemoteInfo.java:314)
      at weblogic.servlet.ClasspathServlet.getIIOPStubClassSource(ClasspathServlet.java:578)
      at weblogic.servlet.ClasspathServlet.getGeneratedClassSource(ClasspathServlet.java:504)
      at weblogic.servlet.ClasspathServlet.findSourceFromApplicationContainer(ClasspathServlet.java:462)
      at weblogic.servlet.ClasspathServlet.findResource(ClasspathServlet.java:367)
      at weblogic.servlet.ClasspathServlet.doGet(ClasspathServlet.java:224)
      at weblogic.servlet.ClasspathServlet.service(ClasspathServlet.java:209)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:346)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:243)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3432)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3402)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
      at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
      at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2285)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2201)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1572)
      at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:255)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)
  </code></pre>
  
  <p>I tried with other <code>Primefaces</code> versions, but the same error occured. I tried to build without <code>&lt;scope&gt;compile&lt;/scope&gt;</code> didn't change anything. What should I try?</p>