# Custom transaction names stopped working and warning message

**URL:** <https://discuss.elastic.co/t/custom-transaction-names-stopped-working-and-warning-message/158335>\
**Category:** APM\
**Created:** [November 27, 2018, 12:10pm UTC](https://discuss.elastic.co/t/custom-transaction-names-stopped-working-and-warning-message/158335 "2018-11-27T12:10:58Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Blackwell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_blackwell/32/4786_2.png) [@Chris\_Blackwell](https://discuss.elastic.co/u/Chris_Blackwell)\
**Post date:** [November 27, 2018, 12:10pm UTC](https://discuss.elastic.co/t/custom-transaction-names-stopped-working-and-warning-message/158335/1 "2018-11-27T12:10:59Z")

</div>

We had apm working in an app, which is built on Lucee CFML ([https://lucee.org/](https://lucee.org/)) . Which is a scripting language on the JVM. The app runs in tomcat, but because the script engine only exposes a single servlet we need to set a custom transaction name in the app. This was working fine with earlier version of apm, but upgrading to 1.0.1 seems to have broken it and we now get an error in the logs. Heres some details

In our onRequestStart handler we do

```auto
ElasticApm.currentTransaction().setName(txName);

```

Where `ElasticAPM` is a singleton instance of the `co.elastic.apm.api.ElasticApm` . Previously that was all we needed, and we got our custom tx name in apm. Now however, we still get data in apm, but all transactions are named `CFMLServlet#doGet` or `CFMLServlet#doPost` etc

In the server logs/console we get the stack trace below. I've truncated the trace, but it starts from /Application.cfc:129, which is the location in our code where we call `ElasticApm.currentTransaction().setName(txName);`

If this is better posted on github, then happy to move it over there

[edit]  
I forgot to add environment info

```auto
openjdk version "1.8.0_181"
Apache Tomcat/7.0.59

```

```auto
2018-11-27 10:40:14.471 [http-bio-8080-exec-9] WARN co.elastic.apm.bci.bytebuddy.ErrorLoggingListener - ERROR on transformation co.elastic.apm.api.TransactionImpl
java.lang.IllegalStateException: Cannot locate field named span for class co.elastic.apm.api.TransactionImpl
	at co.elastic.apm.shaded.bytebuddy.asm.Advice$OffsetMapping$ForField$Unresolved.resolve(Advice.java:2177)
	at co.elastic.apm.shaded.bytebuddy.asm.Advice$OffsetMapping$ForField.resolve(Advice.java:2121)
	at co.elastic.apm.shaded.bytebuddy.asm.Advice$Dispatcher$Inlining$Resolved$ForMethodEnter.doApply(Advice.java:7664)
	at co.elastic.apm.shaded.bytebuddy.asm.Advice$Dispatcher$Inlining$Resolved$ForMethodEnter$WithDiscardedEnterType.doApply(Advice.java:7756)
	at co.elastic.apm.shaded.bytebuddy.asm.Advice$Dispatcher$Inlining$Resolved$ForMethodEnter.apply(Advice.java:7625)
	at co.elastic.apm.shaded.bytebuddy.asm.Advice$Dispatcher$Inlining$Resolved$AdviceMethodInliner.visitMethod(Advice.java:7334)
	at co.elastic.apm.shaded.bytebuddy.jar.asm.ClassReader.readMethod(ClassReader.java:1113)
	at co.elastic.apm.shaded.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:679)
	at co.elastic.apm.shaded.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:391)
	at co.elastic.apm.shaded.bytebuddy.asm.Advice$Dispatcher$Inlining$Resolved$AdviceMethodInliner.apply(Advice.java:7328)
	at co.elastic.apm.shaded.bytebuddy.asm.Advice$AdviceVisitor.onAfterExceptionTable(Advice.java:9376)
	at co.elastic.apm.shaded.bytebuddy.utility.visitor.ExceptionTableSensitiveMethodVisitor.considerEndOfExceptionTable(ExceptionTableSensitiveMethodVisitor.java:49)
	at co.elastic.apm.shaded.bytebuddy.utility.visitor.ExceptionTableSensitiveMethodVisitor.visitLabel(ExceptionTableSensitiveMethodVisitor.java:62)
	at co.elastic.apm.shaded.bytebuddy.jar.asm.Label.accept(Label.java:357)
	at co.elastic.apm.shaded.bytebuddy.jar.asm.ClassReader.readCode(ClassReader.java:1815)
	at co.elastic.apm.shaded.bytebuddy.jar.asm.ClassReader.readMethod(ClassReader.java:1275)
	at co.elastic.apm.shaded.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:679)
	at co.elastic.apm.shaded.bytebuddy.jar.asm.ClassReader.accept(ClassReader.java:391)
	at co.elastic.apm.shaded.bytebuddy.dynamic.scaffold.TypeWriter$Default$ForInlining.create(TypeWriter.java:3393)
	at co.elastic.apm.shaded.bytebuddy.dynamic.scaffold.TypeWriter$Default.make(TypeWriter.java:1930)
	at co.elastic.apm.shaded.bytebuddy.dynamic.scaffold.inline.RedefinitionDynamicTypeBuilder.make(RedefinitionDynamicTypeBuilder.java:207)
	at co.elastic.apm.shaded.bytebuddy.agent.builder.AgentBuilder$Default$Transformation$Simple$Resolution.apply(AgentBuilder.java:10050)
	at co.elastic.apm.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.doTransform(AgentBuilder.java:10469)
	at co.elastic.apm.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:10432)
	at co.elastic.apm.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.access$1500(AgentBuilder.java:10198)
	at co.elastic.apm.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$LegacyVmDispatcher.run(AgentBuilder.java:10807)
	at co.elastic.apm.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$LegacyVmDispatcher.run(AgentBuilder.java:10754)
	at java.security.AccessController.doPrivileged(Native Method)
	at co.elastic.apm.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:10355)
	at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
	at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2957)
	at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1210)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1690)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
	at co.elastic.apm.api.ElasticApm.currentTransaction(ElasticApm.java:94)
	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 lucee.runtime.reflection.pairs.MethodInstance.invoke(MethodInstance.java:55)
	at lucee.runtime.java.JavaObject.call(JavaObject.java:246)
	at lucee.runtime.java.JavaObject.call(JavaObject.java:268)
	at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:756)
	at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1718)
	at application_cfc$cf.udfCall1(/Application.cfc:129)

```

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [November 27, 2018, 2:04pm UTC](https://discuss.elastic.co/t/custom-transaction-names-stopped-working-and-warning-message/158335/2 "2018-11-27T14:04:11Z")

</div>

Could it be that you are using an older version of the [`apm-agent-api`](https://www.elastic.co/guide/en/apm/agent/java/current/public-api.html#public-api) module? Updating that to the latest version should fix the problem.

---

<div class="post-metadata">

**Author:** ![Chris\_Blackwell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_blackwell/32/4786_2.png) [@Chris\_Blackwell](https://discuss.elastic.co/u/Chris_Blackwell)\
**Post date:** [November 29, 2018, 7:44pm UTC](https://discuss.elastic.co/t/custom-transaction-names-stopped-working-and-warning-message/158335/3 "2018-11-29T19:44:47Z")

</div>

no, we're using elastic-agent-api 1.0.1 and the same version of the agent

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [November 29, 2018, 9:25pm UTC](https://discuss.elastic.co/t/custom-transaction-names-stopped-working-and-warning-message/158335/4 "2018-11-29T21:25:36Z")

</div>

Hmm, that's somewhat strange 🤔

> [@Chris\_Blackwell](#):
>
> `java.lang.IllegalStateException: Cannot locate field named span for class co.elastic.apm.api.TransactionImpl`

In version 1.0.1, there is actually a span property in `TransactionImpl`'s superclass `SpanImpl`:

> <https://github.com/elastic/apm-agent-java/blob/v1.0.1/apm-agent-api/src/main/java/co/elastic/apm/api/SpanImpl.java#L36>

However in previous versions, there was no property called `span`, as it was called `transaction`.

> <https://github.com/elastic/apm-agent-java/blob/v0.7.1/apm-agent-api/src/main/java/co/elastic/apm/api/TransactionImpl.java#L36>

Could you double check that you are using the current version of this artifact: [Maven Central Repository Search](https://search.maven.org/search?q=g:co.elastic.apm%20AND%20a:apm-agent-api)

---

<div class="post-metadata">

**Author:** ![Chris\_Blackwell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_blackwell/32/4786_2.png) [@Chris\_Blackwell](https://discuss.elastic.co/u/Chris_Blackwell)\
**Post date:** [November 29, 2018, 10:04pm UTC](https://discuss.elastic.co/t/custom-transaction-names-stopped-working-and-warning-message/158335/5 "2018-11-29T22:04:46Z")

</div>

My bad. I did a `find ./src | grep apm` and it spat out an old jar in a lib directory where it had no right to be hiding. Now works as expected, thank you!

However,I do get the following warning on the first request

```auto
2018-11-29 21:55:17.668 [http-bio-8080-exec-1] WARN co.elastic.apm.bci.bytebuddy.ErrorLoggingListener - ERROR on transformation lucee.runtime.net.http.HTTPServletRequestWrap
java.lang.IllegalStateException: Cannot resolve type description for javax.servlet.http.HttpUpgradeHandler

```

The src for that class would be here - [https://github.com/lucee/Lucee/blob/master/core/src/main/java/lucee/runtime/net/http/HTTPServletRequestWrap.java](https://github.com/lucee/Lucee/blob/master/core/src/main/java/lucee/runtime/net/http/HTTPServletRequestWrap.java)

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [November 30, 2018, 7:18am UTC](https://discuss.elastic.co/t/custom-transaction-names-stopped-working-and-warning-message/158335/6 "2018-11-30T07:18:43Z")

</div>

Warnings with the message `Cannot resolve type description for` are not something to worry about. The reason in this case is that Tomcat 7 ships with the Servlet API 3.0, but [HTTPServletRequestWrap.java](https://github.com/lucee/Lucee/blob/master/core/src/main/java/lucee/runtime/net/http/HTTPServletRequestWrap) referrrs to classes of the servlet api 3.1, which are not present in Tomcat.

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [November 30, 2018, 7:54am UTC](https://discuss.elastic.co/t/custom-transaction-names-stopped-working-and-warning-message/158335/7 "2018-11-30T07:54:10Z")

</div>

This pull request should remove the warning for that as it does not try to resolve the missing class anymore: [https://github.com/elastic/apm-agent-java/pull/363](https://github.com/elastic/apm-agent-java/pull/363)

To get notified of the next release, go to [https://github.com/elastic/apm-agent-java](https://github.com/elastic/apm-agent-java), click on watch and select "Releases only".

Thanks for reporting!

---

<div class="post-metadata">

**Author:** ![Chris\_Blackwell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_blackwell/32/4786_2.png) [@Chris\_Blackwell](https://discuss.elastic.co/u/Chris_Blackwell)\
**Post date:** [November 30, 2018, 7:03pm UTC](https://discuss.elastic.co/t/custom-transaction-names-stopped-working-and-warning-message/158335/8 "2018-11-30T19:03:01Z")

</div>

Thankyou @felixbarny

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 21, 2018, 3:03pm UTC](https://discuss.elastic.co/t/custom-transaction-names-stopped-working-and-warning-message/158335/9 "2018-12-21T15:03:13Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
