-
1. Re: Problem getting simple Srping (Servlet 3.0) application work on JBOSS.
jaikiran Oct 16, 2013 2:07 AM (in response to dozherel)Danil, I had quick look at that project and I don't see any Java EE or Servlet 3.0 related thing in there. Furthermore, I don't think many volunteers here will even go ahead and check it out. So please post the relevant code here and also a some more details of what exactly isn't working.
-
2. Re: Problem getting simple Srping (Servlet 3.0) application work on JBOSS.
dozherel Oct 16, 2013 12:04 PM (in response to jaikiran)Did I post the wrong git? The example is here https://github.com/geowarin/spring-mvc-examples/tree/master/mvc-base.
I thought the best way to 'show' an issue is a link to complete project. This project mvc-base is a type I tried to make work on Jboss eap.
It is Spring 3.2 Servlet 3.0 based and has no xml configs (including web.xml). As I said before I spent some time trying to make it works but failed.
It works find on others Servlet 3.0 compatible servers. There is no visible 'errors' application get deployed and it everything seems OK but servlet mapping isn't working as it suppose to. I'm trying to get help from people who have working spring application configured without web.xml using Servlet 3.0 approach.
Thank you!
Dan
-
3. Re: Problem getting simple Srping (Servlet 3.0) application work on JBOSS.
jrantav Oct 18, 2013 4:37 PM (in response to dozherel)What I do see is someone trying to use xml-less Spring configuration. The way it works is that one extends AbstractAnnotationConfigDispatcherServletInitializer and that implements WebApplicationInitializer, which is picked up by SpringServletContainerInitializer which should be initialized by any Servlet 3.0-compatible container. Which it does, but somehow it binds the classes to a context that doesn't get the requests with JBoss EAP 6.1 at least, even though it is happening and working on Tomcat 7.
-
4. Re: Problem getting simple Srping (Servlet 3.0) application work on JBOSS.
jrantav Oct 18, 2013 4:27 PM (in response to dozherel)I think this is the same issue:
spring mvc dispatcher servlet mapping
It looks as if JBoss and AbstractAnnotationConfigDispatcherServletInitializer don't play together.
However, here's another example app which works: https://github.com/Pyrolistical/xml-free-spring
From this article: http://pyrolistical.github.io/blog/2011/10/23/spring-without-xml/
This works fine on my EAP 6.1. That one doesn't use AbstractAnnotationConfigDispatcherServletInitializer, but instead implements WebApplicationInitializer. Abstract... implements that too, but it might be that JBoss deployment scanner doesn't pick that up.
-
5. Re: Problem getting simple Srping (Servlet 3.0) application work on JBOSS.
dozherel Oct 28, 2013 5:00 PM (in response to dozherel)Thank you guys for replies!
Yes Jarkko It's the same issue I've run into with my project (the one you reference too). I do use WebApplicationInitializer though and problem persist.
The application example you provided isn't correct. It uses wrong servlet mapping
servlet.addMapping("/*");
it does work for this application since there is no jsp pages and the only output come from controller itself. The correct servlet mapping should not have '*' and than corrected it's the same issue. So I'm still looking for an answer here . I've checked with Spring guys too but haven't got anything back from them (yet).
Again I would really appreciate if someone will find a working solution for this type of the project.
Thanks!
Dan.
-
6. Re: Problem getting simple Srping (Servlet 3.0) application work on JBOSS.
arthurvernon Dec 28, 2014 11:13 PM (in response to dozherel)See Bug 1094248 – [QE] (6.3.0) Default servlet can't be overridden without web.xml
I have also tried (as suggested) to add a web.xml file to my war. This did not solve my problem either - the DispatcherServlet was still not being called. The response to this issue I got from JBoss is as follows:
“Because of a bug on JBoss EAP, the default Servlet can't be overridden programmatically, which is how a Spring Boot application initializes.”