Inq Forums
September 08, 2010, 01:27:01 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Inq 1.0.2 - Hello World example added
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Problem with the inq starting script under OS X  (Read 2032 times)
fjossinet
Member

Posts: 4


« on: November 07, 2008, 11:11:58 am »

Dear Inq Team,

The inq script in the bin directory is not working under OSX. This is due to the readlink version used by OSX. The -f option is not available. But I think that this script can be simplified, since your online documentation precises that I have to define the INQHOME variable. Then I decided to simply remove these lines:

cmd=`basename $0`
#fp=`readlink -f $cmd`
fp=`readlink -f $0`
inqhome=`dirname $fp`
inqhome=`dirname $inqhome`
echo $fp

if [ "$INQHOME" = "" ]
then
  INQHOME=$inqhome
  export INQHOME
fi

And now it is working. BTW, I wasn't able to launch the HelloWorld example using the online documentation. Then, by reading the inq script, I understood that I have to do:

inq -server helloSrv.inq
inq -client helloClient.inq

Regards

Fabrice
Logged
Inqwell
Administrator

Posts: 5


Email
« Reply #1 on: November 07, 2008, 11:23:22 am »

Hi Fabrice

Thanks for trying Inq.

I have to say that at this time we haven't run Inq on OSX since launch, though we did try it to see what it looked like a few months prior...

Anyway, yes, readlink - I was a bit suspicious about that one. Of course, it's better to require INQHOME to be in the environment and not be too clever trying to set it. We'll fix that.

I think from what you say about launching the client and server that there is something else OSX doesn't like about the inq launch script. The arguments you add (helloClient/helloSrv) don't do anything but may be OSX doesn't like the shift statement? That's all I can think of.

Regards

Logged
fjossinet
Member

Posts: 4


« Reply #2 on: November 07, 2008, 12:11:55 pm »

Ok, after reading the "Execution modes" page of the documentation, I understand now that with the -server and -client options, this doesn't launch the Hello World application. I modified the launch script to print the command executed. If i'm typing "inq helloSrv.inq" I get:
"java -Dsun.java2d.nodddraw=true -Dinq.home=/Users/fjossinet/inq1_0_2 com.inqwell.any.parser.Inq helloSrv.inq"

If i'm typing "inq helloClient.inq", I get:
"java -Dsun.java2d.nodddraw=true -Dinq.home=/Users/fjossinet/inq1_0_2 com.inqwell.any.parser.Inq helloClient.inq"

So I think that the command line generated by the script is ok. But, in both cases, nothing happened. BTW, my version of java is 1.5.0_13.

If I'm doing "inq -in helloSrv.inq", the application exit with this message:
Inq done

If I'm doing "inq -in helloClient.inq", I got a stacktrace for these exceptions:
Inq done
Operand $root.ochannel could not be resolved
com.inqwell.any.AnyRuntimeException: Operand $root.ochannel could not be resolved

Then i decided to test the C2F example by typing "inq -in C2F.inq". Then I got a stacktrace for these exceptions:
java.net.UnknownHostException: Users

and

i18n is en
com.inqwell.any.AnyRuntimeException: Operand $catalog.{$root.i18n}.title could not be resolved

Thanx for your help,

Fabrice
Logged
fjossinet
Member

Posts: 4


« Reply #3 on: November 07, 2008, 12:22:29 pm »

But I just want to precise that several examples are working quite well, like:

inq -in doc1.inq
inq -in sum.inq
inq -in datechooser.inq

Fabrice

Logged
Inqwell
Administrator

Posts: 5


Email
« Reply #4 on: November 07, 2008, 01:08:30 pm »

Ok, after reading the "Execution modes" page of the documentation, I understand now that with the -server and -client options, this doesn't launch the Hello World application. I modified the launch script to print the command executed. If i'm typing "inq helloSrv.inq" I get:
"java -Dsun.java2d.nodddraw=true -Dinq.home=/Users/fjossinet/inq1_0_2 com.inqwell.any.parser.Inq helloSrv.inq"

If i'm typing "inq helloClient.inq", I get:
"java -Dsun.java2d.nodddraw=true -Dinq.home=/Users/fjossinet/inq1_0_2 com.inqwell.any.parser.Inq helloClient.inq"

So I think that the command line generated by the script is ok. But, in both cases, nothing happened. BTW, my version of java is 1.5.0_13.

In both these cases, as you can see from your modified script, the shell script is launching the com.inqwell.any.parser.Inq class. This is the so-called "interactive" mode. You are using Inq like perl, say, just as a plain scripting language and not client server.

Quote
If I'm doing "inq -in helloSrv.inq", the application exit with this message:
Inq done

The Inq (parser) has just parsed the file in the local environment, not loaded it into any long-running server. Since it doesn't produce any output that's all you get. You have defined the functions and typedef but then your parser terminates.

Quote
If I'm doing "inq -in helloClient.inq", I got a stacktrace for these exceptions:
Inq done
Operand $root.ochannel could not be resolved
com.inqwell.any.AnyRuntimeException: Operand $root.ochannel could not be resolved

Again, by launching the parser (as opposed to the client startup) you have no connection to the server and therefore no channel connecting you to anything. The helloClient.inq script tries to to the send initHello(); statement at line 41 and fails.

Quote
Then i decided to test the C2F example by typing "inq -in C2F.inq". Then I got a stacktrace for these exceptions:
java.net.UnknownHostException: Users

and

i18n is en
com.inqwell.any.AnyRuntimeException: Operand $catalog.{$root.i18n}.title could not be resolved

May be this is a better place to start - especially as we are OSX-lite...

I think the UnknownHostException is coming from inq's attempt to process the #include line. Perhaps you can provide the full stack trace. It carries on anyway but the files en.inq and fr.inq define the language strings including title, which it then falls over on...incidentally, if you add "-i18n fr" you get the French strings.

As a brutal fix, comment out the #include line and paste the lines from fr.inq in its place.

Inq forms a URL based on whatever was resolved for C2F.inq. This will be a file: URL and it seems to be getting confused about the "host" and path components. You could try something like
inq -in file:/Users/fjossinet/..../examples/C2F.inq (or whatever works) to help it along. This is a platform issue, I think, so I need to check it out on OSX.
Logged
Inqwell
Administrator

Posts: 5


Email
« Reply #5 on: November 07, 2008, 02:23:10 pm »

Something I forgot to mention - you need to use the -load option to load helloSrv.inq into the server before you try to login with inq -client

Regards,

Logged
nrg-b
Administrator

Posts: 2


WWW Email
« Reply #6 on: November 07, 2008, 03:19:24 pm »

Fabrice: Thanks for trying out Inq.  Like Tom says we've not tried under OSX recently.

I just want to make sure you're following the instructions for the hello world app which are in: http://www.inqwell.com/examples/helloworld/runhello.html

I've installed inq1_0_2.jar into my home area /home/inqwell :-

1. Set up INQHOME:
export INQHOME=/home/inqwell/inq1_0_2

2. Set up the PATH so that the inq launcher script is found :
export PATH=$INQHOME/bin:$PATH

3. Change you directory to the INQHOME
cd $INQHOME

3. Run the inq server in background. Otherwise run the inq server in another window (remembering to do steps 1, 2 and 3 above):
inq -server &

You will see some output like:-
Inq Server
Copyright (c) InqWell Ltd 2002-2008
Java Compiler Compiler Version 3.2 Copyright (c) 2003 Sun Microsystems, Inc. All  Rights Reserved.
DeadlockScanner Started
Server Started
speakinq Socket Listener Started on port 6556


4.  Load the HelloSrv code into the inq server. Please note the "-url" is relative - this is why you must change directory in step 3 before starting the server:
inq -load -u admin -p inqwell -serverHost speakinq://localhost -package system.server -url file:examples/helloworld/helloSrv.inq

You will see some output from the inq server like:
speakinq Socket Listener accepted on socket Socket[addr=/127.0.0.1,port=38236,localport=6556]
Socket closed


5. Now start the GUI client. On my unbuntu box I get some GTK l&f exceptions so I start with the default java L&F:
inq -client -lookandfeel none

You will see some output like:
Inq Client
Copyright (c) InqWell Ltd 2002-2008
Java Compiler Compiler Version 3.2 Copyright (c) 2003 Sun Microsystems, Inc. All  Rights Reserved.
JDateChooser Copyright (c) Kai Toedter 1999 - 2006
AnyClient: Connecting by socket to speakinq://localhost
speakinq Socket Listener accepted on socket Socket[addr=/127.0.0.1,port=38244,localport=6556]


Does any of that help?

In the meantime, we'll have to retry Inq on OS X and get back to you...

nrg-b.
Logged
fjossinet
Member

Posts: 4


« Reply #7 on: November 07, 2008, 04:13:21 pm »

Ok, sorry, I started my tests too quickly ;) With the details in http://www.inqwell.com/examples/helloworld/runhello.html it is working under OS X. It was only necessary for me to precise an absolute path for the url parameter. But I think that this is due to the fact that I used a symbolic link to go into my inq directory.

Thank you for your help.

Fabrice
Logged
nrg-b
Administrator

Posts: 2


WWW Email
« Reply #8 on: November 07, 2008, 04:24:22 pm »

Ok, sorry, I started my tests too quickly ;) With the details in http://www.inqwell.com/examples/helloworld/runhello.html it is working under OS X. It was only necessary for me to precise an absolute path for the url parameter. But I think that this is due to the fact that I used a symbolic link to go into my inq directory.

Thank you for your help.

Fabrice

Phew. No worries! :-) I am really pleased the Inq HelloWorld worked for you as we were scratching our heads thinking we'd need to obtain OS X from somewhere!!
Just out of interest did you try the chat example ? (The instructions are almost exactly the same).

Bharat.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!