AnsweredAssumed Answered

Urgent - Error deploying .BAR file, why?

Question asked by sergiofigueras_4724 on Feb 2, 2013
Latest reply on Feb 13, 2013 by jbarrez
Hi everyone,

When I deploy my .BAR file in activiti-explorer, everything goes fine. But when I try to deploy on my application, I'm getting this error:

Feb 2, 2013 5:59:51 PM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource AprovacaoCredito.bpmn20.xml
Feb 2, 2013 5:59:51 PM com.vaadin.Application terminalError
SEVERE: Terminal error:
com.vaadin.terminal.gwt.server.UploadException: Upload failed
   at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.streamToReceiver(AbstractCommunicationManager.java:626)
   at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleSimpleMultipartFileUpload(AbstractCommunicationManager.java:479)
   at com.vaadin.terminal.gwt.server.CommunicationManager.handleFileUpload(CommunicationManager.java:257)
   at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:495)
   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:293)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   at java.lang.Thread.run(Thread.java:679)
Caused by: com.vaadin.event.ListenerMethod$MethodException
Cause: java.lang.StackOverflowError
   at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:532)
   at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
   at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1219)
   at com.vaadin.ui.Upload.fireUploadSuccess(Upload.java:744)
   at com.vaadin.ui.Upload$1.streamingFinished(Upload.java:1022)
   at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.streamToReceiver(AbstractCommunicationManager.java:603)
   … 16 more
Caused by: java.lang.StackOverflowError
   at org.apache.xerces.util.URI.isConformantSchemeName(URI.java:1213)
   at org.apache.xerces.util.URI.setScheme(URI.java:904)
   at org.apache.xerces.util.URI.initializeScheme(URI.java:576)
   at org.apache.xerces.util.URI.initialize(URI.java:400)
   at org.apache.xerces.util.URI.<init>(URI.java:211)
   at org.apache.xerces.util.URI.<init>(URI.java:195)
   at org.apache.xerces.impl.XMLEntityManager.expandSystemId(XMLEntityManager.java:1140)
   at org.apache.xerces.impl.XMLEntityManager.resolveEntity(XMLEntityManager.java:581)
   at org.apache.xerces.impl.xs.XMLSchemaLoader.xsdToXMLInputSource(XMLSchemaLoader.java:625)
   at org.apache.xerces.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(XMLSchemaLoader.java:580)
   at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:489)
   at org.apache.xerces.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(XMLSchemaLoader.java:588)
   at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:489)
   at org.apache.xerces.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(XMLSchemaLoader.java:588)
   at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:489)
   at org.apache.xerces.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(XMLSchemaLoader.java:588)
   at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:489)
   at org.apache.xerces.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(XMLSchemaLoader.java:588)
   at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:489)
   at org.apache.xerces.impl.xs.XMLSchemaLoader.processJAXPSchemaSource(XMLSchemaLoader.java:588)

I'm using those dependencies in my pom.xml:

      <dependency>
         <groupId>org.activiti</groupId>
         <artifactId>activiti-engine</artifactId>
         <version>5.10</version>
      </dependency>
      
      <dependency>
         <groupId>org.activiti</groupId>
         <artifactId>activiti-spring</artifactId>
         <version>5.10</version>
      </dependency>

And configuring in my applicationContext with:

<bean id="dataSourceBean"
      class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
      <property name="driverClass" value="#{props.bpmjdbcdriver}" />
      <property name="url" value="#{props.bpmjdbcurl}" />
      <property name="username" value="#{props.bpmjdbcusername}" />
      <property name="password" value="#{props.bpmjdbcpassword}" />
   </bean>

   <bean id="transactionManagerBean"
      class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
      <property name="dataSource" ref="dataSourceBean" />
   </bean>

   <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
      <property name="dataSource" ref="dataSourceBean" />
      <property name="transactionManager" ref="transactionManagerBean" />
      <property name="databaseSchemaUpdate" value="true" />
      <property name="jobExecutorActivate" value="false" />
   </bean>

   <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
      <property name="processEngineConfiguration" ref="processEngineConfiguration" />
   </bean>

   <bean id="repositoryService" factory-bean="processEngine"
      factory-method="getRepositoryService" />
   <bean id="runtimeService" factory-bean="processEngine"
      factory-method="getRuntimeService" />
   <bean id="taskService" factory-bean="processEngine"
      factory-method="getTaskService" />
   <bean id="historyService" factory-bean="processEngine"
      factory-method="getHistoryService" />
   <bean id="managementService" factory-bean="processEngine"
      factory-method="getManagementService" />
   <bean id="identityService" factory-bean="processEngine"
      factory-method="getIdentityService" />
   <bean id="formService" factory-bean="processEngine"
      factory-method="getFormService" />

My code to deploy is very simple:

   public void deployProcessBar(String fileName, byte [] barBytes) throws ExecutionException {
      DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().name(fileName);
      InputStream byteArrayInputStream = new ByteArrayInputStream(bytes);
      ZipInputStream zipInputStream = new ZipInputStream(byteArrayInputStream);
      deploymentBuilder.addZipInputStream(zipInputStream).deploy();
      try {
         byteArrayInputStream.close();
      } catch (IOException e) {
         throw new ExecutionException(e);
      }
   }

The file name and BAR bytes are fine, I just don't know what I'm doing wrong. Another point is there's NO other reference to Xerces in my project.

Outcomes