[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Re: Problem with starting CPPSERV
Well, when I run LD_LIBRARY_PATH= from cppserv-samples/ directory and try
to call one of our sample servlets, it behaives exactly the same: the
browser hangs. So I don't think it's related to my code.
However when I run it in gdb I get error messages. Here is what I do:
1. Run 'gdb --args cppserv -c engine.xml -P eng.pid' in my trunk directory.
2. Run 'run LD_LIBRARY_PATH=debug/libui
../../cppserv/debug/src/container/cppserv -P eng.pid -c engine.xml' in
gdb.
3. Get error message "libuu.so: cannot open shared object file: No such
file or directory"
4. Program exited with code 01.
I do have libuu.so in debug/libui directory.
When I do the same operation in cppserv-samples directory, I get
"libCommon.so: cannot open shared object file: No such file or directory"
error message despite of the fact that libCommon.so does exist in
cppserv-samples/debug/sharedata.
So looks like this problem related to library pathes, maybe something has
changed b/c of recent cppserv upgrade. I did try to remove "export
LD_LIBRARY_PATH=/usr/local/lib" line from my ./.bash_profile file, but it
didn't help either.
Hopefully this info may lead to some clues.
> Aah. So I was trying to diagnose wrong problem.
> OK. cppserv is working for you then. Your problem
> is somewhere in your code - it hangs before returning any
> data.
> My recommendation is to run CPPSERV under gdb
> (gdb --args cppserv -c engine.xml -P eng.pid)
> And see where it hangs. If you do Ctl+C when under GDB,
> you should be able to get a stack trace.
>
> sergey@total-knowledge.com wrote:
>> Nope, the browser just hangs when I call servlets.
>>
>>
>>> Are you still getting error 503?
>>>
>>> sergey@total-knowledge.com wrote:
>>>
>>>>> OK. This is strange, I admit. Try doing netstat -an after starting
>>>>> cppserv, to see where it really is listening.
>>>>>
>>>>>
>>>> Here is what I get after starting cppserv:
>>>> unix 2 [ ACC ] STREAM LISTENING 75497
>>>> /tmp/cppserv.sock
>>>>
>>>> When I start servlet in the browser, it adds:
>>>> unix 3 [ ] STREAM CONNECTED 75673
>>>> /tmp/cppserv.sock
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> Another thing - did you update apache mod_cserv? sudo make install
>>>>> should take care of that.
>>>>>
>>>>>
>>>>>
>>>> I did 'sudo make install' in my cppserv/ directory, got
>>>>
>>>> Linking mod_cserv
>>>> Installing debug/./src/mod_cppserv/mod_cserv.so into
>>>> //usr/lib64/apache/mod_cserv.so
>>>>
>>>> message, but it didn't resolve the issue.
>>>>
>>>> Another thing, after starting cppserv I get debug "Connecting to DB"
>>>> message which is used in my uudb class' constructor, if it may lead to
>>>> any
>>>> clues.
>>>>
>>>>
>>>>
>>>>
>>>>> sergey@total-knowledge.com wrote:
>>>>>
>>>>>
>>>>>> I went farther with debugging this issue and I think that cppserv is
>>>>>> listening on /tmp/cppserv.sock.
>>>>>>
>>>>>> First of all I confirmed that <listener> tag in engine.xml was
>>>>>> parsed
>>>>>> correctly. Here is the output:
>>>>>>
>>>>>> path = /tmp/cppserv.sock
>>>>>> protocol = unix
>>>>>>
>>>>>> Then in serverconfig.cpp I put debug message in
>>>>>> ServerConfig::GlobalContext::setListener()
>>>>>> and found out that RequestListener::UnixAcceptor(path) called with
>>>>>> correct
>>>>>> path = /tmp/cppserv.sock
>>>>>>
>>>>>> Then I checked requestlistener.cpp' RequestListener::UnixAcceptor()
>>>>>> and
>>>>>> found out that
>>>>>> int sock=socket(PF_UNIX,SOCK_STREAM,0); sock=4
>>>>>> ret=listen(sock,MAX_BACKLOG); ret=0
>>>>>>
>>>>>> No exceptions were thrown, so init() was called and
>>>>>> unsigned long flags = fcntl(sock,F_GETFL); flags=2
>>>>>>
>>>>>> Again, no exceptions were thrown.
>>>>>>
>>>>>> Any ideas?
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Mmm.. So, I guess it didn't quite work with parsing.
>>>>>>> Apparently cppserv is _not_ listening on /tmp/cppserv.sock,
>>>>>>> since you get connection refused.
>>>>>>>
>>>>>>> sergey@total-knowledge.com wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> I do use Unix domain sockets:
>>>>>>>>
>>>>>>>> <listener protocol="unix" path="/tmp/cppserv.sock"/>
>>>>>>>>
>>>>>>>> I tried to create my own socket using perl script but it didn't
>>>>>>>> help
>>>>>>>> either.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> Use unix domain sockets
>>>>>>>>> -----Original Message-----
>>>>>>>>> From: sergey@total-knowledge.com
>>>>>>>>> Date: Sun, 11 Mar 2007 17:39:09
>>>>>>>>> To:"C++ Servlet Engine Discussion" <cppserv@total-knowledge.com>
>>>>>>>>> Subject: Re: Problem with starting CPPSERV
>>>>>>>>>
>>>>>>>>> I checked both Apache logs(/var/log/syslog and
>>>>>>>>> /var/log/httpd/error_log)
>>>>>>>>> In /var/log/httpd/error_log I got
>>>>>>>>>
>>>>>>>>> [error] [client 127.0.0.1] Cannot connect to CPPSERV
>>>>>>>>> (/tmp/cppserv.sock):
>>>>>>>>> Connection refused
>>>>>>>>>
>>>>>>>>> Also I tried to specify host="localhost" in <listener> with no
>>>>>>>>> luck.
>>>>>>>>> I'm trying to find out if the parsed data actually loaded to
>>>>>>>>> constructors,
>>>>>>>>> but have trouble finding where this proccess takes place.
>>>>>>>>> Can you give me some hints which classes I should check in order
>>>>>>>>> to
>>>>>>>>> do
>>>>>>>>> it?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Connection properties are described in engine.xml
>>>>>>>>>> If it isn't set up right, it won't be connecting. Look at
>>>>>>>>>> apache logs.
>>>>>>>>>>
>>>>>>>>>> sergey@total-knowledge.com wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>> Which means you don't have apache connecting to your cppserv
>>>>>>>>>>>> instance.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>> Hmm.. why did it happen after recent changes to
>>>>>>>>>>> xmlserverconfig.cpp
>>>>>>>>>>> then?
>>>>>>>>>>> I don't think these things can be related, it worked well
>>>>>>>>>>> before.
>>>>>>>>>>> How can I connect apache to my cppserv instance?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Ilya A. Volynets-Evenbakh
>>>>>>>>>> Total Knowledge. CTO
>>>>>>>>>> http://www.total-knowledge.com
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>> --
>>>>>>> Ilya A. Volynets-Evenbakh
>>>>>>> Total Knowledge. CTO
>>>>>>> http://www.total-knowledge.com
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>> --
>>>>> Ilya A. Volynets-Evenbakh
>>>>> Total Knowledge. CTO
>>>>> http://www.total-knowledge.com
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>> --
>>> Ilya A. Volynets-Evenbakh
>>> Total Knowledge. CTO
>>> http://www.total-knowledge.com
>>>
>>>
>>>
>>
>>
>>
>
> --
> Ilya A. Volynets-Evenbakh
> Total Knowledge. CTO
> http://www.total-knowledge.com
>
>