cancel
Showing results for 
Search instead for 
Did you mean: 

Urgent - Error deploying .BAR file, why?

sergiofigueras_
Champ in-the-making
Champ in-the-making
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.
15 REPLIES 15

sergiofigueras_
Champ in-the-making
Champ in-the-making
Hi folks,

I've verified and in my workspace exists two classes named XMLSchemaLoader. One inside java-6-openjdk, in the package com.sun.org.apache.xerces.internal.impl.xs, and other inside XercesImpl-2.0.2, in the package org.apache.xerces.impl.xs, that one is being used with Activiti. There's no other class or Xerces package.

Any idea?

Regards,

trademak
Star Contributor
Star Contributor
Is there a specific reason for using OpenJDK 6?
Could you try and use the Oracle JDK just to see if that solves the issue?

Best regards,

sergiofigueras_
Champ in-the-making
Champ in-the-making
Hi trademak,

I've changed the runtime environment to Oracle JDK 1.6.0u35, but the same error has occurred.

Just to remember: I'm using the Activiti code to deploy.

protected void deployUploadedFile() {
    DeploymentBuilder deploymentBuilder = repositoryService.createDeployment().name(fileName);
    try {
      try {
        if (fileName.endsWith(".bpmn20.xml")) {
          validFile = true;
          deployment = deploymentBuilder
            .addInputStream(fileName, new ByteArrayInputStream(outputStream.toByteArray()))
            .deploy();
        } else if (fileName.endsWith(".bar") || fileName.endsWith(".zip")) {
          validFile = true;
          deployment = deploymentBuilder
            .addZipInputStream(new ZipInputStream(new ByteArrayInputStream(outputStream.toByteArray())))
            .deploy();
        } else {
          notificationManager.showErrorNotification("deployment.upload.invalid.file",
            MessagesUtility.getMessage("deployment.upload.invalid.desc"));
        }
      } catch (ActivitiException e) {
        String errorMsg = e.getMessage().replace(System.getProperty("line.separator"), "<br/>");
        notificationManager.showErrorNotification("deployment.upload.failed", errorMsg);
      }
    } finally {
      if (outputStream != null) {
        try {
          outputStream.close();
        } catch (IOException e) {
          notificationManager.showErrorNotification("Server-side error", e.getMessage());
        }
      }
    }
  }

jbarrez
Star Contributor
Star Contributor
Phew … I'm almost out of options.

Is it possible to put your bar file somewhere online (or a bar file that fails, at least), so we can test it ourselves?

sergiofigueras_
Champ in-the-making
Champ in-the-making
Hi jbarrez,

Thanks for your patience. I've discovered the problem. I was using commons-dbcp 1.2.1 , but it's not supported. Then, I changed to 1.4 version and everything is going fine now.

Thanks! Smiley Happy

jbarrez
Star Contributor
Star Contributor
Okay, that is a really strange solution … would never have expected the connection pool to be the culprit….

Thanks for posting back!