cancel
Showing results for 
Search instead for 
Did you mean: 

Creating own CustomServiceTask with PropertyItems annotation

marcin_lepicki
Champ in-the-making
Champ in-the-making
Hi,

I'm trying to create own shape in the Designer. I want to use PropertyItems annotation, but this gives me error:
annotation org.activiti.designer.integration.servicetask.annotation.PropertyItems is missing <clinit>
I think that it is sun javac bug: fields initializers using "new" cause this bug when annotation class is in the classpath http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6857918 while the same works in the eclipse compiler https://bugs.eclipse.org/bugs/show_bug.cgi?id=324931
Of couse, there is static field with initializer in the PropertyItems annotation: http://svn.codehaus.org/activiti/projects/designer/trunk/org.activiti.designer.integration/src/main/...

The easiest way to reproduce is downloading AcmeMoneyTask example and trying to compile it:
svn checkout http://svn.codehaus.org/activiti/projects/designer/trunk/examples/
cd examples/money-tasks
(optional if you use profile with repos) add http://maven.alfresco.com/nexus/content/repositories/activiti/ repo to pom.xml
mvn compile
This gives me error:
[ERROR] /path/to/files/examples/money-tasks/src/main/java/org/acme/servicetasks/AcmeMoneyTask.java:[85,2] annotation org.activiti.designer.integration.servicetask.annotation.PropertyItems is missing <clinit>

My environment: Ubuntu Linux 10.04, Sun Java 1.6.0_26, Maven 3.0.3

Any advice on this problem? Should I fill JIRA bug?
7 REPLIES 7

tiesebarrell
Champ in-the-making
Champ in-the-making
marcin,

do you have the option to attempt with Java 7? That might yield different results.

It does seem like you've run into the particular bug you mentioned. If that's the case, I doubt we will be able to solve it specifically for Designer. However, I'm willing to look into it to see whether this is the case if you create an issue.

marcin_lepicki
Champ in-the-making
Champ in-the-making
Hi Tiese,

Thanks for quick reply! Yes, I also get this error on jdk1.7.0. I'll try to test it on windows&mac and then fill issue on JIRA.

msandoz
Champ in-the-making
Champ in-the-making
i dont see this in jira. i am having the same issue. I go to the command line and do this:

mvn clean install

and get:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project money-tasks: Compilation failure: Compilation failure:
[ERROR] \workspaces\money-tasks\src\main\java\org\acme\servicetasks\AcmeMoneyTask.java:[78,2] annotation org.activiti.designer.integration.servicetask.annotation.PropertyItems is missing <clinit>
[ERROR] \workspaces\money-tasks\src\main\java\org\acme\servicetasks\AcmeMoneyTask.java:[85,2] annotation org.activiti.designer.integration.servicetask.annotation.PropertyItems is missing <clinit>

I also have maven 3.0.3 and jdk 1.6.0_26

also tried with 1.6.0_27…

msandoz
Champ in-the-making
Champ in-the-making
when I remove this from the PropertyItems annotation:


  public static final String[] DEFAULT_VALUE = new String[] {};
everything builds fine.

It may be related to this bug:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6857918


javac cannot handle fields in @interface: will generate "is missing <clinit>".

I will raise this as a jira ticket.

tiesebarrell
Champ in-the-making
Champ in-the-making
There is already a Jira ticket for this, so there's no need. It looks like the same problem.

msandoz
Champ in-the-making
Champ in-the-making
sorry - i did create one - http://jira.codehaus.org/browse/ACT-1010.

if its a duplicate please feel free to close! while it shows up in activiti code, it looks like a java issue.

tiesebarrell
Champ in-the-making
Champ in-the-making
Sorry. I thought the OP had created an issue for this, but it seems that's not the case. So your issue is not a duplicate.