samplr
samplr copied to clipboard
compilation error - missing CreateRegistrationProcessor
HI, I have tried to use this lib, but the compilation fails with message about missing service - org.netbeans.modules.editor.mimelookup.CreateRegistrationProcessor, referenced in javax.annotation,processing.Processor. I used the "big" library with dependencies inside,
Hi,
Thank you for reporting this problem. May I ask you if you tried to build the library yourself or if you used the binary jar file provided in the downloads section? Can you also provide some details about your build configuration (ide version, java version etc)?
Regards,
- Juliano
Hi,
I tried to use the library provided in the download section, I had
impression that this jar contains all required dependencies, such option
would be helpful for me.
I was too lazy to check where is the missing lib. However I just looked on
the maven conf and added this to shade-pligin configuration:
After the change, the class was included. I'll check tomorow if this is enough Kind regards, Marek.
2012/10/2 jjviana [email protected]
Hi,
Thank you for reporting this problem. May I ask you if you tried to build the library yourself or if you used the binary jar file provided in the downloads section? Can you also provide some details about your build configuration (ide version, java version etc)?
Regards,
Juliano
— Reply to this email directly or view it on GitHubhttps://github.com/jjviana/samplr/issues/2#issuecomment-9068227.
I've tried to use the binary JAR provided in the downloads section and to build the project myself using Maven. In both cases, I get the same error when I compile my project, which depends on samplr-core:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project my-project: Compilation failure
[ERROR] error: Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Provider org.netbeans.modules.editor.mimelookup.CreateRegistrationProcessor not found
I'm using Java 1.6.0_18 and Maven 3.0.4.
I've also tried to make the change suggested by mhawrylczak and build samplr again. Compiling my own project, I got the following error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project my-project: Compilation failure
[ERROR] error: Exception thrown while constructing Processor object: org/openide/filesystems/annotations/LayerGeneratingProcessor
Any idea what I'm doing wrong?
I included the jars below and the test RequestManagerTest, included in the sources as a example, seems to be working.
http://findjar.net/downloadfile.x?id=12763&type=jar http://findjar.net/downloadfile.x?id=12677&type=jar
The file generated can be imported in VisualVM and now i'll try to adapt it to my needs.
Hi, Thanks to everyone for the feedback. The problem seems related to the use of the maven shade plugin. I used shade to shrink the resulting library, ad I didnt want to include the entire netbeans platform inside it. It seems like the soluton works well but there are certain classes that should be included and are not. These clases are related to compiler annotation processors. I will try and find a solution for including the missing classes in the final jar. In the mean time, one workaround is to disable annotation processing while compiling your projects if you dont use this compiler feature (most peojects dont). This can be disabled by passing the option -proc:none to the Java compiler.In maven you can do that by including the following configuration in the maven compiler plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>
1.6
</source>
<target>
1.6
</target>
<compilerArgument>-proc:none</compilerArgument>
</configuration>
</plugin>