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.

Exception while trying to create SQL span on Lucee server

See original GitHub issue

Describe the bug Got an exception while trying to create an SQL span on our Lucee servers. It happens on every Lucee servers (using v5.3) running in Tomcat.

To Reproduce

Config of the APM agent
CATALINA_OPTS="$CATALINA_OPTS -javaagent:/opt/lucee/tomcat/lib/elastic-apm-agent-1.10.0.jar"
CATALINA_OPTS="$CATALINA_OPTS -Delastic.apm.service_name=service"
CATALINA_OPTS="$CATALINA_OPTS -Delastic.apm.environment=environment"
CATALINA_OPTS="$CATALINA_OPTS -Delastic.apm.disable_instrumentations=''"
CATALINA_OPTS="$CATALINA_OPTS -Delastic.apm.trace_methods='lucee.runtime.type.QueryImpl.*,lucee.runtime.PageContextImpl.*'"
CATALINA_OPTS="$CATALINA_OPTS -Delastic.apm.application_packages=lucee.runtime.*"
CATALINA_OPTS="$CATALINA_OPTS -Delastic.apm.server_urls=server.url"

Expected behavior We should see SQL span on the APM viewer but it is not showed there as an error occur when the agent try to create them.

Debug logs

Exception stack trace
java.lang.NoClassDefFoundError: co/elastic/apm/agent/jdbc/helper/JdbcHelper
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.prepareStatement(SQLServerConnection.java:2169)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.prepareStatement(SQLServerConnection.java:1853)
    at lucee.runtime.db.DatasourceConnectionImpl.getPreparedStatement(DatasourceConnectionImpl.java:187)
    at lucee.runtime.type.QueryImpl.execute(QueryImpl.java:265)
    at lucee.runtime.type.QueryImpl.<init>(QueryImpl.java:215)
    at lucee.runtime.tag.Query.executeDatasoure(Query.java:1055)
    at lucee.runtime.tag.Query._doEndTag(Query.java:655)
    at lucee.runtime.tag.Query.doEndTag(Query.java:537)
    at quizzdao_cfc$cf.udfCall1(/dao/QuizzDao.cfc:73)
    at quizzdao_cfc$cf.udfCall(/dao/QuizzDao.cfc)
    at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
    at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
    at lucee.runtime.type.UDFImpl.call(UDFImpl.java:215)
    at lucee.runtime.ComponentImpl._call(ComponentImpl.java:682)
    at lucee.runtime.ComponentImpl._call(ComponentImpl.java:570)
    at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1918)
    at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:768)
    at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1707)
    at quizz_cfc$cf.udfCalla(/business/Quizz.cfc:557)
    at quizz_cfc$cf.udfCall(/business/Quizz.cfc)
    at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
    at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
    at lucee.runtime.type.UDFImpl.call(UDFImpl.java:215)
    at lucee.runtime.ComponentImpl._call(ComponentImpl.java:682)
    at lucee.runtime.ComponentImpl._call(ComponentImpl.java:570)
    at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1918)
    at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:768)
    at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1707)
    at campagnesdao_cfc$cf.udfCall5(/dao/CampagnesDao.cfc:1143)
    at campagnesdao_cfc$cf.udfCall(/dao/CampagnesDao.cfc)
    at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
    at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
    at lucee.runtime.type.UDFImpl.call(UDFImpl.java:215)
    at lucee.runtime.ComponentImpl._call(ComponentImpl.java:682)
    at lucee.runtime.ComponentImpl._call(ComponentImpl.java:570)
    at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1918)
    at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:768)
    at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1707)
    at campagnes_cfc$cf.udfCall5(/business/Campagnes.cfc:224)
    at campagnes_cfc$cf.udfCall(/business/Campagnes.cfc)
    at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
    at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
    at lucee.runtime.type.UDFImpl.call(UDFImpl.java:215)
    at lucee.runtime.ComponentImpl._call(ComponentImpl.java:682)
    at lucee.runtime.ComponentImpl._call(ComponentImpl.java:570)
    at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1918)
    at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:768)
    at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1707)
    at v1._inc_loader_initgame_cfm$cf.call(/v1/_inc_loader_initgame.cfm:140)
    at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:942)
    at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:834)
    at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:816)
    at v1_cfm$cf.call(/v1.cfm:4)
    at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:942)
    at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:834)
    at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:816)
    at application_cfc$cf.udfCall(/Application.cfc:78)
    at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
    at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
    at lucee.runtime.type.UDFImpl.call(UDFImpl.java:215)
    at lucee.runtime.ComponentImpl._call(ComponentImpl.java:682)
    at lucee.runtime.ComponentImpl._call(ComponentImpl.java:570)
    at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1918)
    at lucee.runtime.listener.ModernAppListener.call(ModernAppListener.java:436)
    at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:215)
    at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:42)
    at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2409)
    at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2399)
    at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2374)
    at lucee.runtime.engine.Request.exe(Request.java:43)
    at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1037)
    at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:983)
    at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:102)
    at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)
java.lang.NoClassDefFoundError: co/elastic/apm/agent/jdbc/helper/JdbcHelper
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.prepareStatement(SQLServerConnection.java:1855)
    at lucee.runtime.db.DatasourceConnectionImpl.getPreparedStatement(DatasourceConnectionImpl.java:187)
    at lucee.runtime.type.QueryImpl.execute(QueryImpl.java:265)
    at lucee.runtime.type.QueryImpl.<init>(QueryImpl.java:215)
    at lucee.runtime.tag.Query.executeDatasoure(Query.java:1055)
    at lucee.runtime.tag.Query._doEndTag(Query.java:655)
    at lucee.runtime.tag.Query.doEndTag(Query.java:537)
    at quizzdao_cfc$cf.udfCall1(/dao/QuizzDao.cfc:73)
    at quizzdao_cfc$cf.udfCall(/dao/QuizzDao.cfc)
    at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
    at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
    at lucee.runtime.type.UDFImpl.call(UDFImpl.java:215)
    at lucee.runtime.ComponentImpl._call(ComponentImpl.java:682)
    at lucee.runtime.ComponentImpl._call(ComponentImpl.java:570)
    at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1918)
    at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:768)
    at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1707)
    at quizz_cfc$cf.udfCalla(/business/Quizz.cfc:557)
    at quizz_cfc$cf.udfCall(/business/Quizz.cfc)
    at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
    at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
    at lucee.runtime.type.UDFImpl.call(UDFImpl.java:215)
    at lucee.runtime.ComponentImpl._call(ComponentImpl.java:682)
    at lucee.runtime.ComponentImpl._call(ComponentImpl.java:570)
    at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1918)
    at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:768)
    at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1707)
    at campagnesdao_cfc$cf.udfCall5(/dao/CampagnesDao.cfc:1143)
    at campagnesdao_cfc$cf.udfCall(/dao/CampagnesDao.cfc)
    at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
    at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
    at lucee.runtime.type.UDFImpl.call(UDFImpl.java:215)
    at lucee.runtime.ComponentImpl._call(ComponentImpl.java:682)
    at lucee.runtime.ComponentImpl._call(ComponentImpl.java:570)
    at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1918)
    at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:768)
    at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1707)
    at campagnes_cfc$cf.udfCall5(/business/Campagnes.cfc:224)
    at campagnes_cfc$cf.udfCall(/business/Campagnes.cfc)
    at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
    at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
    at lucee.runtime.type.UDFImpl.call(UDFImpl.java:215)
    at lucee.runtime.ComponentImpl._call(ComponentImpl.java:682)
    at lucee.runtime.ComponentImpl._call(ComponentImpl.java:570)
    at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1918)
    at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:768)
    at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1707)
    at v1._inc_loader_initgame_cfm$cf.call(/v1/_inc_loader_initgame.cfm:140)
    at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:942)
    at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:834)
    at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:816)
    at v1_cfm$cf.call(/v1.cfm:4)
    at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:942)
    at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:834)
    at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:816)
    at application_cfc$cf.udfCall(/Application.cfc:78)
    at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
    at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
    at lucee.runtime.type.UDFImpl.call(UDFImpl.java:215)
    at lucee.runtime.ComponentImpl._call(ComponentImpl.java:682)
    at lucee.runtime.ComponentImpl._call(ComponentImpl.java:570)
    at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1918)
    at lucee.runtime.listener.ModernAppListener.call(ModernAppListener.java:436)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
xdecockcommented, Oct 16, 2019

Hi, the issue seems to be solved by modifying the actual file indeed, i’ll propose a PR to the project thanks for your support, i’ll now ensure what timing we get, and list what classes we need to instrument

0reactions
mbandizzlecommented, Jun 22, 2021

@jeremiej-q @xdecock could you please post an example of the java system properties you used to get this working?

I’m using:

-javaagent:lib/elastic-apm-agent-1.24.0/elastic-apm-agent-1.24.0.jar
-Delastic.apm.service_name=server_name_here
-Delastic.apm.server_url=http://path/to/server:8200
-Delastic.apm.environment=development
-Delastic.apm.use_path_as_transaction_name=true

which is working well with APM except for the logging of SQL/JDBC spans.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception Output - Lucee Documentation
How to catch and display exceptions. ... <cfscript> try { throw "an error happened"; } catch ( any e ){ dump(e); } </cfscript>...
Read more >
Lucee Language and Syntax Differences
Architecture Adobe ColdFusion (ACF) is configured in a way that only one single web context is available for a server instance.
Read more >
Locking Down Lucee
To change the Request Timeout value, log in to the Lucee server administrator and go to Settings -> Application -> Request Timeout. It...
Read more >
System Properties and Environment Variables
This documentation shows how to set and use Environment Variables or System Properties to configure specific Lucee Server settings.
Read more >
cftry - Lucee Documentation
Used with one or more cfcatch tags, the cftry tag lets you catch and process exceptions in CFML pages.
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