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

Unable to compile the package: MojoFailureException #94

Open
Dentrax opened this issue Dec 25, 2023 · 3 comments
Open

Unable to compile the package: MojoFailureException #94

Dentrax opened this issue Dec 25, 2023 · 3 comments

Comments

@Dentrax
Copy link

Dentrax commented Dec 25, 2023

After ran the rake command, I run into a compilation error:

...
[INFO] Compiling 38 source files to /work/jrjackson/pkg/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:35 min
[INFO] Finished at: 2023-12-25T17:27:15+00:00
[INFO] Final Memory: 59M/141M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project jrjackson: Compilation failure -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
  jar dependencies for jrjackson-0.4.18-java.gemspec . . .
      com.fasterxml.jackson.core:jackson-core:2.15.2:compile
      com.fasterxml.jackson.core:jackson-annotations:2.15.2:compile
      com.fasterxml.jackson.core:jackson-databind:2.15.2:compile
      com.fasterxml.jackson.module:jackson-module-afterburner:2.15.2:compile

There are lots of Downloaded longs before this. But catch a Warning log:

Downloading: https://repo.maven.apache.org/maven2/rubygems/bundler/maven-metadata.xml
io/console on JRuby shells out to stty for most operations
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jruby.ext.zlib.RubyZlib (file:/root/.m2/repository/org/jruby/jruby-core/9.1.17.0/jruby-core-9.1.17.0.jar) to field java.util.zip.CRC32.crc
WARNING: Please consider reporting this to the maintainers of org.jruby.ext.zlib.RubyZlib
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
set default encoding to UTF-8 for current runtime

I'm using jruby-9.4 with openjdk-11 on Alpine. How can I debug the error? Any thoughts?

@Dentrax
Copy link
Author

Dentrax commented Dec 25, 2023

After rake clean && rake compie, I hit this:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building A JRuby wrapper for the java jackson json processor jar 1.2.35
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ jrjackson ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /work/jrjackson/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ jrjackson ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 38 source files to /work/jrjackson/pkg/classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.539 s
[INFO] Finished at: 2023-12-25T17:53:13+00:00
[INFO] Final Memory: 26M/63M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project jrjackson: Compilation failure -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
  jar dependencies for jrjackson-0.4.18-java.gemspec . . .
      com.fasterxml.jackson.core:jackson-core:2.15.2:compile
      com.fasterxml.jackson.core:jackson-annotations:2.15.2:compile
      com.fasterxml.jackson.core:jackson-databind:2.15.2:compile
      com.fasterxml.jackson.module:jackson-module-afterburner:2.15.2:compile

@Dentrax
Copy link
Author

Dentrax commented Dec 26, 2023

Have tried with java-8 as well and replaced the jruby version in .jrubyr_c file but no luck. cc @jsvd @kares

@jsvd
Copy link
Collaborator

jsvd commented May 8, 2024

I've done a few updates to the gem. compilation seems to be working correctly now:

❯ cat Dockerfile 
FROM jruby:9.4-jdk8
RUN apt-get update -q && apt-get install -q -y git vim
RUN git clone https://github.com/guyboertje/jrjackson/ 
WORKDIR /jrjackson
RUN bundle install && bundle exec rake
RUN bundle exec rake test benchmark
RUN bundle exec rake package
/tmp/docker ❯ docker build -q . -t jrjackson 
sha256:bb45c856b9e3312a7a9c73f65e33b93036840ef84f5cc581488cfde682ab3d11

/tmp/docker
❯ docker run -it jrjackson sh -c "ls -lha pkg/*gem"
-rw-r--r-- 1 root root 2.3M May  8 13:04 pkg/jrjackson-0.4.19-java.gem

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

2 participants