Hi all,
I need some advice because I'm messing around with a requirement without getting any solution. All I wanna do is to access some previous uploaded files (in a User Task, from the upload form field) in a downstream ServiceTask. For me it looks like that the example behind the following link is the way to go:
I assume I can get the content by injecting (or "Autowireing") the RelatedContentService (?):
RelatedContentService relatedContentService;
The issue I get is already right after copy&paste the demo code from the above link to my project. The project has been created with the org.alfresco.maven.archetype:activiti-jar-archetype (see attached screenshot).
But the following packages can not be resolved (see attached screenshot):
import com.activiti.content.storage.api.ContentObject;
import com.activiti.extension.domain.runtime.RelatedContent;
Which dependencies are missing here? If I double check at maven.alfresco.com/nexus for RelatedContent, it only refers to a class within a org.activiti package. Even the ContentObject seems to be only available in org.activiti group of the content-storage-api artifact. However, if I use the classes from the org.activiti package instead, the startup of the application server crashes with the following:
Caused by: java.lang.IllegalStateException: Failed to introspect bean class [com.activiti.extension.bean.MyTestClass] for persistence metadata: could not find class that it depends on
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:401)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(PersistenceAnnotationBeanPostProcessor.java:333)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:992)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:523)
... 28 more
Caused by: java.lang.NoClassDefFoundError: Lorg/activiti/app/service/runtime/RelatedContentService;
Can anyone help me with that issue, please? Maybe the approach is wrong? Again, what I need is, just to get the uploaded content from a previous UserTask in a ServiceTask.
Thanks!
BR,
Solved! Go to Solution.
Hi!
You do need activiti-app-logic-1.5.3.jar (or other version) dependency in your pom.xml
For example:
<dependency>
<groupId>${activiti.groupId}</groupId>
<artifactId>activiti-app-logic</artifactId>
<version>${activiti.version}</version>
<exclusions>
<!-- Exclude the SLF4J JAR so we don't get multiple binding warnings when running -->
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
Regards.
Hi!
You do need activiti-app-logic-1.5.3.jar (or other version) dependency in your pom.xml
For example:
<dependency>
<groupId>${activiti.groupId}</groupId>
<artifactId>activiti-app-logic</artifactId>
<version>${activiti.version}</version>
<exclusions>
<!-- Exclude the SLF4J JAR so we don't get multiple binding warnings when running -->
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
Regards.
Fernando González thanks! The mentioned dependency is available in the POM after creating the project with the org.alfresco.maven.archetype:activiti-jar-archetype artifact. However, I do not see the packages / classes in the JAR file so the IDE doesn't see it either!???
Any thoughts what I'm doing wrong?
BR,
Mario
Ah!!, ok, ok, have you tried doing this from terminal?
mvn eclipse:eclipse
This synchronize dependencies with Eclipse from maven.
Regards.
I don't have Eclipse as IDE.
Ops! I'm sorry. Then do can use maven in command mode for test this dependency and after watch your config with your IDE.
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.