cancel
Showing results for 
Search instead for 
Did you mean: 

Exception while initializing process engine Can't debug

skougiou
Champ in-the-making
Champ in-the-making
Hello,

I am trying to initialize the activiti engine through a jsp scriptlet and I keep receiving this error from the console :

INFO: Exception while initializing process engine Smiley Surprisedrg/springframework/beans/factory/support/BeanDefinitionRegistry

when I try to debug I manage to dig until the following call inside the file : ProcessEngines.class :

private static  ProcessEngine buildProcessEngine(URL resource) {
    InputStream inputStream = null;
    try {
      inputStream = resource.openStream();
      ProcessEngineConfiguration processEngineConfiguration = ProcessEngineConfiguration.createProcessEngineConfigurationFromInputStream(inputStream);
      return processEngineConfiguration.buildProcessEngine();
     
    } catch (IOException e) {
      throw new ActivitiException("couldn't open resource stream: "+e.getMessage(), e);
    } finally {
      IoUtil.closeSilently(inputStream);
    }
  }

The problem is that I can't step into   .createProcessEngineConfigurationFromInputStream(inputStream);
to find out what is going on, because when hitting "step into" the debugger jumps to the finally section.
( I have already tried to enable breakpoints inside the function createProcessEngineConfigurationFromInputStream  ) it just keeps moving on to the finally section.

Apparently another exception is being fired…other than IOException. I can't see clearly what the exception is because this call : createProcessEngineConfigurationFromInputStream   does not throws any exception

Thank you for your time! Smiley Happy
11 REPLIES 11

frederikherema1
Star Contributor
Star Contributor
How are you initializing your process-engine? Are you using the ProcessEngines.getEngine()? If so, you could check out the getProcessEngineInfos(), this contains an engine-info with the full stack-trace of the exception.

Anyway, the message of the exception says "org/springframework/beans/factory/support/BeanDefinitionRegistry" -> possibly a ClassNotFound or NoClassDef? Is spring-beans on your classpath?

skougiou
Champ in-the-making
Champ in-the-making
Hello,

For the engine initialization I use this call ->  ProcessEngine processEng = ProcessEngines.getDefaultProcessEngine();
The correct call is like this?  –> getProcessEngineInfos("processEng") ; ?  if it is, it returns null.
In the build path I have this one,  spring-beans-3.0.0.RELEASE.jar

( why can't I go step by step this code segment? it is the first time I encounter something like this  :shock:  )

Thanks for the quick reply Smiley Happy

frederikherema1
Star Contributor
Star Contributor
You should use the list of Info's… Since you're process-engine hasn't been initialized, it won't have the correct name, so getProcessEngineInfo("default") won't work, use:

public static List<ProcessEngineInfo> getProcessEngineInfos()
Should be one ProcessEngineInfo, containing the full stacktrace

skougiou
Champ in-the-making
Champ in-the-making
ok I managed to extract the exception and I pasted it below. I have already included the spring jars…is there something that I miss?  I can't understand

java.lang.NoClassDefFoundError: org/springframework/beans/factory/support/BeanDefinitionRegistry at org.activiti.engine.ProcessEngines.buildProcessEngine(ProcessEngines.java:152) at org.activiti.engine.ProcessEngines.initProcessEnginFromResource(ProcessEngines.java:126) at org.activiti.engine.ProcessEngines.init(ProcessEngines.java:85) at org.activiti.engine.ProcessEngines.getProcessEngine(ProcessEngines.java:183) at org.activiti.engine.ProcessEngines.getDefaultProcessEngine(ProcessEngines.java:176) at org.apache.jsp.testBPM_jsp._jspService(testBPM_jsp.java:86) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) 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.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:127) 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:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.support.BeanDefinitionRegistry at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) … 24 more

frederikherema1
Star Contributor
Star Contributor
Hi,

Seems like the class (BeanDefinitionRegistry) was found on the classpath, but an error occurred while loading. Probably a class referenced from 'BeanDefinitionRegistry' is not present on the classpath. The only obvious non-spring-beans dependency I see in that class is: org.springframework.core.AliasRegistry.

Do you have the spring-core on your classpath as well?

skougiou
Champ in-the-making
Champ in-the-making
well yes…unfortunately I do have org.springframework.core.AliasRegistry in my classpath. The whole package is.. I also changed from spring-core-3.0.0.RELEASE.jar   to  spring-core-3.0.3.RELEASE.jar  but no luck.

tombaeyens
Champ in-the-making
Champ in-the-making
NoClassDefFoundError means that BeanDefinitionRegistry imports can't be found.
Try using all the spring libs as they are in the workspace/activiti-engine-examples/libs-runtime

skougiou
Champ in-the-making
Champ in-the-making
Hello,

I have taken all the libs from workspace/activiti-engine-examples/libs-runtime the problem still persists. I tried to add the jars as external to the build path and still the same. I also downloaded the spring framework 3.0.5 and the problem wasn't solved. The next thing I thought was that the class file was not inside the jar…Double checked and it is there. Any other ideas? I lastly searched for a conflicting jar inside the build path but that wasn't the case.

Thank you for your time, this thing is starting to wind me up

skougiou
Champ in-the-making
Champ in-the-making
Hello,

I have solved the problem eventually. The solution was that I took only the runtime-libs and put them in the build path. Everything else was deleted. Apparently a .jar was conflicting. When I removed the extra jars everything went fine.

Thank you for your time and help