Link to home
Start Free TrialLog in
Avatar of geraldw
geraldw

asked on

Using CFGrid and registering java applets

Hello,
I'm experiencing a great deal of frustration and although I've looked through as much printed and online documentation as I can find I cannot figure out the correct thing to do here.

First, on my XP box I have a full StudioMX install and so I am running CFMX developers edition. I want to add a CFGRID to a page on our intranet. I started by using Forta's ActorGrid.cfm from his book and it works fine on my machine. I then wrote my own version for our database and it works fine on my machine.

Next, I moved the file over to the Win2003 in-house web server which is running CFMX 6.1. I am the administrator. I have never run CFGRID on this box before and the code is not running properly. I get a big gray box with a red X at the top.

So, after reading bunches of help that doesn't exactly give me the answers I decided that the answer is to use the Administrator | Extensions | Java Applets page to register the CFGridApplet. I looked in my PC's administrator page and there are NO Java Applets listed so I couldn't figure out why the CFGRID ran fine on my machine but will not run on the web server. So I tried to register the Applet with the following:

Applet Name: CFGridApplet.class
Code: CFGridApplet.class
Code Base: http://SIMPWEBI/inetpub/wwwroot/CFIDE/applets/coldfusion/applets
Archive:
Method:
Height: 500 Width: 500
VSpace: Hspace:
Alight: Left
Not supported message: not supported.

Applet Parameters: left blank

So I hit add and it appears on the Java Applets page but it doesn't do anything for me.

Incidentally, I found a folder buried deep on my C drive under my username/documents and settings with a 41 CF*.class files. I copied these to my web server and pointed the Java Applets page (under code base) to the CFGridApplet.class in this folder.

There is no security turned on with either of these boxes. They are internal and not exposed to the web.  

Thanks in advance, Jerry
Avatar of shooksm
shooksm

Make sure your production server has a copy of CFIDE located at the root of the webserver.  That is where the CLASS and JS files are located for some of the special tags like CFGRID and CFFORM.  View the source of the page and make sure that in the applet tag CFGRID creates that you can physically download (no 404 errors) the file referenced in the code and codebase attributes.
Avatar of geraldw

ASKER

Hi shooksm,

I've looked at the CFIDE folder.  I have CFIDE at the \inetpub\wwwroot on the same level as the website folder.  I looked in the administrator and it is mapped properly.

I've looked over the source code from the page that works correctly (on my XP box) and the one that comes from the internal web server and they look absolutely identical.

I've tried changing the settings for the Applet in the CF Administrator as well as eliminating them altogether since it's not in the Administrator on my XP box.

One thing that might be useful is that if I turn on the Java Console in IE6 I get no errors when I run the page from my XP box but when I run the page from the server I get an error that starts with:

load: class coldfusion.applets.CFGridApplet.class not found.
      etc, etc,

On my XP box the only place that I can find the CFGridApplet.class is buried very deep under C:\documents and settings\Application Data\Sun\.......

all the way down to \jav and I find the files:

cfapplets.jar-52a3ced8-618f8c41.idx  and
cfapplets.jar-52a8ced8-618f8c41.zip

the .idx file has a reference to the CFGridApplet class, etc. and so I tried to put these two files in the same place under the Administrator Documents and Settings on the server. It didn't help.

I tried putting the same files under \CFIDE\ and it didn't help either - even after I tried different mappings.

The only final clue I have is that the browser shows an error message at the bottom when it fails:

Applet coldfusion.applets.CFGridApplet notinited

I'm not a java guy so I'm don't know how to INIT it.  

Sorry, for the long posting.  I hope someone can help.
Thanks, Jerry
Doesn't look like I made my statement very clear.  You are getting not found errors and class init errors most likely because the class file is not in the proper place.  Take another look at your the APPLET tag that gets generated.  Take the CODEBASE and CODE attribute.  Open up a new browser window and put the following changing what is between the < >:  http://<Production Server URL><CODEBASE><CODE>  

If you get a 404 error, then make sure you create the appropriate folder and make sure the .class file is in there until you no longer get 404 errors.  Then retry your CF page.
Avatar of geraldw

ASKER

Hi shooksm,
A lot of work for 250 points I know but thanks for getting back to me.

In my source code for BOTH documents (the successful one (my pc) and the failure one (production server) I see:

<OBJECT
  CLASSID="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
  CODEBASE="/CFIDE/classes/cf-j2re-win.cab"
  WIDTH="500"
  HEIGHT="300"
>
    <PARAM NAME="CODE" VALUE="coldfusion.applets.CFGridApplet.class">
    <PARAM NAME="ARCHIVE" VALUE="/CFIDE/classes/cfapplets.jar">
    <PARAM NAME="MAYSCRIPT" VALUE="true">
    <PARAM NAME="AUTOWIDTH" VALUE="no">
    <PARAM NAME="GRIDDATA"

So in my browser it tried:
http://jerrys_xp_box/cfide/classes/cf-j2re-win.cab - succeeds (ask for save or download)
http://simptranet/cfide/classes/cf-j2re-win.cab - fails - page not found

and

http://jerrys_xp_box/cfide/classes/cfapplets.jar - succeeds (ask for save or download)
http://simptranet/cfide/classes/cfapplets.jar - fails - page not found

I checked the \cfide\classes\ folder on both machines and they are identical with the same files, date modified, and file sizes.

My path in the Java Applets page of the administrator now looks like this:

http://SIMPWEBI/cfide/classes/cfapplets.jar-52a8ced8-618f8c41.zip/coldfusion/applets

I can absolutely see CFGridApplet.class as a file in this folder but nothing I do seems to make the application see it.  I checked the permissions on the folder in Windows and I can't think of another darn thing to try.
Thanks, Jerry
ASKER CERTIFIED SOLUTION
Avatar of shooksm
shooksm

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of geraldw

ASKER

Hello shooksm,

I actually found a solution for this on a Cold Fusion web site but since you stayed with me and your answer is close to the solution I want to give you all the points.

Thanks for your help.  The answer ended up being to use IIS to alias the CFIDE folder from the web site on the production server.  There are 3 sites on the server and this one wasn't linking up with the folder.  So, I just made an alias and that solved the problem without having multiple copies of CFIDE added to the web folder.
Thanks, Jerry