Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarkus 3.12.0 with CXF: java.lang.NullPointerException in CxfDeploymentUtils.findSei(CxfDeploymentUtils.java:60) without #1427

Closed
gawrilsemke opened this issue Jul 1, 2024 · 9 comments

Comments

@gawrilsemke
Copy link

gawrilsemke commented Jul 1, 2024

[ERROR]   PackageSequenceGeneratorTest.testGetPackageId » Runtime java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkiverse.cxf.deployment.CxfEndpointImplementationProcessor#collectEndpoints threw an exception: java.lang.NullPointerException: Cannot invoke "org.jboss.jandex.ClassInfo.annotation(org.jboss.jandex.DotName)" because "interfaceInfo" is null
	at io.quarkiverse.cxf.deployment.CxfDeploymentUtils.findSei(CxfDeploymentUtils.java:60)

The solution was to add a parameter 'endpointInterface' by WS Annotation:
@WebService(targetNamespace = "http://some", serviceName = "SomeServices", endpointInterface = "SomePortType") public class SomePortTypeImpl implements SomePortType {...

is it naccessery? backwards compatibility?

JavaDoc:
String jakarta.jws.WebService.endpointInterface()
The complete name of the service endpoint interface defining the service's abstract Web Service contract.

This annotation allows the developer to separate the interface contract from the implementation. If this annotation is present, the service endpoint interface is used to determine the abstract WSDL contract (portType and bindings). The service endpoint interface MAY include JSR-181 annotations to customize the mapping from Java to WSDL. The service implementation bean MAY implement the service endpoint interface, but is not REQUIRED to do so. If this member-value is not present, the Web Service contract is generated from annotations on the service implementation bean. If a service endpoint interface is required by the target environment, it will be generated into an implementation-defined package with an implementation- defined name

This member-value is not allowed on endpoint interfaces. Default: ""

@ppalaga
Copy link
Contributor

ppalaga commented Jul 4, 2024

Hi @gawrilsemke, thanks for the report!.

We definitely have service implementations with implements and without @WebService(endpointInterface = "... in our tests that worked both before and after 3.12.0, such as

@WebService(serviceName = "HelloService")
public class HelloServiceImpl implements HelloService {

Regardless of that, we may have broken something in some corner case recently and I'd be very much interested to see a reproducer for your issue.

@dstein90
Copy link

dstein90 commented Jul 4, 2024

Hi @ppalaga

I traced this issue back. It boils down to having the interfaces pulled from a dependency without a jandex index and the fact the annotation scanning changed with 02f027c

@ppalaga
Copy link
Contributor

ppalaga commented Jul 4, 2024

Nice, thanks for the investigation, @dstein90! So adding jandex to the dependency using the maven plugin or application.properties is a valid solution?

@dstein90
Copy link

dstein90 commented Jul 4, 2024

Indeed generating the index on the dependency solves this issue.

ppalaga added a commit to ppalaga/quarkus-cxf that referenced this issue Jul 8, 2024
ppalaga added a commit to ppalaga/quarkus-cxf that referenced this issue Jul 8, 2024
@ppalaga
Copy link
Contributor

ppalaga commented Jul 8, 2024

I made the build fail with an informative exception if some interface cannot be found in Jandex: https://github.com/quarkiverse/quarkus-cxf/pull/1437/files

@ppalaga
Copy link
Contributor

ppalaga commented Jul 8, 2024

I am afraid we cannot restore the pre-3.12.0 behavior. I think throwing an exception that tells the user what to do is the best thing we can do. Or you @dstein90 have a better idea?

ppalaga added a commit that referenced this issue Jul 8, 2024
@ppalaga
Copy link
Contributor

ppalaga commented Jul 12, 2024

Closing this for now. @dstein90 please feel free to reopen, if you have any suggestion what else we could do.

@ppalaga ppalaga closed this as not planned Won't fix, can't repro, duplicate, stale Jul 12, 2024
@ppalaga ppalaga added this to the no fix/won't fix milestone Jul 12, 2024
@dstein90
Copy link

dstein90 commented Jul 12, 2024

I think it's fine this way. But good to have the issue with the solution. Maybe the requirement for the jandex index should be added to the docs.

@ppalaga
Copy link
Contributor

ppalaga commented Jul 12, 2024

Thanks, that's a good idea, @dstein90 . I filed a follow up issue: #1449

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants