https://bz.apache.org/bugzilla/show_bug.cgi?id=66299

            Bug ID: 66299
           Summary: Cannot find annotation method 'value()' in type
                    'aQute.bnd.annotation.spi.ServiceConsumer' with Tomcat
           Product: Tomcat 9
           Version: 9.0.50
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: gar...@globalmentor.com
  Target Milestone: -----

I have a Java 11 project embedding Tomcat:

```xml
<dependency>
  <groupId>org.apache.tomcat.embed</groupId>
  <artifactId>tomcat-embed-core</artifactId>
  <version>9.0.50</version>
</dependency>
```

The Tomcat-specific code is in a subproject with only two classes. When I
compile using Maven 3.8.6 and Java 17 using `-Xlint:all`, I see the following
warning for that subproject:

> [WARNING] Cannot find annotation method 'value()' in type
> 'aQute.bnd.annotation.spi.ServiceConsumer':
> class file for aQute.bnd.annotation.spi.ServiceConsumer not found

Doing a bit of searching brings up similar (but not exact) things, such as
[Lombok Issue #2145](https://github.com/projectlombok/lombok/issues/2145),
which hints that I may need to add some sort of extra dependency such as
`biz.aQute.bnd:bndlib` or `org.osgi:osgi.annotation`.

But I've tried this and and I still get the warning:

```xml
<dependency>
  <groupId>biz.aQute.bnd</groupId>
  <artifactId>bndlib</artifactId>
  <version>2.4.0</version>
</dependency>
```

I also tried this; no difference:

```xml
<dependency>
  <groupId>org.osgi</groupId>
  <artifactId>osgi.annotation</artifactId>
  <version>7.0.0</version>
</dependency>
```
Where is this error coming from, and what does it mean? I don't have any
`@ServiceConsumer` annotation in my source code, and I couldn't find any in the
Tomcat classes I'm extending, either. Shouldn't the
`org.apache.tomcat.embed:tomcat-embed-core` dependency contain everything I
need (either in the artifact or via a transitive dependency) just to build a
project that references the Tomcat classes? What is missing here?

I also [asked on Stack Overflow](https://stackoverflow.com/q/74000505). No
answers so far.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to