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

RestIT test works with (jakarta.ws.rs.core.MediaType) Hal#APPLICATION_HAL_JSON_TYPE #3561

Open
1 task
yanavasileva opened this issue Jul 6, 2023 · 8 comments
Labels
type:task Issues that are a change to the project that is neither a feature nor a bug fix.

Comments

@yanavasileva
Copy link
Member

After update to Spring Boot 3, RestIT started to fail with NoSuchFieldError: APPLICATION_HAL_JSON_TYPE. Due to unresolved dependency issue (javax/jakarta), we decided to simplify the rest and avoid using the MediaType type (#3441 (comment)).

Error details
testTaskFilterResultContentType(org.camunda.bpm.rest.RestIT)  Time elapsed: 5.494 s  <<< ERROR!
java.lang.NoSuchFieldError: APPLICATION_HAL_JSON_TYPE
        at org.camunda.bpm.rest.RestIT.assertMediaTypesOfResource(RestIT.java:308)
        at org.camunda.bpm.rest.RestIT.testTaskFilterResultContentType(RestIT.java:174)

[ERROR] testSingleTaskContentType(org.camunda.bpm.rest.RestIT)  Time elapsed: 5.245 s  <<< ERROR!
java.lang.NoSuchFieldError: APPLICATION_HAL_JSON_TYPE
        at org.camunda.bpm.rest.RestIT.assertMediaTypesOfResource(RestIT.java:308)
        at org.camunda.bpm.rest.RestIT.testSingleTaskContentType(RestIT.java:150)

[ERROR] testTaskQueryContentType(org.camunda.bpm.rest.RestIT)  Time elapsed: 5.178 s  <<< ERROR!
java.lang.NoSuchFieldError: APPLICATION_HAL_JSON_TYPE
        at org.camunda.bpm.rest.RestIT.assertMediaTypesOfResource(RestIT.java:308)
        at org.camunda.bpm.rest.RestIT.testTaskQueryContentType(RestIT.java:140)

Acceptance Criteria (Required on creation)

  • Revert the workaround and ensure Hal class and MediaType can be resolved correctly in the Spring Boot integration test setup

Hints

  • rewrite the tests to not use the jersey apache client 4

Links

Breakdown

Pull Requests

Preview Give feedback
No tasks being tracked yet.

Dev2QA handover

  • Does this ticket need a QA test and the testing goals are not clear from the description? Add a Dev2QA handover comment
@yanavasileva yanavasileva added the type:task Issues that are a change to the project that is neither a feature nor a bug fix. label Jul 6, 2023
@punitdarira
Copy link
Contributor

Hi @yanavasileva,
When I try to test the changes by running mvn install -Pintegration-test-spring-boot-starter in the qa-webapp-ce-runtime project, I get this error- ### Error querying database. Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "ACT_RE_DECISION_DEF" not found;
Am I missing something?

@yanavasileva
Copy link
Member Author

yanavasileva commented Jul 16, 2024

@punitdarira, when you are in the root of the mono repo try running the following:

mvn clean install -Pintegration-test-spring-boot-starter -f spring-boot-starter/pom.xml

@punitdarira
Copy link
Contributor

@yanavasileva ,
I get the same error through this above cmd

@yanavasileva
Copy link
Member Author

@punitdarira make sure to drop all of local changes that you have (might be related to some changes that you worked on). Also use JDK 17 and Maven 3.8.6. If none of that works, please share the stack trace and the output of the maven execution, I am not sure to what might be related.

@punitdarira
Copy link
Contributor

stacktrace.txt
@yanavasileva, I used JDK 17 and maven wrapper in the project itself.

@punitdarira
Copy link
Contributor

punitdarira commented Jul 17, 2024

@yanavasileva ,
Please ignore. It resolved after the whole build of the workspace. Sorry for the trouble!

@punitdarira
Copy link
Contributor

@yanavasileva

  1. Just wanted to make sure that the usage of jersey apache client doesn't have to do anything with the dependency issue of javax/jakarta right?
  2. I think spring webclient would be a good option to use.
  3. from your comment , the jakarta field does not resolve as there is a second javax on the classpath. How did you find this? class loader logs? Are we aiming for the jakarta version to get resolved? Because if we are, then there should be a mapping for javax to jakarta for integration testing right? Sorry but I am not very confident with Maven. I am trying to learn it.

@yanavasileva
Copy link
Member Author

Just wanted to make sure that the usage of jersey apache client doesn't have to do anything with the dependency issue of javax/jakarta right?

I am not sure, I wrote that a note to try out "rewrite the tests to not use the jersey apache client 4". So my suspect at the time was the client.

I think spring webclient would be a good option to use.

Maybe, I am not sure without exploring the option in detail. We need to keep in mind that the test should work with all supported environments.

from your #3441 (comment), the jakarta field does not resolve as there is a second javax on the classpath. How did you find this?

Debugging and checking the class loaders. Due to time restrictions, I didn't get to the bottom of the issue, therefore this open ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:task Issues that are a change to the project that is neither a feature nor a bug fix.
Projects
None yet
Development

No branches or pull requests

2 participants