InternalError on Class.getPackage()

Chris Newland cnewland at chrisnewland.com
Tue Oct 20 21:14:15 UTC 2015


Hi Alan, Mandy, Lois,

I've modified the JITWatch maven pom to use a jfxrt.jar from jdk1.8.0_60
to get around the jake / JavaFX issues.

With the Jigsaw EA b83 I still get this exception during junit tests:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.adoptopenjdk.jitwatch.test.TestAssemblyLabels
Failed to instantiate [ch.qos.logback.classic.LoggerContext]
Reported exception:
java.lang.InternalError: unnamed package in named module java.base
	at
jdk.internal.misc.BuiltinClassLoader.definePackage(java.base at 9.0/BuiltinClassLoader.java:569)
	at
jdk.internal.misc.BootLoader.definePackage(java.base at 9.0/BootLoader.java:123)
	at java.lang.Class.getPackage(java.base at 9.0/Class.java:917)
	at
ch.qos.logback.core.joran.util.StringToObjectConverter.canBeBuiltFromSimpleString(StringToObjectConverter.java:34)
	at
ch.qos.logback.core.joran.util.PropertySetter.computeRawAggregationType(PropertySetter.java:233)
	at
ch.qos.logback.core.joran.util.PropertySetter.computeAggregationType(PropertySetter.java:194)
	at
ch.qos.logback.core.joran.action.NestedComplexPropertyIA.isApplicable(NestedComplexPropertyIA.java:61)
	at
ch.qos.logback.core.joran.spi.Interpreter.lookupImplicitAction(Interpreter.java:237)
	at
ch.qos.logback.core.joran.spi.Interpreter.getApplicableActionList(Interpreter.java:256)
	at
ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:144)
	at
ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:129)
	at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50)
	at
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
	at
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
	at
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
	at
ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
	at
ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
	at
ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
	at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
	at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)
	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)
	at
org.adoptopenjdk.jitwatch.model.assembly.AssemblyInstruction.<clinit>(AssemblyInstruction.java:39)
	at
org.adoptopenjdk.jitwatch.test.TestAssemblyLabels.testFormatAddressJumpForeign(TestAssemblyLabels.java:108)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(java.base at 9.0/Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(java.base at 9.0/NativeMethodAccessorImpl.java:62)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(java.base at 9.0/DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(java.base at 9.0/Method.java:530)
	at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
	at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
	at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
	at
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
	at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

But with the jimages JDK built from the tip of jake I get no exception
during mvn test so perhaps the bug has been fixed between b83 and the tip?

Not sure if you're familiar with SLF4J but it does some clever classpath
stuff so that you don't declare the concrete logger implementation in
config. Instead you just put the slf4j jar and any of the supported
implementation jars in your classpath.

If you could let me know how to pull the source tree snapshot used to make
EA b83 then I could try Mandy's patch without all the other fixes in the
tip?

Kind regards,

Chris


On Tue, October 20, 2015 16:01, Alan Bateman wrote:
>

>
> On 20/10/2015 15:53, Chris Newland wrote:
>
>> Caused by: java.lang.IllegalAccessError: class
>> com.sun.javafx.util.Logging (in module: Unnamed Module) cannot access
>> class sun.util.logging.PlatformLogger (in module: java.base),
>> sun.util.logging is not exported to Unnamed Module
>>
> This must be FX on the class path rather than linking it in as modules.
> In that case, you'll need to use
> -XaddExports:java.base/sun.util.loggging=ALL-UNNAMED . There might be
> other exports needed too.
>
> -Alan
>
>




More information about the jigsaw-dev mailing list