Embedded jetty in efxclipse application [message #1720407] |
Mon, 18 January 2016 13:53 |
Ali Karimi Messages: 36 Registered: October 2015 |
Member |
|
|
Hey there,
i am trying to embed a jetty server into my efxclipse application and export a standalone runnable executable with the provided
tycho stubs generated by the efxclipse tooling in eclipse.
In short: Everything works fine, when running my application from eclipse. I have configured a servlet in the embedded jetty and i am
able to get a response when calling the servlet from a browser. The problem is, i am not able to reach the servlet when starting my
application from the generated executable file.
As far as a can see, the jetty server isn't running at all, but i am clueless why. I have created a small demo app demonstrating my
problem. Basically it consists of the usual 4 projects generated by the efxlipse tooling. I have added the dependencies to the embedded
jetty server and configured a servlet (e.g. HelloServlet.java).
Steps to get the demo running:
- Make sure you have jdk configured in your eclipse installation (i am using eclipse mars and jdk1.8_60)
- Download attached zip file
- In Eclipse choose -> Import -> General - > Exisiting Projects into workspace
- Select the downloaded zip file
- Import all 4 projects
- Open de.jetty.test.app/targetplatfrom/efxclipse_2.2.0_release.target in eclipse
- Select Set as target platfrom in the upper right corner
- Run .product file in de.jetty.test.app.product
After that a window should open showing a circle and you should be able to point a browser to the url http://127.0.0.1:8888/hello
Now when creating a runnable executable by running a mvn clean install on the de.jetty.test.app.releng/pom.xml file and executing the de.jetty.test.app.releng/build.xml ant script, an executable should be created. However when running this executable the servlet is not running. Unfortunately i have no idea why? As far as i can see i have included all required plugins in my .product file and set the start level and auto-start accordingly. However the server is not starting.
Anyone an idea what could be problem? I guess its only a tiny configuration problem, however i can not get it.
Thanks in advance...
[Updated on: Tue, 19 January 2016 07:39] Report message to a moderator
|
|
|
|
|
|
Re: Embedded jetty in efxclipse application [message #1720518 is a reply to message #1720415] |
Tue, 19 January 2016 07:34 |
Ali Karimi Messages: 36 Registered: October 2015 |
Member |
|
|
For anyone comming to this thread, it turns out that the jetty server is running but using a different port then the one i specified when running from eclipse.
From within eclipse one can specify the port by using a command line argument in the vm arguments section of the launching tab of the product file.
The following two, which i was using also in older versions of jetty are working when the application is started from eclipse. You only need one of those:
VM Arguments
-Dorg.osgi.service.http.port=8888
-Dorg.eclipse.equinox.http.jetty.http.port=8888
However, the resulting executable ignores those parameters although they exist in the eclipse.ini file. Also note the default port in jetty is 80.
This is also the reason why i did not recognize that the server is already running. I thought it was 8080.
[Updated on: Tue, 19 January 2016 07:35] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03904 seconds