abrarShariar / ffead-cpp

Automatically exported from code.google.com/p/ffead-cpp
0 stars 0 forks source link

Building libinter.so #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Building the Library libinter.so manually because the ffead-logs telling me 
it is missing (auto-generation also fails)

What is the expected output? What do you see instead?
Building file: ReflectorInterface.cpp
Invoking: GCC C++ Compiler
g++ -I/data/work1/gui/ffead/src/Debug/ffead-server/web/default/include/ 
-I/data/work1/gui/ffead/src/Debug/ffead-server/web/flexApp/include/ 
-I/data/work1/gui/ffead/src/Debug/ffead-server/web/oauthApp/include/ 
-I/data/work1/gui/ffead/src/Debug/ffead-server/web/rest2cobol/include/  
-I../include -O0 -Wall -c -fmessage-length=0 -fPIC -MMD -MP 
-MF"ReflectorInterface.d" -MT"ReflectorInterface.d" -o"ReflectorInterface.o" 
"ReflectorInterface.cpp"
ReflectorInterface.cpp: In function »ClassInfo 
getReflectionCIForDefaultRestController()«:
ReflectorInterface.cpp:1840: Fehler: redefinition of »ClassInfo 
getReflectionCIForDefaultRestController()«
ReflectorInterface.cpp:243: Fehler: »ClassInfo 
getReflectionCIForDefaultRestController()« wurde vorher hier definiert
ReflectorInterface.cpp: In function »void 
invokeAdToVecForDefaultRestController(void*, void*)«:
ReflectorInterface.cpp:1884: Fehler: redefinition of »void 
invokeAdToVecForDefaultRestController(void*, void*)«
ReflectorInterface.cpp:287: Fehler: »void 
invokeAdToVecForDefaultRestController(void*, void*)« wurde vorher hier 
definiert
ReflectorInterface.cpp: In function »void* 
invokeGetNewVecForDefaultRestController()«:
ReflectorInterface.cpp:1885: Fehler: redefinition of »void* 
invokeGetNewVecForDefaultRestController()«
ReflectorInterface.cpp:288: Fehler: »void* 
invokeGetNewVecForDefaultRestController()« wurde vorher hier definiert
ReflectorInterface.cpp: In function »int 
invokeGetVecSizeForDefaultRestController(void*)«:
ReflectorInterface.cpp:1886: Fehler: redefinition of »int 
invokeGetVecSizeForDefaultRestController(void*)«
ReflectorInterface.cpp:289: Fehler: »int 
invokeGetVecSizeForDefaultRestController(void*)« wurde vorher hier definiert
ReflectorInterface.cpp: In function »void* 
invokeGetVecElementForDefaultRestController(void*, int)«:
ReflectorInterface.cpp:1887: Fehler: redefinition of »void* 
invokeGetVecElementForDefaultRestController(void*, int)«
ReflectorInterface.cpp:290: Fehler: »void* 
invokeGetVecElementForDefaultRestController(void*, int)« wurde vorher hier 
definiert
ReflectorInterface.cpp: In function »void* 
invokeReflectionCICtorForDefaultRestController(vals)«:
ReflectorInterface.cpp:2995: Fehler: redefinition of »void* 
invokeReflectionCICtorForDefaultRestController(vals)«
ReflectorInterface.cpp:2018: Fehler: »void* 
invokeReflectionCICtorForDefaultRestController(vals)« wurde vorher hier 
definiert
ReflectorInterface.cpp: In function »void 
invokeReflectionCIDtorForDefaultRestController(void*)«:
ReflectorInterface.cpp:3002: Fehler: redefinition of »void 
invokeReflectionCIDtorForDefaultRestController(void*)«
ReflectorInterface.cpp:2025: Fehler: »void 
invokeReflectionCIDtorForDefaultRestController(void*)« wurde vorher hier 
definiert
ReflectorInterface.cpp: In function »void* 
invokeReflectionCIMethodForDefaultRestControlleraddNumbersintint(void*, vals)«:
ReflectorInterface.cpp:3007: Fehler: redefinition of »void* 
invokeReflectionCIMethodForDefaultRestControlleraddNumbersintint(void*, vals)«
ReflectorInterface.cpp:2030: Fehler: »void* 
invokeReflectionCIMethodForDefaultRestControlleraddNumbersintint(void*, vals)« 
wurde vorher hier definiert
ReflectorInterface.cpp: In function »void* 
invokeReflectionCIMethodForDefaultRestControllerpowerintint(void*, vals)«:
ReflectorInterface.cpp:3015: Fehler: redefinition of »void* 
invokeReflectionCIMethodForDefaultRestControllerpowerintint(void*, vals)«
ReflectorInterface.cpp:2038: Fehler: »void* 
invokeReflectionCIMethodForDefaultRestControllerpowerintint(void*, vals)« 
wurde vorher hier definiert
make: *** [ReflectorInterface.o] Fehler 1

What version of the product are you using? On what operating system?
Linux 2.6.32-100.28.5.el6.x86_64 #1 SMP Wed Feb 2 18:40:23 EST 2011 x86_64 
x86_64 x86_64 GNU/Linux

I am in directory:
ffead/src/Debug/ffead-server/rtdcf

Please provide any additional information below.

Original issue reported on code.google.com by michael....@forward-tech.de on 26 Nov 2012 at 11:00

GoogleCodeExporter commented 8 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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
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