Results 1 to 4 of 4

Thread: Spring with ColdFusion

  1. #1
    Join Date
    Oct 2004
    Location
    Orlando, FL
    Posts
    7

    Default Spring with ColdFusion

    Hi,

    I am trying to get Spring to work with ColdFusion. However, just about every Spring class I need to use seems to use logging. Any time anything log related happens when Spring is running in ColdFusion, I get an error similar to the following:

    "Error creating bean with name 'myDataSource' defined in file [/Applications/jakarta-tomcat-5.0.25/webapps/ROOT/spring2/styles.xml]: Instantiation of bean failed; nested exception is org.apache.commons.logging.LogConfigurationExcepti on: org.apache.commons.logging.LogConfigurationExcepti on: org.apache.commons.logging.LogConfigurationExcepti on: Class org.apache.commons.logging.impl.Jdk14Logger does not implement Log"

    Having dug around a bit, I have determined that ColdFusion uses an older version of log4j than the current Spring distro, and as a result, this problem occurs whenever ColdFusion tries to load a Java object that was compiled using the newer version of log4j (like the ones in Spring).

    Does anybody have any ideas how I can get around this problem?

    Thanks,

    - max

  2. #2
    Join Date
    Oct 2004
    Location
    Orlando, FL
    Posts
    7

    Default

    Moo hoo haa haa ha! I have figured out the solution.

    According to a post I found online on another forum, the file webservices.jar that comes with ColdFusion MX has a really old version of commons-logging. If you delete commons-logging from this jar file, re-jar it and replace the old jar with this altered one, the problem goes away.

    Here's the step-by-step solution:

    1) Go to WEB-INF/cfusion/lib/ under your CF MX installation
    2) Rename the old webservices.jar file
    3) Copy this jar file out to another location
    4) Extract all files within the jar into a directory called "webservices" (i.e. jar -xvf webservices.jar)
    5) Remove the commons-logging directory in this extracted "webservices" directory (just delete it and all its contents). You have to dig through the class file structure to find it
    6) Re-jar the contents of the extracted "webservices" directory into webservices.jar (i.e. jar -cvf webservices.jar -C webservices/ .)
    7) Copy the new webservices.jar to the location in #1

    After doing this, I was able to instantiate a BeanFactory and load beans without any log4j errors (something I've never been able to do before). I haven't tested it any further than that, so use this method on a production server at your own risk.

    I highly recommend holding on to the original webservices.jar file in case you run in to issues and need to switch back quickly.

    - max

  3. #3
    Join Date
    Oct 2004
    Location
    Orlando, FL
    Posts
    7

    Default JRun Issues

    Hi again,

    FYI: I've found that the solution listed above works fine if you deployed CFMX in Tomcat, but not in JRun. I'm working on a fix/workaround for JRun and I'll post it once I have it figured out.

    - max

  4. #4
    Join Date
    Oct 2004
    Location
    Orlando, FL
    Posts
    7

    Default JRun 4/Spring Logging fix found

    Hi,

    I have determined how to fix the logging issue with Spring in JRun 4. Use these instructions *instead* of the ones listed above for Tomcat.

    1) Go to [jrun root]/lib
    2) Copy out the webservices.jar file
    3) Extract the jar file using the jar utility
    4) Navigate the extracted directory structure to org/apache/commons
    5) Remove the "logging" directory
    6) Replace it with the "logging" directory from commons-logging-1.0.4 (you can get this from http://www.apache.org/dist/jakarta/commons/logging/ ). (NOTE: I'm assuming that any newer version of commons-logging will work, this happened to be the distro that I used successfully)
    7) Re-jar your webservices directory into webservices.jar
    8) Copy the modified webservices.jar in to [jrun root]/lib
    9) Start JRun

    You should now be able to use the Spring classes in ColdFusion without issue.

    - max

Similar Threads

  1. Spring MVC Web Framework versus Struts
    By biguniverse in forum Web Flow
    Replies: 27
    Last Post: Aug 29th, 2012, 03:57 AM
  2. Replies: 5
    Last Post: Aug 9th, 2008, 05:30 AM
  3. A Spring Class Loader?
    By azzoti in forum Architecture
    Replies: 8
    Last Post: May 7th, 2005, 04:02 AM
  4. No one hires for Spring expertise
    By ctassoni in forum Meta
    Replies: 13
    Last Post: May 5th, 2005, 04:29 PM
  5. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •