GroovyServ under FreeBSD?

已查看 24 次
跳至第一个未读帖子

Alexey Panteleev

未读,
2012年2月10日 20:46:282012/2/10
收件人 groov...@googlegroups.com
Hello, I am trying to see if I can deploy GroovyServ on a FreeBSD box.
Has anyone tried this before? Do you think it would work?

Everything seems to have compiled fine but my 'mvn install' gets stuck in the following test:

[INFO] --- maven-assembly-plugin:2.2-beta-5:single (assembly-zip) @ groovyserv ---
[INFO] Reading assembly descriptor: src/main/assembly/bin.xml
[INFO] Reading assembly descriptor: src/main/assembly/src.xml
[INFO] Building zip: /usr/home/alexey/tmp/groovysrv/groovyserv-0.9/target/groovyserv-0.9-freebsd-amd64-bin.zip
[INFO] Building zip: /usr/home/alexey/tmp/groovysrv/groovyserv-0.9/target/groovyserv-0.9-src.zip
[INFO] 
[INFO] --- maven-antrun-plugin:1.3:run (start-groovyserver) @ groovyserv ---
[INFO] Executing tasks
     [echo] Startup groovyserver for integration test
     [exec] Groovy home directory: (none)
     [exec] Groovy command path: /usr/local/bin/groovy (found at PATH)
     [exec] GroovyServ home directory: /usr/home/alexey/tmp/groovysrv/groovyserv-0.9/target/groovyserv-0.9.dir/groovyserv-0.9
     [exec] GroovyServ work directory: /home/alexey/.groovy/groovyserv
     [exec] Original classpath: (none)
     [exec] GroovyServ default classpath: /usr/home/alexey/tmp/groovysrv/groovyserv-0.9/target/groovyserv-0.9.dir/groovyserv-0.9/lib/*
     [exec] Killed groovyserver of 74802(1961)
     [exec] Restarting groovyserver

Alexey Panteleev

未读,
2012年2月10日 21:23:212012/2/10
收件人 groov...@googlegroups.com
 I think it is having trouble starting but possibly not because it is not possible but because I am running in a jail environment:

DEBUG: 2012/02/10 17:39:55.956 Recieved socket: Socket[addr=/XX.ZZ.CC.YY,port=58299,localport=1961]
2012/02/10 17:39:55.968 Cannot accept except loopback address: Socket[addr=/XX.ZZ.CC.YY,port=58299,localport=1961]

 Any ideas? Can you please explain those log messages?

Thanks

Yasuharu Nakano

未读,
2012年2月10日 23:00:072012/2/10
收件人 groov...@googlegroups.com
Hi Alexey,

GroovyServ cannot allow the access except from loopback address from a
point of view of security.
If you can change the policy, based on your responsibility, comment
out the lines 81..84 in
src/main/groovy/org/jggug/kobo/groovyserv/GroovyServer.groovy:

//if (!socket.localSocketAddress.address.isLoopbackAddress()) { //
only from localhost
//    DebugUtils.errorLog "Cannot accept except loopback address: ${socket}"
//    continue
//}

But it's too risky, so I recommend changing the condition of the "if"
statement, which can accept only your IP address.


Regards,
--
Yasuharu NAKANO / nobeans

2012/2/11 Alexey Panteleev <ale...@yoxel.com>:

Alexey Panteleev

未读,
2012年2月11日 02:21:332012/2/11
收件人 groov...@googlegroups.com
Ok, thanks. The jail environment does not allow loopback but I can use
the assigned IP.
If you could add a command line parameter for this in the future that
would be great.

Yasuharu Nakano

未读,
2012年2月11日 02:55:092012/2/11
收件人 groov...@googlegroups.com
Ok, I'll consider the idea.

e.g.
$ groovyserv --allow-from=192.168.1.1,192.168.1.2

thanks.

2012/2/11 Alexey Panteleev <ale...@yoxel.com>:

Alexey Panteleev

未读,
2012年2月11日 02:59:512012/2/11
收件人 groov...@googlegroups.com
I changed the source code and now mvn tests went furhter.
now stuck on

Running org.jggug.kobo.groovyserv.ThreadIT

I wonder what is wrong now.

Alexey Panteleev

未读,
2012年2月11日 03:04:102012/2/11
收件人 groov...@googlegroups.com
Maybe this log output would help?

DEBUG: 2012/02/10 23:57:49.572 RequestWorker:64581: Future task of
handler is created: StreamRequestHandler:64581
DEBUG: 2012/02/10 23:57:49.573 RequestWorker:64581: Thread is created:
Thread[Thread-55,5,GServThreadGroup:64581:0]
DEBUG: 2012/02/10 23:57:49.573 RequestWorker:64581: Future task of
handler is created: GroovyInvokeHandler:64581
DEBUG: 2012/02/10 23:57:49.574 StreamRequestHandler:64581: Thread started
DEBUG: 2012/02/10 23:57:49.574 RequestWorker:64581: Thread is created:
Thread[Thread-56,5,GServThreadGroup:64581:1]
DEBUG: 2012/02/10 23:57:49.574 RequestWorker:64581: Request worker is started
DEBUG: 2012/02/10 23:57:49.575 GroovyInvokeHandler:64581: Thread started
DEBUG: 2012/02/10 23:57:49.576 putenv(PWD,
/usr/home/alexey/tmp/groovysrv/groovyserv-0.9)
DEBUG: 2012/02/10 23:57:49.576 GroovyInvokeHandler:64581: Invoking
groovy: [--classpath, ".", -e, Thread.start {; println('started');
while (true) {; Thread.sleep 100; }; println("end"); }; Thread.sleep
1000; Thread.currentThread().interrupt();]
DEBUG: 2012/02/10 23:57:49.591
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
DEBUG: 2012/02/10 23:57:49.591 Server->Client {
DEBUG: 2012/02/10 23:57:49.591 id: out
DEBUG: 2012/02/10 23:57:49.591 size(actual): 7
DEBUG: 2012/02/10 23:57:49.591 thread group: GServThreadGroup:64581:1
DEBUG: 2012/02/10 23:57:49.591 body:
DEBUG: 2012/02/10 23:57:49.591
+-----------+-----------+-----------+-----------+----------------+
DEBUG: 2012/02/10 23:57:49.591 73 74 61 72 74 65 64
| started
DEBUG: 2012/02/10 23:57:49.591
+-----------+-----------+-----------+-----------+----------------+
DEBUG: 2012/02/10 23:57:49.591 }
DEBUG: 2012/02/10 23:57:49.591
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
DEBUG: 2012/02/10 23:57:49.592
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
DEBUG: 2012/02/10 23:57:49.592 Server->Client {
DEBUG: 2012/02/10 23:57:49.592 id: out
DEBUG: 2012/02/10 23:57:49.592 size(actual): 1
DEBUG: 2012/02/10 23:57:49.592 thread group: GServThreadGroup:64581:1
DEBUG: 2012/02/10 23:57:49.592 body:
DEBUG: 2012/02/10 23:57:49.592
+-----------+-----------+-----------+-----------+----------------+
DEBUG: 2012/02/10 23:57:49.592 0a
| ?
DEBUG: 2012/02/10 23:57:49.592
+-----------+-----------+-----------+-----------+----------------+
DEBUG: 2012/02/10 23:57:49.592 }
DEBUG: 2012/02/10 23:57:49.592
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
DEBUG: 2012/02/10 23:57:50.593 GroovyInvokeHandler:64581: All sub
threads are joining....

Alexey Panteleev

未读,
2012年2月11日 03:12:552012/2/11
收件人 groov...@googlegroups.com
Overall, the following seems to be working fine, and much faster then
using groovy -e
groovyclient -e "println('Hello, GroovyServ!')"

Just not sure how the mvn tests are supposed to finish and if the
threading is ok.

Also, from the start script in FreeBSD case I will get OS_MSYS=true
Do you think it would be better to use OS_DARWIN=true instead?
Does it change anything?

Thanks

Yasuharu Nakano

未读,
2012年2月11日 03:27:102012/2/11
收件人 groov...@googlegroups.com
What's the version of your FreeBSD? I found some article writing about
a former FreeBSD's problem of threading.
http://www.usenix.org/event/bsdcon03/tech/full_papers/baldwin/baldwin_html/node5.html
, etc.

OS_MSYS and OS_DARWIN is just reset in bin/groovyserver. So I think it
doesn't related to the issue...


2012/2/11 Alexey Panteleev <ale...@yoxel.com>:

--
Yasuharu NAKANO / nobeans

Alexey Panteleev

未读,
2012年2月11日 03:37:252012/2/11
收件人 groov...@googlegroups.com
Mine is FreeBSD 7.2-RELEASE-p1-jc2, much more recent than 4.x so I
dont think that article applies.

btw, if you want to test out GroovyServe on FreeBSD I could set up a
temp account for you.

Yasuharu Nakano

未读,
2012年2月11日 04:13:032012/2/11
收件人 groov...@googlegroups.com
I don't know if I can fix it, but could I try it?

2012/2/11 Alexey Panteleev <ale...@yoxel.com>:

--
Yasuharu NAKANO / nobeans

Alexey Panteleev

未读,
2012年2月20日 01:23:122012/2/20
收件人 groov...@googlegroups.com
So far GroovyServ has been working well for me under FreeBSD :)
But here something I ran into after a long period of inactivity:

Caught: my-package.persist.db.RuntimeSQLException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 261,708,661 milliseconds ago.  The last packet sent successfully to the server was 261,708,661 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.

I wonder if this is related to how GroovyServ is managing db connections or it is a general JVM thing and I could configure my own code better.

My script opens the db connection every time, is jvm really keeping the connections alive even when the script finishes? 

Any suggestions?
回复全部
回复作者
转发
0 个新帖子