Open jwmatthews opened 5 months ago
This issue is currently awaiting triage.
If contributors determine this is a relevant issue, they will accept it by applying the triage/accepted
label and provide further guidance.
The triage/accepted
label can be added by org members.
When running this locally, I notice that the search scope for the project is empty, and that is why we are getting zero results.
At this time, I can only think of two reasons:
I will continue to work on this, as source only mode should be able to work even with this broken pom file.
I am postive that this is currently the more correct behavior, and the reasoning is this.
Currently this application, does not compile, and more importantly does not have any references to either Jakarta or Javax.
I think what is happening, is becuas the language server does not have these types, when we are asking for them, it is unable to find any reference for them. I tried to get this POM in a place that was usable, but was unable to.
My primary concern is two fold:
I don't have a good way forward, as both have huge pitfalls in the overall health of the results and to users.
@dymurray @jwmatthews @fabianvf @pranavgaikwad @jmle Looking for help and guidance on what our next steps should be.
Is there an existing issue for this?
Konveyor version
Latest as of June 13 2024
Priority
Undefined (Default)
Current Behavior
We noticed a regression where a custom rule that used to match no longer does. Below is the information
Source file, using an '@Remote' src/main/java/org/jboss/as/quickstarts/ejb/remote/stateful/CounterBean.java
Link to custom rule
Link to full output.yaml
We originally suspected this may be related to the sample app having 2 different modules in it for client and server-side. I ran Kantra against those individual modules, i.e. ran against the 'server-side' module, and I still did not see the custom rule for the Remote annotation match.
At this point, I think the issue may be related to the ANNOTATION location.
Expected Behavior
Assume we'd have a match like this:
[](- name: kai/quarkus description: Quarkus focused rules to help migrate from Java EE violations: remote-ejb-to-quarkus-00000: description: Remote EJBs are not supported in Quarkus category: mandatory labels:
@Remote
annotation on the class with a@jakarta.ws.rs.Path(\"<endpoint>\")
annotation. An endpoint must be added to the annotation in place of<endpoint>
to specify the actual path to the REST service.\n 2. Remove@Stateless
annotations if present. Given that REST services are stateless by nature, it makes it unnecessary.\n 3. For every public method on the EJB being converted, do the following:\n - Annotate the method with@jakarta.ws.rs.GET
\n - Annotate the method with@jakarta.ws.rs.Path(\"<endpoint>\")
and give it a proper endpoint path. As a rule of thumb, the method name can be used as endpoint, for instance:\n\n @Path(\"/increment\")\n public void increment() \n
\n - Add@jakarta.ws.rs.QueryParam(\"<param-name>\")
to any method parameters if needed, where<param-name>
is a name for the parameter." codeSnip: " 1 /\n 2 JBoss, Home of Professional Open Source\n 3 Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual\n 4 contributors by the @authors tag. See the copyright.txt in the\n 5 distribution for a full listing of individual contributors.\n 6 \n 7 Licensed under the Apache License, Version 2.0 (the \"License\");\n 8 you may not use this file except in compliance with the License.\n 9 You may obtain a copy of the License at\n 10 http://www.apache.org/licenses/LICENSE-2.0\n 11 Unless required by applicable law or agreed to in writing, software\n 12 distributed under the License is distributed on an \"AS IS\" BASIS,\n 13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n 14 See the License for the specific language governing permissions and\n 15 limitations under the License.\n 16 /\n 17 package org.jboss.as.quickstarts.ejb.remote.stateful;\n 18 \n 19 import javax.ejb.Remote;\n 20 import javax.ejb.Stateful;\n 21 \n 22 /*\n 23 @author Jaikiran Pai\n 24 */\n 25 @Stateful\n 26 @Remote(RemoteCounter.class)\n 27 public class CounterBean implements RemoteCounter {\n 28 \n 29 private int count = 0;\n 30 \n 31 @Override\n 32 public void increment() {\n 33 this.count++;\n 34 }\n 35 \n 36 @Override\n 37 public void decrement() {\n 38 this.count--;\n 39 }\n 40 \n 41 @Override\n 42 public int getCount() {\n 43 return this.count;\n 44 }\n 45 }\n" lineNumber: 26 variables: file: file:///tmp/source-code/server-side/src/main/java/org/jboss/as/quickstarts/ejb/remote/stateful/CounterBean.java kind: Class name: Stateful package: org.jboss.as.quickstarts.ejb.remote.stateful@Remote
annotation on the class with a@jakarta.ws.rs.Path(\"<endpoint>\")
annotation. An endpoint must be added to the annotation in place of<endpoint>
to specify the actual path to the REST service.\n 2. Remove@Stateless
annotations if present. Given that REST services are stateless by nature, it makes it unnecessary.\n 3. For every public method on the EJB being converted, do the following:\n - Annotate the method with@jakarta.ws.rs.GET
\n - Annotate the method with@jakarta.ws.rs.Path(\"<endpoint>\")
and give it a proper endpoint path. As a rule of thumb, the method name can be used as endpoint, for instance:\n\n @Path(\"/increment\")\n public void increment() \n
\n - Add@jakarta.ws.rs.QueryParam(\"<param-name>\")
to any method parameters if needed, where<param-name>
is a name for the parameter." codeSnip: " 1 /\n 2 JBoss, Home of Professional Open Source\n 3 Copyright 2015, Red Hat, Inc. and/or its affiliates, and individual\n 4 contributors by the @authors tag. See the copyright.txt in the\n 5 distribution for a full listing of individual contributors.\n 6 \n 7 Licensed under the Apache License, Version 2.0 (the \"License\");\n 8 you may not use this file except in compliance with the License.\n 9 You may obtain a copy of the License at\n 10 http://www.apache.org/licenses/LICENSE-2.0\n 11 Unless required by applicable law or agreed to in writing, software\n 12 distributed under the License is distributed on an \"AS IS\" BASIS,\n 13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n 14 See the License for the specific language governing permissions and\n 15 limitations under the License.\n 16 /\n 17 package org.jboss.as.quickstarts.ejb.remote.stateless;\n 18 \n 19 import javax.ejb.Remote;\n 20 import javax.ejb.Stateless;\n 21 \n 22 /*\n 23 @author Jaikiran Pai\n 24 */\n 25 @Stateless\n 26 @Remote(RemoteCalculator.class)\n 27 public class CalculatorBean implements RemoteCalculator {\n 28 \n 29 @Override\n 30 public int add(int a, int b) {\n 31 return a + b;\n 32 }\n 33 \n 34 @Override\n 35 public int subtract(int a, int b) {\n 36 return a - b;\n 37 }\n 38 }\n" lineNumber: 26 variables: file: file:///tmp/source-code/server-side/src/main/java/org/jboss/as/quickstarts/ejb/remote/stateless/CalculatorBean.java kind: Class name: Stateless package: org.jboss.as.quickstarts.ejb.remote.stateless links:How Reproducible
Always (Default)
Steps To Reproduce
I have a short reproducer here: https://github.com/jwmatthews/issue_reproducers/tree/main/kantra/ejb_remote
Environment
Anything else?
This appears to be a regression as we saw matches for this rule + sample application about 3 months ago, here is an example we checked in from an older notebook example.
https://github.com/konveyor-ecosystem/kai/blob/main/notebooks/ejb_remote/analysis_report/ejb-remote/output.yaml#L1278
This is related to an issue we are tracking in kai: https://github.com/konveyor-ecosystem/kai/issues/204
There is another open issue on java.referenced location ANNOTATION, don't think it's related, but will link for awareness: https://github.com/konveyor/analyzer-lsp/issues/508