From cheetah at monkeysintown.com Thu May 1 22:44:55 2014 From: cheetah at monkeysintown.com (Aleksandar Vidakovic) Date: Fri, 02 May 2014 03:44:55 +0100 Subject: [undertow-dev] Undertow + CXF + Spring single JAR Message-ID: <536306A7.4090405@monkeysintown.com> Hi, ... I tried to package a CXF project with fairly standard WAR setup (CXFServlet in web.xml configured) and some additional Spring configuration (nothing fancy) in a single JAR (with Maven Shade plugin). 99% is working (Undertow is starting, Spring context gets initialized), but CXF has a problem picking up a transport. I thought that it would just behave the same like in a servlet container environment, but apparently something is missing. This is the exception that I get: [console] Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.cxf.jaxrs.spring.JAXRSServerFactoryBeanDefinitionParser$SpringJAXRSServerFactoryBean---72839183': Invocation of init method failed; nested exception is org.apache.cxf.service.factory.ServiceConstructionException at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) at org.apache.cxf.transport.servlet.CXFServlet.createSpringContext(CXFServlet.java:151) at org.apache.cxf.transport.servlet.CXFServlet.loadBus(CXFServlet.java:74) at org.apache.cxf.transport.servlet.CXFNonSpringServlet.init(CXFNonSpringServlet.java:76) at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:214) at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:119) at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:501) at com.hotlabuyo.rest.server.Main.main(Main.java:51) Caused by: org.apache.cxf.service.factory.ServiceConstructionException at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:205) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1681) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1620) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549) ... 16 more Caused by: org.apache.cxf.BusException: No DestinationFactory was found for the namespace http://cxf.apache.org/transports/http. at org.apache.cxf.bus.managers.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:122) at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:79) at org.apache.cxf.endpoint.ServerImpl.(ServerImpl.java:63) at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:160) ... 23 more [/console] ... and the relevant piece of configuration for CXF looks like this: [config] ... ... [/config] Any help with this would be much appreciated. Thanks in advance and cheers, Aleks From sahmed1020 at gmail.com Sun May 4 15:51:01 2014 From: sahmed1020 at gmail.com (S Ahmed) Date: Sun, 4 May 2014 15:51:01 -0400 Subject: [undertow-dev] few questions about undertow and asych nature Message-ID: Hello, I have a few questions I was hoping someone could clarify some things for me. 1. Undertow is asych by nature like netty etc., are there currently libraries that are asych when you need to connect to popular services like mysql (hibernate), memcached, and redis? 2. If there are no libraries for #1, is it common pracitise to then create a seperate thread pool and somehow execute blocking queries in a seperate thread pool? 3. are there any big names using undertow currently or is it a very fresh framework that is just getting started? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140504/ab2b8d93/attachment.html From draganj at gmail.com Mon May 5 06:08:16 2014 From: draganj at gmail.com (Dragan Jotanovic) Date: Mon, 5 May 2014 11:08:16 +0100 Subject: [undertow-dev] Adding JSP support Message-ID: Hi, does anyone have code example of how to configure Undertow with JSP support? I didn't find any information on this in documentation. Thanks, Dragan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140505/007c0c77/attachment.html From jason.greene at redhat.com Mon May 5 18:10:54 2014 From: jason.greene at redhat.com (Jason Greene) Date: Mon, 5 May 2014 17:10:54 -0500 Subject: [undertow-dev] few questions about undertow and asych nature In-Reply-To: References: Message-ID: <3802EA73-90FF-448F-9E94-9FB5087A3BB1@redhat.com> On May 4, 2014, at 2:51 PM, S Ahmed wrote: > Hello, > > I have a few questions I was hoping someone could clarify some things for me. > > 1. Undertow is asych by nature like netty etc., are there currently libraries that are asych when you need to connect to popular services like mysql (hibernate), memcached, and redis? For data stores just about everything out there involves blocking. There are some experimental non-blocking drivers, but most of them are just doing threads under the hood which isn?t better than a blocking solution, since Undertow provides you a way to do that already. Regardless of whether or not you need blocking activity, Undertow?s non blocking behavior can efficiently handle inactive connections, and you can also mix in pure non blocking aspects. For example, you can cache common static info in your application, or hardwire routing rules in a non blocking fashion. Undertow?s proxy capability is also completely non-blocking. > 2. If there are no libraries for #1, is it common pracitise to then create a seperate thread pool and somehow execute blocking queries in a seperate thread pool? If you are implementing a handler, you can do this: exchange.startBlocking(); if (exchange.isInIoThread()) { exchange.dispatch(this); } else { this.handleRequest(exchange); } Otherwise you can use the servlet API and get blocking behavior as well (without the non blocking . > > 3. are there any big names using undertow currently or is it a very fresh framework that is just getting started? It?s still relatively new. However, WildFly (previously known as JBoss Application Server) is based on Undertow, so it does get heavy usage. -- Jason T. Greene WildFly Lead / JBoss EAP Platform Architect JBoss, a division of Red Hat From jason.greene at redhat.com Mon May 5 18:10:54 2014 From: jason.greene at redhat.com (Jason Greene) Date: Mon, 5 May 2014 17:10:54 -0500 Subject: [undertow-dev] few questions about undertow and asych nature In-Reply-To: References: Message-ID: <8EE2D971-5752-48C4-B80A-3248938476A6@redhat.com> On May 4, 2014, at 2:51 PM, S Ahmed wrote: > Hello, > > I have a few questions I was hoping someone could clarify some things for me. > > 1. Undertow is asych by nature like netty etc., are there currently libraries that are asych when you need to connect to popular services like mysql (hibernate), memcached, and redis? For data stores just about everything out there involves blocking. There are some experimental non-blocking drivers, but most of them are just doing threads under the hood which isn?t better than a blocking solution, since Undertow provides you a way to do that already. Regardless of whether or not you need blocking activity, Undertow?s non blocking behavior can efficiently handle inactive connections, and you can also mix in pure non blocking aspects. For example, you can cache common static info in your application, or hardwire routing rules in a non blocking fashion. Undertow?s proxy capability is also completely non-blocking. > 2. If there are no libraries for #1, is it common pracitise to then create a seperate thread pool and somehow execute blocking queries in a seperate thread pool? If you are implementing a handler, you can do this: exchange.startBlocking(); if (exchange.isInIoThread()) { exchange.dispatch(this); } else { this.handleRequest(exchange); } Otherwise you can use the servlet API and get blocking behavior as well (without the non blocking . > > 3. are there any big names using undertow currently or is it a very fresh framework that is just getting started? It?s still relatively new. However, WildFly (previously known as JBoss Application Server) is based on Undertow, so it does get heavy usage. -- Jason T. Greene WildFly Lead / JBoss EAP Platform Architect JBoss, a division of Red Hat From tomaz.cerar at gmail.com Tue May 6 18:03:25 2014 From: tomaz.cerar at gmail.com (=?UTF-8?B?VG9tYcW+IENlcmFy?=) Date: Wed, 7 May 2014 00:03:25 +0200 Subject: [undertow-dev] Adding JSP support In-Reply-To: References: Message-ID: JSP support is just another servlet you need to map, noting more. for example see how we create SevletInfo for JSP servlet https://github.com/wildfly/wildfly/blob/master/undertow/src/main/java/org/wildfly/extension/undertow/JSPConfig.java then all you need to do is add mappings where jsp servlet will listent to, usualy *.jsp... see https://github.com/wildfly/wildfly/blob/master/undertow/src/main/java/org/wildfly/extension/undertow/deployment/UndertowDeploymentInfoService.java#L553 to see what we do in WildFly to wire everything up, to be fair you probably don't need Injection stuff. -- tomaz On Mon, May 5, 2014 at 12:08 PM, Dragan Jotanovic wrote: > Hi, > does anyone have code example of how to configure Undertow with JSP > support? I didn't find any information on this in documentation. > > Thanks, > Dragan > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140507/00ef39c3/attachment.html From sdouglas at redhat.com Tue May 6 22:13:56 2014 From: sdouglas at redhat.com (Stuart Douglas) Date: Tue, 06 May 2014 19:13:56 -0700 Subject: [undertow-dev] Adding JSP support In-Reply-To: References: Message-ID: <536996E4.5030506@redhat.com> You need to make sure you have included the jastow artifact: io.undertow.jastow jastow 1.0.0.Final Then you can call io.undertow.jsp.JspServletBuilder#createServlet() to create a ServletInfo that represents the JSP servlet, and then use that to create any mappings you require (generally *.jsp). Make sure that you have set a ResourceManager on the deployment info (usually FileResourceManager or ClassPathResourceManager), as this is what is used to resolve the JSP pages. I have created a JIRA issue to improve the docs for this: https://issues.jboss.org/browse/UNDERTOW-234 Hopefully will get to it this week. Stuart Toma? Cerar wrote: > JSP support is just another servlet you need to map, noting more. > > for example see how we create SevletInfo for JSP servlet > https://github.com/wildfly/wildfly/blob/master/undertow/src/main/java/org/wildfly/extension/undertow/JSPConfig.java > then all you need to do is add mappings where jsp servlet will listent > to, usualy *.jsp... > > see > https://github.com/wildfly/wildfly/blob/master/undertow/src/main/java/org/wildfly/extension/undertow/deployment/UndertowDeploymentInfoService.java#L553 > to see what we do in WildFly to wire everything up, to be fair you > probably don't need Injection stuff. > > -- > tomaz > > > > On Mon, May 5, 2014 at 12:08 PM, Dragan Jotanovic > wrote: > > Hi, > does anyone have code example of how to configure Undertow with JSP > support? I didn't find any information on this in documentation. > > Thanks, > Dragan > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev > > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From sdouglas at redhat.com Tue May 6 22:15:55 2014 From: sdouglas at redhat.com (Stuart Douglas) Date: Tue, 06 May 2014 19:15:55 -0700 Subject: [undertow-dev] Undertow + CXF + Spring single JAR In-Reply-To: <536306A7.4090405@monkeysintown.com> References: <536306A7.4090405@monkeysintown.com> Message-ID: <5369975B.4060006@redhat.com> Can you post the code that you are using? Ideally as a github project I can try out? Off the top of my head the only thing I can think of is that maybe it is something to do with the ResourceManager setup. ResourceManager is used to resolve files in a war, so if a ResourceManager is not set CXF may not be able to find a config file it is after. Stuart Aleksandar Vidakovic wrote: > Hi, > > ... I tried to package a CXF project with fairly standard WAR setup > (CXFServlet in web.xml configured) and some additional Spring > configuration (nothing fancy) in a single JAR (with Maven Shade plugin). > > 99% is working (Undertow is starting, Spring context gets initialized), > but CXF has a problem picking up a transport. I thought that it would > just behave the same like in a servlet container environment, but > apparently something is missing. > > This is the exception that I get: > > [console] > > Exception in thread "main" > org.springframework.beans.factory.BeanCreationException: Error creating > bean with name > 'org.apache.cxf.jaxrs.spring.JAXRSServerFactoryBeanDefinitionParser$SpringJAXRSServerFactoryBean---72839183': > Invocation of init method failed; nested exception is > org.apache.cxf.service.factory.ServiceConstructionException > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) > at > org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) > at > org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) > at > org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) > at > org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) > at > org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703) > at > org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760) > at > org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) > at > org.apache.cxf.transport.servlet.CXFServlet.createSpringContext(CXFServlet.java:151) > at > org.apache.cxf.transport.servlet.CXFServlet.loadBus(CXFServlet.java:74) > at > org.apache.cxf.transport.servlet.CXFNonSpringServlet.init(CXFNonSpringServlet.java:76) > at > io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:214) > at > io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:119) > at > io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:501) > at com.hotlabuyo.rest.server.Main.main(Main.java:51) > Caused by: org.apache.cxf.service.factory.ServiceConstructionException > at > org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:205) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:483) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1681) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1620) > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549) > ... 16 more > Caused by: org.apache.cxf.BusException: No DestinationFactory was found > for the namespace http://cxf.apache.org/transports/http. > at > org.apache.cxf.bus.managers.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:122) > at > org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:79) > at org.apache.cxf.endpoint.ServerImpl.(ServerImpl.java:63) > at > org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:160) > ... 23 more > > [/console] > > ... and the relevant piece of configuration for CXF looks like this: > > [config] > > ... > > > > > > ... > > [/config] > > Any help with this would be much appreciated. > > Thanks in advance and cheers, > > Aleks > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From cheetah at monkeysintown.com Wed May 7 04:08:04 2014 From: cheetah at monkeysintown.com (Aleksandar Vidakovic) Date: Wed, 07 May 2014 09:08:04 +0100 Subject: [undertow-dev] Undertow + CXF + Spring single JAR In-Reply-To: <5369975B.4060006@redhat.com> References: <536306A7.4090405@monkeysintown.com> <5369975B.4060006@redhat.com> Message-ID: <5369E9E4.1080305@monkeysintown.com> Hi Stuart, ... someone from the CXF user list finally put me on the right track to solve this... Summary: there was a conflict with CXF's META-INF/bus-extensions.txt (there are multiple of those in different JARs) when merging all the dependencies with Maven Shade. I just had to treat these like META-INF/spring.handlers... now they get merged into one file (instead of being overwritten). I posted the details of the configuration here: http://mail-archives.apache.org/mod_mbox/cxf-users/201405.mbox/browser I didn't have to change anything with Undertow... it runs like a charm. Thanks again, Aleks On 07.05.2014 03:15, Stuart Douglas wrote: > Can you post the code that you are using? Ideally as a github project > I can try out? > > Off the top of my head the only thing I can think of is that maybe it > is something to do with the ResourceManager setup. ResourceManager is > used to resolve files in a war, so if a ResourceManager is not set CXF > may not be able to find a config file it is after. > > Stuart -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140507/6270369b/attachment-0001.html From draganj at gmail.com Wed May 7 12:29:10 2014 From: draganj at gmail.com (Dragan Jotanovic) Date: Wed, 7 May 2014 17:29:10 +0100 Subject: [undertow-dev] Adding JSP support In-Reply-To: References: Message-ID: Thanks, that's what I needed. Dragan On Tue, May 6, 2014 at 11:03 PM, Toma? Cerar wrote: > JSP support is just another servlet you need to map, noting more. > > for example see how we create SevletInfo for JSP servlet > https://github.com/wildfly/wildfly/blob/master/undertow/src/main/java/org/wildfly/extension/undertow/JSPConfig.java > then all you need to do is add mappings where jsp servlet will listent to, > usualy *.jsp... > > see > https://github.com/wildfly/wildfly/blob/master/undertow/src/main/java/org/wildfly/extension/undertow/deployment/UndertowDeploymentInfoService.java#L553 > to see what we do in WildFly to wire everything up, to be fair you > probably don't need Injection stuff. > > -- > tomaz > > > > On Mon, May 5, 2014 at 12:08 PM, Dragan Jotanovic wrote: > >> Hi, >> does anyone have code example of how to configure Undertow with JSP >> support? I didn't find any information on this in documentation. >> >> Thanks, >> Dragan >> >> _______________________________________________ >> undertow-dev mailing list >> undertow-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/undertow-dev >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140507/2979a749/attachment.html From marc.boorshtein at tremolosecurity.com Thu May 8 06:42:56 2014 From: marc.boorshtein at tremolosecurity.com (Marc Boorshtein) Date: Thu, 8 May 2014 06:42:56 -0400 Subject: [undertow-dev] Tls renegotiation from inside of servlet? Message-ID: Does undertow have a way that I could trigger a tls renegotiation from inside of a servlet/filter? (Ie to request a client certificate) Thanks Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140508/eb6de9a6/attachment.html From sdouglas at redhat.com Thu May 8 22:58:36 2014 From: sdouglas at redhat.com (Stuart Douglas) Date: Thu, 08 May 2014 19:58:36 -0700 Subject: [undertow-dev] Tls renegotiation from inside of servlet? In-Reply-To: References: Message-ID: <536C445C.40103@redhat.com> If you use Client cert auth then this should happen automatically. Otherwise you can do: io.undertow.servlet.handlers.ServletRequestContext.current().getExchange().getConnection().getSslSessionInfo().renegotiate(ServletRequestContext.current().getExchange(), SslClientAuthMode.REQUIRED); Stuart Marc Boorshtein wrote: > Does undertow have a way that I could trigger a tls renegotiation from > inside of a servlet/filter? (Ie to request a client certificate) > > Thanks > Marc > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From michaelremond at gmail.com Mon May 12 11:32:11 2014 From: michaelremond at gmail.com (=?UTF-8?Q?Micha=C3=ABl_REMOND?=) Date: Mon, 12 May 2014 17:32:11 +0200 Subject: [undertow-dev] CAS / OAuth / OpenID / HTTP / SAML client protocol support? Message-ID: Hi, I currently contribute to a Java library from Jerome Leleu, able to protect applications and delegate authentications to various identity providers. It currently supports 5 different protocols: CAS, OAuth, OpenID, HTTP and SAML and 18 identity providers (Facebook, Twitter, Google, Yahoo...) through a very simple and unified API accross protocols/JVM frameworks: https://github.com/leleuj/pac4j. The pac4j librairies are used in various JVM frameworks with the appropriate implementations: Spring Security, Shiro, CAS, J2E and Play. Although the core pac4j librairies gathers "a lot of" code (300 classes, 26000 lines of source code), the implementations to specific JVM frameworks are pretty straigtforward: from 4 classes for Spring Security to 11 classes for Play Framework 2.x. We are currently targeting new plateforms and especially async one; we got an implementation from ratpack (http://www.ratpack.io/) and we discussed also with the guys from vert.x. They gave us some ideas in order to improve our library by becoming more "reactive". I think that pac4j could be helpful for the Undertow community too by bringing client multi-protocols support. I looked at the security model from Undertow and I start to think about a possible integration by developing a "Pac4jAuthenticationMechanism". What do you think about such development? Are you interested in a demo app showing how this could work? Do you have suggestions? Thanks. Best regards, Michael Remond -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140512/c8a498dd/attachment.html From bburke at redhat.com Mon May 12 11:38:38 2014 From: bburke at redhat.com (Bill Burke) Date: Mon, 12 May 2014 11:38:38 -0400 Subject: [undertow-dev] CAS / OAuth / OpenID / HTTP / SAML client protocol support? In-Reply-To: References: Message-ID: <5370EAFE.206@redhat.com> If I wrote a pac4j module for Keycloak [1], it could be accepted and distributed with pac4j? [1] http://keycloak.org On 5/12/2014 11:32 AM, Micha?l REMOND wrote: > Hi, > > I currently contribute to a Java library from Jerome Leleu, able to > protect applications and delegate authentications to various identity > providers. It currently supports 5 different protocols: CAS, OAuth, > OpenID, HTTP and SAML and 18 identity providers (Facebook, Twitter, > Google, Yahoo...) through a very simple and unified API accross > protocols/JVM frameworks: https://github.com/leleuj/pac4j. > > The pac4j librairies are used in various JVM frameworks with the > appropriate implementations: Spring Security, Shiro, CAS, J2E and Play. > Although the core pac4j librairies gathers "a lot of" code (300 classes, > 26000 lines of source code), the implementations to specific JVM > frameworks are pretty straigtforward: from 4 classes for Spring Security > to 11 classes for Play Framework 2.x. > > We are currently targeting new plateforms and especially async one; we > got an implementation from ratpack (http://www.ratpack.io/) and we > discussed also with the guys from vert.x. They gave us some ideas in > order to improve our library by becoming more "reactive". > > I think that pac4j could be helpful for the Undertow community too by > bringing client multi-protocols support. > > I looked at the security model from Undertow and I start to think about > a possible integration by developing a "Pac4jAuthenticationMechanism". > > What do you think about such development? Are you interested in a demo > app showing how this could work? Do you have suggestions? > > Thanks. > Best regards, > Michael Remond > > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com From leleuj at gmail.com Mon May 12 13:28:31 2014 From: leleuj at gmail.com (=?UTF-8?B?SsOpcsO0bWUgTEVMRVU=?=) Date: Mon, 12 May 2014 19:28:31 +0200 Subject: [undertow-dev] CAS / OAuth / OpenID / HTTP / SAML client protocol support? Message-ID: Hi, I'm the creator of pac4j and we would be happy to receive a new contribution. I don't know Keycloak, but the only "constraint" is that it respects more or less the general flow : redirect the user to the provider, authentication, be redirected back to the application, retrieve the user profile... The main advantage of integrating Keycloak into pac4j is that it would become available subsequently in: - any J2E application - any Shiro application - any Spring Security application - any Play application - the CAS server - any Ratpack application - any Vertx application (soon I hope) - any Undertow application (soon I hope). Open a discussion on the pac4j-dev mailing list: https://groups.google.com/forum/?fromgroups#!forum/pac4j-dev or send a pull request to: https://github.com/leleuj/pac4j... Thanks. Best regards, J?r?me ---------- Message transf?r? ---------- > De : "Bill Burke" > Date : 12 mai 2014 17:39 > Objet : Re: [undertow-dev] CAS / OAuth / OpenID / HTTP / SAML client > protocol support? > ? : > Cc : > > If I wrote a pac4j module for Keycloak [1], it could be accepted and > distributed with pac4j? > > [1] http://keycloak.org > > > On 5/12/2014 11:32 AM, Micha?l REMOND wrote: > > Hi, > > > > I currently contribute to a Java library from Jerome Leleu, able to > > protect applications and delegate authentications to various identity > > providers. It currently supports 5 different protocols: CAS, OAuth, > > OpenID, HTTP and SAML and 18 identity providers (Facebook, Twitter, > > Google, Yahoo...) through a very simple and unified API accross > > protocols/JVM frameworks: https://github.com/leleuj/pac4j. > > > > The pac4j librairies are used in various JVM frameworks with the > > appropriate implementations: Spring Security, Shiro, CAS, J2E and Play. > > Although the core pac4j librairies gathers "a lot of" code (300 classes, > > 26000 lines of source code), the implementations to specific JVM > > frameworks are pretty straigtforward: from 4 classes for Spring Security > > to 11 classes for Play Framework 2.x. > > > > We are currently targeting new plateforms and especially async one; we > > got an implementation from ratpack (http://www.ratpack.io/) and we > > discussed also with the guys from vert.x. They gave us some ideas in > > order to improve our library by becoming more "reactive". > > > > I think that pac4j could be helpful for the Undertow community too by > > bringing client multi-protocols support. > > > > I looked at the security model from Undertow and I start to think about > > a possible integration by developing a "Pac4jAuthenticationMechanism". > > > > What do you think about such development? Are you interested in a demo > > app showing how this could work? Do you have suggestions? > > > > Thanks. > > Best regards, > > Michael Remond > > > > > > _______________________________________________ > > undertow-dev mailing list > > undertow-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/undertow-dev > > > > -- > Bill Burke > JBoss, a division of Red Hat > http://bill.burkecentral.com > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140512/accb103f/attachment-0001.html From jgreene at redhat.com Mon May 12 17:58:21 2014 From: jgreene at redhat.com (Jason T. Greene) Date: Mon, 12 May 2014 17:58:21 -0400 (EDT) Subject: [undertow-dev] Web Sockets Question In-Reply-To: References: <2BE7D683-EC51-4ECC-BCB0-5CEBCDCB34C2@redhat.com> Message-ID: <29385ED2-FC7B-4F17-849C-B36855C05CC7@redhat.com> Moving to undertow. I'm not sure I follow your description of the problem. However you may be experiencing a discarded SYN, which could be caused by a firewall like iptables, and the end result is a very long timeout on the client. You can determine this by doing a netstat on the client, and seeing if the connection is in SYN_SENT > On May 12, 2014, at 4:48 PM, Hamed Hatami wrote: > > Hi, > > I wanna manage my websocket connection or session when to connecttoserver at undertow by java client and when the server is not available , the client try to connect without exception and there is not any timeout to handle it > > Please help me > > Regards, > Hamed Hatami > >> On May 13, 2014 1:57 AM, "Jason Greene" wrote: >> After the tag of CR2, master is now officially 9.x. Only blocker level patches for 8.1.0.Final will be accepted for the new 8.x branch. >> >> Thanks! >> >> -- >> Jason T. Greene >> WildFly Lead / JBoss EAP Platform Architect >> JBoss, a division of Red Hat >> >> >> _______________________________________________ >> wildfly-dev mailing list >> wildfly-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/wildfly-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140512/e693978a/attachment.html From bburke at redhat.com Mon May 12 18:42:35 2014 From: bburke at redhat.com (Bill Burke) Date: Mon, 12 May 2014 18:42:35 -0400 Subject: [undertow-dev] CAS / OAuth / OpenID / HTTP / SAML client protocol support? In-Reply-To: References: Message-ID: <53714E5B.7050409@redhat.com> Keycloak is an extension of OAuth/OpenID Connect. Looking at pac4j further, it looks like it would fit under the OAuth adapter. On 5/12/2014 1:28 PM, J?r?me LELEU wrote: > Hi, > > I'm the creator of pac4j and we would be happy to receive a new > contribution. > > I don't know Keycloak, but the only "constraint" is that it respects > more or less the general flow : redirect the user to the provider, > authentication, be redirected back to the application, retrieve the user > profile... > > The main advantage of integrating Keycloak into pac4j is that it would > become available subsequently in: > - any J2E application > - any Shiro application > - any Spring Security application > - any Play application > - the CAS server > - any Ratpack application > - any Vertx application (soon I hope) > - any Undertow application (soon I hope). > > Open a discussion on the pac4j-dev mailing list: > https://groups.google.com/forum/?fromgroups#!forum/pac4j-dev > or send > a pull request to: https://github.com/leleuj/pac4j... > > Thanks. > Best regards, > J?r?me > > > > > ---------- Message transf?r? ---------- > De : "Bill Burke" > > Date : 12 mai 2014 17:39 > Objet : Re: [undertow-dev] CAS / OAuth / OpenID / HTTP / SAML client > protocol support? > ? : > > Cc : > > If I wrote a pac4j module for Keycloak [1], it could be accepted and > distributed with pac4j? > > [1] http://keycloak.org > > > On 5/12/2014 11:32 AM, Micha?l REMOND wrote: > > Hi, > > > > I currently contribute to a Java library from Jerome Leleu, able to > > protect applications and delegate authentications to various identity > > providers. It currently supports 5 different protocols: CAS, OAuth, > > OpenID, HTTP and SAML and 18 identity providers (Facebook, Twitter, > > Google, Yahoo...) through a very simple and unified API accross > > protocols/JVM frameworks: https://github.com/leleuj/pac4j. > > > > The pac4j librairies are used in various JVM frameworks with the > > appropriate implementations: Spring Security, Shiro, CAS, J2E and > Play. > > Although the core pac4j librairies gathers "a lot of" code (300 > classes, > > 26000 lines of source code), the implementations to specific JVM > > frameworks are pretty straigtforward: from 4 classes for Spring > Security > > to 11 classes for Play Framework 2.x. > > > > We are currently targeting new plateforms and especially async > one; we > > got an implementation from ratpack (http://www.ratpack.io/) and we > > discussed also with the guys from vert.x. They gave us some ideas in > > order to improve our library by becoming more "reactive". > > > > I think that pac4j could be helpful for the Undertow community too by > > bringing client multi-protocols support. > > > > I looked at the security model from Undertow and I start to think > about > > a possible integration by developing a > "Pac4jAuthenticationMechanism". > > > > What do you think about such development? Are you interested in a > demo > > app showing how this could work? Do you have suggestions? > > > > Thanks. > > Best regards, > > Michael Remond > > > > > > _______________________________________________ > > undertow-dev mailing list > > undertow-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/undertow-dev > > > > -- > Bill Burke > JBoss, a division of Red Hat > http://bill.burkecentral.com > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev > > > > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com From sdouglas at redhat.com Tue May 13 09:01:15 2014 From: sdouglas at redhat.com (Stuart Douglas) Date: Tue, 13 May 2014 08:01:15 -0500 Subject: [undertow-dev] CAS / OAuth / OpenID / HTTP / SAML client protocol support? In-Reply-To: References: Message-ID: <5372179B.8080006@redhat.com> This does sound pretty cool. I would start by looking at the existing authenticator implementations and the security docs at http://undertow.io/documentation/core/security.html Stuart Micha?l REMOND wrote: > Hi, > > I currently contribute to a Java library from Jerome Leleu, able to > protect applications and delegate authentications to various identity > providers. It currently supports 5 different protocols: CAS, OAuth, > OpenID, HTTP and SAML and 18 identity providers (Facebook, Twitter, > Google, Yahoo...) through a very simple and unified API accross > protocols/JVM frameworks: https://github.com/leleuj/pac4j. > > The pac4j librairies are used in various JVM frameworks with the > appropriate implementations: Spring Security, Shiro, CAS, J2E and Play. > Although the core pac4j librairies gathers "a lot of" code (300 classes, > 26000 lines of source code), the implementations to specific JVM > frameworks are pretty straigtforward: from 4 classes for Spring Security > to 11 classes for Play Framework 2.x. > > We are currently targeting new plateforms and especially async one; we > got an implementation from ratpack (http://www.ratpack.io/) and we > discussed also with the guys from vert.x. They gave us some ideas in > order to improve our library by becoming more "reactive". > > I think that pac4j could be helpful for the Undertow community too by > bringing client multi-protocols support. > > I looked at the security model from Undertow and I start to think about > a possible integration by developing a "Pac4jAuthenticationMechanism". > > What do you think about such development? Are you interested in a demo > app showing how this could work? Do you have suggestions? > > Thanks. > Best regards, > Michael Remond > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From bburke at redhat.com Tue May 13 09:11:34 2014 From: bburke at redhat.com (Bill Burke) Date: Tue, 13 May 2014 09:11:34 -0400 Subject: [undertow-dev] CAS / OAuth / OpenID / HTTP / SAML client protocol support? In-Reply-To: <5372179B.8080006@redhat.com> References: <5372179B.8080006@redhat.com> Message-ID: <53721A06.3070405@redhat.com> Keycloak has a oauth based mechanism that you might want to check out: https://github.com/keycloak/keycloak/tree/master/integration/undertow On 5/13/2014 9:01 AM, Stuart Douglas wrote: > This does sound pretty cool. I would start by looking at the existing > authenticator implementations and the security docs at > > http://undertow.io/documentation/core/security.html > > Stuart > > Micha?l REMOND wrote: >> Hi, >> >> I currently contribute to a Java library from Jerome Leleu, able to >> protect applications and delegate authentications to various identity >> providers. It currently supports 5 different protocols: CAS, OAuth, >> OpenID, HTTP and SAML and 18 identity providers (Facebook, Twitter, >> Google, Yahoo...) through a very simple and unified API accross >> protocols/JVM frameworks: https://github.com/leleuj/pac4j. >> >> The pac4j librairies are used in various JVM frameworks with the >> appropriate implementations: Spring Security, Shiro, CAS, J2E and Play. >> Although the core pac4j librairies gathers "a lot of" code (300 classes, >> 26000 lines of source code), the implementations to specific JVM >> frameworks are pretty straigtforward: from 4 classes for Spring Security >> to 11 classes for Play Framework 2.x. >> >> We are currently targeting new plateforms and especially async one; we >> got an implementation from ratpack (http://www.ratpack.io/) and we >> discussed also with the guys from vert.x. They gave us some ideas in >> order to improve our library by becoming more "reactive". >> >> I think that pac4j could be helpful for the Undertow community too by >> bringing client multi-protocols support. >> >> I looked at the security model from Undertow and I start to think about >> a possible integration by developing a "Pac4jAuthenticationMechanism". >> >> What do you think about such development? Are you interested in a demo >> app showing how this could work? Do you have suggestions? >> >> Thanks. >> Best regards, >> Michael Remond >> >> _______________________________________________ >> undertow-dev mailing list >> undertow-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/undertow-dev > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com From draganj at gmail.com Tue May 13 09:54:52 2014 From: draganj at gmail.com (Dragan Jotanovic) Date: Tue, 13 May 2014 14:54:52 +0100 Subject: [undertow-dev] Embedded undertow and atmosphere framework websockets Message-ID: Hi, I'm struggling to make simple chat atmosphere application to work with embedded undertow. The app seems to connect to websocket, and requests are passing through to AtmosphereHandler but response never reaches client. I suppose that I'm missing something in my undertow configuration but don't know what. Same code works when dropped into Tomcat or Jetty. Here is my bootstrap class: public class Bootstrap { public static void main(String[] args) throws Exception { // deploy to undertow DeploymentInfo servletBuilder = Servlets.deployment() .setClassLoader(Bootstrap.class.getClassLoader()) .setContextPath("") .setDeploymentName("chat") .setDefaultEncoding("UTF-8") .setUrlEncoding("UTF-8") .setResourceManager(new FileResourceManager(new File(""), 0)) .addWelcomePage("index.html"); servletBuilder.addServlet(Servlets.servlet("AtmosphereServlet", AtmosphereServlet.class) .addInitParam("org.atmosphere.cpr.AtmosphereHandler", "org.atmosphere.samples.chat.Chat") .addMapping("/chat/*") .setAsyncSupported(true)); final WebSocketDeploymentInfo webSocketDeploymentInfo = new WebSocketDeploymentInfo(); servletBuilder.addServletContextAttribute(WebSocketDeploymentInfo.ATTRIBUTE_NAME, webSocketDeploymentInfo); DeploymentManager manager = Servlets.defaultContainer().addDeployment(servletBuilder); manager.deploy(); HttpHandler servletHandler = manager.start(); PathHandler path = Handlers.path(Handlers.redirect("/")).addPrefixPath("/", servletHandler); Undertow server = Undertow.builder() .addHttpListener(8080, "0.0.0.0") .setHandler(path) .build(); server.start(); } } Does anyone know how to properly configure websockets support so that it works with Atmosphere Framework? Complete example can be seen here: https://github.com/djotanov/atmosphere-undertow Regards, Dragan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140513/6669de5b/attachment.html From cheetah at monkeysintown.com Tue May 13 11:01:27 2014 From: cheetah at monkeysintown.com (Aleksandar Vidakovic) Date: Tue, 13 May 2014 16:01:27 +0100 Subject: [undertow-dev] Embedded undertow and atmosphere framework websockets In-Reply-To: References: Message-ID: <537233C7.5030909@monkeysintown.com> Hi Dragan, ... I just had a similar issue a couple of days ago... my setup is slightly different from yours (using Spring behind the scenes), but it shouldn't matter... The problem was (in my case) the Atmosphere servlet mapping and the path parameter in the annotated handler service... I had (like you) an asterisk ("*") in the servlet mapping and that lead to a similar problem that you are describing (messages seem to arrive on the server side, but broadcasts to subscribed clients don't work). Also: Atmosphere was picky concerning the path parameter in my annotated handler service (see below). So... I'd suggest you try something like this (just showing the relevant parts): [java] public class Bootstrap { ... .addMapping("/chat") ... // Not sure if this is required and related to your problem... including it anyway... final Xnio xnio = Xnio.getInstance("nio", Undertow.class.getClassLoader()); final XnioWorker xnioWorker = xnio.createWorker(OptionMap.builder().getMap()); final WebSocketDeploymentInfo webSockets = new WebSocketDeploymentInfo().setWorker(xnioWorker); servletBuilder.addServletContextAttribute(ATTRIBUTE_NAME, webSockets); ... final DeploymentManager manager = defaultContainer().addDeployment(servletBuilder); manager.deploy(); // Not sure if it matters, but I don't use a path handler Undertow server = Undertow.builder() .addHttpListener("8080", "localhost") .setHandler(manager.start()) .build(); server.start(); } // Not sure if you are using the annotations... including it anyway... I think at least the path parameter has to be defined (interceptors can also be defined in servlet init param)... Atmosphere didn't pick the handler in my case when left out @Singleton @ManagedService( path = "/{id}", broadcasterCache = UUIDBroadcasterCache.class, interceptors = {AtmosphereResourceLifecycleInterceptor.class, CorsInterceptor.class, TrackMessageSizeInterceptor.class, SuspendTrackerInterceptor.class}, broadcaster = SimpleBroadcaster.class) public class Chat { ... } [/java] ... and then on the client side: [javascript] var globalCallback = function (response) { // do something }; var roomId = '123'; var rq = $.atmosphere.subscribe('http://localhost:8080/chat/' + roomId, globalCallback, $.atmosphere.request = { enableXDR: true, logLevel: 'debug', contentType: 'application/json', transport: 'websocket', onError: function (response) { }, onClose: function (response) { }, onOpen: function (response) { }, onMessage: function (response) { }, onReopen: function (request, response) { }, onReconnect: function (request, response) { }, onMessagePublished: function (response) { }, onTransportFailure: function (reason, request) { }, onLocalMessage: function (request) { }, onFailureToReconnect: function (request, response) { }, onClientTimeout: function(request){ }, callback: function () { } }); [/javascript] Note: I am using the latest 2.2.0-RC1 jars with Atmosphere JQuery 2.2.0 Hope it helps... Cheers, Aleks On 13.05.2014 14:54, Dragan Jotanovic wrote: > Hi, > > I'm struggling to make simple chat atmosphere application to work with > embedded undertow. > The app seems to connect to websocket, and requests are passing > through to AtmosphereHandler but response never reaches client. I > suppose that I'm missing something in my undertow configuration but > don't know what. Same code works when dropped into Tomcat or Jetty. > > Here is my bootstrap class: > > public class Bootstrap { > public static void main(String[] args) throws Exception { > // deploy to undertow > DeploymentInfo servletBuilder = Servlets.deployment() > .setClassLoader(Bootstrap.class.getClassLoader()) > .setContextPath("") > .setDeploymentName("chat") > .setDefaultEncoding("UTF-8") > .setUrlEncoding("UTF-8") > .setResourceManager(new FileResourceManager(new > File(""), 0)) > .addWelcomePage("index.html"); > servletBuilder.addServlet(Servlets.servlet("AtmosphereServlet", > AtmosphereServlet.class) > .addInitParam("org.atmosphere.cpr.AtmosphereHandler", > "org.atmosphere.samples.chat.Chat") > .addMapping("/chat/*") > .setAsyncSupported(true)); > > final WebSocketDeploymentInfo webSocketDeploymentInfo = new > WebSocketDeploymentInfo(); > servletBuilder.addServletContextAttribute(WebSocketDeploymentInfo.ATTRIBUTE_NAME, > webSocketDeploymentInfo); > > DeploymentManager manager = > Servlets.defaultContainer().addDeployment(servletBuilder); > manager.deploy(); > > HttpHandler servletHandler = manager.start(); > PathHandler path = > Handlers.path(Handlers.redirect("/")).addPrefixPath("/", servletHandler); > Undertow server = Undertow.builder() > .addHttpListener(8080, "0.0.0.0") > .setHandler(path) > .build(); > server.start(); > } > } > > Does anyone know how to properly configure websockets support so that > it works with Atmosphere Framework? > > Complete example can be seen here: > https://github.com/djotanov/atmosphere-undertow > > > Regards, > Dragan > > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140513/1f8c2983/attachment-0001.html From draganj at gmail.com Tue May 13 12:00:13 2014 From: draganj at gmail.com (Dragan Jotanovic) Date: Tue, 13 May 2014 17:00:13 +0100 Subject: [undertow-dev] Embedded undertow and atmosphere framework websockets In-Reply-To: <537233C7.5030909@monkeysintown.com> References: <537233C7.5030909@monkeysintown.com> Message-ID: Thanks for the quick reply, but unfortunately it didn't help. I changed the mapping, removed asterisk, but it's still not working. I'm not using any annotations or interceptors, it's the simplest setup possible. Just an ordinary AtmosphereHandler implementation. AtmosphereHander is registered directly with AtmosphereFramework through init parameter of AtmosphereServlet. You can see the full code at: https://github.com/djotanov/atmosphere-undertow I thought that I missed some configuration parameter in undertow but it seems that that is not the case since the same config works for you. I guess I will have to dig deeper into undertow code. Thanks, Dragan On Tue, May 13, 2014 at 4:01 PM, Aleksandar Vidakovic < cheetah at monkeysintown.com> wrote: > Hi Dragan, > > ... I just had a similar issue a couple of days ago... my setup is > slightly different from yours (using Spring behind the scenes), but it > shouldn't matter... > > The problem was (in my case) the Atmosphere servlet mapping and the path > parameter in the annotated handler service... > > I had (like you) an asterisk ("*") in the servlet mapping and that lead to > a similar problem that you are describing (messages seem to arrive on the > server side, but broadcasts to subscribed clients don't work). > > Also: Atmosphere was picky concerning the path parameter in my annotated > handler service (see below). > > So... I'd suggest you try something like this (just showing the relevant > parts): > > [java] > > public class Bootstrap { > ... > > .addMapping("/chat") > > ... > // Not sure if this is required and related to your problem... > including it anyway... > final Xnio xnio = Xnio.getInstance("nio", > Undertow.class.getClassLoader()); > final XnioWorker xnioWorker = > xnio.createWorker(OptionMap.builder().getMap()); > final WebSocketDeploymentInfo webSockets = new > WebSocketDeploymentInfo().setWorker(xnioWorker); > > servletBuilder.addServletContextAttribute(ATTRIBUTE_NAME, webSockets); > > ... > > final DeploymentManager manager = > defaultContainer().addDeployment(servletBuilder); > manager.deploy(); > > // Not sure if it matters, but I don't use a path handler > Undertow server = Undertow.builder() > .addHttpListener("8080", "localhost") > .setHandler(manager.start()) > .build(); > server.start(); > } > > // Not sure if you are using the annotations... including it anyway... I > think at least the path parameter has to be defined (interceptors can also > be defined in servlet init param)... Atmosphere didn't pick the handler in > my case when left out > @Singleton > @ManagedService( > path = "/{id}", > broadcasterCache = UUIDBroadcasterCache.class, > interceptors = {AtmosphereResourceLifecycleInterceptor.class, > CorsInterceptor.class, TrackMessageSizeInterceptor.class, > SuspendTrackerInterceptor.class}, > broadcaster = SimpleBroadcaster.class) > public class Chat { > ... > } > > [/java] > > ... and then on the client side: > > [javascript] > > var globalCallback = function (response) { > // do something > }; > > var roomId = '123'; > > var rq = $.atmosphere.subscribe('http://localhost:8080/chat/' + roomId, > globalCallback, $.atmosphere.request = { > enableXDR: true, > logLevel: 'debug', > contentType: 'application/json', > transport: 'websocket', > onError: function (response) { > }, > onClose: function (response) { > }, > onOpen: function (response) { > }, > onMessage: function (response) { > }, > onReopen: function (request, response) { > }, > onReconnect: function (request, response) { > }, > onMessagePublished: function (response) { > }, > onTransportFailure: function (reason, request) { > }, > onLocalMessage: function (request) { > }, > onFailureToReconnect: function (request, response) { > }, > onClientTimeout: function(request){ > }, > callback: function () { > } > }); > > [/javascript] > > Note: I am using the latest 2.2.0-RC1 jars with Atmosphere JQuery 2.2.0 > > Hope it helps... > > Cheers, > > Aleks > > > On 13.05.2014 14:54, Dragan Jotanovic wrote: > > Hi, > > I'm struggling to make simple chat atmosphere application to work with > embedded undertow. > The app seems to connect to websocket, and requests are passing through to > AtmosphereHandler but response never reaches client. I suppose that I'm > missing something in my undertow configuration but don't know what. Same > code works when dropped into Tomcat or Jetty. > > Here is my bootstrap class: > > public class Bootstrap { > public static void main(String[] args) throws Exception { > // deploy to undertow > DeploymentInfo servletBuilder = Servlets.deployment() > .setClassLoader(Bootstrap.class.getClassLoader()) > .setContextPath("") > .setDeploymentName("chat") > .setDefaultEncoding("UTF-8") > .setUrlEncoding("UTF-8") > .setResourceManager(new FileResourceManager(new File(""), > 0)) > .addWelcomePage("index.html"); > servletBuilder.addServlet(Servlets.servlet("AtmosphereServlet", > AtmosphereServlet.class) > .addInitParam("org.atmosphere.cpr.AtmosphereHandler", > "org.atmosphere.samples.chat.Chat") > .addMapping("/chat/*") > .setAsyncSupported(true)); > > final WebSocketDeploymentInfo webSocketDeploymentInfo = new > WebSocketDeploymentInfo(); > > servletBuilder.addServletContextAttribute(WebSocketDeploymentInfo.ATTRIBUTE_NAME, > webSocketDeploymentInfo); > > DeploymentManager manager = > Servlets.defaultContainer().addDeployment(servletBuilder); > manager.deploy(); > > HttpHandler servletHandler = manager.start(); > PathHandler path = > Handlers.path(Handlers.redirect("/")).addPrefixPath("/", servletHandler); > Undertow server = Undertow.builder() > .addHttpListener(8080, "0.0.0.0") > .setHandler(path) > .build(); > server.start(); > } > } > > Does anyone know how to properly configure websockets support so that it > works with Atmosphere Framework? > > Complete example can be seen here: > https://github.com/djotanov/atmosphere-undertow > > > Regards, > Dragan > > > _______________________________________________ > undertow-dev mailing listundertow-dev at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/undertow-dev > > > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140513/9637c167/attachment.html From draganj at gmail.com Tue May 20 08:45:20 2014 From: draganj at gmail.com (Dragan Jotanovic) Date: Tue, 20 May 2014 13:45:20 +0100 Subject: [undertow-dev] Undertow not handling servlet exceptions properly Message-ID: Hi, I'm using embedded undertow with jastow for serving jsp pages. I registered custom error page for handling all 500 errors, but exception is not propagated to my custom 500.jsp page (javax.servlet.error.exception request attribute is never set). I debugged through undertow code and found that the problem is in "ServletInitialHandler", "handleFirstRequest" method. When a servlet throws exception, error page location is looked for only by exception type and not by exception code as well, so the exception is never propagated to my custom error page. Is this a bug or a feature? The only workaround I have found is to register my custom error page against JasperException.class, but I wouldn't want to do this for all the possible exceptions my application could throw. If it's a bug, than simple fix would be to look for error page by 500 error code as well, like so: String location = servletContext.getDeployment().getErrorPages().getErrorLocation(t); if (location == null) { location = servletContext.getDeployment().getErrorPages().getErrorLocation(500); } Regards, Dragan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140520/86166fbb/attachment.html From sdouglas at redhat.com Wed May 21 11:41:51 2014 From: sdouglas at redhat.com (Stuart Douglas) Date: Wed, 21 May 2014 10:41:51 -0500 Subject: [undertow-dev] Undertow not handling servlet exceptions properly In-Reply-To: References: Message-ID: <537CC93F.1080208@redhat.com> This does sound like a bug. Stuart Dragan Jotanovic wrote: > Hi, > > I'm using embedded undertow with jastow for serving jsp pages. > I registered custom error page for handling all 500 errors, but > exception is not propagated to my custom 500.jsp page > (javax.servlet.error.exception request attribute is never set). > I debugged through undertow code and found that the problem is in > "ServletInitialHandler", "handleFirstRequest" method. When a servlet > throws exception, error page location is looked for only by exception > type and not by exception code as well, so the exception is never > propagated to my custom error page. > Is this a bug or a feature? The only workaround I have found is to > register my custom error page against JasperException.class, but I > wouldn't want to do this for all the possible exceptions my application > could throw. > > If it's a bug, than simple fix would be to look for error page by 500 > error code as well, like so: > > String location = > servletContext.getDeployment().getErrorPages().getErrorLocation(t); > if (location == null) { > location = > servletContext.getDeployment().getErrorPages().getErrorLocation(500); > } > > Regards, > Dragan > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From agbauer at gmail.com Fri May 23 13:21:53 2014 From: agbauer at gmail.com (Adrian) Date: Fri, 23 May 2014 10:21:53 -0700 Subject: [undertow-dev] asynchronous cassandra queries Message-ID: Hi I'm trying to query Cassandra asynchronously from inside an HttpHandler, but by the time the listener is run, Undertow has closed the response channel. Is there some way to keep it open? Can you suggest another approach? Thanks Adrian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140523/4dc8ac7f/attachment-0001.html From sdouglas at redhat.com Fri May 23 14:10:09 2014 From: sdouglas at redhat.com (Stuart Douglas) Date: Fri, 23 May 2014 14:10:09 -0400 (EDT) Subject: [undertow-dev] asynchronous cassandra queries In-Reply-To: References: Message-ID: <2008822919.9996924.1400868609783.JavaMail.zimbra@redhat.com> You need to call the HttpServerExchange#dispatch() method, this will stop the exchange from ending when the call stack returns. Stuart ----- Original Message ----- > From: "Adrian" > To: undertow-dev at lists.jboss.org > Sent: Friday, 23 May, 2014 12:21:53 PM > Subject: [undertow-dev] asynchronous cassandra queries > > Hi > > I'm trying to query Cassandra asynchronously from inside an HttpHandler, but > by the time the listener is run, Undertow has closed the response channel. > Is there some way to keep it open? Can you suggest another approach? > > Thanks > Adrian > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev From agbauer at gmail.com Fri May 23 14:19:10 2014 From: agbauer at gmail.com (Adrian) Date: Fri, 23 May 2014 11:19:10 -0700 Subject: [undertow-dev] asynchronous cassandra queries In-Reply-To: <2008822919.9996924.1400868609783.JavaMail.zimbra@redhat.com> References: <2008822919.9996924.1400868609783.JavaMail.zimbra@redhat.com> Message-ID: Really? I tried dispatch(this) and dispatching to a separate thread pool I created. In both cases exchange.isComplete() returned true in my Cassandra listener and writing response data resulted in an exception. On May 23, 2014 11:10 AM, "Stuart Douglas" wrote: > You need to call the HttpServerExchange#dispatch() method, this will stop > the exchange from ending when the call stack returns. > > Stuart > > ----- Original Message ----- > > From: "Adrian" > > To: undertow-dev at lists.jboss.org > > Sent: Friday, 23 May, 2014 12:21:53 PM > > Subject: [undertow-dev] asynchronous cassandra queries > > > > Hi > > > > I'm trying to query Cassandra asynchronously from inside an HttpHandler, > but > > by the time the listener is run, Undertow has closed the response > channel. > > Is there some way to keep it open? Can you suggest another approach? > > > > Thanks > > Adrian > > > > _______________________________________________ > > undertow-dev mailing list > > undertow-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/undertow-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140523/e1512e5b/attachment.html From sdouglas at redhat.com Fri May 23 14:34:51 2014 From: sdouglas at redhat.com (Stuart Douglas) Date: Fri, 23 May 2014 14:34:51 -0400 (EDT) Subject: [undertow-dev] asynchronous cassandra queries In-Reply-To: References: <2008822919.9996924.1400868609783.JavaMail.zimbra@redhat.com> Message-ID: <1050067950.10005069.1400870091829.JavaMail.zimbra@redhat.com> You need to call the version with no arguments, or the one that dispatches to a Runnable (which is not well named, I think I will change it to detach() or suspend(), its current name came about just because internally it works the same as the other dispatch method calls). When Undertow is running a handler chain then it will always end the exchange when the call stack completes unless dispatch() has been called, in your case you immediately dispatched another handler chain, so when that handler returned the exchange will be ended. Stuart ----- Original Message ----- > From: "Adrian" > To: "Stuart Douglas" > Cc: undertow-dev at lists.jboss.org > Sent: Friday, 23 May, 2014 1:19:10 PM > Subject: Re: [undertow-dev] asynchronous cassandra queries > > Really? I tried dispatch(this) and dispatching to a separate thread pool I > created. In both cases exchange.isComplete() returned true in my Cassandra > listener and writing response data resulted in an exception. > On May 23, 2014 11:10 AM, "Stuart Douglas" wrote: > > > You need to call the HttpServerExchange#dispatch() method, this will stop > > the exchange from ending when the call stack returns. > > > > Stuart > > > > ----- Original Message ----- > > > From: "Adrian" > > > To: undertow-dev at lists.jboss.org > > > Sent: Friday, 23 May, 2014 12:21:53 PM > > > Subject: [undertow-dev] asynchronous cassandra queries > > > > > > Hi > > > > > > I'm trying to query Cassandra asynchronously from inside an HttpHandler, > > but > > > by the time the listener is run, Undertow has closed the response > > channel. > > > Is there some way to keep it open? Can you suggest another approach? > > > > > > Thanks > > > Adrian > > > > > > _______________________________________________ > > > undertow-dev mailing list > > > undertow-dev at lists.jboss.org > > > https://lists.jboss.org/mailman/listinfo/undertow-dev > > > From agbauer at gmail.com Fri May 23 14:38:28 2014 From: agbauer at gmail.com (Adrian) Date: Fri, 23 May 2014 11:38:28 -0700 Subject: [undertow-dev] asynchronous cassandra queries In-Reply-To: <1050067950.10005069.1400870091829.JavaMail.zimbra@redhat.com> References: <2008822919.9996924.1400868609783.JavaMail.zimbra@redhat.com> <1050067950.10005069.1400870091829.JavaMail.zimbra@redhat.com> Message-ID: Great. Thank you. On May 23, 2014 11:34 AM, "Stuart Douglas" wrote: > You need to call the version with no arguments, or the one that dispatches > to a Runnable (which is not well named, I think I will change it to > detach() or suspend(), its current name came about just because internally > it works the same as the other dispatch method calls). > > When Undertow is running a handler chain then it will always end the > exchange when the call stack completes unless dispatch() has been called, > in your case you immediately dispatched another handler chain, so when that > handler returned the exchange will be ended. > > Stuart > > ----- Original Message ----- > > From: "Adrian" > > To: "Stuart Douglas" > > Cc: undertow-dev at lists.jboss.org > > Sent: Friday, 23 May, 2014 1:19:10 PM > > Subject: Re: [undertow-dev] asynchronous cassandra queries > > > > Really? I tried dispatch(this) and dispatching to a separate thread pool > I > > created. In both cases exchange.isComplete() returned true in my > Cassandra > > listener and writing response data resulted in an exception. > > On May 23, 2014 11:10 AM, "Stuart Douglas" wrote: > > > > > You need to call the HttpServerExchange#dispatch() method, this will > stop > > > the exchange from ending when the call stack returns. > > > > > > Stuart > > > > > > ----- Original Message ----- > > > > From: "Adrian" > > > > To: undertow-dev at lists.jboss.org > > > > Sent: Friday, 23 May, 2014 12:21:53 PM > > > > Subject: [undertow-dev] asynchronous cassandra queries > > > > > > > > Hi > > > > > > > > I'm trying to query Cassandra asynchronously from inside an > HttpHandler, > > > but > > > > by the time the listener is run, Undertow has closed the response > > > channel. > > > > Is there some way to keep it open? Can you suggest another approach? > > > > > > > > Thanks > > > > Adrian > > > > > > > > _______________________________________________ > > > > undertow-dev mailing list > > > > undertow-dev at lists.jboss.org > > > > https://lists.jboss.org/mailman/listinfo/undertow-dev > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140523/ae4cc349/attachment.html From michaelremond at gmail.com Tue May 27 14:02:01 2014 From: michaelremond at gmail.com (=?UTF-8?Q?Micha=C3=ABl_REMOND?=) Date: Tue, 27 May 2014 20:02:01 +0200 Subject: [undertow-dev] CAS / OAuth / OpenID / HTTP / SAML client protocol support? In-Reply-To: <5372179B.8080006@redhat.com> References: <5372179B.8080006@redhat.com> Message-ID: Hello dear Community, I made a first draft of what could be a pac4j binding for Undertow. You can find our standard demo application here https://github.com/pac4j/undertow-pac4j-demo. You can test several different authentication providers (facebook, twitter, form, CAS, SAML...). I'd like to share some implementation details with you: - I implemented a new AuthenticationMechanism delegating the authentication to a pac4j client; so this mechanism is rather "generic" in regards to what you got in undertow (one for basic auth, one for form...) - pac4j needs a session mechanism so I used the Undertow SessionManager to store some attributes but also the User Profile once the user is successfully authenticated - pac4j also needs a callback url to finish the authentication process so I developped a dedicated handler - finally I used the EagerFormParsingHandler to grab the required POSTed data To conclude I have to say I really appreciated the maturity of the framework because it was pretty straightforward to play with all the concepts and the ability to change from the IO thread to the dispatcher is really powerfull. J?r?me and I are really interrested to get your feedback on this work. Does this binding makes sense to you? How can we improve this work to fit perfectly in Undertow and how can we extract a viable library from the demo? Thank you for your help, Regards, Micha?l 2014-05-13 15:01 GMT+02:00 Stuart Douglas : > This does sound pretty cool. I would start by looking at the existing > authenticator implementations and the security docs at > > http://undertow.io/documentation/core/security.html > > Stuart > > Micha?l REMOND wrote: > >> Hi, >> >> I currently contribute to a Java library from Jerome Leleu, able to >> protect applications and delegate authentications to various identity >> providers. It currently supports 5 different protocols: CAS, OAuth, >> OpenID, HTTP and SAML and 18 identity providers (Facebook, Twitter, >> Google, Yahoo...) through a very simple and unified API accross >> protocols/JVM frameworks: https://github.com/leleuj/pac4j. >> >> The pac4j librairies are used in various JVM frameworks with the >> appropriate implementations: Spring Security, Shiro, CAS, J2E and Play. >> Although the core pac4j librairies gathers "a lot of" code (300 classes, >> 26000 lines of source code), the implementations to specific JVM >> frameworks are pretty straigtforward: from 4 classes for Spring Security >> to 11 classes for Play Framework 2.x. >> >> We are currently targeting new plateforms and especially async one; we >> got an implementation from ratpack (http://www.ratpack.io/) and we >> discussed also with the guys from vert.x. They gave us some ideas in >> order to improve our library by becoming more "reactive". >> >> I think that pac4j could be helpful for the Undertow community too by >> bringing client multi-protocols support. >> >> I looked at the security model from Undertow and I start to think about >> a possible integration by developing a "Pac4jAuthenticationMechanism". >> >> What do you think about such development? Are you interested in a demo >> app showing how this could work? Do you have suggestions? >> >> Thanks. >> Best regards, >> Michael Remond >> >> _______________________________________________ >> undertow-dev mailing list >> undertow-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/undertow-dev >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140527/35082894/attachment.html From golovnin at gmx.net Tue May 27 19:02:16 2014 From: golovnin at gmx.net (Andrej Golovnin) Date: Wed, 28 May 2014 01:02:16 +0200 Subject: [undertow-dev] Undertow 1.0.x - Handling of large binary messages is probably broken Message-ID: <3950DC43-FF9C-4489-9364-4748EF3A5542@gmx.net> Hi Stuart, I think that the handling of large binary messages is broken in Undertow 1.0.x branch. If you copy the test classes from the pull request 206 to the 1.0.x branch and execute the test BinaryEndpointTest, then you should get this exception: 00:51:25,401 ERROR (XNIO-1 I/O-1) [org.xnio.listener] XNIO001007: A channel event listener threw an exception: java.lang.IndexOutOfBoundsException at java.nio.Buffer.checkIndex(Buffer.java:532) at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:253) at io.undertow.websockets.core.protocol.version07.Masker.mask(Masker.java:54) at io.undertow.websockets.core.protocol.version07.Masker.afterRead(Masker.java:67) at io.undertow.websockets.core.FixedPayloadFrameSourceChannel.afterRead(FixedPayloadFrameSourceChannel.java:117) at io.undertow.websockets.core.FixedPayloadFrameSourceChannel.read(FixedPayloadFrameSourceChannel.java:78) at io.undertow.websockets.core.BufferedBinaryMessage$1.handleEvent(BufferedBinaryMessage.java:87) at io.undertow.websockets.core.BufferedBinaryMessage$1.handleEvent(BufferedBinaryMessage.java:79) at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) at io.undertow.server.protocol.framed.AbstractFramedChannel$FrameReadListener.invokeReadListener(AbstractFramedChannel.java:647) at io.undertow.server.protocol.framed.AbstractFramedChannel$FrameReadListener.handleEvent(AbstractFramedChannel.java:620) at io.undertow.server.protocol.framed.AbstractFramedChannel$FrameReadListener.handleEvent(AbstractFramedChannel.java:614) at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66) at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:87) at org.xnio.nio.NioHandle$1.run(NioHandle.java:50) at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:552) at org.xnio.nio.WorkerThread.run(WorkerThread.java:461) I was not able to find the cause for this exception. It is possible that my test is just wrong. In that please let me know, what I'm doing wrong. If the test is OK, then I hope you can find the bug and fix it before the release of WildFly 8.1.0. Best regards, Andrej Golovnin From sdouglas at redhat.com Wed May 28 10:25:16 2014 From: sdouglas at redhat.com (Stuart Douglas) Date: Wed, 28 May 2014 09:25:16 -0500 Subject: [undertow-dev] Undertow 1.0.x - Handling of large binary messages is probably broken In-Reply-To: <3950DC43-FF9C-4489-9364-4748EF3A5542@gmx.net> References: <3950DC43-FF9C-4489-9364-4748EF3A5542@gmx.net> Message-ID: <5385F1CC.60301@redhat.com> Should be fixed now and 1.0.15.Final has been released with the fix. Stuart Andrej Golovnin wrote: > Hi Stuart, > > I think that the handling of large binary messages is broken in > Undertow 1.0.x branch. > If you copy the test classes from the pull request 206 to the 1.0.x > branch and > execute the test BinaryEndpointTest, then you should get this exception: > > 00:51:25,401 ERROR (XNIO-1 I/O-1) > [org.xnio.listener] XNIO001007: A channel > event listener threw an exception: java.lang.IndexOutOfBoundsException > at java.nio.Buffer.checkIndex(Buffer.java:532) > at java.nio.DirectByteBuffer.get(DirectByteBuffer.java:253) > at > io.undertow.websockets.core.protocol.version07.Masker.mask(Masker.java:54) > > > at > io.undertow.websockets.core.protocol.version07.Masker.afterRead(Masker.java:67) > > > at > io.undertow.websockets.core.FixedPayloadFrameSourceChannel.afterRead(FixedPayloadFrameSourceChannel.java:117) > > > at > io.undertow.websockets.core.FixedPayloadFrameSourceChannel.read(FixedPayloadFrameSourceChannel.java:78) > > > at > io.undertow.websockets.core.BufferedBinaryMessage$1.handleEvent(BufferedBinaryMessage.java:87) > > > at > io.undertow.websockets.core.BufferedBinaryMessage$1.handleEvent(BufferedBinaryMessage.java:79) > > > at > org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) > at > io.undertow.server.protocol.framed.AbstractFramedChannel$FrameReadListener.invokeReadListener(AbstractFramedChannel.java:647) > > > at > io.undertow.server.protocol.framed.AbstractFramedChannel$FrameReadListener.handleEvent(AbstractFramedChannel.java:620) > > > at > io.undertow.server.protocol.framed.AbstractFramedChannel$FrameReadListener.handleEvent(AbstractFramedChannel.java:614) > > > at > org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) > at > org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66) > > > at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:87) > at org.xnio.nio.NioHandle$1.run(NioHandle.java:50) > at org.xnio.nio.WorkerThread.safeRun(WorkerThread.java:552) > at org.xnio.nio.WorkerThread.run(WorkerThread.java:461) > > > I was not able to find the cause for this exception. It is possible > that my test is just wrong. > In that please let me know, what I'm doing wrong. If the test is OK, > then I hope you can find the bug > and fix it before the release of WildFly 8.1.0. > > Best regards, > Andrej Golovnin > > From ron.leisti at gmail.com Thu May 29 09:43:55 2014 From: ron.leisti at gmail.com (Ron Leisti) Date: Thu, 29 May 2014 09:43:55 -0400 Subject: [undertow-dev] Welcome file does not seem to work with default servlet and / Message-ID: Hi, I've encountered what seems like a but with the handling of welcome files. I am using Undertow 1.0.0 included in Wildfly 8.0.0 If I don't create a servlet mapping for the URL "/", then Undertow will automatically registers its own DefaultServlet as the mapping. I would like "/" to automatically invoke a servlet that is mapped to some path like "/foo". I don't setup an explicit mapping because I don't want my servlet to be the default servlet, because I still want static resources to get resolved automatically. To get this to work, I create a welcome file entry "foo". However, I think Undertow is ignoring this mapping in this circumstance. I've done some debugging into Undertow and found that when the ServletPathMatchesData is created, the DefaultServlet is given an exact match "/" which forces requiredWelcomeFileMatch to false, (ServletPathMatchesData constructor) even if requiredWelcomeFileMatch was true for the DefaultServlet. With requiredWelcomeFileMatch=false, the welcome file logic is skipped and control is given to the default servlet, which simply returns a 404 for "/". Is my logic just flawed, or is this a bug? Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140529/6d9574a4/attachment.html From tomaz.cerar at gmail.com Thu May 29 15:20:10 2014 From: tomaz.cerar at gmail.com (=?UTF-8?B?VG9tYcW+IENlcmFy?=) Date: Thu, 29 May 2014 21:20:10 +0200 Subject: [undertow-dev] Welcome file does not seem to work with default servlet and / In-Reply-To: References: Message-ID: This is more discussion for WildFly forums https://community.jboss.org/en/wildfly not undertow dev list. Anyhow, without knowing know your mappings are configured it is hard to help you. Maybe you just have mapping bit wrong, as there is difference between "/" and "/*" -- tomaz On Thu, May 29, 2014 at 3:43 PM, Ron Leisti wrote: > Hi, > > I've encountered what seems like a but with the handling of welcome files. > I am using Undertow 1.0.0 included in Wildfly 8.0.0 > > If I don't create a servlet mapping for the URL "/", then Undertow will > automatically registers its own DefaultServlet as the mapping. I would > like "/" to automatically invoke a servlet that is mapped to some path like > "/foo". I don't setup an explicit mapping because I don't want my servlet > to be the default servlet, because I still want static resources to get > resolved automatically. > > To get this to work, I create a welcome file entry "foo". However, I > think Undertow is ignoring this mapping in this circumstance. I've done > some debugging into Undertow and found that when the ServletPathMatchesData > is created, the DefaultServlet is given an exact match "/" which forces > requiredWelcomeFileMatch to false, (ServletPathMatchesData constructor) > even if requiredWelcomeFileMatch was true for the DefaultServlet. With > requiredWelcomeFileMatch=false, the welcome file logic is skipped and > control is given to the default servlet, which simply returns a 404 for "/". > > Is my logic just flawed, or is this a bug? > > Thank you > > _______________________________________________ > undertow-dev mailing list > undertow-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/undertow-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140529/aaf0ecc7/attachment.html From ron.leisti at gmail.com Thu May 29 16:07:29 2014 From: ron.leisti at gmail.com (Ron Leisti) Date: Thu, 29 May 2014 16:07:29 -0400 Subject: [undertow-dev] Welcome file does not seem to work with default servlet and / In-Reply-To: References: Message-ID: Thank you Tomaz; I'll try the wildfly list. In my case I am not setting a mapping on "/". That mapping is being created automatically by Undertow to its DefaultServlet, which is good because that servlet is responsible for serving static resources. However, it also seems to ignore the welcome files. On Thu, May 29, 2014 at 3:20 PM, Toma? Cerar wrote: > This is more discussion for WildFly forums > https://community.jboss.org/en/wildfly not undertow dev list. > Anyhow, without knowing know your mappings are configured it is hard to > help you. > > Maybe you just have mapping bit wrong, as there is difference between "/" > and "/*" > > -- > tomaz > > > On Thu, May 29, 2014 at 3:43 PM, Ron Leisti wrote: > >> Hi, >> >> I've encountered what seems like a but with the handling of welcome >> files. I am using Undertow 1.0.0 included in Wildfly 8.0.0 >> >> If I don't create a servlet mapping for the URL "/", then Undertow will >> automatically registers its own DefaultServlet as the mapping. I would >> like "/" to automatically invoke a servlet that is mapped to some path like >> "/foo". I don't setup an explicit mapping because I don't want my servlet >> to be the default servlet, because I still want static resources to get >> resolved automatically. >> >> To get this to work, I create a welcome file entry "foo". However, I >> think Undertow is ignoring this mapping in this circumstance. I've done >> some debugging into Undertow and found that when the ServletPathMatchesData >> is created, the DefaultServlet is given an exact match "/" which forces >> requiredWelcomeFileMatch to false, (ServletPathMatchesData constructor) >> even if requiredWelcomeFileMatch was true for the DefaultServlet. With >> requiredWelcomeFileMatch=false, the welcome file logic is skipped and >> control is given to the default servlet, which simply returns a 404 for "/". >> >> Is my logic just flawed, or is this a bug? >> >> Thank you >> >> _______________________________________________ >> undertow-dev mailing list >> undertow-dev at lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/undertow-dev >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140529/2eaaaff8/attachment.html From ron.leisti at gmail.com Thu May 29 16:34:48 2014 From: ron.leisti at gmail.com (Ron Leisti) Date: Thu, 29 May 2014 16:34:48 -0400 Subject: [undertow-dev] Welcome file does not seem to work with default servlet and / In-Reply-To: References: Message-ID: Actually, you already helped me solve the issue with point on "/" vs "/*". I had a filter mapping to "/", which causes Undertow's DefaultFilter to be exact matched to "/", which then prevents the welcome files from working. Once I changed the filter to map to "/*" then it works. Thank you On Thu, May 29, 2014 at 4:07 PM, Ron Leisti wrote: > Thank you Tomaz; I'll try the wildfly list. > > In my case I am not setting a mapping on "/". That mapping is being > created automatically by Undertow to its DefaultServlet, which is good > because that servlet is responsible for serving static resources. However, > it also seems to ignore the welcome files. > > > On Thu, May 29, 2014 at 3:20 PM, Toma? Cerar wrote: > >> This is more discussion for WildFly forums >> https://community.jboss.org/en/wildfly not undertow dev list. >> Anyhow, without knowing know your mappings are configured it is hard to >> help you. >> >> Maybe you just have mapping bit wrong, as there is difference between "/" >> and "/*" >> >> -- >> tomaz >> >> >> On Thu, May 29, 2014 at 3:43 PM, Ron Leisti wrote: >> >>> Hi, >>> >>> I've encountered what seems like a but with the handling of welcome >>> files. I am using Undertow 1.0.0 included in Wildfly 8.0.0 >>> >>> If I don't create a servlet mapping for the URL "/", then Undertow will >>> automatically registers its own DefaultServlet as the mapping. I would >>> like "/" to automatically invoke a servlet that is mapped to some path like >>> "/foo". I don't setup an explicit mapping because I don't want my servlet >>> to be the default servlet, because I still want static resources to get >>> resolved automatically. >>> >>> To get this to work, I create a welcome file entry "foo". However, I >>> think Undertow is ignoring this mapping in this circumstance. I've done >>> some debugging into Undertow and found that when the ServletPathMatchesData >>> is created, the DefaultServlet is given an exact match "/" which forces >>> requiredWelcomeFileMatch to false, (ServletPathMatchesData constructor) >>> even if requiredWelcomeFileMatch was true for the DefaultServlet. With >>> requiredWelcomeFileMatch=false, the welcome file logic is skipped and >>> control is given to the default servlet, which simply returns a 404 for "/". >>> >>> Is my logic just flawed, or is this a bug? >>> >>> Thank you >>> >>> _______________________________________________ >>> undertow-dev mailing list >>> undertow-dev at lists.jboss.org >>> https://lists.jboss.org/mailman/listinfo/undertow-dev >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/undertow-dev/attachments/20140529/5b92db16/attachment-0001.html