users@jersey.java.net

[Jersey] Re: Jersey REST Resource Config

From: Jennifer Sears <jsears_at_galtech.net>
Date: Fri, 11 Dec 2015 09:49:38 -0500

You need to provide a logging filter class to use depending on which
loggging framework you're using i.e.:
Logger jerseyLogger =
org.apache.logging.log4j.jul.LogManager.getLogManager().getLogger(IdentityRestApplication.class.getName());
registerInstances(new LoggingFilter(jerseyLogger, false));

On Fri, Dec 11, 2015 at 8:55 AM, Robert Middleton <osfan6313_at_gmail.com>
wrote:

> Hello,
>
> I'm using Jersey to create a REST-based web service, and I've got a
> question as to how to set Jersey up.
>
> My situtation is that I'm using jersey-container-servlet(2.22.1) from
> maven central on Tomcat 8. I have an application that looks like the
> following:
>
> @ApplicationPath( "foo" )
> public class MyApplication extends ResourceConfig {
>
> public MyApplication(){
> //register( new LoggingFilter() );
> property( ServerProperties.PROVIDER_CLASSPATH,
> "com.rm5248.testmavenjersey" );
> }
> }
>
> This works fine, until I un-comment the first line in the constructor( the
> call to register() ). At that point, I get a 404 error whenever I try to
> hit any of the REST endpoints. Am I doing something wrong here? From the
> documentation that I have read, it seems like this should work.
>
> -Robert Middleton
>