AnsweredAssumed Answered

JSP+Servlets+Activiti = error

Question asked by leandro1 on Jul 1, 2015
Latest reply on Jul 3, 2015 by martin.grofcik
this from a java class works fine, but when you use on servlet the result is…. 

java.lang.NoClassDefFoundError: org/activiti/engine/ProcessEngines
   servlets.Hello.doPost(Hello.java:56)

This is the code:
—————————————————————-
PROCESSENGINE:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans.xsd">
   
  <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration" >
    <!– Database configurations –>
   
    <property name="databaseType" value="mysql" />
    <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/activiti" />
    <property name="jdbcDriver" value="com.mysql.jdbc.Driver" />
    <property name="jdbcUsername" value="root" />
    <property name="jdbcPassword" value="" />
    <property name="databaseSchemaUpdate" value = "true"/>        
    <property name="mailServerPort" value="1025"/>
    <property name="jobExecutorActivate" value="false" />  
    <property name="customPostDeployers">
      <list>
        <bean class="org.activiti.engine.impl.rules.RulesDeployer" />
      </list>
    </property>
  </bean>
</beans>
—————————————————————-
SERVLET:
package servlets;
import …
@WebServlet("/Hello")
public class Hello extends HttpServlet {
   private static final long serialVersionUID = 1L; 
    /**
     * @see HttpServlet#HttpServlet()
     */
    public Hello() {
        super(); // TODO Auto-generated constructor stub
    }
   /**
    * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
    */
   protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      // TODO Auto-generated method stub
   }
   /**
    * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
    */
   protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      // TODO Auto-generated method stub
      ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();                           
      IdentityService identityService = processEngine.getIdentityService();
      User newUser = identityService.newUser("lbruzzi");
              
      newUser.setId("lbruzzi");
      newUser.setPassword("123456");
      newUser.setFirstName("Leandro");
      newUser.setLastName("Bruzzi");
      newUser.setEmail("leandrobruzzi@gmail.com");
      identityService.saveUser(newUser);
      
      
                Persona p = new Persona(request.getParameter("usConf"),request.getParameter("passConf"), request.getParameter("nombre"),                                   
                request.getParameter("apellido"), request.getParameter("email"));
       
       System.out.println(p.getUsuario()+p.getContraseña()+p.getNombre()+p.getApellido()+p.getEmail());
       
        request.setAttribute("usuario", p.getUsuario());
        request.getRequestDispatcher("registroExito.jsp").forward(request, response);    
   }
}

—————————————————————-
ERROR:
type Informe de Excepción
mensaje La ejecución del Servlet lanzó una excepción
descripción El servidor encontró un error interno que hizo que no pudiera rellenar este requerimiento.
excepción
javax.servlet.ServletException: La ejecución del Servlet lanzó una excepción

causa raíz
java.lang.NoClassDefFoundError: org/activiti/engine/ProcessEngines
   servlets.Hello.doPost(Hello.java:56)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:731)

causa raíz
java.lang.ClassNotFoundException: org.activiti.engine.ProcessEngines
   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
   servlets.Hello.doPost(Hello.java:56)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
—————————————————————-

Waiting for an answer. Regards.

Outcomes