02-18-2018 03:28 PM
In a JAX-RS and CDI application, configuring Activiti using CDI, and then getting LocalProcessEngineLookup error using Weld: "Could not find an implementation of the org.activiti.cdi.spi.ProcessEngineLookup service returning a non-null processEngine. Giving up." Looking at the User Guide, should be easy but I can't figure it out. Including both activiti-engine and activiti-cdi in the Maven pom.xml file.
02-19-2018 08:28 AM
If it helps, here is the POM.XML file:
SyntaxEditor Code Snippet
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.reisystems</groupId> <artifactId>ehb-TaskMgmt</artifactId> <version>${revision}</version> <packaging>war</packaging> <name>EHB Task Management</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <!-- MicroProfile specs v1.2--> <version.servlet.api>4.0.0</version.servlet.api> <version.cdi>2.0</version.cdi> <version.jaxrs>2.1</version.jaxrs> <version.jsonp>1.1.2</version.jsonp> <version.jsonb>1.0</version.jsonb> <version.annotation>1.3.1</version.annotation> <version.config>1.1</version.config> <version.ft>1.0</version.ft> <version.health>1.0</version.health> <version.metrics>1.0</version.metrics> <version.jwt>1.0</version.jwt> <!-- Implementations --> <!-- CDI --> <version.weld>3.0.3.Final</version.weld> <!-- JAX-RS --> <version.jersey>2.26</version.jersey> <!-- ORM and RDBMS --> <version.oracle>12.2.0.1</version.oracle> <!-- Workflow --> <version.activiti>6.0.0</version.activiti> <!-- Helper Libraries --> <version.junit>4.12</version.junit> <version.commons>1.9.2</version.commons> <version.slf4j>1.7.25</version.slf4j> <version.jackson>2.9.3</version.jackson> <!-- Maven Plugins --> <version.findbugs.plugin>3.0.3</version.findbugs.plugin> <version.maven-surefire-plugin>2.19.1</version.maven-surefire-plugin> <version.maven-failsafe-plugin>2.19.1</version.maven-failsafe-plugin> <version.shrinkwrap-resolver-impl-maven>2.2.2</version.shrinkwrap-resolver-impl-maven> <!-- other properties used for Release to Nexus --> <!-- whether autorelease maven central staging repositories - default false to allow review and manually release repositories --> <autorelease>false</autorelease> <!-- keeping closed repos with failure - default is false because the errors are visible in the maven output, but true will leave the repo open for investigation in Sonatype Nexus --> <keepStagingReposOnFailure>false</keepStagingReposOnFailure> <!-- will be overridden in CD pipeline --> <!-- when running on local machine (as developer) :mvn clean package, results in the artifact version 1.0.0+local --> <!-- when running Maven on CI server (Jenkins), :mvn clean package -DbuildNumber=b${buildNumber} — with the build number --> <!-- taken from the current pipeline build, results in artifact versions 1.0.0+b123, 1.0.0+b124, etc. --> <!-- then when ready to publish to artifact repository (Nexus), :mvn deploy requires the property to be set accordingly --> <!-- This approach comes in handy to both specify predictable versions and fallback versions for local builds. --> <!-- It’s important to note that the semantic version 1.0.0 should only changed by developers, since it reflects --> <!-- the nature and compatibility of API-changes. --> <buildNumber>local</buildNumber> <revision>1.0.0+${buildNumber}</revision> </properties> <repositories> <repository> <id>maven.oracle.com</id> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> <url>https://maven.oracle.com</url> <layout>default</layout> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>maven.oracle.com</id> <url>https://maven.oracle.com</url> </pluginRepository> </pluginRepositories> <dependencies> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>${version.servlet.api}</version> </dependency> <dependency> <groupId>javax.enterprise</groupId> <artifactId>cdi-api</artifactId> <version>${version.cdi}</version> </dependency> <dependency> <groupId>javax.ws.rs</groupId> <artifactId>javax.ws.rs-api</artifactId> <version>${version.jaxrs}</version> </dependency> <dependency> <groupId>javax.json</groupId> <artifactId>javax.json-api</artifactId> <version>${version.jsonp}</version> </dependency> <dependency> <groupId>javax.json.bind</groupId> <artifactId>javax.json.bind-api</artifactId> <version>${version.jsonb}</version> </dependency> <dependency> <groupId>javax.annotation</groupId> <artifactId>javax.annotation-api</artifactId> <version>${version.annotation}</version> </dependency> <dependency> <groupId>org.jboss.weld.servlet</groupId> <artifactId>weld-servlet-core</artifactId> <version>${version.weld}</version> </dependency> <dependency> <groupId>org.glassfish.jersey.containers</groupId> <artifactId>jersey-container-servlet</artifactId> <version>${version.jersey}</version> </dependency> <dependency> <groupId>org.glassfish.jersey.ext.cdi</groupId> <artifactId>jersey-cdi1x-servlet</artifactId> <version>${version.jersey}</version> </dependency> <dependency> <groupId>org.glassfish.jersey.inject</groupId> <artifactId>jersey-hk2</artifactId> <version>${version.jersey}</version> </dependency> <dependency> <groupId>org.glassfish.jersey.media</groupId> <artifactId>jersey-media-json-jackson</artifactId> <version>${version.jersey}</version> </dependency> <dependency> <groupId>org.glassfish.jersey.media</groupId> <artifactId>jersey-media-json-processing</artifactId> <version>${version.jersey}</version> </dependency> <dependency> <groupId>org.glassfish.jersey.media</groupId> <artifactId>jersey-media-multipart</artifactId> <version>${version.jersey}</version> </dependency> <dependency> <groupId>org.glassfish.jersey.media</groupId> <artifactId>jersey-media-sse</artifactId> <version>${version.jersey}</version> </dependency> <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.json</artifactId> <version>${version.jsonp}</version> </dependency> <dependency> <groupId>org.eclipse</groupId> <artifactId>yasson</artifactId> <version>${version.jsonb}</version> </dependency> <dependency> <groupId>javax.annotation</groupId> <artifactId>jsr250-api</artifactId> <version>1.0</version> </dependency> <!-- WORKFLOW --> <dependency> <groupId>org.activiti</groupId> <artifactId>activiti-engine</artifactId> <version>${version.activiti}</version> </dependency> <dependency> <groupId>org.activiti</groupId> <artifactId>activiti-cdi</artifactId> <version>${version.activiti}</version> </dependency> <!-- RDBMS --> <dependency> <groupId>com.oracle.jdbc</groupId> <artifactId>ojdbc8</artifactId> <version>${version.oracle}</version> </dependency> <!-- HELPERs --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${version.junit}</version> <scope>test</scope> </dependency> <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> <version>${version.commons}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> <version>${version.slf4j}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>${version.jackson}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> <version>${version.jackson}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>${version.jackson}</version> </dependency> <!-- DEPENDENCY RESOLVER --> <dependency> <groupId>org.jboss.shrinkwrap.resolver</groupId> <artifactId>shrinkwrap-resolver-impl-maven</artifactId> <version>${version.shrinkwrap-resolver-impl-maven}</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> <version>${version.findbugs.plugin}</version> <configuration> <!--Enables analysis which takes more memory but finds more bugs. If you run out of memory, changes the value of the effort element to 'Low'.--> <effort>Max</effort> <!-- Reports all bugs (other values are medium and max) --> <threshold>Low</threshold> <!-- Produces XML report --> <xmlOutput>true</xmlOutput> <excludeFilterFile>code-rules/findbugs-excludes.xml</excludeFilterFile> </configuration> <executions> <execution> <id>analyze-compile</id> <phase>compile</phase> <goals> <goal>check</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.5.1</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.6</version> <configuration> <warName>${project.artifactId}</warName> <failOnMissingWebXml>false</failOnMissingWebXml> <archive> <addMavenDescriptor>false</addMavenDescriptor> </archive> <archiveClasses>true</archiveClasses> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <version>2.3.2</version> <configuration> <autoVersionSubmodules>true</autoVersionSubmodules> <tagNameFormat>@{project.version}</tagNameFormat> <preparationGoals>clean install</preparationGoals> <pushChanges>false</pushChanges> <localCheckout>true</localCheckout> </configuration> </plugin> <!-- we tell surefire not to run integration tests during 'test' phase (unit test phase) --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>${version.maven-surefire-plugin}</version> <configuration> <excludes> <exclude>**/*IntegrationTest.java</exclude> <exclude>**/*AppTest.java</exclude> </excludes> </configuration> </plugin> <!-- we tell failsafe to specifically run integration tests during 'integration-test' phase (after the war has been generated) --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <version>${version.maven-failsafe-plugin}</version> <configuration> <encoding>UTF-8</encoding> <includes> <include>**/*IntegrationTest.java</include> <include>**/*AppTest.java</include> </includes> </configuration> <executions> <execution> <id>integration-test</id> <goals> <goal>integration-test</goal> </goals> </execution> <execution> <id>verify</id> <goals> <goal>verify</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <profiles> <profile> <id>release</id> <build> <plugins> <plugin> <groupId>org.sonatype.plugins</groupId> <artifactId>nexus-staging-maven-plugin</artifactId> <version>1.5.1</version> <extensions>true</extensions> <configuration> <nexusUrl>https://oss.reisystems.com/</nexusUrl> <serverId>oss</serverId> <autoReleaseAfterClose>${autorelease}</autoReleaseAfterClose> <keepStagingRepositoryOnCloseRuleFailure>${keepStagingReposOnFailure}</keepStagingRepositoryOnCloseRuleFailure> </configuration> </plugin> </plugins> </build> </profile> </profiles></project>
Explore our Alfresco products with the links below. Use labels to filter content by product module.