To send errors to Rollbar from your Java application, you should use our rollbar-java package.



If your web server is implemented as a Servlet, you can configure and enable Rollbar entirely within your WEB-INF/web.xml file using rollbar-web:

<?xml version="1.0" encoding="UTF-8"?>
<web-app ...>
    <!-- Rollbar listener and filter -->

        <filter-name>Rollbar Filter</filter-name>
            <param-value>[{{ server_access_token }}]</param-value>
        <filter-name>Rollbar Filter</filter-name>

    <!-- Servlets -->

rollbar-web exposes a request listener and a filter which can be used to report all errors that occur during the request lifecycle to Rollbar. You can see a rollbar-web example on GitHub.


All configuration is done via the Config object in rollbar-java. You can see the interface here.