Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] jetty 8 M1 annotation auto discover

Hi Paulo,

Sorry, not sure I understand? If you specify 3.0 in web.xml
for your webapp, does it work or not?

thanks,
Jan

On 28/08/10 10:34, Paulo Silveira - Caelum wrote:
Hi Jan

Thanks, comparing with test-annotations I ve discovered the problem: I
had changed my webdefault.xml to use version=3.0 and the corresponding
DTD. Quite odd to affect the autoloading like this. If I use a web.xml
with  version="3.0", it will neither autoload the classes.

Paulo

--
Paulo Silveira
Caelum | Ensino e Inovação
www.caelum.com.br
www.arquiteturajava.com.br



On Fri, Aug 27, 2010 at 7:36 PM, Jan Bartel<janb@xxxxxxxxxxx>  wrote:
Paulo,

Can you enable debugging, and look for lines like this:

Metadata-complete==true,  not processing annotations for context ...

parsing annotations

Scanning all classses for annotations: webxmlVersion=...
configurationDiscovered=...

Let me know which ones you see.

Also, you can look at the test-annotation webapp that comes
with the hightide distro and see what is different about it
to you webapp.

cheers
Jan

On 28/08/10 03:22, Paulo Silveira wrote:

Hello

I am having some trouble to use the classpath scan. I have a servlet
annotated as followed:
@WebServlet(urlPatterns = "/chat", asyncSupported = true)
public class ChatServlet extends HttpServlet {

If I start jetty 8M1 hightide with a war containing this servlets
inside webapps, the servlet is not mapped and I will get a 404 (in the
absence of a web.xml or even with a web.xml only declaring the webapp
and the 3.0dtd)

If I put an pretty simple web.xml inside, declaring:


<servlet>
     <servlet-name>X</servlet-name>
     <servlet-class>packagename.ChatServlet</servlet-class>
   </servlet>

   <servlet-mapping>
     <servlet-name>X</servlet-name>
     <url-pattern>/chat</url-pattern>
   </servlet-mapping>

It works.

Shouldnt these configurations inside hightide be enough for the
classpath scanning?

                <Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item>
                <Item>org.eclipse.jetty.webapp.WebXmlConfiguration</Item>
                <Item>org.eclipse.jetty.webapp.MetaInfConfiguration</Item>
                <Item>org.eclipse.jetty.webapp.FragmentConfiguration</Item>
                <Item>org.eclipse.jetty.plus.webapp.EnvConfiguration</Item>
                <Item>org.eclipse.jetty.plus.webapp.Configuration</Item>

  <Item>org.eclipse.jetty.annotations.AnnotationConfiguration</Item>

  <Item>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Item>

  <Item>org.eclipse.jetty.annotations.ContainerInitializerConfiguration
--
Paulo Silveira
Caelum | Ensino e Inovação
www.caelum.com.br
www.arquiteturajava.com.br
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users

--
Jan Bartel, Webtide LLC | janb@xxxxxxxxxxx | http://www.webtide.com

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users

--
Jan Bartel, Webtide LLC | janb@xxxxxxxxxxx | http://www.webtide.com


Back to the top