Problems installing FC on Railo/Linux/mySQL

Ok - after failing at installing FarCry on a shared host (as documented on the google groups) I went ahead and got my self a dedicated server. The server has Ubuntu on it, with Apache. And I installed Railo on it. And after some fumbling about I got virtual hosts AND virtual directories up and running as well :smile:

So I have the domain lab.trondulseth.com pointing to /farcry/projects/trondulsethno/www
With virtual directory /farcry pointing to /farcry and virtual directory /webtop pointing to /farcry/core/webtop

But I get an error saying:
invalid component definition, can’t find farcry.core.proxyApplication

Even when trying to access dev.trondulseth.com/farcry/core/proxyApplication.cfc in the web browser I get this error.

I have to admit I’m fairly new both to Linux/Apache and Railo - and maybe the question would be better suited in the Railo group? But anyway - I’m trying here first :smile:

Trond

With Railo you also need to go into the Web context in the Railo Admin and
add a /farcry mapping.

With ColdFusion the connector was able to relay the virtual directories
that were configure in the webserver back to the servlet engine, but Railo
doesn’t do anything special in this regard, so you just need to add the
mapping yourself.

1 Like

Ok - so obviously I had to create the mappings in the Railo Server Admin. Ok - since this is global it was a one time thing anyways :smile:

But now - when running the install I get some errors again on some of the sql scripts. And it’s almost identical to the ones that reported errors when I ran the install on the shared host. Different server, different OS, different web server software - I think maybe something must be a bit ‘off’ in the installer files?

Well - I’ll get PhpMyAdmin up and run those sql scripts from there. That worked like a charm on the shared host.

Do you have any errors in the logs on this server?

If you’re unfamiliar with Apache, feel free to share your config for your VirtualHost. It’s unrelated to this problem, but could help alleviate potential other issues. Also, don’t forget to add index.cfm to your DirectoryIndex (I noticed that was missing on your domain).

There apache2/error.log does not show anything I find to be relevant to the install problem, and both the mysql.err and mysql.log are empty, but the mysql/error.log have some stuff in it. I can send it to you by email.

As for my virtual host config - it’s very basic I guess. I had to ‘dumb’ it down to get my virtual directory to work at all (you can read about it here: http://ubuntuforums.org/showthread.php?t=2220729).

Now it looks like this:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName trondulseth.com
ServerAlias *.trondulseth.com
DocumentRoot /var/vhosts/farcry/projects/trondulsethno/www
<Directory /var/vhosts/farcry/projects/trondulsethno/www/>
	Satisfy Any
	Allow from all
</Directory>

With a MySQL datasource you will need to tick a setting like “Allow
multiple statements” for the import scripts to run correctly. At the moment
I don’t know of an easier way to make this always work… We may have to do
some detection and then run the SQL insert statements one by one…

Also if you run those scripts manually, you’ll need to initialize the app
using /?updateall=your-app-key (note “all” not “app”) because the
refObjects table needs to be populated. The installer normally does this
for you.

Now I get another error - which I have not seen before…

Had it not been past midnight already in my corner of the world, I might have headed into the code to see what can cause this. For now I will let anyone else who might have a theory be free to express it here while I go and get some sorely needed beauty sleep :wink:

Justin, could it be fixed by wrapping each insert (or group of related inserts) in db transactions?

Do transactions trick the driver into allowing multiple statements? I can
give it a try :slight_smile:

Make sure you are running the latest mySQL driver. Depending on your version of Railo and mySQL server you may find some odd behaviour on earlier versions of the driver.

You want at least mysql-connector-java-5.1.25-bin.jar. Just drop this into the Railo lib directory at ./WEB-INF/lib.

Downloads available here: https://dev.mysql.com/downloads/connector/j/

A few other settings you’ll likely want to add to your Apache config (not sure if you’ll need the /farcry alias since Justin says you need to create a “farcry” cf mapping anyway for Railo - I know you don’t need to for CF):

#FarCry Friendly URLS
RewriteEngine On
RewriteCond %{REQUEST_URI} !(^/farcry|^/webtop|^/flex2gateway|^/flashservices|^/CFIDE)($|/)
RewriteRule ^([a-zA-Z0-9\/\-\%:\[\]\{\}\|\;\<\>\?\,\*\!\@\#\$\ \(\)\^_`~]*)$ /index.cfm?furl=$1 [L,PT,QSA]

Alias /webtop "/var/vhosts/farcry/core/webtop"
Alias /farcry "/var/vhosts/farcry"

As you have seen I am experiencing problems setting up FarCry on my own server. I managed to run the installer - though I had to trick it a little by taking out the sql insert files from the install directory of the skeleton - and then run all this inserts in phpmyadmin after I finished the install.

So a new project was created with the proper new project directory and files, and the db looks to be in order.

But opening the project I get an error saying:

No matching property [tablename] found

And the failing code was to be found on line 142 in farcry/core/packages/lib/db.cfc in the initialiseTableMetadata function.

I wrapped the failing line inside a cftry so that it now looks like this:

<cftry>
 <cfset variables.tables[this.tablemetadata[arguments.typename].tablename] = arguments.typename />
   <cfcatch>
     <cfdump var="#structkeyexists(arguments,"schema")#">
     <cfdump var="#arguments.schema#">
     <cfdump var="#arguments.typename#">
     <cfdump var="#this.tablemetadata#">
     <cfdump var="#cfcatch#">
     <cfabort>
    </cfcatch>

and this gives the following output, showing that the variable arguments.schema is true, but it is empty, and I think that is why the script is failing.

I believe the dog is burried here somewhere, but at least not yet am I able to figure out what exactly is going on/wrong and why…

It looks like it can’t find the table meta data.

  1. What database server are you using?
  2. Can you paste your database related settings from your
    farcryConstructor.com ? (dsn, dbtype, dbowner)
  3. Can you confirm that the table exists in the database?
  4. Does the schema (dbowner) of the table match your configuration?
    (Usually for H2, MySQL the dbowner should be blank, and for SQL server it
    should be set (default of “dbo.”)

I am thinking that somehow the wrong dbowner was used when you’re tables
were created…

1 Like

What I have done so far is:
Copy a project from our work server over to my server - still same error.
Then copy the FC core from our work server over to my server - still same error.

So I think we can very likely narrow it down to a DB issue - as you are saying Justin :smile:

  1. The database is MySQL (client version: 5.5.37)

  2. <cfset THIS.dsn = "trondulseth" /> <cfset THIS.dbType = "mysql" /> <cfset THIS.dbOwner = "" />

  3. Yes, the farcryPermission table exist and it is populated with data

  4. Now we are into unfamiliar territory for me - is the following image the info you are asking for?

Just out of curiosity, did you try updating the mysql driver that Geoff suggested?

It must have something to do with the way the tables were created, I’m just not 100% sure what the cause is…

I’ve done a couple of installs onto MySQL 5.5 (with Railo 4.1 express) today and they were successful. The trick is that you need to enable multiple query statements in the data source settings. On Railo 4.1 there is an option “Allow multiple Queries” that you just need to set to “true”:

On ColdFusion you need to add an option to the connection string, “allowMultiQueries=true”. Ben Nadel has blogged it here:

Can you try re-running the installer and making sure your datasource is set up to allow multiple queries to see if that resolves your issue?

1 Like

The “allow multiple queries” option totally solved the install issues. Thanks a bunch Justin.

However in the new project I still got the same error :frowning:

I then downloaded the last driver as per Geoffs suggestion:

I then renamed the old file with file extension .bak - and renamed the new one to the the same name as the old one:

I then restarted Railo/Tomcat, Apache and MySQL. And still I am getting the same error :frowning:

Hmmm ok… You may need to make the table names case insensitive for MySQL on Linux. Find the MySQL my.cnf (in /etc?) and set:

lower_case_table_names=1`

You’ll need to restart MySQL, drop the database and run the installer again.

You only need to place the new driver in ./lib, Java will work out which is the latest version if you don’t change the filename. You can also keep updating the driver in this way.