Skip to content

SBM tool - migrate-stateless-ejb isssue #837

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

Closed
L-G-v1 opened this issue Jul 7, 2023 · 4 comments
Closed

SBM tool - migrate-stateless-ejb isssue #837

L-G-v1 opened this issue Jul 7, 2023 · 4 comments
Labels
type: bug Something isn't working

Comments

@L-G-v1
Copy link

L-G-v1 commented Jul 7, 2023

Describe the bug
Running the migrate-stateless-ejb from the terminal in Windows/Linux, is making SBM to throw this error:
ERROR o.s.sbm.java.impl.OpenRewriteMember - Could not get Type for annotation: 'EJB' while comparing with 'javax.inject.Inject'.

SBM Version
0.11 and 0.11.1 , since the application is using Java 11 and not Java 17

SBM Application
Shell

To Reproduce
Steps to reproduce the behavior:

  1. Run SBM shell.
  2. Run scan on the project
  3. Run: apply migrate-stateless-ejb
  4. See error that looks like: ERROR o.s.sbm.java.impl.OpenRewriteMember - Could not get Type for annotation: 'EJB' while comparing with 'javax.inject.Inject'.

Expected behavior
I've would expect for all the @ejb to be migrated to @Autowired

Screenshots
sbm_error

Stacktrace
There isn't any stacktrace, except the error that appears in the terminal:
ERROR o.s.sbm.java.impl.OpenRewriteMember - Could not get Type for annotation: 'EJB' while comparing with 'javax.inject.Inject'.

@L-G-v1 L-G-v1 added the type: bug Something isn't working label Jul 7, 2023
@fabapp2
Copy link
Contributor

fabapp2 commented Jul 11, 2023

Thanks for reporting and giving SBM a try @brebDevv 🚀

What I learn from your issue is that SBM should allow using JDK versions supported by OpenRewrite and not force you to an outdated version. I will create a new issue for this.
I assume it's not easy for you to switch to JDK 17 and use a recent version of SBM, or?

@L-G-v1
Copy link
Author

L-G-v1 commented Jul 11, 2023

HI @fabapp2 . Unfortunately it's not easy to upgrade to JDK17. That's why I've tried with SBM versions: 0.11 and 0.11.1 , since I've seen that from 0.12 -> 0.14 it requires only the JDK 17.

@L-G-v1
Copy link
Author

L-G-v1 commented Aug 10, 2023

Hi @fabapp2 . I've managed to upgrade the project to JDK-17. I've used the SBM-0.14, and applied the following command: apply migrate-jax-rs . After around 5 minutes hanging, I've received the same error again:
Screenshot from 2023-08-10 17-52-04

But even though that error appeared, the JAX-RS annotation were replaced by spring ones and spring-boot-starter was added. So I guess it did the job.

Please give a sign, if you manage to fix these errors.

Really appreciate it,
brebDevv

@fabapp2
Copy link
Contributor

fabapp2 commented Oct 9, 2023

Hi @brebDevv
please excuse my delayed reply.
This error indicates that the type for Inject could not be resolved.
You could check if the dependency is there and if it's broken.
Or just delete the dir under ~/.m2/reposuitory/javax/inject/... and ~/.rewrite/cache and see if the dependency gets downloaded. The recipe should then run.
I'll close this issue for now, hoping it's solved for you. Please reopen if the error persists.

@fabapp2 fabapp2 closed this as completed Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants