Skip to content

Frequently Asked Questions

Pete Cheslock edited this page Aug 8, 2022 · 6 revisions

Frequently Asked Questions

Our latest up-to-date documentation can be found at appmap.io/docs

Table of Contents

  1. Is there a mapping checklist for configuring my Java application?
  2. How do I fix an unknown template for ordinal error?
  3. I've read through the FAQ and still haven't answered my question

Is there a mapping checklist for configuring my Java application?

How do I fix an unknown template for ordinal error?

When trying to create a recording of test that uses PowerMock either directly or indirectly (e.g. by using Mockito), you may see an error message similar to this one:

com.appland.appmap.record.UnknownEventException: unknown template for ordinal 1557
	at com.appland.appmap.record.EventTemplateRegistry.cloneEventTemplate(EventTemplateRegistry.java:89)
	at hudson.slaves.DelegatingComputerLauncherTest.testRecursionAvoidance(DelegatingComputerLauncherTest.java)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:68)
	at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.runTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:326)
	at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:89)
	at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:97)
...

An unknown template for ordinal error happens when PowerMock uses its own ClassLoader to load the com.appland.* classes. To avoid this, you need to instruct PowerMock to ignore these classes. You can do this using the annotation @PowerMockIgnore("com.appland.*"), or by adding the entry

powermock.global-ignore=com.appland.*

to the PowerMock configuration file, as described here: https://github.com/powermock/powermock/wiki/PowerMock-Configuration#global-powermockignore . (Note that as of 20201124, there is an issue with the way that document describes ignoring multiple packages: https://github.com/powermock/powermock/issues/989.)

I've read through the FAQ and still haven't answered my question

Have you gone through:

and still haven't found an answer to your question? Then come join us on Slack and get help from the AppMap community!