Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Coldfusion Clustering issue - Images are not loading properly

New Here ,
Nov 27, 2009 Nov 27, 2009

Hi,

I am new to coldfusion. I installed CF7 in multiserver configuration. I created two instances on same box and created a cluster. I can browse to the two instances seperately and thru the cluster.

I am having an issue. When I access instances directly the site is working fine, but when I access it thru cluster, the images, javascript are not loading. I am getting error on jjQuery also( jQuery is undefined error).

I might have missed a basic thing in the installation but do not know what.

Could anyone help me to resolve this issue?

Thanks in advance.

535
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Nov 27, 2009 Nov 27, 2009

Where are your images and javascript files located on the filesystem? Are they located in the webroot of the webserver or are they inside the ColdFusion webroot? Can you explain the layout of the filesystemn of your webserver (Apache? IIS?) and CF server?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 29, 2009 Nov 29, 2009

Thanks for your response.

The installation is a multierver configuration installation. IIS is the web server.

CFIDE location is:
C:\Inetpub\CFMX7\CFIDE

cfusion location
C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\cfusion

Instance 1 file location
C:\JRun4\servers\AppnInstance1\cfusion.ear\cfusion.war\Application

Instance 2 file location
C:\JRun4\servers\AppnInstance2\ePermits1_2.ear\ePermits1_2.war\Application

Image files and javascript files are under Application folder.
C:\JRun4\servers\AppnInstance2\ePermits1_2.ear\ePermits1_2.war\Application\Images
C:\JRun4\servers\AppnInstance2\ePermits1_2.ear\ePermits1_2.war\Application\JS

Application components are located at c:\AppnComponents

If I browse each instance with its URL then it is ok, but when I access using cluster then it is not loading images and

throwing errors on javascript.

Thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Nov 29, 2009 Nov 29, 2009

By default the IIS connector is set up such that only requests for *.cfm and *.cfc are forwarded from IIS to CF. So when you request .js files, they will be handled by IIS and not by CF. So you have two options:

1. Move all your js, gif, png etc. files from the war file to the IIS webroot.

2. Add additional mappings to /WEB-INF/web.xml so requests for .js files are forwarded from IIS to CF too.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 29, 2009 Nov 29, 2009

I think we can not move images and js to under Inetpub without making changes to the application. I do not want to change the applicaiton because it involves changin multiple places and risk.

I added the below mapping in C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\jrun-web.xml file but its not working. Is it the right place and right way to add mappings?

<virtual-mapping>

  <resource-path>/Appn/images*</resource-path>
  <system-path>C:\JRun4\servers\AppnInstance2\Appn1_2.ear\Appn1_2.war\Application\Images</system-path>

</virtual-mapping>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Nov 29, 2009 Nov 29, 2009
LATEST

No, that is not the right place. Virtual directories tell CF where to look for the source. But to get there, you need to tell the connector to forward the request to CF first.

We typically add the mapping to the EAR file before it is deployed on the cluster. Not sure how the server rewrites that upon deployment, but what we add to web.xml to forward the js folder is something like:

&lt;servlet-mapping id="prisma_mapping_6"&lt;

&lt;servlet-name&lt;FileServlet&lt;/servlet-name&lt;

&lt;url-pattern&lt;/js/*&lt;/url-pattern&lt;

&lt;/servlet-mapping&lt;

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