question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to use aspectj in java library

See original GitHub issue

Description of the problem / feature request:

When a project uses aspectj (aspectjtools-1.8.13.jar) in a java_library ijar fails with the error ‘Bad magic efbfbdef’

When the ijar utility is used separately the output is: … INFO: StripClass: org/aspectj/org/eclipse/jdt/internal/compiler/parser/UpdateParserFiles.class Bad magic efbfbdef

It seems that the ijar utility isn’t able to read the UpdateParserFiles class file properly or it contains an invalid magic number.

Due to this issue we aren’t able to migrate from Maven to Bazel.

Bugs: what’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Checkout bazel project and build ijar

git clone “https://github.com/bazelbuild/bazel.git” cd bazel bazel build //third_party/ijar

Download aspjectj jar

mvn org.apache.maven.plugins:maven-dependency-plugin:3.0.2:get -Dartifact=org.aspectj:aspectjtools:1.8.13

Run ijar against aspectj jar

./bazel-bin/third_party/ijar/ijar -v ~/.m2/repository/org/aspectj/aspectjtools/1.8.13/aspectjtools-1.8.13.jar

What operating system are you running Bazel on?

MacOS Sierra

What’s the output of bazel info release?

release 0.10.0

Have you found anything relevant by searching the web?

When searching for 0xEFBFBDEF i found this stackoverflow question regarding encoding errors: https://stackoverflow.com/questions/5421879/objectinputstream-happy-with-fileinputstream-not-happy-with-getresourceasstream

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
auke-commented, Apr 18, 2018

If I only was a little less impatient… Aspectj released version 1.9.0 which doesn’t include the corrupt class file.

0reactions
auke-commented, Feb 14, 2018

Ok, thanks. I’ll try to use maven_jar from a Skylark rule.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to use aspect from class library - java - Stack Overflow
I have a web UI project and a JavaFX UI project that both reference a class library that contains all the common logic...
Read more >
7.8 Using AspectJ with Spring applications
In this section, we're going to look at how you can use the AspectJ compiler/weaver instead of, or in addition to, Spring AOP...
Read more >
The AspectJ tm Problem Diagnosis Guide - Eclipse
Abstract. This guide describes how to configure the AspectJ compiler/weaver to provide information for diagnosing problems in the input programs, ...
Read more >
IDEA is unable to resolve AspectJ compiler JAR if Maven 3 ...
Since updating to 12.0.1 I now get this warning: IDEA was unable to find AspectJ compiler .jar among plugin dependencies.
Read more >
Spring AOP Example Tutorial - Aspect, Advice, Pointcut ...
Aspects can be a normal class configured through Spring XML configuration or we can use Spring AspectJ integration to define a class as ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found