Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Scanning for annotations using embedded Jetty

You need more Configuration entries btw.

Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts

On Tue, Apr 1, 2014 at 10:34 AM, David Erickson <halcyon1981@xxxxxxxxx> wrote:
Hi I've got a simple embedded Jetty server that I'd like to have load Spring via Java config.  Jetty is correctly picking up the Spring Servlet initializer, but not finding my files on the classpath:

10:22:49.456 [main] INFO  / - No Spring WebApplicationInitializer types detected on classpath

My config is very simple:

        Server server = new Server(5050);

        MBeanContainer mbContainer = new MBeanContainer(ManagementFactory.getPlatformMBeanServer());


        WebAppContext context = new WebAppContext();



        context.setConfigurations(new Configuration[] {

                new WebXmlConfiguration(),

                new AnnotationConfiguration()





I found mention of this on stackoverflow here:

Which pointed to a fix by Jan here:

But I haven't had luck implementing this, and my Jetty API knowledge is pretty limited, so translating the text in Comment 5 to working code isn't happening.  Effectively I just want Jetty's annotation scanner to scan the entire (or some user defined subset) of the classpath/classloader that started Jetty in the first place.  Can anyone provide a minimal example of how to achieve this?



jetty-users mailing list

Back to the top