RE: Servlet with Osgi bundle issue

Scarletake Bwi, modified 2 Years ago. Expert Posts: 327 Join Date: 12/20/10 Recent Posts

hi 

i am follow Servlets-in-a-Module, create an api module.

but when i try access the servlet (http://localhost:8080/o/cwh/trigger/), i got 

2023-08-04 10:16:02.280 WARN  [https-jsse-nio-443-exec-40][code_jsp:159] {code="404", msg="ProxyServlet: /cwh/trigger/", uri=/o/cwh/trigger/}
2023-08-04 10:16:10.326 WARN  [https-jsse-nio-443-exec-23][code_jsp:159] {code="404", msg="ProxyServlet: /cwh/trigger", uri=/o/cwh/trigger}
 

@Component(immediate = true, property = { 
		"osgi.http.whiteboard.context.path=/"
		,"osgi.http.whiteboard.servlet.name=com.dpc.ci.cwh.servlet.ChatWebhook"
		, "osgi.http.whiteboard.servlet.pattern=/cwh/trigger/*"
}
		, service = Servlet.class)
public class ChatWebhook extends HttpServlet {

can anyone help please, thanks in advance.

thumbnail
Olaf Kock, modified 2 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts

You seem to be missing the /o/ in the URL (pointing to where the OSGi framework listens).

Try http://localhost:8080/o/cwh/trigger/

Scarletake Bwi, modified 2 Years ago. Expert Posts: 327 Join Date: 12/20/10 Recent Posts

hi Olaf

i updated the question,  sorry for missed the /o/,

I use http://localhost:8080/o/cwh/trigger/ 

got that error message. 

 

and, it was works fine for a while,  for some reason I do not know, it doesn't work, and I got the error message. 

Scarletake Bwi, modified 2 Years ago. Expert Posts: 327 Join Date: 12/20/10 Recent Posts

for record

it's weare, i deleted folder "osgi/state", and copied a new (orangnal) osgi/state, and restart server.

the servlet is back.

Scarletake Bwi, modified 2 Years ago. Expert Posts: 327 Join Date: 12/20/10 Recent Posts

update

it's weird, i delete /osgi/state and copy an original /osgi/state, restart server, it works again.