Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Scout build-in diagnostics - how to call?
Scout build-in diagnostics - how to call? [message #1822786] Fri, 13 March 2020 14:01 Go to next message
Krzysztof Leja is currently offline Krzysztof LejaFriend
Messages: 55
Registered: April 2019
Member
Hi,
I found information that Scout has the ability to display additional diagnostics in a web browser, described among others here:
https://wiki.eclipse.org/Scout/NewAndNoteworthy/3.10#Diagnostic_Servlet
https://wiki.eclipse.org/Scout/Concepts/Servlets

In my *.ui.html.app.dev module I have the following, default entries in the file src/main/webapp/WEB-INF/web.xml:
<servlet>
    <servlet-name>diagnostics</servlet-name>
    <servlet-class>org.eclipse.scout.rt.server.admin.diagnostic.DiagnosticServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>diagnostics</servlet-name>
    <url-pattern>/diagnostics</url-pattern>
  </servlet-mapping>

But when I enter the above servlet address in the web browser (http://localhost:8082/diagnostics), then I get the answer:
HTTP ERROR 404
Problem accessing /diagnostics. Reason:
Not Found

In Eclipse console I get:
2020-03-12 18:57:10,260 INFO  [qtp717176949-62] org.eclipse.scout.rt.ui.html.UiServlet.sendNotFound(UiServlet.java:279) - 404_NOT_FOUND: GET /diagnostics - MDC[]


The same problem occurs in the production instance of my application.

What am I doing wrong?
Re: Scout build-in diagnostics - how to call? [message #1822862 is a reply to message #1822786] Mon, 16 March 2020 07:18 Go to previous messageGo to next message
Beat Schwarzentrub is currently offline Beat SchwarzentrubFriend
Messages: 214
Registered: November 2010
Senior Member
Hi Krzysztof,

Since the DiagnosticServlet shows details about database connections or webservice status, is only available in the rt.server module. Thus, it cannot be added to the UI server (rt.ui.html). Either you have to register it with the backend server's web.xml (and call it on localhost:8080) or you can try to copy the code to your own ui.html project and remove any server-specific code.

Regards,
Beat
Re: Scout build-in diagnostics - how to call? [message #1822887 is a reply to message #1822862] Mon, 16 March 2020 11:42 Go to previous messageGo to next message
Krzysztof Leja is currently offline Krzysztof LejaFriend
Messages: 55
Registered: April 2019
Member
Hi Beat,
I used your tip with backend server's web.xml solution.
But when I open http://localhost:8080/diagnostics URL in internet browse I get this message:
HTTP ERROR 403
Problem accessing /diagnostics. Reason:
Forbidden


I am logged in to the application, so do I have to do any other authorization actions here?

[Updated on: Mon, 16 March 2020 11:43]

Report message to a moderator

Re: Scout build-in diagnostics - how to call? [message #1822889 is a reply to message #1822887] Mon, 16 March 2020 12:16 Go to previous message
Beat Schwarzentrub is currently offline Beat SchwarzentrubFriend
Messages: 214
Registered: November 2010
Senior Member
Make sure that you have configured the authentication correctly.

web.xml:
  <servlet>
    <servlet-name>diagnostics</servlet-name>
    <servlet-class>org.eclipse.scout.rt.server.admin.diagnostic.DiagnosticServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>diagnostics</servlet-name>
    <url-pattern>/diagnostics</url-pattern>
  </servlet-mapping>

  <filter>
    <filter-name>AuthFilter</filter-name>
    <filter-class>com.example.foo.server.ServerServletFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>AuthFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>


Also make sure your user has the ReadDiagnosticServletPermission assigned.

If you still can't access the servlet, try debugging your ServerServletFilter. By adding a breakpoint and stepping through the code you should be able to find the reason why your request is rejected.

Regards,
Beat
Previous Topic:Saving users table customisation
Next Topic:Table with data not visible on mobile device
Goto Forum:
  


Current Time: Sun Nov 10 08:55:07 GMT 2024

Powered by FUDForum. Page generated in 0.03100 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top