ECF / JaxRSProviders

Remote Services distribution provider based upon JaxRS. Includes imples based upon Jersey and CXF.
Apache License 2.0
13 stars 18 forks source link

Problem running the example com.mycorp.examples.student.remoteservice.host #45

Closed rmmalpica closed 1 year ago

rmmalpica commented 1 year ago

Hi:

I have just cloned the repository, imported the bundles in Eclipse and set ecf-jaxrs-2020-12.target as the platform target. Everything compiles fine but when I run the product StudentServer.zeroconf.jersey.product, I get this log:

2022-11-29 00:00:08.480:INFO::Start Level: Equinox Container: 076fca46-342e-4163-a085-e3255ec9fc0f: Logging initialized @3061ms to org.eclipse.jetty.util.log.StdErrLog 2022-11-29 00:00:08.707:INFO:oejs.session:Start Level: Equinox Container: 076fca46-342e-4163-a085-e3255ec9fc0f: DefaultSessionIdManager workerName=node0 2022-11-29 00:00:08.707:INFO:oejs.session:Start Level: Equinox Container: 076fca46-342e-4163-a085-e3255ec9fc0f: No SessionScavenger set, using defaults 2022-11-29 00:00:08.710:INFO:oejs.session:Start Level: Equinox Container: 076fca46-342e-4163-a085-e3255ec9fc0f: node0 Scavenging every 660000ms 2022-11-29 00:00:08.795:INFO:oejs.session:Start Level: Equinox Container: 076fca46-342e-4163-a085-e3255ec9fc0f: node0 Scavenging every 660000ms Nov 29, 2022 12:00:09 AM org.glassfish.jersey.internal.inject.Providers checkProviderRuntime WARNING: A provider com.mycorp.examples.student.remoteservice.host.StudentServiceImpl2 registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider com.mycorp.examples.student.remoteservice.host.StudentServiceImpl2 will be ignored. 00:00:15.048;EXPORT_REGISTRATION;exportedSR={com.mycorp.examples.student.StudentService}={service.exported.intents=[osgi.async,jaxrs], ecf.jaxrs.server.pathPrefix=/rs2, service.exported.configs=ecf.jaxrs.jersey.server, service.id=76, service.bundleid=5, service.scope=bundle, osgi.basic.timeout=1000000, component.name=com.mycorp.examples.student.remoteservice.host.StudentServiceImpl2, service.exported.interfaces=*, component.id=4};cID=URIID [uri=http://localhost:8080/rservices/rs2];rsId=1 --Endpoint Description---

com.mycorp.examples.student.StudentService ecf.jaxrs.jersey.server passByValue exactlyOnce ordered osgi.async osgi.private osgi.confidential jaxrs ecf.jaxrs.jersey.server osgi.async jaxrs

---End Endpoint Description Nov 29, 2022 12:00:15 AM org.glassfish.jersey.internal.inject.Providers checkProviderRuntime WARNING: A provider com.mycorp.examples.student.remoteservice.host.StudentServiceImpl registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider com.mycorp.examples.student.remoteservice.host.StudentServiceImpl will be ignored. 00:00:18.305;EXPORT_REGISTRATION;exportedSR={com.mycorp.examples.student.StudentService}={service.exported.intents=[osgi.async,jaxrs], ecf.jaxrs.server.pathPrefix=/rs1, service.exported.configs=ecf.jaxrs.jersey.server, service.id=81, service.bundleid=5, service.scope=bundle, osgi.basic.timeout=0, component.name=com.mycorp.examples.student.remoteservice.host.StudentServiceImpl, service.exported.interfaces=*, component.id=5};cID=URIID [uri=http://localhost:8080/rservices/rs1];rsId=2 --Endpoint Description---

com.mycorp.examples.student.StudentService ecf.jaxrs.jersey.server passByValue exactlyOnce ordered osgi.async osgi.private osgi.confidential jaxrs ecf.jaxrs.jersey.server osgi.async jaxrs

---End Endpoint Description osgi>

I have tried in my browser http://localhost:8080/rservices/rs2/students, http://localhost:8080/rs2/students or just http://localhost:8080/students but I have always a 404. What am I doing wrong?

Thanks

PD: I am using linux (SLES15) and openjdk11

rmmalpica commented 1 year ago

ok, I have seen in another example that my url was wrong... I should use something like: http://localhost:8080/rservices/rs1/studentservice/students

The warning made me think that it was not executing correctly, but it looks like a minor jersey problem.

scottslewis commented 1 year ago

Hi

ok, I have seen in another example that my url was wrong... I should use something like: http://localhost:8080/rservices/rs1/studentservice/students

The warning made me think that it was not executing correctly, but it looks like a minor jersey problem.

Yes this warning is a little annoying in the OSGi context. I wish I could find a way to turn it off. If you know details about Jersey config please do let me know.

Feel free to ask any other questions about this provider and I'll respond as quickly as I can. There's actually a lot of jaxrs extension/customization that can be done...and the osgi services usage makes it pretty easy and dynamic (easier than using the Jaxrs annotations/extensions IMHO).

rmmalpica commented 1 year ago

This problem is mentioned here https://github.com/eclipse-ee4j/jersey/issues/3700 but it looks liket it is not finally considered a bug. I tried using a ResourceConfig and registering the classes but did not remove the warnings. I will let you know if I finally find something.