This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 248513 - Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Provider org.netbeans.modules.openide.modules.PatchedPublicProcessor not a subtype
Summary: Bad service configuration file, or exception thrown while constructing Proces...
Status: NEW
Alias: None
Product: apisupport
Classification: Unclassified
Component: Maven (show other bugs)
Version: 8.0.1
Hardware: PC Windows 8 x64
: P3 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-08 20:01 UTC by ziupex
Modified: 2014-11-12 08:55 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ziupex 2014-11-08 20:01:59 UTC
I develop a simple Netbens plugin. And what i trying to do is dynamic comppile a simple java class from file, using JavaCompiler. This class looks like:

    package web.others;

    public class User {

    }

My Project is Maven Project Type

As you can see the class conatins nothing special. One thing what i need to do is geting a java.lang.Class object from this class. But at runtime. I need dynamic compile and after that i can get this object. 

To compile and run im using a following 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();

     try {
       fileManager.close();
     } catch (IOException ex) {
        Exceptions.printStackTrace(ex);
     }
     System.out.println("Success: " + success);
     if (!success) {
        List<Diagnostic<? extends JavaFileObject>> dia = diagnostics.getDiagnostics();
        System.out.println("Diagnostic: " + dia);
     }


But always i getting a following error from 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 a subtype

What is wrong with this subtype? It is wrong implements version in class org.netbeans.modules.openide.modules.PatchedPublicProcessor

I trying alot things. I change compiler maven plugin to using a javac from 1.5 to 1.8 version but still same error

             <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>  
                    <source>1.5</source>   
                    <target>1.5</target>   
                </configuration>
            </plugin>

What is wrong?
Comment 1 ziupex 2014-11-10 09:06:38 UTC
anyone?
Comment 2 ziupex 2014-11-12 08:55:13 UTC
(In reply to ziupex from comment #0)
> I develop a simple Netbens plugin. And what i trying to do is dynamic
> comppile a simple java class from file, using JavaCompiler. This class looks
> like:
> 
>     package web.others;
> 
>     public class User {
> 
>     }
> 
> My Project is Maven Project Type
> 
> As you can see the class conatins nothing special. One thing what i need to
> do is geting a java.lang.Class object from this class. But at runtime. I
> need dynamic compile and after that i can get this object. 
> 
> To compile and run im using a following 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();
> 
>      try {
>        fileManager.close();
>      } catch (IOException ex) {
>         Exceptions.printStackTrace(ex);
>      }
>      System.out.println("Success: " + success);
>      if (!success) {
>         List<Diagnostic<? extends JavaFileObject>> dia =
> diagnostics.getDiagnostics();
>         System.out.println("Diagnostic: " + dia);
>      }
> 
> 
> But always i getting a following error from 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 a
> subtype
> 
> What is wrong with this subtype? It is wrong implements version in class
> org.netbeans.modules.openide.modules.PatchedPublicProcessor
> 
> I trying alot things. I change compiler maven plugin to using a javac from
> 1.5 to 1.8 version but still same error
> 
>              <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-compiler-plugin</artifactId>
>                 <version>3.2</version>
>                 <configuration>  
>                     <source>1.5</source>   
>                     <target>1.5</target>   
>                 </configuration>
>             </plugin>
> 
> What is wrong?