Highlighted

CF Docker CustomTags

Community Beginner ,
Apr 08, 2020

Copy link to clipboard

Copied

I've tried both 2016.0.14 and 2018.0.8 docker images and both don't seem to recognize any jars that I place in the CustomTags directory. I've also tried adding new CustomTags locations and that doesn't work as well. I don't know what would be breaking this by default. Seems like I can't be the only person that wants to run ColdFusion in a docker container and also needs to run some additional jars.

Adobe Community Professional
Correct answer by Charlie Arehart | Adobe Community Professional

tslow, I don't think this is an issue about use of the CF Docker image.

 

Are you saying you have a working CF instance (non-docker) where you place jars in the CF custom tags, and somehow they "just work"? you can call them with cfobject or createobject, etc? That would be a surprise, as the customtags folder has no inherent connection with CF's support of Java objects/jars.

 

Instead, one who wanted use a jar could do any of a few things, such as add the jar (or the jar's folder) to the classpath (in the CF Admin "java and jvm" page), or they could point to it using the app-specific class-loading feature introduced in CF10. There are also some implicit libraries inside CF where classes can be loaded from.

 

I wonder if your issue may be that on your "working system", someone DID add the path to that customtags location into the classpath field of the CF admin, If so, that's why it would work on that sytem but not in Docker. You'd need to add that into the Docker implementation, either manually (in the admin) or via the Admin API (which can be called implicitly during container startup if placed in a template in a particular folder, as you may have seen in the CF docs on the CF Docker images.) 

 

Finally, in case someone there (you or a colleague) may "swear" that they did "something" regarding custom tags and java libraries, note also that CF has long supported CFX custom tags, where you a) register the class/jar in the CF Admin special page for CFX's, and then b) you'd call them in your code as a CFML tag with a cfx_ prefix. For more, see https://helpx.adobe.com/coldfusion/developing-applications/building-blocks-of-coldfusion-applications/building-custom-cfxapi-tags/writing-a-java-cfx-tag.html. But you don't mention using such cfx's, so I don't think that's your issue (but it could be).

 

If what I share doesn't get you going, tell us the exact error you are getting, and what kind of CFML tag or function is failing. When it comes to working with Docker images (at all, let alone CF), it can be more challenging, finding the diagnostics needed to understand how to solve problems. But it sounds like you have a handle on that.

 

Finally, it is certainly is a smaller pool of people you can turn to who are using CF Docker images at all (still not quite taking hold in the hearts and minds of the CF community, for a variety or reasons). And then the number within that group using "additional jars" (with respect to calling java objects from CFML) would certainly be a very small number. I'll admit, I haven't even had occasion to try that (calling a Java object from CFML, in a jar I've placed within CF), but I've done that with normal CF instances for years, and worked with the CF Docker images for over a year, so if anyone can help you resolve things, I hope I can. 🙂

Views

527

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

CF Docker CustomTags

Community Beginner ,
Apr 08, 2020

Copy link to clipboard

Copied

I've tried both 2016.0.14 and 2018.0.8 docker images and both don't seem to recognize any jars that I place in the CustomTags directory. I've also tried adding new CustomTags locations and that doesn't work as well. I don't know what would be breaking this by default. Seems like I can't be the only person that wants to run ColdFusion in a docker container and also needs to run some additional jars.

Adobe Community Professional
Correct answer by Charlie Arehart | Adobe Community Professional

tslow, I don't think this is an issue about use of the CF Docker image.

 

Are you saying you have a working CF instance (non-docker) where you place jars in the CF custom tags, and somehow they "just work"? you can call them with cfobject or createobject, etc? That would be a surprise, as the customtags folder has no inherent connection with CF's support of Java objects/jars.

 

Instead, one who wanted use a jar could do any of a few things, such as add the jar (or the jar's folder) to the classpath (in the CF Admin "java and jvm" page), or they could point to it using the app-specific class-loading feature introduced in CF10. There are also some implicit libraries inside CF where classes can be loaded from.

 

I wonder if your issue may be that on your "working system", someone DID add the path to that customtags location into the classpath field of the CF admin, If so, that's why it would work on that sytem but not in Docker. You'd need to add that into the Docker implementation, either manually (in the admin) or via the Admin API (which can be called implicitly during container startup if placed in a template in a particular folder, as you may have seen in the CF docs on the CF Docker images.) 

 

Finally, in case someone there (you or a colleague) may "swear" that they did "something" regarding custom tags and java libraries, note also that CF has long supported CFX custom tags, where you a) register the class/jar in the CF Admin special page for CFX's, and then b) you'd call them in your code as a CFML tag with a cfx_ prefix. For more, see https://helpx.adobe.com/coldfusion/developing-applications/building-blocks-of-coldfusion-applications/building-custom-cfxapi-tags/writing-a-java-cfx-tag.html. But you don't mention using such cfx's, so I don't think that's your issue (but it could be).

 

If what I share doesn't get you going, tell us the exact error you are getting, and what kind of CFML tag or function is failing. When it comes to working with Docker images (at all, let alone CF), it can be more challenging, finding the diagnostics needed to understand how to solve problems. But it sounds like you have a handle on that.

 

Finally, it is certainly is a smaller pool of people you can turn to who are using CF Docker images at all (still not quite taking hold in the hearts and minds of the CF community, for a variety or reasons). And then the number within that group using "additional jars" (with respect to calling java objects from CFML) would certainly be a very small number. I'll admit, I haven't even had occasion to try that (calling a Java object from CFML, in a jar I've placed within CF), but I've done that with normal CF instances for years, and worked with the CF Docker images for over a year, so if anyone can help you resolve things, I hope I can. 🙂

Views

528

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 08, 2020 0
Adobe Community Professional ,
Apr 10, 2020

Copy link to clipboard

Copied

tslow, I don't think this is an issue about use of the CF Docker image.

 

Are you saying you have a working CF instance (non-docker) where you place jars in the CF custom tags, and somehow they "just work"? you can call them with cfobject or createobject, etc? That would be a surprise, as the customtags folder has no inherent connection with CF's support of Java objects/jars.

 

Instead, one who wanted use a jar could do any of a few things, such as add the jar (or the jar's folder) to the classpath (in the CF Admin "java and jvm" page), or they could point to it using the app-specific class-loading feature introduced in CF10. There are also some implicit libraries inside CF where classes can be loaded from.

 

I wonder if your issue may be that on your "working system", someone DID add the path to that customtags location into the classpath field of the CF admin, If so, that's why it would work on that sytem but not in Docker. You'd need to add that into the Docker implementation, either manually (in the admin) or via the Admin API (which can be called implicitly during container startup if placed in a template in a particular folder, as you may have seen in the CF docs on the CF Docker images.) 

 

Finally, in case someone there (you or a colleague) may "swear" that they did "something" regarding custom tags and java libraries, note also that CF has long supported CFX custom tags, where you a) register the class/jar in the CF Admin special page for CFX's, and then b) you'd call them in your code as a CFML tag with a cfx_ prefix. For more, see https://helpx.adobe.com/coldfusion/developing-applications/building-blocks-of-coldfusion-application.... But you don't mention using such cfx's, so I don't think that's your issue (but it could be).

 

If what I share doesn't get you going, tell us the exact error you are getting, and what kind of CFML tag or function is failing. When it comes to working with Docker images (at all, let alone CF), it can be more challenging, finding the diagnostics needed to understand how to solve problems. But it sounds like you have a handle on that.

 

Finally, it is certainly is a smaller pool of people you can turn to who are using CF Docker images at all (still not quite taking hold in the hearts and minds of the CF community, for a variety or reasons). And then the number within that group using "additional jars" (with respect to calling java objects from CFML) would certainly be a very small number. I'll admit, I haven't even had occasion to try that (calling a Java object from CFML, in a jar I've placed within CF), but I've done that with normal CF instances for years, and worked with the CF Docker images for over a year, so if anyone can help you resolve things, I hope I can. 🙂

/Charlie (server troubleshooter, carehart.org)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 10, 2020 1
Adobe Community Professional ,
Apr 10, 2020

Copy link to clipboard

Copied

I would be very surprised if putting jars in a Custom Tags directory would do anything different in a non-Docker install. As far as I know, you have to put jars in your JREs classpath, then use CreateObject or CFOBJECT to invoke classes within those jars.

 

Dave Watts, Eidolon LLC

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 10, 2020 1
Community Beginner ,
Apr 10, 2020

Copy link to clipboard

Copied

Thank you both for your help! That's exactly what my problem is. We were adding the CustomTags folder to the jvm classpath using adminapi when provisioning. That step did not make it into my new docker setup and instead I confused CustomTags functionality. I appreciate the quick responses!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 10, 2020 0
Adobe Community Professional ,
Apr 10, 2020

Copy link to clipboard

Copied

Glad to hear, and thanks for the update. It's an understandable challenge. And thanks also for marking a correct answer. Hope it (or Dave's subsequent one) would help others finding the same challenge in the future. 

/Charlie (server troubleshooter, carehart.org)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 10, 2020 0