Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4586,7 +4586,7 @@ public void testConstructorInjectionErrorOnMissingDefaultNoArgConstructor() thro
// expect error because class has no noArg constructor and
if (!b.check(
Pattern.quote(
"test.component.DSAnnotationTest$ConstructorInjectionMissingDefaultNoArgConstructor] The DS component class test.component.DSAnnotationTest$ConstructorInjectionMissingDefaultNoArgConstructor must declare a public no-arg constructor, or a public constructor annotated with @Activate.")))
"test.component.DSAnnotationTest$ConstructorInjectionMissingDefaultNoArgConstructor] The DS component class test.component.DSAnnotationTest$ConstructorInjectionMissingDefaultNoArgConstructor must be publicly accessible and have either a public no-arg constructor or a public constructor annotated with @Activate. Non-public classes, including public inner classes enclosed in non-public classes, are not supported.")))
fail();
}
}
Expand All @@ -4605,7 +4605,7 @@ public void testConstructorInjectionErrorOnNonStaticInnerClassComponent() throws
// cannot be instantiated
if (!b.check(
Pattern.quote(
"The DS component class test.component.constructorinjection.ConstructorInjectionErrorOnNonStaticInnerClassComponent$ConstructorInjectionErrorOnNonStaticInnerClassComponentInner must declare a public no-arg constructor, or a public constructor annotated with @Activate")))
"The DS component class test.component.constructorinjection.ConstructorInjectionErrorOnNonStaticInnerClassComponent$ConstructorInjectionErrorOnNonStaticInnerClassComponentInner must be publicly accessible and have either a public no-arg constructor or a public constructor annotated with @Activate. Non-public classes, including public inner classes enclosed in non-public classes, are not supported.")))
fail();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ private ComponentDef getDef() throws Exception {
DeclarativeServicesAnnotationError details = new DeclarativeServicesAnnotationError(
implementationClass.getFQN(), null, null, ErrorType.INVALID_COMPONENT_TYPE);
details.addError(analyzer,
"[%s] The DS component class %s must declare a public no-arg constructor, or a public constructor annotated with @Activate.",
"[%s] The DS component class %s must be publicly accessible and have either a public no-arg constructor or a public constructor annotated with @Activate. Non-public classes, including public inner classes enclosed in non-public classes, are not supported.",
details.location(), implementationClass.getFQN());
}

Expand Down
2 changes: 1 addition & 1 deletion docs/_chapters/200-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ A DS component class must have **either**:
If your component class has a constructor with parameters but no `@Activate` annotation, bnd will generate an error:

```
The DS component class {className} must declare a public no-arg constructor, or a public constructor annotated with @Activate.
The DS component class {className} must be publicly accessible and have either a public no-arg constructor or a public constructor annotated with @Activate. Non-public classes, including public inner classes enclosed in non-public classes, are not supported.
```

**Examples of valid components:**
Expand Down
2 changes: 1 addition & 1 deletion docs/_chapters/920-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Starting with bnd 7.3.0, bnd enforces the DS specification requirement that comp

If you see this error:
```
The DS component class {className} must declare a public no-arg constructor, or a public constructor annotated with @Activate.
The DS component class {className} must be publicly accessible and have either a public no-arg constructor or a public constructor annotated with @Activate. Non-public classes, including public inner classes enclosed in non-public classes, are not supported.
```

You need to either add a public no-arg constructor, use `@Activate` on your constructor, ensure your class is public, or make inner classes static.
Expand Down
Loading