You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I briefly mentioned this to @wasabii over here and have created a little repro project: IKVM.FOP.zip
My Java and Maven knowledge is next to 0, but from anecdotal reading, the fop-util jar file here is being recreated by IKVM with a different signature, so when fop-core tries to call out to it, it think it's working with a different assembly and throws this exception:
Unhandled exception. java.lang.IllegalAccessError: Try to access field org.apache.fop.util.text.AdvancedMessageFormat.COMMA_SEPARATOR_REGEX from class org.apache.fop.util.text.IfFieldPart
In the attached repro, I've got it working with a very basic fo file, it can generate a pdf from align.xml, but there's something in basicfonts.xml that sends it down a slightly different path that then causes the error. I haven't quite figured out how to reference the jar files using IKVMReference so I can absolve IKVM here and just put it down to MavenReference.
The text was updated successfully, but these errors were encountered:
wasabii
changed the title
java.lang.IllegalAccessError When referencing FOP via MavenReference
Package-Private access is not allowed between individual assemblies
Mar 11, 2024
So I am working on a solution to this. The basic issue is that fop is split into three JARs, which access each other's package-private members. This is fine as long as all three are loaded dynamically. However, in general IKVM use, we treat each individual JAR as a separate assembly. But, package-private members get converted to 'internal'. So, .NET cannot access across them.
The solution I'm working on currently is to use the IgnoresAccessChecksToAttribute to insure each generated assembly has access to the internals of their referenced assemblies. This does skip a .NET verification check. But, it would have no impact on a Java compiler examine the assembly exported to a stub JAR. So, access should be prevented at compile time. It's an interesting solution, and we'll see if it works.
I briefly mentioned this to @wasabii over here and have created a little repro project: IKVM.FOP.zip
My Java and Maven knowledge is next to 0, but from anecdotal reading, the
fop-util
jar file here is being recreated by IKVM with a different signature, so whenfop-core
tries to call out to it, it think it's working with a different assembly and throws this exception:In the attached repro, I've got it working with a very basic fo file, it can generate a pdf from
align.xml
, but there's something inbasicfonts.xml
that sends it down a slightly different path that then causes the error. I haven't quite figured out how to reference the jar files usingIKVMReference
so I can absolve IKVM here and just put it down toMavenReference
.The text was updated successfully, but these errors were encountered: