Re: mod_jk, JSESSION_ID and load-balancing
Hi Rainer. > > It seems Shiro recommend to extend > > https://svn.apache.org/viewvc/shiro/trunk/web/src/main/java/org/apache/shiro/web/session/mgt/DefaultWebSessionManager.java > >From code review (I may be wrong), it seems Nexus is extending org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter https://github.com/sonatype/nexus-oss/blob/master/plugins/restlet1x/nexus-restlet1x-plugin/src/main/java/org/sonatype/nexus/security/filter/authc/NexusHttpAuthenticationFilter.java > in order to add the needed suffix to a new id when creating a session > cookie and to subtract it before forwarding the id to the shiro internals. > > Some of the things you need are already implemented in recent mod_jk: > > Strategy 1: > > You can let mod_jk know about using another cookie by setting the worker > load balancer attribute "session_cookie" e.g. to "mycookie". You might > also want to change session_path to something non-standard such that an > occasional path encoding with the busted session id doesn't interfere > with mod_jk. > > See "session_cookie" and "session_path" in > http://tomcat.apache.org/connectors-doc/reference/workers.html. Yep, but Tomcat or HTTPd/mod_jk should set this cookie instead of JSESSIONID isn't it ? > Strategy 2: > > Directly set the route with Apache means into the Apache environment > variable JK_ROUTE. See "JK_ROUTE" in > http://tomcat.apache.org/connectors-doc/reference/apache.html. > > The problem is how to set the cookie. You could do it using a servlet > filter on the Tomcat side. Such a simple filter could be added to the > webapp, without the need of changing the webapp sources. The filter is > independent and would just be added to web.xml and the WEB-INF/lib. Sadly I can't update Nexus installation or setup ;( > Letting mod_jk itself set the cookie could be a nice addition, because > it would be easy for it to do. It knows the correct route name, whether > the cookie was already received with the request and whether a failover > happened. Would be easy to add. The configuration would need to wire the > "HttpOnly" and "Secure" flags for the cookie. Yes and back to my initial question, about updating mod_jk so it could set and reuse its own cookie instead of substring of JSESSIONID :) HTTPd mod_proxy and mod_balancer did the same and it seems a smart alternative. What do you think ?
Re: Your Gump Build(s)
On 2013-06-24, Mark Thomas wrote: > On 24/06/2013 14:20, Stefan Bodewig wrote: >> Before we re-enable emails we'd like to know whether you are still >> interested in the service Gump provides, so please tell us. :-) > Yes please! Noted, thanks. > As an aside, there were (and probably still are) a number of projects > with dependencies on very old (and no longer supported) Tomcat versions. > It would be good to get those cleaned up. Finding the time to do that > has been on my TODO list for a while. It is pretty likely we'll end up with a smaller set of projects after this poll. Tomcat 4 is used by Ant - and only by Ant AFAICT - for the deprecated jcpc task. I don't see any project using Tomcat 5.x or 6.x on first glance. Stefan - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55137] New: Test
https://issues.apache.org/bugzilla/show_bug.cgi?id=55137 Bug ID: 55137 Summary: Test Product: Tomcat Connectors Version: 1.2.0 Hardware: PC Status: NEW Severity: normal Priority: P2 Component: Common Assignee: dev@tomcat.apache.org Reporter: manoj.vasala...@gmail.com -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55138] New: testtrunk
https://issues.apache.org/bugzilla/show_bug.cgi?id=55138 Bug ID: 55138 Summary: testtrunk Product: Tomcat 8 Version: trunk Hardware: PC Status: NEW Severity: normal Priority: P2 Component: Catalina Assignee: dev@tomcat.apache.org Reporter: manoj.vasala...@gmail.com -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55139] New: Test Catalina
https://issues.apache.org/bugzilla/show_bug.cgi?id=55139 Bug ID: 55139 Summary: Test Catalina Product: Tomcat 7 Version: 7.0.0 Hardware: PC Status: NEW Severity: normal Priority: P2 Component: Catalina Assignee: dev@tomcat.apache.org Reporter: manoj.vasala...@gmail.com -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55137] Test
https://issues.apache.org/bugzilla/show_bug.cgi?id=55137 Mark Thomas changed: What|Removed |Added OS||All --- Comment #1 from Mark Thomas --- Bugzilla is not a playground. This idiot has had their account locked. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55138] testtrunk
https://issues.apache.org/bugzilla/show_bug.cgi?id=55138 Mark Thomas changed: What|Removed |Added OS||All --- Comment #1 from Mark Thomas --- Bugzilla is not a playground. This idiot has had their account locked. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55139] Test Catalina
https://issues.apache.org/bugzilla/show_bug.cgi?id=55139 Mark Thomas changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |INVALID OS||All --- Comment #1 from Mark Thomas --- Bugzilla is not a playground. This idiot has had their account locked. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55138] testtrunk
https://issues.apache.org/bugzilla/show_bug.cgi?id=55138 Mark Thomas changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |INVALID -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55137] Test
https://issues.apache.org/bugzilla/show_bug.cgi?id=55137 Mark Thomas changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |INVALID -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Bugzilla account is disabled
On 25/06/2013 09:55, Manoj Kumar wrote: > Hi Admin, > > My Bugzilla account is disabled. > Could you enable my account ASAP. No. Your account was blocked for abuse (spam generation). It will not be unblocked. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1496398 - in /tomcat/trunk/java/org/apache/tomcat/websocket/server: LocalStrings.properties UriTemplate.java WsServerContainer.java
Author: markt Date: Tue Jun 25 10:08:11 2013 New Revision: 1496398 URL: http://svn.apache.org/r1496398 Log: WebSocket 1.0. Section 4.1.1 Improve path validation Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties tomcat/trunk/java/org/apache/tomcat/websocket/server/UriTemplate.java tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties?rev=1496398&r1=1496397&r2=1496398&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties Tue Jun 25 10:08:11 2013 @@ -22,6 +22,7 @@ serverContainer.pojoDeploy=POJO class [{ serverContainer.servletContextMismatch=Attempted to register a POJO annotated for WebSocket at path [{0}] in the ServletContext with context path [{1}] when the WebSocket ServerContainer is allocated to the ServletContext with context path [{2}] serverContainer.servletContextMissing=No ServletContext was specified +uriTemplate.invalidPath=The path [{0}] is not valid. uriTemplate.invalidSegment=The segment [{0}] is not valid in the provided path [{1}] wsHttpUpgradeHandler.destroyFailed=Failed to close WebConnection while destroying the WebSocket HttpUpgradeHandler Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/UriTemplate.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/UriTemplate.java?rev=1496398&r1=1496397&r2=1496398&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/server/UriTemplate.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/server/UriTemplate.java Tue Jun 25 10:08:11 2013 @@ -22,6 +22,8 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import javax.websocket.DeploymentException; + import org.apache.tomcat.util.res.StringManager; /** @@ -38,7 +40,13 @@ public class UriTemplate { private final boolean hasParameters; -public UriTemplate(String path) { +public UriTemplate(String path) throws DeploymentException { + +if (path == null || path.length() ==0 || !path.startsWith("/")) { +throw new DeploymentException( +sm.getString("uriTemplate.invalidPath", path)); +} + StringBuilder normalized = new StringBuilder(path.length()); String[] segments = path.split("/"); Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java?rev=1496398&r1=1496397&r2=1496398&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java Tue Jun 25 10:08:11 2013 @@ -190,7 +190,7 @@ public class WsServerContainer extends W try { configurator = annotation.configurator().newInstance(); } catch (InstantiationException | IllegalAccessException e) { -throw new IllegalStateException(sm.getString( +throw new DeploymentException(sm.getString( "serverContainer.configuratorFail", annotation.configurator().getName(), pojo.getClass().getName()), e); @@ -232,7 +232,13 @@ public class WsServerContainer extends W } // No exact match. Need to look for template matches. -UriTemplate pathUriTemplate = new UriTemplate(path); +UriTemplate pathUriTemplate = null; +try { +pathUriTemplate = new UriTemplate(path); +} catch (DeploymentException e) { +// Path is not valid so can't be matched to a WebSocketEndpoint +return null; +} // Number of segments has to match Integer key = Integer.valueOf(pathUriTemplate.getSegmentCount()); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1496400 - in /tomcat/trunk: java/org/apache/tomcat/websocket/server/LocalStrings.properties java/org/apache/tomcat/websocket/server/WsServerContainer.java test/org/apache/tomcat/websocket
Author: markt Date: Tue Jun 25 10:19:54 2013 New Revision: 1496400 URL: http://svn.apache.org/r1496400 Log: WebSocket 1.0. Section 4.1.1 Deployment to duplicate paths is not permitted Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java tomcat/trunk/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties?rev=1496400&r1=1496399&r2=1496400&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties Tue Jun 25 10:19:54 2013 @@ -15,6 +15,7 @@ sci.newInstance.fail=Failed to create an Endpoint instance of type [{0}] serverContainer.configuratorFail=Failed to create configurator of type [{0}] for POJO of type [{1}] +serverContainer.duplicatePaths=Multiple Endpoints may not be deployed to using the same path [{0}] serverContainer.endpointDeploy=Endpoint class [{0}] deploying to path [{1}] in ServletContext [{2}] serverContainer.missingAnnotation=Cannot deploy POJO class [{0}] as it is not annotated with @ServerEndpoint serverContainer.missingEndpoint=An Endpoint instance has been request for path [{0}] but no matching Endpoint class was found Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java?rev=1496400&r1=1496399&r2=1496400&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java Tue Jun 25 10:19:54 2013 @@ -148,10 +148,19 @@ public class WsServerContainer extends W TemplatePathMatchComparator.getInstance()); configTemplateMatchMap.put(key, templateMatches); } -templateMatches.add(new TemplatePathMatch(sec, uriTemplate)); +if (!templateMatches.add(new TemplatePathMatch(sec, uriTemplate))) { +// Duplicate uriTemplate; +throw new DeploymentException( +sm.getString("serverContainer.duplicatePaths", path)); +} } else { // Exact match -configExactMatchMap.put(path, sec); +ServerEndpointConfig old = configExactMatchMap.put(path, sec); +if (old != null) { +// Duplicate path mappings +throw new DeploymentException( +sm.getString("serverContainer.duplicatePaths", path)); +} } } Modified: tomcat/trunk/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java?rev=1496400&r1=1496399&r2=1496400&view=diff == --- tomcat/trunk/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java (original) +++ tomcat/trunk/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java Tue Jun 25 10:19:54 2013 @@ -112,4 +112,67 @@ public class TestWsServerContainer exten Assert.assertEquals(configB, sc.findMapping("/b/d").getConfig()); } + + +@Test(expected = javax.websocket.DeploymentException.class) +public void testDuplicatePaths_01() throws Exception { +WsServerContainer sc = WsServerContainer.getServerContainer(); +sc.setServletContext(new TesterServletContext()); + +ServerEndpointConfig configA = ServerEndpointConfig.Builder.create( +Object.class, "/a/b/c").build(); +ServerEndpointConfig configB = ServerEndpointConfig.Builder.create( +Object.class, "/a/b/c").build(); + +sc.addEndpoint(configA); +sc.addEndpoint(configB); +} + + +@Test(expected = javax.websocket.DeploymentException.class) +public void testDuplicatePaths_02() throws Exception { +WsServerContainer sc = WsServerContainer.getServerContainer(); +sc.setServletContext(new TesterServletContext()); + +ServerEndpointConfig configA = ServerEndpointConfig.Builder.create( +Object.class, "/a/b/{var}").build(); +ServerEndpointConfig configB = ServerEndpointConfig.Builder.create( +Object.class, "/a/b/{var}").build(); + +sc.addEndpoint(configA); +sc.addEndpoint(configB); +} + + +@Test(expected = j
svn commit: r1496411 - in /tomcat/trunk/java/org/apache/tomcat/websocket/pojo: LocalStrings.properties PojoMethodMapping.java
Author: markt Date: Tue Jun 25 11:02:37 2013 New Revision: 1496411 URL: http://svn.apache.org/r1496411 Log: Fix copy/paste error in i18n Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties?rev=1496411&r1=1496410&r2=1496411&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties Tue Jun 25 11:02:37 2013 @@ -23,6 +23,7 @@ pojoMethodMapping.duplicateLastParam=Mul pojoMethodMapping.duplicateMessageParam=Multiple message parameters present on the method [{0}] of class [{1}] that was annotated with OnMessage pojoMethodMapping.duplicatePongMessageParam=Multiple PongMessage parameters present on the method [{0}] of class [{1}] that was annotated with OnMessage pojoMethodMapping.duplicateSessionParam=Multiple session parameters present on the method [{0}] of class [{1}] that was annotated with OnMessage +pojoMethodMapping.invalidDecoder=The specified decoder of type [{0}] could not be instantiated pojoMethodMapping.noPayload=No payload parameter present on the method [{0}] of class [{1}] that was annotated with OnMessage pojoMethodMapping.onErrorNoThrowable=No Throwable parameter was present on the method [{0}] of class [{1}] that was annotated with OnError pojoMethodMapping.partialInputStream=Invalid InputStream and boolean parameters present on the method [{0}] of class [{1}] that was annotated with OnMessage Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java?rev=1496411&r1=1496410&r2=1496411&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java Tue Jun 25 11:02:37 2013 @@ -165,7 +165,7 @@ public class PojoMethodMapping { instance = decoderClazz.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new DeploymentException( -sm.getString("wsRemoteEndpoint.invalidEncoder", +sm.getString("pojoMethodMapping.invalidDecoder", decoderClazz.getName()), e); } DecoderEntry entry = new DecoderEntry( - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1496417 - /tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java
Author: markt Date: Tue Jun 25 11:16:06 2013 New Revision: 1496417 URL: http://svn.apache.org/r1496417 Log: Refactor to add some clarity Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java?rev=1496417&r1=1496416&r2=1496417&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java Tue Jun 25 11:16:06 2013 @@ -160,6 +160,9 @@ public class PojoMethodMapping { List result = new ArrayList<>(); for (Class decoderClazz : decoderClazzes) { +// Need to instantiate decoder to ensure it is valid and that +// deployment can be failed i=f it is not +@SuppressWarnings("unused") Decoder instance; try { instance = decoderClazz.newInstance(); @@ -169,7 +172,7 @@ public class PojoMethodMapping { decoderClazz.getName()), e); } DecoderEntry entry = new DecoderEntry( -Util.getDecoderType(decoderClazz), instance); +Util.getDecoderType(decoderClazz), decoderClazz); result.add(entry); } @@ -373,9 +376,9 @@ public class PojoMethodMapping { if (decoderEntry.getClazz().isAssignableFrom( types[i])) { if (Binary.class.isAssignableFrom( -decoderEntry.getDecoder().getClass()) || +decoderEntry.getDecoderClazz()) || BinaryStream.class.isAssignableFrom( - decoderEntry.getDecoder().getClass())) { +decoderEntry.getDecoderClazz())) { if (!foundBinaryDecoderMatch) { if (indexByteBuffer == -1) { indexByteBuffer = i; @@ -565,19 +568,20 @@ public class PojoMethodMapping { private static class DecoderEntry { private final Class clazz; -private final Decoder decoder; +private final Class decoderClazz; -public DecoderEntry(Class clazz, Decoder decoder) { +public DecoderEntry(Class clazz, +Class decoderClazz) { this.clazz = clazz; -this.decoder = decoder; +this.decoderClazz = decoderClazz; } public Class getClazz() { return clazz; } -public Decoder getDecoder() { -return decoder; +public Class getDecoderClazz() { +return decoderClazz; } } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1496418 - /tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java
Author: markt Date: Tue Jun 25 11:16:36 2013 New Revision: 1496418 URL: http://svn.apache.org/r1496418 Log: Typo Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java?rev=1496418&r1=1496417&r2=1496418&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java Tue Jun 25 11:16:36 2013 @@ -161,7 +161,7 @@ public class PojoMethodMapping { List result = new ArrayList<>(); for (Class decoderClazz : decoderClazzes) { // Need to instantiate decoder to ensure it is valid and that -// deployment can be failed i=f it is not +// deployment can be failed if it is not @SuppressWarnings("unused") Decoder instance; try { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1496421 - in /tomcat/tc7.0.x/trunk: java/org/apache/catalina/mbeans/MBeanUtils.java webapps/docs/changelog.xml
Author: pero Date: Tue Jun 25 11:26:48 2013 New Revision: 1496421 URL: http://svn.apache.org/r1496421 Log: Avoid Warning message at shutdown, if GlobalResourceLifecacleListener isn't configured Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java?rev=1496421&r1=1496420&r2=1496421&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java Tue Jun 25 11:26:48 2013 @@ -1618,7 +1618,9 @@ public class MBeanUtils { // The database itself ObjectName db = new ObjectName( "Users:type=UserDatabase,database=" + userDatabase); -mserver.unregisterMBean(db); +if(mserver.isRegistered(db)) { +mserver.unregisterMBean(db); +} } Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1496421&r1=1496420&r2=1496421&view=diff == --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Tue Jun 25 11:26:48 2013 @@ -98,6 +98,10 @@ java.beans.Introspector.flushCaches() and sun.awt.AppContext.getAppContext() in Java 7. (markt) + +Avoid WARNING log message of Users:type=UserDatabase,database=UserDatabase +at tomcat shutdown. (pero) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1496426 - in /tomcat/trunk/java/org/apache/tomcat/websocket/server: LocalStrings.properties WsServerContainer.java
Author: markt Date: Tue Jun 25 11:36:59 2013 New Revision: 1496426 URL: http://svn.apache.org/r1496426 Log: WebSocket 1.0. Section 4.1.2 Ensure encoders are valid at deployment time Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties?rev=1496426&r1=1496425&r2=1496426&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/server/LocalStrings.properties Tue Jun 25 11:36:59 2013 @@ -16,6 +16,7 @@ sci.newInstance.fail=Failed to create an serverContainer.configuratorFail=Failed to create configurator of type [{0}] for POJO of type [{1}] serverContainer.duplicatePaths=Multiple Endpoints may not be deployed to using the same path [{0}] +serverContainer.encoderFail=Unable to create encoder of type [{0}] serverContainer.endpointDeploy=Endpoint class [{0}] deploying to path [{1}] in ServletContext [{2}] serverContainer.missingAnnotation=Cannot deploy POJO class [{0}] as it is not annotated with @ServerEndpoint serverContainer.missingEndpoint=An Endpoint instance has been request for path [{0}] but no matching Endpoint class was found Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java?rev=1496426&r1=1496425&r2=1496426&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java Tue Jun 25 11:36:59 2013 @@ -30,6 +30,7 @@ import javax.servlet.DispatcherType; import javax.servlet.FilterRegistration; import javax.servlet.ServletContext; import javax.websocket.DeploymentException; +import javax.websocket.Encoder; import javax.websocket.server.ServerContainer; import javax.websocket.server.ServerEndpoint; import javax.websocket.server.ServerEndpointConfig; @@ -186,6 +187,9 @@ public class WsServerContainer extends W // Uri Template UriTemplate uriTemplate = new UriTemplate(path); +// Validate encoders +validateEncoders(annotation.encoders()); + // Method mapping PojoMethodMapping methodMapping = new PojoMethodMapping(pojo, annotation.decoders(), path); @@ -314,6 +318,23 @@ public class WsServerContainer extends W } +private static void validateEncoders(Class[] encoders) +throws DeploymentException { + +for (Class encoder : encoders) { +// Need to instantiate decoder to ensure it is valid and that +// deployment can be failed if it is not +@SuppressWarnings("unused") +Encoder instance; +try { +encoder.newInstance(); +} catch(InstantiationException | IllegalAccessException e) { +throw new DeploymentException(sm.getString( +"serverContainer.encoderFail", encoder.getName()), e); +} +} +} + private static class TemplatePathMatch { private final ServerEndpointConfig config; private final UriTemplate uriTemplate; - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1496428 - /tomcat/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java
Author: pero Date: Tue Jun 25 11:40:27 2013 New Revision: 1496428 URL: http://svn.apache.org/r1496428 Log: Avoid Warning message at shutdown, if GlobalResourceLifecacleListener isn't configured Modified: tomcat/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java Modified: tomcat/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java?rev=1496428&r1=1496427&r2=1496428&view=diff == --- tomcat/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java (original) +++ tomcat/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java Tue Jun 25 11:40:27 2013 @@ -787,6 +787,8 @@ public class MBeanUtils { // The database itself ObjectName db = new ObjectName( "Users:type=UserDatabase,database=" + userDatabase); -mserver.unregisterMBean(db); +if( mserver.isRegistered(db) ) { +mserver.unregisterMBean(db); +} } } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
buildbot failure in ASF Buildbot on tomcat-trunk
The Buildbot has detected a new failure on builder tomcat-trunk while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomcat-trunk/builds/4519 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/trunk] 1496400 Blamelist: markt BUILD FAILED: failed compile_1 sincerely, -The Buildbot
[Bug 54693] Add a validationQueryTimeout property
https://issues.apache.org/bugzilla/show_bug.cgi?id=54693 --- Comment #9 from Christopher Schultz --- (In reply to Rob Dunn from comment #8) > Any idea when this will be released ? Not likely until it's fixed. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1496443 - in /tomcat/trunk: java/org/apache/tomcat/websocket/server/WsServerContainer.java test/org/apache/tomcat/websocket/server/TestWsServerContainer.java
Author: markt Date: Tue Jun 25 12:17:03 2013 New Revision: 1496443 URL: http://svn.apache.org/r1496443 Log: Fix failing tests Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java tomcat/trunk/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java?rev=1496443&r1=1496442&r2=1496443&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/server/WsServerContainer.java Tue Jun 25 12:17:03 2013 @@ -77,6 +77,13 @@ public class WsServerContainer extends W return result; } +// For unit testing +protected static void recycle() { +synchronized (classLoaderContainerMapLock) { +classLoaderContainerMap.clear(); +} +} + private final WsWriteTimeout wsWriteTimeout = new WsWriteTimeout(); private volatile ServletContext servletContext = null; Modified: tomcat/trunk/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java?rev=1496443&r1=1496442&r2=1496443&view=diff == --- tomcat/trunk/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java (original) +++ tomcat/trunk/test/org/apache/tomcat/websocket/server/TestWsServerContainer.java Tue Jun 25 12:17:03 2013 @@ -77,6 +77,7 @@ public class TestWsServerContainer exten @Test public void testSpecExample3() throws Exception { +WsServerContainer.recycle(); WsServerContainer sc = WsServerContainer.getServerContainer(); sc.setServletContext(new TesterServletContext()); @@ -99,6 +100,7 @@ public class TestWsServerContainer exten @Test public void testSpecExample4() throws Exception { +WsServerContainer.recycle(); WsServerContainer sc = WsServerContainer.getServerContainer(); sc.setServletContext(new TesterServletContext()); @@ -116,6 +118,7 @@ public class TestWsServerContainer exten @Test(expected = javax.websocket.DeploymentException.class) public void testDuplicatePaths_01() throws Exception { +WsServerContainer.recycle(); WsServerContainer sc = WsServerContainer.getServerContainer(); sc.setServletContext(new TesterServletContext()); @@ -131,6 +134,7 @@ public class TestWsServerContainer exten @Test(expected = javax.websocket.DeploymentException.class) public void testDuplicatePaths_02() throws Exception { +WsServerContainer.recycle(); WsServerContainer sc = WsServerContainer.getServerContainer(); sc.setServletContext(new TesterServletContext()); @@ -146,6 +150,7 @@ public class TestWsServerContainer exten @Test(expected = javax.websocket.DeploymentException.class) public void testDuplicatePaths_03() throws Exception { +WsServerContainer.recycle(); WsServerContainer sc = WsServerContainer.getServerContainer(); sc.setServletContext(new TesterServletContext()); @@ -161,6 +166,7 @@ public class TestWsServerContainer exten @Test public void testDuplicatePaths_04() throws Exception { +WsServerContainer.recycle(); WsServerContainer sc = WsServerContainer.getServerContainer(); sc.setServletContext(new TesterServletContext()); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1496444 - /tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
Author: markt Date: Tue Jun 25 12:18:56 2013 New Revision: 1496444 URL: http://svn.apache.org/r1496444 Log: Line length. tomcat -> Tomcat Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1496444&r1=1496443&r2=1496444&view=diff == --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Tue Jun 25 12:18:56 2013 @@ -99,8 +99,9 @@ sun.awt.AppContext.getAppContext() in Java 7. (markt) -Avoid WARNING log message of Users:type=UserDatabase,database=UserDatabase -at tomcat shutdown. (pero) +Avoid WARNING log message of +Users:type=UserDatabase,database=UserDatabase at Tomcat +shutdown. (pero) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: mod_jk, JSESSION_ID and load-balancing
Henri, On 6/25/13 2:33 AM, Henri Gomez wrote: >> Henri, >> This sounds more like a question for the users list. Cross-posting to >> re-locate. See more below... > > > I used dev list because question was also about updating mod_jk code. > >> Is is important to retain the original JSESSIONID, or do you only want >> to retain the jvmRoute information? I would think you'd want both. > > jvmRoute should be kept in JSESSIONID as mod_jk load-balancing use it to > dispatch requests to proper Tomcat :) Of course! But it sounded like both Tomcat and Shiro generate a JSESSIONID but you were only worried about Tomcat's /jvmRoute/ (and not the rest of the session). I'm assuming that you want to maintain both session ids simultaneously. Assuming you want to retain both at the client, why not simply change the name of the cookie for Tomcat (or Shiro)? -chris signature.asc Description: OpenPGP digital signature
[Bug 55143] New: Unable to add programmatic message handler to an endpoint with custom decoder
https://issues.apache.org/bugzilla/show_bug.cgi?id=55143 Bug ID: 55143 Summary: Unable to add programmatic message handler to an endpoint with custom decoder Product: Tomcat 8 Version: trunk Hardware: PC Status: NEW Severity: normal Priority: P2 Component: Catalina Assignee: dev@tomcat.apache.org Reporter: nick...@gmail.com Created attachment 30483 --> https://issues.apache.org/bugzilla/attachment.cgi?id=30483&action=edit WsSession patch Current implementation in WsSession skips checks for custom decoders when addMessageHandler is called for a programmatic endpoint. The same checks are performed for annotated pojos. Here I attach a sample (as there are multiple way of implementing this) and would like to hear your opinion. cheers niki -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55143] Unable to add programmatic message handler to an endpoint with custom decoder
https://issues.apache.org/bugzilla/show_bug.cgi?id=55143 Niki Dokovski changed: What|Removed |Added Attachment #30483|0 |1 is patch|| -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1496454 - in /tomcat/trunk/java/org/apache/tomcat/websocket/pojo: LocalStrings.properties PojoMethodMapping.java
Author: markt Date: Tue Jun 25 13:00:42 2013 New Revision: 1496454 URL: http://svn.apache.org/r1496454 Log: WebSocket 1.0. Section 4.1.[4-6] Duplicate on[Open|Close|Error] annotations should trigger a deployment failure Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties?rev=1496454&r1=1496453&r2=1496454&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties Tue Jun 25 13:00:42 2013 @@ -19,6 +19,7 @@ pojoEndpointBase.onErrorFail=Failed to c pojoEndpointBase.onOpenFail=Failed to call onOpen method of POJO end point for POJO of type [{0}] pojoEndpointServer.getPojoInstanceFail=Failed to create instance of POJO of type [{0}] pojoMethodMapping.decodePathParamFail=Failed to decode path parameter value [{0}] to expected type [{1}] +pojoMethodMapping.duplicateAnnotation=Duplicate annotations present on class [{0}] pojoMethodMapping.duplicateLastParam=Multiple boolean (last) parameters present on the method [{0}] of class [{1}] that was annotated with OnMessage pojoMethodMapping.duplicateMessageParam=Multiple message parameters present on the method [{0}] of class [{1}] that was annotated with OnMessage pojoMethodMapping.duplicatePongMessageParam=Multiple PongMessage parameters present on the method [{0}] of class [{1}] that was annotated with OnMessage Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java?rev=1496454&r1=1496453&r2=1496454&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java Tue Jun 25 13:00:42 2013 @@ -90,6 +90,10 @@ public class PojoMethodMapping { error = method; } else if (method.getAnnotation(OnMessage.class) != null) { onMessage.add(new MessageMethod(method, decoders)); +} else { +// Duplicate annotation +throw new DeploymentException(sm.getString( +"pojoMethodMapping.duplicateAnnotation", clazzPojo)); } } this.onOpen = open; - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
buildbot success in ASF Buildbot on tomcat-trunk
The Buildbot has detected a restored build on builder tomcat-trunk while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomcat-trunk/builds/4521 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/trunk] 1496443 Blamelist: markt,pero Build succeeded! sincerely, -The Buildbot
buildbot failure in ASF Buildbot on tomcat-trunk
The Buildbot has detected a new failure on builder tomcat-trunk while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomcat-trunk/builds/4522 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/trunk] 1496454 Blamelist: markt BUILD FAILED: failed compile_1 sincerely, -The Buildbot
[Bug 55143] Unable to add programmatic message handler to an endpoint with custom decoder
https://issues.apache.org/bugzilla/show_bug.cgi?id=55143 Mark Thomas changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |INVALID OS||All --- Comment #1 from Mark Thomas --- The specification is not particularly clear on this but the discussion in the EG was explicit. The only permitted values of T in MessageHandler are those the WsSession implementation checks for. Developers are responsible for any decoding. This restriction may be relaxed in a later version of the specification but reviewing the discussion any such relaxation is very likely to create lots of nasty edge cases. Any such relaxation is going to have to be very carefully thought through. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: [taglibs] Site plans
Help much appreciated - but do we want all the content of all the modules to be there? It feels to me that the website does not map directly to the codebase. We want an overall site, and subsites for Standard and for RDC. We don't want to have the 14 pom.xmls become a site structure, or the 4 pom.xmls (tld-generator and extended). Hen On Mon, Jun 24, 2013 at 5:23 AM, Olivier Lamy wrote: > Hi, > Can be easy :-) > mvn site site:stage and all the content of all modules will be in > ${project.build.directory}/staging (target/staging). > But to achieve this and having something easy we must the site module > on the top! > Means here http://svn.apache.org/repos/asf/tomcat/taglibs/trunks/ > As we don't release the site (that doesn't shok me :-) ). > With this tree deploying the site will be as easy as: mvn clean site > site:stage && mvn scm-publish:publish-scm > > Make sense ? > I can work on that or help you if you want. > > > > > 2013/6/24 Henri Yandell : > > FYI that I'm digging into the Taglibs site to figure out how it is we go > > from 15 Maven target/site directories to 1 site. > > > > I'm then going to write a dumb shell script that copies the relevant > parts > > to a Tomcat site/taglibs checkout, allowing for the site to be updated. > I'm > > sure there's a very clever Maven plugin that can take care of this and > > handle the logic of the 15 maven projects becoming 1 site, but I'd rather > > build Lego :) > > > > Hen > > > > -- > Olivier Lamy > Ecetera: http://ecetera.com.au > http://twitter.com/olamy | http://linkedin.com/in/olamy > > - > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > >
svn commit: r1496511 - in /tomcat/trunk/java/org/apache/tomcat/websocket/pojo: LocalStrings.properties PojoMethodMapping.java
Author: markt Date: Tue Jun 25 15:05:58 2013 New Revision: 1496511 URL: http://svn.apache.org/r1496511 Log: Fix failing tests. Duplicate annotation test was wrong. Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties?rev=1496511&r1=1496510&r2=1496511&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties Tue Jun 25 15:05:58 2013 @@ -19,7 +19,7 @@ pojoEndpointBase.onErrorFail=Failed to c pojoEndpointBase.onOpenFail=Failed to call onOpen method of POJO end point for POJO of type [{0}] pojoEndpointServer.getPojoInstanceFail=Failed to create instance of POJO of type [{0}] pojoMethodMapping.decodePathParamFail=Failed to decode path parameter value [{0}] to expected type [{1}] -pojoMethodMapping.duplicateAnnotation=Duplicate annotations present on class [{0}] +pojoMethodMapping.duplicateAnnotation=Duplicate annotations [{0}] present on class [{1}] pojoMethodMapping.duplicateLastParam=Multiple boolean (last) parameters present on the method [{0}] of class [{1}] that was annotated with OnMessage pojoMethodMapping.duplicateMessageParam=Multiple message parameters present on the method [{0}] of class [{1}] that was annotated with OnMessage pojoMethodMapping.duplicatePongMessageParam=Multiple PongMessage parameters present on the method [{0}] of class [{1}] that was annotated with OnMessage Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java?rev=1496511&r1=1496510&r2=1496511&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java Tue Jun 25 15:05:58 2013 @@ -79,21 +79,37 @@ public class PojoMethodMapping { Method close = null; Method error = null; for (Method method : clazzPojo.getMethods()) { -if (open == null && -method.getAnnotation(OnOpen.class) != null) { -open = method; -} else if (close == null && -method.getAnnotation(OnClose.class) != null) { -close = method; -} else if (error == null && -method.getAnnotation(OnError.class) != null) { -error = method; +if (method.getAnnotation(OnOpen.class) != null) { +if (open == null) { +open = method; +} else { +// Duplicate annotation +throw new DeploymentException(sm.getString( +"pojoMethodMapping.duplicateAnnotation", +OnOpen.class, clazzPojo)); +} +} else if (method.getAnnotation(OnClose.class) != null) { +if (close == null) { +close = method; +} else { +// Duplicate annotation +throw new DeploymentException(sm.getString( +"pojoMethodMapping.duplicateAnnotation", +OnClose.class, clazzPojo)); +} +} else if (method.getAnnotation(OnError.class) != null) { +if (error == null) { +error = method; +} else { +// Duplicate annotation +throw new DeploymentException(sm.getString( +"pojoMethodMapping.duplicateAnnotation", +OnError.class, clazzPojo)); +} } else if (method.getAnnotation(OnMessage.class) != null) { onMessage.add(new MessageMethod(method, decoders)); } else { -// Duplicate annotation -throw new DeploymentException(sm.getString( -"pojoMethodMapping.duplicateAnnotation", clazzPojo)); +// Method not annotated } } this.onOpen = open; - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55143] Unable to add programmatic message handler to an endpoint with custom decoder
https://issues.apache.org/bugzilla/show_bug.cgi?id=55143 --- Comment #2 from Niki Dokovski --- Thanks Mark. From the spec text this is not obvious at all. May I ask if such discussion exists and respective decision is made to be added to the next revision of the spec? May be we can improve the error of the exception as well. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
buildbot success in ASF Buildbot on tomcat-trunk
The Buildbot has detected a restored build on builder tomcat-trunk while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomcat-trunk/builds/4523 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/trunk] 1496511 Blamelist: markt Build succeeded! sincerely, -The Buildbot
[Bug 55143] Unable to add programmatic message handler to an endpoint with custom decoder
https://issues.apache.org/bugzilla/show_bug.cgi?id=55143 Niki Dokovski changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|INVALID |--- --- Comment #3 from Niki Dokovski --- Please close it again if you find it as inpropriate. I'd like to continue the discussion on this topic (just to keep everything on same place): Here I attach a sample war file (decoder.war) that when deployed on WebSocket RI (glassfish4) handles endpoint just fine: OutputGlassfish4 system:connection established, ws://localhost:8181/decoder/pep command:/binary test sent:<4B of binary data> 74 65 73 74 |test| received:<4B of binary data> 74 65 73 74 |test| On Tomcat 8 sample example produces SEVERE: Error reading request, ignored java.lang.IllegalArgumentException: Unable to add the message handler [pd.mh.AppMessageHandler@2cb5e028] as it was for the unrecognised type [class pd.bean.StringBean] at org.apache.tomcat.websocket.WsSession.addMessageHandler(WsSession.java:182) The RI is normative and if the spec text is unclear then the implementation should be correct. If that is not the case here then RI and the spec should be changed IMHO, otherwise we should implement the same behaviour in Tomcat 8. Opinions ? -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55143] Unable to add programmatic message handler to an endpoint with custom decoder
https://issues.apache.org/bugzilla/show_bug.cgi?id=55143 --- Comment #4 from Niki Dokovski --- Created attachment 30484 --> https://issues.apache.org/bugzilla/attachment.cgi?id=30484&action=edit decoder.war -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55143] Unable to add programmatic message handler to an endpoint with custom decoder
https://issues.apache.org/bugzilla/show_bug.cgi?id=55143 --- Comment #5 from Mark Thomas --- The spec is defined by the doc plus Javadoc. Anything else (TCK, RI, EG lists) merely provides indications of how the spec has been interpreted by others and/or what was intended but ultimately, only the spec counts. I've had a quick scan though the archives and I can't find the discussion I'm sure I had with the EG lead on this. I've found some related discussions. I'll spend some more time digging. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1496592 - in /tomcat/trunk/java/org/apache/tomcat/websocket/pojo: LocalStrings.properties PojoMethodMapping.java
Author: markt Date: Tue Jun 25 19:05:50 2013 New Revision: 1496592 URL: http://svn.apache.org/r1496592 Log: Parameters using decoders can't use partial messages Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties?rev=1496592&r1=1496591&r2=1496592&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/pojo/LocalStrings.properties Tue Jun 25 19:05:50 2013 @@ -28,6 +28,7 @@ pojoMethodMapping.invalidDecoder=The spe pojoMethodMapping.noPayload=No payload parameter present on the method [{0}] of class [{1}] that was annotated with OnMessage pojoMethodMapping.onErrorNoThrowable=No Throwable parameter was present on the method [{0}] of class [{1}] that was annotated with OnError pojoMethodMapping.partialInputStream=Invalid InputStream and boolean parameters present on the method [{0}] of class [{1}] that was annotated with OnMessage +pojoMethodMapping.partialObject=Invalid Object and boolean parameters present on the method [{0}] of class [{1}] that was annotated with OnMessage pojoMethodMapping.partialPong=Invalid PongMesssge and boolean parameters present on the method [{0}] of class [{1}] that was annotated with OnMessage pojoMethodMapping.partialReader=Invalid Reader and boolean parameters present on the method [{0}] of class [{1}] that was annotated with OnMessage pojoMethodMapping.pongWithPayload=Invalid PongMessgae and Message parameters present on the method [{0}] of class [{1}] that was annotated with OnMessage Modified: tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java?rev=1496592&r1=1496591&r2=1496592&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/pojo/PojoMethodMapping.java Tue Jun 25 19:05:50 2013 @@ -300,6 +300,7 @@ public class PojoMethodMapping { Class[] types = m.getParameterTypes(); Annotation[][] paramsAnnotations = m.getParameterAnnotations(); +boolean decoderParameterFound = false; for (int i = 0; i < types.length; i++) { boolean paramFound = false; @@ -403,6 +404,7 @@ public class PojoMethodMapping { if (indexByteBuffer == -1) { indexByteBuffer = i; foundBinaryDecoderMatch = true; +decoderParameterFound = true; } else { throw new IllegalArgumentException(sm.getString( "pojoMethodMapping.duplicateMessageParam", @@ -414,6 +416,7 @@ public class PojoMethodMapping { if (indexString == -1) { indexString = i; foundTextDecoderMatch = true; +decoderParameterFound = true; } else { throw new IllegalArgumentException(sm.getString( "pojoMethodMapping.duplicateMessageParam", @@ -510,6 +513,11 @@ public class PojoMethodMapping { "pojoMethodMapping.partialInputStream", m.getName(), m.getDeclaringClass().getName())); } +if (decoderParameterFound && indexBoolean != -1) { +throw new IllegalArgumentException(sm.getString( +"pojoMethodMapping.partialObject", +m.getName(), m.getDeclaringClass().getName())); +} } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55143] Unable to add programmatic message handler to an endpoint with custom decoder
https://issues.apache.org/bugzilla/show_bug.cgi?id=55143 --- Comment #6 from Mark Thomas --- Bingo! Found it and it is my memory that is at fault. The Javadoc for MessageHandler Whole and Partial have explicit lists of the values that are permitted for T. Looking at the code again, there appear to be several issues including the one raised here. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: mod_jk, JSESSION_ID and load-balancing
Hi Christopher I don't have access to code inside application, I'm using stock Sonatype Nexus OSS who use Shiro internally to manage (and regenetate JSESSIONID cookie), loosing jvmRoute contents. See https://issues.sonatype.org/browse/NEXUS-5756 We could told mod_jk to use another cookie but I think Tomcat allways append jvmRoute content to cookie JSESSIONID. That's why Rainer and I discussed about mod_jk to generate and inject another cookie and use it to maintain sticky affinity. It will be an even better solution for large cluster of Tomcat behind HTTPd/mod_jk, especially when instance are automatically provisionned from template since we don't have to set jvmRoute in server.xml for each instance. But I may be wrong and may be Tomcat 7 could inject jvmRoute in another cookie ? Cheers 2013/6/25 Christopher Schultz > Henri, > > On 6/25/13 2:33 AM, Henri Gomez wrote: > >> Henri, > >> This sounds more like a question for the users list. Cross-posting to > >> re-locate. See more below... > > > > > > I used dev list because question was also about updating mod_jk code. > > > >> Is is important to retain the original JSESSIONID, or do you only want > >> to retain the jvmRoute information? I would think you'd want both. > > > > jvmRoute should be kept in JSESSIONID as mod_jk load-balancing use it to > > dispatch requests to proper Tomcat :) > > Of course! But it sounded like both Tomcat and Shiro generate a > JSESSIONID but you were only worried about Tomcat's /jvmRoute/ (and not > the rest of the session). I'm assuming that you want to maintain both > session ids simultaneously. > > Assuming you want to retain both at the client, why not simply change > the name of the cookie for Tomcat (or Shiro)? > > -chris > >
svn commit: r1496732 - in /tomcat/trunk: java/org/apache/catalina/core/AsyncContextImpl.java test/org/apache/catalina/core/TestAsyncContextImpl.java
Author: violetagg Date: Wed Jun 26 05:00:22 2013 New Revision: 1496732 URL: http://svn.apache.org/r1496732 Log: When AsyncContext.dispatch(...) is invoked do not cast request and response to HttpServletRequest/HttpServletResponse. AsyncContext.startAsync(ServletRequest,ServletResponse) can be invoked with custom ServletRequest/ServletResponse. Modified: tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java Modified: tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java?rev=1496732&r1=1496731&r2=1496732&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java Wed Jun 26 05:00:22 2013 @@ -168,9 +168,17 @@ public class AsyncContextImpl implements @Override public void dispatch() { check(); -HttpServletRequest sr = (HttpServletRequest)getRequest(); -String path = sr.getRequestURI(); -String cpath = sr.getContextPath(); +String path; +String cpath; +ServletRequest servletRequest = getRequest(); +if (servletRequest instanceof HttpServletRequest) { +HttpServletRequest sr = (HttpServletRequest) servletRequest; +path = sr.getRequestURI(); +cpath = sr.getContextPath(); +} else { +path = request.getRequestURI(); +cpath = request.getContextPath(); +} if (cpath.length()>1) path = path.substring(cpath.length()); dispatch(path); } @@ -205,10 +213,8 @@ public class AsyncContextImpl implements } final AsyncDispatcher applicationDispatcher = (AsyncDispatcher) requestDispatcher; -final HttpServletRequest servletRequest = -(HttpServletRequest) getRequest(); -final HttpServletResponse servletResponse = -(HttpServletResponse) getResponse(); +final ServletRequest servletRequest = getRequest(); +final ServletResponse servletResponse = getResponse(); Runnable run = new Runnable() { @Override public void run() { Modified: tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java?rev=1496732&r1=1496731&r2=1496732&view=diff == --- tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java (original) +++ tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java Wed Jun 26 05:00:22 2013 @@ -30,11 +30,15 @@ import javax.servlet.AsyncContext; import javax.servlet.AsyncEvent; import javax.servlet.AsyncListener; import javax.servlet.DispatcherType; +import javax.servlet.GenericServlet; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; +import javax.servlet.ServletRequest; import javax.servlet.ServletRequestEvent; import javax.servlet.ServletRequestListener; +import javax.servlet.ServletRequestWrapper; import javax.servlet.ServletResponse; +import javax.servlet.ServletResponseWrapper; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -1740,9 +1744,9 @@ public class TestAsyncContextImpl extend Wrapper wrapper = Tomcat.addServlet(ctx, "nonAsyncServlet", nonAsyncServlet); wrapper.setAsyncSupported(true); -ctx.addServletMapping("/nonAsyncServlet", "nonAsyncServlet"); +ctx.addServletMapping("/target", "nonAsyncServlet"); -ForbiddenDispatchingServlet forbiddenDispatchingServlet = new ForbiddenDispatchingServlet(); +DispatchingGenericServlet forbiddenDispatchingServlet = new DispatchingGenericServlet(); Wrapper wrapper1 = Tomcat.addServlet(ctx, "forbiddenDispatchingServlet", forbiddenDispatchingServlet); wrapper1.setAsyncSupported(true); @@ -1766,20 +1770,37 @@ public class TestAsyncContextImpl extend assertTrue(body.toString().contains("NonAsyncServletGet")); } -private static class ForbiddenDispatchingServlet extends HttpServlet { +private static class DispatchingGenericServlet extends GenericServlet { private static final long serialVersionUID = 1L; +private static final String CUSTOM_REQ_RESP = "crr"; +private static final String EMPTY_DISPATCH = "empty"; @Override -protected void doGet(HttpServletRequest req, HttpServletResponse resp) +public void service(ServletRequest req, ServletResponse resp) throws ServletException, IOExcepti
svn commit: r1496734 - /tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java
Author: violetagg Date: Wed Jun 26 05:14:18 2013 New Revision: 1496734 URL: http://svn.apache.org/r1496734 Log: Better response message in the tested servlet. Modified: tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java Modified: tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java?rev=1496734&r1=1496733&r2=1496734&view=diff == --- tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java (original) +++ tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java Wed Jun 26 05:14:18 2013 @@ -1800,7 +1800,7 @@ public class TestAsyncContextImpl extend resp.getWriter().print("OK"); } } else { -resp.getWriter().print("ForbiddenDispatchingServletGet-"); +resp.getWriter().print("DispatchingGenericServletGet-"); } } } @@ -1913,7 +1913,7 @@ public class TestAsyncContextImpl extend expected = new StringBuilder(); expected.append("OK"); -expected.append("ForbiddenDispatchingServletGet-"); +expected.append("DispatchingGenericServletGet-"); assertEquals(expected.toString(), res.toString()); } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Jasper improvements, was: Timeline for beginning EL 3.0 implementation?
On Jun 11, 2013, at 1:50 PM, Nick Williams wrote: > > Okay. One of many reasons I ask is that I still have it on my to-do to make > some improvements on the JSP compiler to support things like 1) precompiling > all JSPs on deploy and 2) a better Ant task. I don't know how much the EL > changes might affect this JSP compilation (hopefully it's fairly decoupled), > and I'd like that to not seriously hinder any effort to back-port my > improvements to Tomcat 7. I'm wondering if this needs to move higher on my > list and get in before the EL changes. Any insight? I have been thinking about improvements to Jasper as well around better support for Servlet 3.0 concepts. One area would be decoupling it from Tomcat, bootstrapping using an SCI as hinted in ContextConfig. I'd also be interested in improving the Ant task as well, such as support for pre-compiling a separate package that would be treated as a web fragment (including web.xml-less pre-compilation, generating a web-fragment.xml rather than a web.xml snippet or potentially eliminating the XML entirely if the generated code can be annotated with @WebServlet). - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: [taglibs] Site plans
On Jun 25, 2013, at 7:54 AM, Henri Yandell wrote: > Help much appreciated - but do we want all the content of all the modules > to be there? > > It feels to me that the website does not map directly to the codebase. We > want an overall site, and subsites for Standard and for RDC. We don't want > to have the 14 pom.xmls become a site structure, or the 4 pom.xmls > (tld-generator and extended). Three mini-sites sounds good: a top-level one holding things together and then sub-sites for standard and RDC. Is there a way to associate the top-level one with the parent POM and the others with the "root" poms in standard and rdc? That would match with the things that are likely to be released (being all "standard" packages together, or all "rdc" packages together, but not both at the same time). Do we still need an aggregator pom as well - how about setting up separate CI jobs for "standard" and "rdc"? From the "standard" side, how about killing the separate "doc" "examples" and "standard-test" modules, rolling the documentation and examples into the site and the test cases into unit or integration tests in the individual modules? - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55144] New: NIO connection locked when trying to release it
https://issues.apache.org/bugzilla/show_bug.cgi?id=55144 Bug ID: 55144 Summary: NIO connection locked when trying to release it Product: Tomcat 7 Version: 7.0.41 Hardware: PC Status: NEW Severity: major Priority: P2 Component: Connectors Assignee: dev@tomcat.apache.org Reporter: pavel.re...@gmail.com I'm using Atmoshphere framework and when I try to resume a resource it locks (can be for hours) I'm not sure how to reproduce since it's happening on our prod servers. Using windows server 2008 standard x64 R2, tomcat 7.0.41, java jrockit-jdk1.6.0_37-R28.2.5-4.1.0 This was happening since version 7.0.30 (that's the one we started using) see dump: "CleanResourceTask" id=79 idx=0x14c tid=228160 prio=5 alive, parked, native_blocked, daemon at jrockit/vm/Locks.park0(J)V(Native Method) at jrockit/vm/Locks.park(Locks.java:2230)[optimized] at jrockit/proxy/sun/misc/Unsafe.park(Unsafe.java:616)[inlined] at java/util/concurrent/locks/LockSupport.parkNanos(LockSupport.java:196)[inlined] at java/util/concurrent/locks/AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1011)[inlined] at java/util/concurrent/locks/AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1303)[inlined] at java/util/concurrent/CountDownLatch.await(CountDownLatch.java:253)[inlined] at org/apache/tomcat/util/net/NioEndpoint$KeyAttachment.awaitLatch(NioEndpoint.java:1577)[inlined] at org/apache/tomcat/util/net/NioEndpoint$KeyAttachment.awaitWriteLatch(NioEndpoint.java:1580)[inlined] at org/apache/tomcat/util/net/NioBlockingSelector.write(NioBlockingSelector.java:109)[optimized] at org/apache/tomcat/util/net/NioSelectorPool.write(NioSelectorPool.java:174)[optimized] at org/apache/coyote/http11/InternalNioOutputBuffer.writeToSocket(InternalNioOutputBuffer.java:163)[inlined] at org/apache/coyote/http11/InternalNioOutputBuffer.flushBuffer(InternalNioOutputBuffer.java:242)[optimized] ^-- Holding lock: org/apache/coyote/http11/InternalNioOutputBuffer@0x000222F4BE70[fat lock] at org/apache/coyote/http11/InternalNioOutputBuffer.endRequest(InternalNioOutputBuffer.java:121) at org/apache/coyote/http11/AbstractHttp11Processor.action(AbstractHttp11Processor.java:752)[optimized] at org/apache/coyote/Response.action(Response.java:173)[inlined] at org/apache/coyote/Response.finish(Response.java:279)[inlined] at org/apache/catalina/connector/OutputBuffer.close(OutputBuffer.java:313)[optimized] at org/apache/catalina/connector/Response.finishResponse(Response.java:512) at org/apache/catalina/connector/CometEventImpl.close(CometEventImpl.java:96) at org/atmosphere/container/Tomcat7CometSupport.bz51881(Tomcat7CometSupport.java:178)[optimized] at org/atmosphere/container/Tomcat7CometSupport.action(Tomcat7CometSupport.java:209) at org/atmosphere/container/Tomcat7CometSupport.action(Tomcat7CometSupport.java:47) at org/atmosphere/cpr/AtmosphereResourceImpl.resume(AtmosphereResourceImpl.java:323)[optimized] at com/fx/tasks/CleanResourceTask.resumeOldResources(CleanResourceTask.java:97)[inlined] at com/fx/tasks/CleanResourceTask.access$200(CleanResourceTask.java:26)[optimized] at com/fx/tasks/CleanResourceTask$1.run(CleanResourceTask.java:51) at java/lang/Thread.run(Thread.java:662) at jrockit/vm/RNI.c2java(J)V(Native Method) -- end of trace -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org