title: java.lang.NoClassDefFoundError: javax/persistence/Persistence... axis2 and eclipselink
body: <p>I want to deploy axis2 web services in netbeans, i installed the plugin axis2 in netbeans. Also i use EclipseLink 2.0 to connect a db. My connection is successful when i use in a main class that i created. But when i try to test my web services in netbeans with right click on the services throw this exception: </p>
  
  <p>[ERROR] javax/persistence/Persistence
  java.lang.NoClassDefFoundError: javax/persistence/Persistence
          at db.util.ManageConnection.getStatsEntityManagerFactory(ManageConnection.java:33)
          at services.LoginService.loginService(LoginService.java:31)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194)
          at org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver.invokeBusinessLogic(RPCInOnlyMessageReceiver.java:63)
          at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)
          at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173)
          at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:135)
          at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:130)
          at org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:825)
          at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:271)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
          at java.lang.Thread.run(Thread.java:662)
  Caused by: java.lang.ClassNotFoundException: Class Not found : javax.persistence.Persistence
          at org.apache.axis2.deployment.DeploymentClassLoader.findClass(DeploymentClassLoader.java:92)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
          at org.apache.axis2.deployment.DeploymentClassLoader.loadClass(DeploymentClassLoader.java:273)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
          ... 31 more
  [ERROR] org.apache.axis2.AxisFault: javax/persistence/Persistence</p>
  
  <p>I can deploy others services that not contain connections with eclipselink (entityManager...)..</p>
  
  <p>I found in others forum with the same problem but they're using hibernate, that the solution is add to classpath this: hibernate-jpa-2.0-api-1.0.0.Final.jar, in this link <a href="http://www.coderanch.com/t/513512/ORM/databases/Error-java-lang-NoClassDefFoundError-javax" rel="nofollow">http://www.coderanch.com/t/513512/ORM/databases/Error-java-lang-NoClassDefFoundError-javax</a></p>
  
  <p>But I dont Know what is the problem with EclipseLink i dont know if i add other library and where.. thank you very much...</p>
  
  <p>This my service class</p>
  
  <p>public class LoginService {</p>
  
  <pre><code>EntityManagerFactory emf = ManageConnection.
      getStatsEntityManagerFactory(PersistenceConfiguration.
      getPERSISTENCE_UNIT_NAME());
  
  public String prubaServicioWeb(String nombre) {
      return nombre + " Welcome";
  
  }
  
  public void loginService(String whatever) {
  
      BankJpaController bankController = new
      BankJpaController(emf);
      Bank bank = new Bank();
      bank.setId(null);
      bank.setBankCode("BNSJ");
      bank.setName("Bank of America");
      bankController.create(bank);
  
  }
  </code></pre>
  
  <p>}</p>