Open GoogleCodeExporter opened 9 years ago
To start with i have a few questions,
1. Are you building the default packaged version or have you made any changes
to the source before running this build?
2. You don't need to build the libinter.so file manually, you just need to run
the ffead-src/Debug/makeAll.sh script, it will automatically generate the
libweblib.so and the ffead-server folder for you and then you just need to go
to the newly generated ffead-src/Debug/ffead-server folder and run the
server.sh which will ultimately create the libinter.so file.
3. In any case can you also please share the generated ReflectorInterface.cpp
file so that i can actually check whats wrong?
Original comment by sumeet.chhetri@gmail.com
on 28 Nov 2012 at 5:44
Hi,
Am 28.11.2012 um 06:45 schrieb ffead-cpp@googlecode.com:
No changes were made to the code, just building the default package downloaded.
OK, did so. After starting the server the ffead.log telling me:
�
[28/11/2012 08:07:30] (CHServer) <info> :0
[28/11/2012 08:07:30] (CHServer) <info> :libinter.so: cannot open shared object
file: No such file or directory
[28/11/2012 08:07:30] (CHServer) <info> :Could not load Library
[28/11/2012 08:07:55] (CHServer) <info> :Intermediate code generation task
...
The console output says it cannot find directories
/data/work1/gui/ffead/src/Debug/ffead-server/web/flexApp/dcp/
/data/work1/gui/ffead/src/Debug/ffead-server/web/flexApp/components/
After accessing http://localhost:8080/welcome.html libinter.so is successfully
build this time (had errors last time I tried):
...
Building target: libinter.so
Invoking: GCC C++ Linker
g++ -L"../lib" -shared -o"libinter.so" ./AjaxInterface.o
./ApplicationInterface.o ./ReflectorInterface.o ./SerializeInterface.o
./DCPInterface.o ./WsInterface.o ./Component_TEST_BEAN.o
./Component_TEST_BEAN_Remote.o -lweblib -ldefault -lflexApp -loauthApp
Finished building target: libinter.so
cp -f libinter.so ../lib/
...
I think this is not necessary any more?
BTW:
How can I call/access the REST interface from the default package (that's the
reason why I want to use ffead)? Tried
http://localhost:8080/rest/controller/base{1}/power/exp{2}
but it does not work. My browser is telling me the link is not working.
Original comment by michael....@forward-tech.de
on 28 Nov 2012 at 8:06
Great!!
First check whether the http://localhost:8080/index.html loads up.
Then try accessing any other restful page like
http://localhost:8080/rest/path/rest1/add/1/2 or
http://localhost:8080/rest/controller/base2/power/exp5
Ok so the URL should be http://localhost:8080/rest/controller/base3/power/exp5,
you need to replace the {1} and {2} with actual numeric values to see the
output.
The server is trying to convert {1} and {2} to numeric values and is failing to
do so, hence you are facing this issue. Also is you check the application.xml
file it has a security section which says that the /rest/* URI is a protected
one, so the server should present you a login screen
Original comment by sumeet.chhetri@gmail.com
on 28 Nov 2012 at 8:21
Trying to adjust the code from the default project I added a
<restcontroller class="DefaultRestController">
<restfunction name="getRootMessage" meth="GET" baseUrl="/rest/rootmessage" />
</restcontroller>
to the application.xml and implemented a function
void DefaultRestController::getRootMessage()
{
ptree testMessageRoot;
ptree::iterator ptit = testMessageRoot.push_back(make_pair("root", "REST-interface entry point"));
std::ostringstream ostr;
write_xml(ostr, testMessageRoot);
response->setStatusCode("200");
response->setStatusMsg("OK");
response->setContent_type("text/plain");
response->setContent_str(ostr.str());
cout << "Processed 'root-message'-request inside DefaultRestController..." << endl;
}
Also added the signature to the header. But a call to
http://localhost:8080/rest/rootmessage dos not work. Did I forget something?
BTW, a change of the power function to
<restfunction name="power" meth="GET"
baseUrl="/rest/controller/base/{1}/power/exp/{2}">
works nicely (notice the {1} and {2} have their own section separated from
/base and /exp).
Best regards,
Michael
Am 28.11.2012 um 09:22 schrieb ffead-cpp@googlecode.com:
Original comment by michael....@forward-tech.de
on 28 Nov 2012 at 9:21
Whenever you make changes to a certain application for eg, default, first note
down the path where you are making those changes i would recommend
ffead-src/web/default/src and not ffead-src/Debug/ffead-server/web/default/src.
Once that is done build the changes by running "make all" inside
ffead-src/web/default/src/Debug. If everything is compiled and built
successfully then copy the resultant libdefault.so file to the
ffead-src/Debug/ffead-server/lib folder and now run
ffead-src/Debug/ffead-server/server.sh again, i think you are just forgetting
to compile your new changes.
the other way would be to change the files in ffead-src/web/default/src and
then inside ffead-src/Debug run the makeAll.sh script to build everythign for
you under ffead-src/DEbug/ffead-server.
Please let me know how this goes.
Original comment by sumeet.chhetri@gmail.com
on 28 Nov 2012 at 10:41
The error I am getting now is:
...
[28/11/2012 13:58:33] (ControllerHandler) <info> :Rest Controller Param/Method
Error
�
application.xml defines:
...
<restcontroller class="DefaultRestController">
<restfunction name="getRootMessage" meth="GET" baseUrl="/rest/get_root_message" />
</restcontroller>
...
The getRootMessage definitions is:
void DefaultRestController::getRootMessage()
{
ptree testMessageRoot;
ptree::iterator ptit = testMessageRoot.push_back(make_pair("root", "REST-interface entry point"));
std::ostringstream ostr;
write_xml(ostr, testMessageRoot);
response->setStatusCode("200");
response->setStatusMsg("OK");
response->setContent_type("text/plain");
response->setContent_str(ostr.str());
cout << "Processed 'root-message'-request inside DefaultRestController..." << endl;
}
Am 28.11.2012 um 11:41 schrieb ffead-cpp@googlecode.com:
Original comment by michael....@forward-tech.de
on 28 Nov 2012 at 1:04
Hi Michael,
The problem is, i am sure you have made changes to the
DefaultRestController.cpp/DefaultRestController.h in the
ffead-server/web/default/src folder. If you take a look at the include folder
inside ffead-server/web/default, it has all the header definition files for all
the business logic, it is here that you need to place the updated header file
DefaultRestController.h. Please make these changes and let me know if this
works for you.
Thanks,
Sumeet Chhetri
Original comment by sumeet.chhetri@gmail.com
on 29 Nov 2012 at 5:43
I need to update the existing source/binary to move all the header definitions
to the include folder, so that these issues can be avoided in the future, i
also think that the documentation needs to improve so that it can be more
helpful and easier for people to understand and implement. If you have any
other suggestions please do let me know.
Original comment by sumeet.chhetri@gmail.com
on 29 Nov 2012 at 5:48
Original issue reported on code.google.com by
michael....@forward-tech.de
on 26 Nov 2012 at 11:00