Skip to content

Instantly share code, notes, and snippets.

@liweinan
Created July 6, 2022 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liweinan/549970a8e507e9c287db92eabf9777e8 to your computer and use it in GitHub Desktop.
Save liweinan/549970a8e507e9c287db92eabf9777e8 to your computer and use it in GitHub Desktop.
Investigation on the jberet usage on the WildFly
@liweinan
Copy link
Author

liweinan commented Jul 6, 2022

Currently the examples doesn't support EE9 yet:

image

So I downgrade my JDK version to build the project:

image

However the build failed with Null Pointer failure:

image

image

@chengfang
Copy link

This project currently does not build with jdk 11. To see the root cause of failure, I ran the following command:

mvn clean install -X -Dmaven.compiler.forceJavacCompilerUse=true

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project jberet-samples-common: Compilation failure: Compilation failure:
[ERROR] bootstrap class path not set in conjunction with -source 8
[ERROR] warning: unknown enum constant XmlAccessType.FIELD
[ERROR]   reason: class file for javax.xml.bind.annotation.XmlAccessType not found
[ERROR] /Users/cfang/dev/jberet-wildfly-samples/jberet-samples-common/src/main/java/org/jberet/samples/wildfly/common/Movie.java:[14,32] error: package javax.xml.bind.annotation does not exist
[ERROR] /Users/cfang/dev/jberet-wildfly-samples/jberet-samples-common/src/main/java/org/jberet/samples/wildfly/common/Movie.java:[15,32] error: package javax.xml.bind.annotation does not exist
[ERROR] /Users/cfang/dev/jberet-wildfly-samples/jberet-samples-common/src/main/java/org/jberet/samples/wildfly/common/Movie.java:[25,1] error: cannot find symbol
[ERROR]   symbol: class XmlRootElement
[ERROR] /Users/cfang/dev/jberet-wildfly-samples/jberet-samples-common/src/main/java/org/jberet/samples/wildfly/common/Movie.java:[29,5] error: cannot find symbol
[ERROR]   symbol:   class XmlAttribute
[ERROR]   location: class Movie
[ERROR] /Users/cfang/dev/jberet-wildfly-samples/jberet-samples-common/src/main/java/org/jberet/samples/wildfly/common/Movie.java:[32,5] error: cannot find symbol
[ERROR]   symbol:   class XmlAttribute
[ERROR]   location: class Movie
[ERROR] /Users/cfang/dev/jberet-wildfly-samples/jberet-samples-common/src/main/java/org/jberet/samples/wildfly/common/Movie.java:[35,5] error: cannot find symbol
[ERROR]   symbol:   class XmlAttribute
[ERROR]   location: class Movie
[ERROR] /Users/cfang/dev/jberet-wildfly-samples/jberet-samples-common/src/main/java/org/jberet/samples/wildfly/common/Movie.java:[38,5] error: cannot find symbol
[ERROR]   symbol:   class XmlAttribute
[ERROR]   location: class Movie
[ERROR] /Users/cfang/dev/jberet-wildfly-samples/jberet-samples-common/src/main/java/org/jberet/samples/wildfly/common/Movie.java:[41,5] error: cannot find symbol
[ERROR]   symbol:   class XmlAttribute
[ERROR]   location: class Movie
[ERROR] -> [Help 1]

So from the above error message, the jaxb api is not there. It is part of Java 8 but was pruned in Java 9 or 10. So we just need to add jaxb-api dependency to fix the above problem. There may be other issues after that.

@chengfang
Copy link

I'll try to bring this project up to date, creating a 1.x branch for javax.batch API, and keeping master branch for jakarta.batch API.

@liweinan
Copy link
Author

liweinan commented Jul 8, 2022

Thanks for checking! @chengfang

@liweinan
Copy link
Author

@chengfang I extracted one of the example and created this project:

I started the server by running:

$ mvn wildfly:run -DskipTests

And then run the test:

image

Though the test passed however the server throws some error messages:

image

I'm not sure how to fix it, could you please help to check it? Thanks!

@chengfang
Copy link

since the error points at line 1 col 0, so it could yasson is expecting some json payload but somehow got empty json object. You may want to check if a json payload is needed in your request.

@chengfang
Copy link

another possibility is the client side (resteasy, etc) libs may be too old.

Also I've updated https://github.com/jberet/jberet-wildfly-samples project with various lib upgrades and fixes.

@liweinan
Copy link
Author

@chengfang I'll check the updated examples. thanks for help!

@liweinan
Copy link
Author

@chengfang After upgrading the jberet-wildfly-samples project locally, I can build the project now. And I went on running the tests restAPI example. I run the start() test and I can reproduce the INVALID TOKEN problem:

image

Could you please help to check it? Thanks!

@chengfang
Copy link

sure, I'll take a look. It could be some problem with jberet-rest-api, which has not been updated for a while. I noticed all rest* sub-modules within jberet-wildfly-samples failed with the above error.

@liweinan
Copy link
Author

@chengfang thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment