Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFMessagePortCreateLocal failed Error



"Erik" <email@hidden> wrote:

>I have a java application that I usually run via a shell script on OS X.

What happens if you eliminate the shell-script, and exec() the 'java'
command directly? Your shell-script isn't using any shell facilities that
can't be done easily in Java (e.g. env-vars, globbing, I/O redirection,
etc.). It should be a fairly simple matter to replace the single command
with the sub-array of Strings:
{ "java", "-cp", "<yourJar>", "stalLab.NeuralNet", ..etc.. }

Or is that impossible?


>I recently upgraded a few days before to 10.2, so this may be the cause (I
>can't be sure as I didn't test this application until a few days later). It
>worked fine a week ago under 10.1.5.

The default PATH environment-variable is smaller in 10.2 than it was in
10.1.*. Several directories that were there have been omitted in 10.2. It
took me a while to figure this out, at which point I edited my shell
dot-file. There may be additional changes to the default environment. I
didn't investigate all the differences.

And I hope you're using 10.2.1, because 10.2.0 has a generous sprinkling of
bugs that I think you'd prefer to avoid. The only program I ran under
10.2.0 was Software Update, to install the 10.2.1 update.


>#! /bin/sh
>
>java -cp
>"/Applications/tomcat-4.0-b5/webapps/ROOT/javaprograms/NeuralNet.jar"
> stahlLab.NeuralNet $* ;

This probably has nothing to do with your failure, but if any arg to the
shell-script contains embedded spaces, then $* won't expand the way you
think it will. I think the space-preserving "all args passed to script"
form is "$@" (the quotes are necessary), but check 'man sh' to be sure.

Not getting arg-expansion correct is how you get fun surprises using
commands like 'rm -R'.

-- GG
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.