mac martine

April 10, 2008

Installing Coldfusion and JRun on OS X

I spent a lot of time getting ColdFusion to run on Leopard. I wish I had kept better track of all the errors I sorted through on path to figuring it out, but unfortunately I didn't.
Here were the biggies though. First make sure to get Update 7 for JRun. I didn't find the updates at first which slowed me down.

Additionally (and the most frustrating), is it turned out that setting java.home in jvm.config was not enough to make JRun use the specified JRE. I wanted it to use JVM 1.5.0. Running './jrun -info' (from the JRun bin directory) returned "Apple Inc. 1.5.0_13-119 Java HotSpot(TM) Client VM", so it appeared to be finding the JVM I wanted it to use, but it wasn't working. So I set the classpath in ~/.bash_profile as well. That didn't cut it either. Finally I found Steven Erat's entry where he had similar issues.

What did resolve it was to change the CurrentJDK alias in System/Library/Frameworks/JavaVM.framework/Versions in addition to the changes already made.
Steven's entry has good directions on how to do so. It seemed to me that setting java.home in jvm.config should have taken care of everything, but it didn't You can to set the JVM in 3 places.

Once I had it running with JDK 1.5, I'd get this error:

Error 500

Could not invoke Java compiler, please make sure jikesw is in /Applications/JRun4/bin or put a JDK bin directory in your path.

jrunx.compiler.JavaCompiler$NoCompilerFoundException: Could not invoke Java compiler, please make sure jikesw is in /Applications/JRun4/bin or put a JDK bin directory in your path.
at jrunx.compiler.JavaCompiler.outProcessCompile(JavaCompiler.java:474)
.................

Basically it can't find javac, and I still have no idea why. The servers running but the sample JSP's aren't getting compiled. You could probably just compile the apps manually but I haven't done that.

Well, there's no great solution here, but hopefully this'll help you to get going with whatever you decide. The problem with changing the CurrentJDK alias to 1.4.2 is that then everything on your system will be using that. That's a hassle for me with all my Eclipse installs, etc where I need JDK 1.5.

April 09, 2008

Adding a user to sudoers file

On Linux you'll need to add your user account to the sudoers file so you can run certain tasks as a superuser (sudo, su). Here's an easy way:

Log in with your user account (not as root):
[martine@machine ~]# sudo
Password:
[root@machine martine]# chmod +w /etc/sudoers
[root@machine martine]# echo 'martine ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
[root@machine martine]# chmod -w /etc/sudoers

April 08, 2008

Crossdomain.xml files in Rails projects

Usually when you need to allow a swf on one server access to data on another domain you would put a crossdomain.xml file in the root folder of that server.

I've found one exception which is if you are making a call to Rails the crossdomain.xml file to the 'public' folder of your Rails project.

April 03, 2008

Resolving gcc errors installing sqlite3 gem on Leopard

The following error kept coming up when trying to install Sqlite3 on OS X (actually, the same thing happened when trying to install Fink too). It was finally resolved by installing the latest XCode packages.

Running ‘sudo ./configure --prefix=/usr/local’

would return:

checking build system type... i386-apple-darwin9.2.2
checking host system type... i386-apple-darwin9.2.2
checking for gcc... gcc
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.


Here’ all the important stuff from the log:

## ----------- ##
## Core tests. ##
## ----------- ##

configure:2062: checking build system type
configure:2080: result: i386-apple-darwin9.2.2
configure:2102: checking host system type
configure:2117: result: i386-apple-darwin9.2.2
configure:2187: checking for gcc
configure:2203: found /usr/bin/gcc
configure:2214: result: gcc
configure:2452: checking for C compiler version
configure:2459: gcc --version >&5
i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2462: $? = 0
configure:2469: gcc -v >&5
Using built-in specs.
Target: i686-apple-darwin8
Configured with: /private/var/tmp/gcc/gcc-5367.obj~1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=powerpc-apple-darwin8 --with-arch=nocona --with-tune=generic --program-prefix= --host=i686-apple-darwin8 --target=i686-apple-darwin8
Thread model: posix
gcc version 4.0.1 (Apple Computer, Inc. build 5367)
configure:2472: $? = 0
configure:2479: gcc -V >&5
gcc: argument to `-V' is missing
configure:2482: $? = 1
configure:2505: checking for C compiler default output file name
configure:2532: gcc conftest.c >&5
/usr/bin/ld: /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../libSystem.dylib unknown flags (type) of section 6 (__TEXT,__literal16) in load command 0
collect2: ld returned 1 exit status
configure:2535: $? = 1
configure:2573: result:
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "sqlite"
| #define PACKAGE_TARNAME "sqlite"
| #define PACKAGE_VERSION "3.5.7"
| #define PACKAGE_STRING "sqlite 3.5.7"
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2580: error: C compiler cannot create executables
See `config.log' for more details.

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE_NAME "sqlite"
#define PACKAGE_TARNAME "sqlite"
#define PACKAGE_VERSION "3.5.7"
#define PACKAGE_STRING "sqlite 3.5.7"
#define PACKAGE_BUGREPORT ""

configure: exit 77

April 02, 2008

Flex and ColdFusion: RemoteObjects and WebServices

Once you have a ColdFusion CFC you can call it's methods with a RemoteObject or via a WebService. RemoteObjects are usually preferred for their performance speed.

Here we'll create a super basic example of calling a CFC from both a WebService and a RemoteObject. The application will simply let you enter your name, click a button, call the CFC and return a welcome message including your name.

Continue reading "Flex and ColdFusion: RemoteObjects and WebServices" »

Linux: chcon to change security context (to solve permissions problems with mounted shares)

On my Fedora server I was creating some shared folders that I could mount from my other machines.
So I created a Samba share, and chmod-ed the directories.
From my other machine I mounted a share and all seemed swell -- that is, until I tried to add a file. It kept telling me I didn't have sufficient permissions. Finally I figured out that chmod-ing was not enough, and that I had to change the context of the directory on the linux server:

chcon -R -t samba_share_t /path/to/share

I could then add files from the remote machine! Phew.

To get more info on the 'chcon' (change context) command, run 'info chcon'

March 24, 2008

Adobe Online Developer Week

Join us for the Adobe Online Developer Week which already under way!
http://adobe.com/go/2008_developer_week

There are a bunch of cool sessions about Flex, AIR, LCDS and more...