Path errors with Tomcat/OpenBD?

32 views
Skip to first unread message

Billy Cravens

unread,
Nov 23, 2011, 6:46:04 PM11/23/11
to MXUnit List
Downloading 2.1 and dropping it into my OpenBD app resulted in some path errors.

CFML Runtime Error
/usr/local/apache-tomcat-7.0.20/webapps/rr/buildprops/version.properties (No such file or directory)
Request/mxunit/index.cfm
File Trace/usr/local/apache-tomcat-7.0.20/webapps/rr/mxunit/index.cfm
|
+-- /usr/local/apache-tomcat-7.0.20/webapps/rr/mxunit/resources/theme/header.cfm

Typejava.io.FileNotFoundException
Tag ContextCFSET (/usr/local/apache-tomcat-7.0.20/webapps/rr/mxunit/resources/theme/header.cfm, Line=21, Column=1)
|
+-- CFINCLUDE (/usr/local/apache-tomcat-7.0.20/webapps/rr/mxunit/index.cfm, Line=5, Column=1)
Source
18: <!--- Find out the version of MXUnit --->
19: <cfset fileStream = createObject('java', 'java.io.FileInputStream') />
20: <cfset resourceBundle = createObject('java', 'java.util.PropertyResourceBundle') />
21: <cfset fileStream.init(context & 'buildprops/version.properties') />
22: <cfset resourceBundle.init(fileStream) />
^ Snippet from underlying CFML source



OSX 10.7.2, install of Tomcat 7.0.20, running on Open BlueDragon 2.0. Note that I am running Tomcat directly, not behind Apache Web Server. (This is a utility app, running on very thin EC2 instances - no need to consume resources with Apache)

Problem seems to be that this line:
<cfset context = getDirectoryFromPath(expandPath(pathBase)) /> 

is returning the absolute path to the parent directory, when it should be returning the path to the mxunit directory.

(/var/lib/tomcat/webapps/myapp/ instead of /var/lib/tomcat/webapps/myapp/mxunit/)

Playing around with pathBase allowed it to run, but messed up the various HTML assets and links. (I think I tried "/mxunit" and other variations)

After changing the line to 
<cfset context = expandPath(pathBase) /> 
everything seems to work fine.

I'm suspecting this is a limitation with Tomcat, based on the way it sees resources - I suspect it sees "mxunit/" not as a directory, but as a resource, so the containing directory of that resource is of course the root directory of the app. 

Assuming this is correct, updating that line to this:

<cfif find("Tomcat",server.coldfusion.appserver)>
<cfset context = expandPath(pathBase)>
<cfelse>
<cfset context = getDirectoryFromPath(expandPath(pathBase)) /> 
</cfif>

seems a more complete fix.

1) Am I correct about how Tomcat sees directories?
2) Does my fix seem correct? Any potential problems I'm not seeing?

Billy Cravens



Marc Esher

unread,
Nov 28, 2011, 6:56:21 AM11/28/11
to mxu...@googlegroups.com, Adam Haskell
Bill, Randy, Adam H, etc: can you comment on this? I thought we had hooks for setting the context when it wasn't correctly resolved.

--
You received this message because you are subscribed to the Google Groups "mxunit" group.
To post to this group, send email to mxu...@googlegroups.com.
To unsubscribe from this group, send email to mxunit+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mxunit?hl=en.

Ray West

unread,
Dec 8, 2011, 1:32:16 PM12/8/11
to mxunit
Same issue for me, except it is giving very inconsistent paths in both
CF (JRun) and Railo (Tomcat) on the same dev machine. Sometimes it
jumps up the the root, and sometimes across to another parallel
directory to the mxUnit folder.

Ray

On Nov 28, 6:56 am, Marc Esher <marc.es...@gmail.com> wrote:
> Bill, Randy, Adam H, etc: can you comment on this? I thought we had hooks
> for setting the context when it wasn't correctly resolved.
>
>
>
>
>
>
>
> On Wed, Nov 23, 2011 at 6:46 PM, Billy Cravens <bdcrav...@gmail.com> wrote:
> > Downloading 2.1 and dropping it into my OpenBD app resulted in some path
> > errors.
>

> > *CFML Runtime Error*
> > Need some help? Visit our manualhttp://openbd.org/manual/<http://openbd.org/manual/>
> > */usr/local/apache-tomcat-7.0.20/webapps/rr/buildprops/version.properties
> > (No such file or directory)*Request/mxunit/index.cfmFile Trace
> > /usr/local/apache-tomcat-7.0.20/webapps/rr/mxunit/index.cfm
> > |
> > +--
> > /usr/local/apache-tomcat-7.0.20/webapps/rr/mxunit/resources/theme/header.cfm
>
> > Typejava.io.FileNotFoundExceptionTag ContextCFSET<http://openbd.org/manual/?/tag/CFSET>(/usr/local/apache-tomcat-7.0.20/webapps/rr/mxunit/resources/theme/header.cfm,
> > Line=21, Column=1)
> > |
> > +-- CFINCLUDE <http://openbd.org/manual/?/tag/CFINCLUDE>(/usr/local/apache-tomcat-7.0.20/webapps/rr/mxunit/index.cfm, Line=5,
> > Column=1)Source

> > bdcrav...@gmail.com

Reply all
Reply to author
Forward
0 new messages