Skip to main content
Participating Frequently
August 20, 2021
Question

OSGi bootdelegation problem giving rise to NoClassDefFoundError

  • August 20, 2021
  • 4 replies
  • 1532 views

Hi,

I am trying to run a Java Agent with ColdFusion 2021. In coldfusion error.log it prints NoClassDefFoundError and breaks some functionalities. This is usually due to OSGi infrastructure conflict which gets resolved via adding property org.osgi.framework.bootdelegation=agent.package.* in a osgi related config file or via -D option. But with  -D option it's not working and there is no appropriate .properties file to give in this value or even a way to know if these are getting picked up or not. Any solution to this?

Exception in thread "DefaultQuartzScheduler_Worker-1" Exception in thread "DefaultQuartzScheduler_Worker-10" java.lang.NoClassDefFoundError: agent/package/InterceptorDelegatorBoott
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java)
.....
Caused by: java.lang.ClassNotFoundException: agent.package.InterceptorDelegatorBoot not found by org.quartz-scheduler.quartz [14]
	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1597)
    This topic has been closed for replies.

    4 replies

    Charlie Arehart
    Community Expert
    Community Expert
    October 11, 2021

    Now that you've mentioned you're running docker, please clarify a few things to help us help you:

    • Are you using the Adobe Cf2021 container? Which one, from where? You can share the image url. 
    • Or might you have crafted your own? Or are you using the Commandbox image with a cf engine?
    • Whichever you are using, what packages/modules (per that new modularity of CF2021 features) are you loading, if any? and how? 
    • How are you setting the - d jvm args you say you're attempting? How are you confirming that any such jvm.config changes are picked up? Have you confirmed, for instance, that merely changing the xmx shows that changed value in the cf admin, for instance? Even if you don't intend to use the admin in the container, check it out for this purpose. Maybe nothing you're setting is being picked up, which would be its own problem. 
    • Have you tried loading that appdynamics agents into a regular install of cf, just to make sure it works as expected? You should not need to copy it into the cfusion/lib folder but rather you should be able to point the javaagent arg to where it exists in the container.
    • How are you getting that jar into the container? Copy while building image?
    • How are you running the image? Simple docker run? Compose? Kubernetes?

     

    Any of these could be clues, or could help some on try to replicate your problem, whether us in the community or Adobe, who may join in. 

     

    And to one of your earlier points, yes, Adobe reps do sometimes chime in here. As for your being directed here by support, how did you request that support? A call? A chat? Or an email, if if the latter, to what address? Do you feel you reached a generic help agent who might carely know cf existed? Just curious about your experience.

     

    In all this, I'm trying to help. Please don't shoot the messenger. 🙂 

    /Charlie (troubleshooter, carehart. org)
    BKBK
    Community Expert
    Community Expert
    October 11, 2021

    Something just occurred to me. Might it just be that this error relates to ColdFusion Builder rather than to ColdFusion?

    Participating Frequently
    October 11, 2021

    I don't know much about CF 2021 flow. How to find that?

     

    So what I see from the logs is that the issue occurs  after the tomcat container starts after running /opt/startup/start-coldfusion.sh start.

    I thought maybe I would have to give that paramter somewhere to tomcat server. But I couldn't find any place, file (such as CATALINA_OPTS, JAVA_OPTS in standard tomcat server distributions) where i could the jvm opt.

    BKBK
    Community Expert
    Community Expert
    October 11, 2021

    Now you mention it, there is a Tomcat/Catalina properties file: {COLDFUSION_HOME}\runtime\conf\catalina.properties. 

    You could try adding the property org.osgi.framework.bootdelegation=agent.package.* there. 

    BKBK
    Community Expert
    Community Expert
    August 31, 2021

    Without even having to look, you can see something obvious because it jumps at you: Boott with two Ts. Might that be the cause of the problem.

    Participating Frequently
    October 9, 2021

    That's obviously a typo I made by mistake while posting 🙂

    Neverthless, let me correct it.

    BKBK
    Community Expert
    Community Expert
    October 9, 2021

    Suggestion: follow the steps

    1.  Place the relevant InterceptorDelegatorBoot Jar file in the {COLDFUSION_HOME}\lib directory;
    2.  Add -Dorg.osgi.framework.bootdelegation=agent.package.* to the classpath in {COLDFUSION_HOME}\bin\jvm.config.
    3.  Restart ColdFusion.
    Participant
    August 30, 2021

    I am experiencing the same event.
    Please tell me how to avoid it.