f



jersey / jackson application not accessable

Hello,

I'm new wil Java REST APIs, but not with REST generally. I have tested my R=
EST service and on the first try (everything is build in a "fat" package) i=
t works, but now I have split-up my application in a single package (for mo=
dularization), but if I use it in my Jetty server the URL is not accessable=
 (404 error).

The application uses a singleton element and I create a binding:

https://github.com/LightJason/REST/blob/master/src/main/java/org/lightjason=
/rest/CApplication.java#L44

The singleton class defines all services:

https://github.com/LightJason/REST/blob/master/src/main/java/org/lightjason=
/rest/CAgentProvider.java#L63

The pom.xml includes all neccessary dependencies:

https://github.com/LightJason/REST/blob/master/pom.xml#L128

Inside my web.xml I register the application:

https://github.com/APTD/Simulation/blob/master/src/main/webapp/web-inf/web.=
xml#L13

and use the singleton instance at=20

https://github.com/APTD/Simulation/blob/master/src/main/java/com/github/apt=
d/simulation/simulation/graph/network/CStationGenerator.java#L80

The application should produce this URLs:

https://github.com/LightJason/REST#usage

but this don't work. If I put the components from my REST project into the =
application, it will work, so I think I have done a mistake by building thi=
s package.
If you want to build all projects you need a dependency to https://github.c=
om/LightJason/AgentSpeak
All three projects are currently under heavy development, so sorry for this=
 patchwork

I expected when the application / resource class is loaded, it binds the si=
ngleton class (with the URL structure) and the dependency to jackson to the=
 server and so, I can get access to the URL., but I think there is a mistak=
e in my mind about the binding process.

Can you explain me, what I have done wrong?

Thanks

Phil
0
Philipp
11/29/2016 8:33:16 AM
comp.lang.java.programmer 52714 articles. 0 followers. Post Follow

2 Replies
99 Views

Similar Articles

[PageSpeed] 23

On 11/29/2016 3:33 AM, Philipp Kraus wrote:
> I'm new wil Java REST APIs, but not with REST generally. I have
> tested my REST service and on the first try (everything is build in a
> "fat" package) it works, but now I have split-up my application in a
> single package (for modularization), but if I use it in my Jetty
> server the URL is not accessable (404 error).

> but this don't work. If I put the components from my REST project
> into the application, it will work, so I think I have done a mistake
> by building this package. If you want to build all projects you need
> a dependency to https://github.com/LightJason/AgentSpeak All three
> projects are currently under heavy development, so sorry for this
> patchwork
>
> I expected when the application / resource class is loaded, it binds
> the singleton class (with the URL structure) and the dependency to
> jackson to the server and so, I can get access to the URL., but I
> think there is a mistake in my mind about the binding process.
>
> Can you explain me, what I have done wrong?

Anything relevant in the servers log file?

Arne

0
UTF
11/30/2016 1:57:13 AM
Hello,


Am Mittwoch, 30. November 2016 02:57:22 UTC+1 schrieb Arne Vajh=C3=B8j:
> Anything relevant in the servers log file?

No, it is my "localhost" test system, so no productive system:

[...] output logs of my internal data structure [...]

2016-11-30 08:44:26.338:INFO::main: Logging initialized @2340ms to org.ecli=
pse.jetty.util.log.StdErrLog
2016-11-30 08:44:26.523:INFO:oejs.Server:main: jetty-9.4.0.RC2
2016-11-30 08:44:26.523:WARN:oejs.Server:main: THIS IS NOT A STABLE RELEASE=
! DO NOT USE IN PRODUCTION!
2016-11-30 08:44:26.523:WARN:oejs.Server:main: Download a stable release fr=
om http://download.eclipse.org/jetty/
2016-11-30 08:44:26.758:INFO:oejs.session:main: DefaultSessionIdManager wor=
kerName=3Dnode0
2016-11-30 08:44:26.758:WARN:oejs.session:main: No SessionScavenger set, us=
ing defaults
2016-11-30 08:44:26.761:INFO:oejs.session:main: Scavenging every 660000ms
2016-11-30 08:44:27.830:INFO:oejsh.ContextHandler:main: Started o.e.j.w.Web=
AppContext@27ead29e{/,file:///Users/myuser/Documents/Simulation/target/clas=
ses/,AVAILABLE}{file:/Users/myuser/Simulation/target/classes/}
2016-11-30 08:44:27.859:INFO:oejs.AbstractConnector:main: Started ServerCon=
nector@62515a47{HTTP/1.1,[http/1.1]}{localhost:8000}
2016-11-30 08:44:27.860:INFO:oejs.Server:main: Started @3861ms

Phil
0
Philipp
11/30/2016 7:47:22 AM
Reply: