java - Netbeans and Bad service configuration file, or exception thrown while constructing Processor object -
here error getting diagnostic throught javacompiler taska:
bad service configuration file, or exception thrown while constructing processor object: javax.annotation.processing.processor: provider org.netbeans.modules.openide.modules.patchedpublicprocessor not subtype
i trying dynamic comppile simple java class file, using javacompiler. class looks like:
package web.others; public class user { }
my project maven project type
as can see class conatins nil special. 1 thing need geting class object class. @ runtime. compile dynamic class , class object. problem working on netbeans plaform , want in ide (i develop simple plugin)
to compile , run im using next code:
javacompiler compiler = toolprovider.getsystemjavacompiler(); diagnosticcollector<javafileobject> diagnostics = new diagnosticcollector<javafileobject>(); standardjavafilemanager filemanager = compiler.getstandardfilemanager(diagnostics, null, null); iterable<? extends javafileobject> compilationunits = arrays.aslist(file); javacompiler.compilationtask task = compiler.gettask(null, filemanager, diagnostics, null,null,compilationunits); boolean success = task.call(); seek { filemanager.close(); } grab (ioexception ex) { exceptions.printstacktrace(ex); } system.out.println("success: " + success); if (!success) { list<diagnostic<? extends javafileobject>> dia = diagnostics.getdiagnostics(); system.out.println("diagnostic: " + dia); }
and getting next error diagnostics:
error: bad service configuration file, or exception thrown while constructing processor object: javax.annotation.processing.processor: provider org.netbeans.modules.openide.modules.patchedpublicprocessor not subtype
anybody can help issue greatful help!
update:
here pom.xml:
<?xml version="1.0" encoding="utf-8"?> <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.mycompany</groupid> <artifactid>mavenproject2</artifactid> <version>1.0-snapshot</version> <packaging>nbm</packaging> <build> <plugins> <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>nbm-maven-plugin</artifactid> <version>3.13</version> <extensions>true</extensions> <configuration> <publicpackages> <publicpackage>org.netbeans.modules</publicpackage> </publicpackages> </configuration> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <version>3.2</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-jar-plugin</artifactid> <version>2.4</version> <configuration> <usedefaultmanifestfile>true</usedefaultmanifestfile> <archive> <manifest> <addclasspath>true</addclasspath> </manifest> </archive> </configuration> </plugin> </plugins> </build> <repositories> <repository> <id>netbeans</id> <name>repository hosting netbeans modules</name> <url>http://bits.netbeans.org/nexus/content/groups/netbeans</url> <snapshots> <enabled>false</enabled> </snapshots> </repository> <repository> <id>unknown-jars-temp-repo</id> <name>a temporary repository created netbeans libraries , jars not identify. please replace dependencies in repository right ones , delete repository.</name> <url>file:${project.basedir}/lib</url> </repository> </repositories> <dependencies> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-netbeans-core-ide</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-openide-util</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-openide-awt</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-openide-nodes</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-openide-filesystems</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-openide-loaders</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-openide-windows</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-openide-util-lookup</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-openide-io</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-openide-explorer</artifactid> <version>release80</version> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-openide-dialogs</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-openide-text</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-openide-modules</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-netbeans-modules-projectuiapi</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-netbeans-modules-settings</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-netbeans-modules-projectapi</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-netbeans-modules-db</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-netbeans-modules-editor-lib2</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-netbeans-modules-editor-lib</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-netbeans-modules-editor-mimelookup</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-netbeans-modules-parsing-api</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-netbeans-modules-editor-indent</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-netbeans-api-java-classpath</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-netbeans-modules-java-source</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-netbeans-libs-javacapi</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.netbeans.api</groupid> <artifactid>org-netbeans-modules-java-project</artifactid> <version>release80</version> <type>jar</type> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-core</artifactid> <version>4.3.6.final</version> <type>jar</type> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-entitymanager</artifactid> <version>4.3.1.final</version> <type>jar</type> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-envers</artifactid> <version>4.3.6.final</version> <type>jar</type> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-c3p0</artifactid> <version>4.3.6.final</version> <type>jar</type> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-proxool</artifactid> <version>4.3.6.final</version> <type>jar</type> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-infinispan</artifactid> <version>4.3.6.final</version> <type>jar</type> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-ehcache</artifactid> <version>4.3.6.final</version> <type>jar</type> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-validator</artifactid> <version>5.1.3.final</version> <type>jar</type> </dependency> <dependency> <groupid>unknown.binary</groupid> <artifactid>postgresql-9.2-1002.jdbc4</artifactid> <version>snapshot</version> </dependency> <dependency> <groupid>org.jboss.logging</groupid> <artifactid>jboss-logging</artifactid> <version>3.1.3.ga</version> <type>jar</type> </dependency> <dependency> <groupid>org.hibernate.common</groupid> <artifactid>hibernate-commons-annotations</artifactid> <version>4.0.5.final</version> <type>jar</type> </dependency> <dependency> <groupid>org.javassist</groupid> <artifactid>javassist</artifactid> <version>3.18.1-ga</version> <type>jar</type> </dependency> <dependency> <groupid>com.sun.codemodel</groupid> <artifactid>codemodel</artifactid> <version>2.6</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-web</artifactid> <version>4.0.5.release</version> <type>jar</type> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-webmvc</artifactid> <version>4.0.5.release</version> <type>jar</type> </dependency> <dependency> <groupid>commons-lang</groupid> <artifactid>commons-lang</artifactid> <version>2.6</version> <type>jar</type> </dependency> <dependency> <groupid>unknown.binary</groupid> <artifactid>postgresql-9.3-1102.jdbc4</artifactid> <version>snapshot</version> </dependency> <dependency> <groupid>org.eclipse.persistence</groupid> <artifactid>eclipselink</artifactid> <version>2.5.1</version> </dependency> <dependency> <groupid>org.eclipse.persistence</groupid> <artifactid>org.eclipse.persistence.jpa.modelgen.processor</artifactid> <version>2.5.1</version> <scope>provided</scope> </dependency> <dependency> <groupid>org.reflections</groupid> <artifactid>reflections</artifactid> <version>0.9.9-rc1</version> </dependency> </dependencies> <properties> <project.build.sourceencoding>utf-8</project.build.sourceencoding> </properties> </project>
i faced exact same problem. problem line missing maven-complier-plugin
's <configuration>
:
<compilerargument>-proc:none</compilerargument>
the purpose of tell compiler not utilize processor ourselves. if not have it, going seek utilize processor during compilation of processor , (as obvious) not going find since beingness compiled.
(or @ to the lowest degree way understand matter, please right me if wrong).
java netbeans netbeans-7 netbeans-platform netbeans-plugins
No comments:
Post a Comment