Re: Embedding Tomcat 7 in Apache OFBiz

2011-06-16 Thread Konstantin Kolinko
2011/6/16 mrisal...@libero.it :
> Hi all,
>
> I'm one of the Apache OFBiz committer and I'm trying to migrate our embedded
> version of Tomcat 6 to 7 and I have discover a small issue when try to do this
> code:
>
> StandardWrapper defaultServlet = new StandardWrapper();
> defaultServlet.setServletClass("org.apache.catalina.servlets.DefaultServlet");
> defaultServlet.setServletName("default");
> defaultServlet.setLoadOnStartup(1);
> defaultServlet.addInitParameter("debug", "0");
> defaultServlet.addInitParameter("listing", "true");
> defaultServlet.addMapping("/");
>
> I'll receive an NullPointerException on org.apache.catalina.core.
> StandardWrapper.addMapping(StandardWrapper.java:755).
>
> Any hint to solve it ?

1. What exactly version of Tomcat 7.0.x ?

2. Why are you using this internal Tomcat class? What do you do with
StandardWrapper later?

3. Apparently the line that fails is the following:
(line numbers in the most recent Tomcat version differ from the one
you are mentioning)

if(parent.getState().equals(LifecycleState.STARTED))

I think it fails because parent is null.


So either
a) Add StandardWrapper as a child to a context.

- See StandardContext#createWrapper()
- See
 - o.a.c.startup.Tomcat#addServlet(..) (a helper class for embedding Tomcat)
 - o.a.c.deploy.WebXml#configureContext(..)
 - o.a.c.core.ApplicationContext#addServlet(String, Class)

b) If you want to change Tomcat code, file an issue in Bugzilla.

It should be easy to fix:  do not see why not to add parent!=null
check there. Though I do not know whether it will fail further down
the road.
The same may be said about similar code in removeMapping() method.


Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1136318 - in /tomcat/trunk/webapps: ROOT/index.jsp docs/changelog.xml

2011-06-16 Thread kkolinko
Author: kkolinko
Date: Thu Jun 16 08:18:44 2011
New Revision: 1136318

URL: http://svn.apache.org/viewvc?rev=1136318&view=rev
Log:
Add session="false" directive to the index page of the ROOT web application.
There is no need to create a session when accessing this page.

Modified:
tomcat/trunk/webapps/ROOT/index.jsp
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/webapps/ROOT/index.jsp
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/ROOT/index.jsp?rev=1136318&r1=1136317&r2=1136318&view=diff
==
--- tomcat/trunk/webapps/ROOT/index.jsp (original)
+++ tomcat/trunk/webapps/ROOT/index.jsp Thu Jun 16 08:18:44 2011
@@ -15,6 +15,7 @@ See the License for the specific languag
 limitations under the License.
 --%>
 
+<%@ page session="false" %>
 <%
 java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("");
 request.setAttribute("year", sdf.format(new java.util.Date()));

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1136318&r1=1136317&r2=1136318&view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Thu Jun 16 08:18:44 2011
@@ -104,6 +104,10 @@
 43538: Add host name and IP address to the HTML Manager
 application. Patch by Dennis Lundberg. (markt)
   
+  
+Add session="false" directive to the index page of the
+ROOT web application. (kkolinko)
+  
 
   
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of "FAQ" by JohnMalos

2011-06-16 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change 
notification.

The "FAQ" page has been changed by JohnMalos:
http://wiki.apache.org/tomcat/FAQ?action=diff&rev1=43&rev2=44

  Welcome to the Tomcat FAQ. In conjunction with this FAQ we strongly emphasis 
doing the following:
  
  * Read the docs. Most answers are already documented.
- * Know the [[http://java.sun.com/products/servlet/|Servlet]] and 
[[http://java.sun.com/products/jsp/|JSP]] specification. Many answers are not 
documented by the Tomcat team since they are generic and already defined by the 
specs. Know the specs, they let you ensure your webapps are portable across 
different servlet containers. You can download them here: 
[[http://java.sun.com/products/servlet/download.html#specs|Servlet]], 
[[http://java.sun.com/products/jsp/reference/api/index.html#specs|JSP]].
+ * Know the [[http://java.sun.com/products/servlet/|Servlet]] and 
[[http://java.sun.com/products/jsp/|JSP]] specification. Many answers are not 
documented by the Tomcat team since they are generic and already defined by the 
specs. Know the specs, they let you ensure your webapps are portable across 
different servlet containers. You can download them here: 
[[http://java.sun.com/products/servlet/download.html#specs|Servlet]], 
[[http://java.sun.com/products/jsp/reference/api/index.html#specs|JSP]].[[http://forexrobot.eu.com/|forex
 robot]]
  * Please do some research. Use a search engine. It is frustrating to see 
questions which can be answered with a simple Google search (or your favorite 
search engine).
  * Browse or search our [[http://tomcat.apache.org/lists.html|mailing 
lists]].
  
@@ -36, +36 @@

  * [[TomcatVersions|Version]] - About the different tomcat versions.
  * [[../Tomcat/WebDav|WebDav]] - Questions on using Tomcat Webdav servlet.
  * [[/Windows|Windows]] - Common Windows questions.
- 
+ * [[http://signalsforex.org/|forex signals]] - Forex signals online
- 
+ ---
  [[CategoryFAQ|CategoryFAQ]]
  

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of "LocalBadContent" by KonstantinKolinko

2011-06-16 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change 
notification.

The "LocalBadContent" page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/LocalBadContent?action=diff&rev1=15&rev2=16

Comment:
Add recent spam addresses

  fcpages\.com
  feeltime\.cn
  feeltime\.com
+ forexrobot
  freecities\.com
  freewebpages\.org
  freewebsitehosting\.com
@@ -74, +75 @@

  sfzone\.cn
  sh-dzbc\.com\.cn
  shyxbc\.com\.cn
+ signalsforex
  smbay\.cn
  tiffanyonsale\.org
  tinyurl\.com

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of "FAQ" by KonstantinKolinko

2011-06-16 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change 
notification.

The "FAQ" page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/FAQ?action=diff&rev1=45&rev2=46

Comment:
Replace direct specification links with a link to our Specifications page

  Welcome to the Tomcat FAQ. In conjunction with this FAQ we strongly emphasis 
doing the following:
  
  * Read the docs. Most answers are already documented.
- * Know the [[http://java.sun.com/products/servlet/|Servlet]] and 
[[http://java.sun.com/products/jsp/|JSP]] specification. Many answers are not 
documented by the Tomcat team since they are generic and already defined by the 
specs. Know the specs, they let you ensure your webapps are portable across 
different servlet containers. You can download them here: 
[[http://java.sun.com/products/servlet/download.html#specs|Servlet]], 
[[http://java.sun.com/products/jsp/reference/api/index.html#specs|JSP]].
+ * Know the [[Specifications|Servlet and JSP specifications]]. Many 
answers are not documented by the Tomcat team since they are generic and 
already defined by the specs. Know the specs, they let you ensure your webapps 
are portable across different servlet containers.
  * Please do some research. Use a search engine. It is frustrating to see 
questions which can be answered with a simple Google search (or your favorite 
search engine).
  * Browse or search our [[http://tomcat.apache.org/lists.html|mailing 
lists]].
  

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of "FAQ" by JohnMalos

2011-06-16 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change 
notification.

The "FAQ" page has been changed by JohnMalos:
http://wiki.apache.org/tomcat/FAQ?action=diff&rev1=46&rev2=47

  
  * Read the docs. Most answers are already documented.
  * Know the [[Specifications|Servlet and JSP specifications]]. Many 
answers are not documented by the Tomcat team since they are generic and 
already defined by the specs. Know the specs, they let you ensure your webapps 
are portable across different servlet containers.
- * Please do some research. Use a search engine. It is frustrating to see 
questions which can be answered with a simple Google search (or your favorite 
search engine).
+ * Please do some research. Use a search engine. It is frustrating to see 
questions which can be answered with a simple Google search (or your favorite 
search engine).[[http://goldbetreview.com|goldbet]]
+ 
  * Browse or search our [[http://tomcat.apache.org/lists.html|mailing 
lists]].
  
  == Table of Contents ==

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: Testfailures in Tomcat 7

2011-06-16 Thread Christoph Pater
Thanks! That works.

Christoph

2011/6/15 Mark Thomas 

> On 15/06/2011 21:11, Christoph Pater wrote:
> > Hi,
> > I'm Christoph, a java  developer from cologne, germany.
> >
> > I had a little free time and checked out the tomcat trunk. I want to look
> at
> > the code and maybe use my further  free time to do some bugfixes to
> > contribute.
> >
> > So the ant build runs fine and I integrated the sources in eclipse. But
> when
> > I execute the tests in test folder I get about 17 failures and 6 errors.
> >
> > Maybe I missed something or run to much tests? (521 runs).
> >
> > Can anybody give me a hint for a kickstart?
>
> ant clean test
>
> should be all you need. If you look in the build.xml file you'll see
> some tests are excluded. You may also want to configure the tests to run
> with the APR connector which will require a little more configuration.
> All the info you need is in the build.xml file.
>
> Mark
>
>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>


DO NOT REPLY [Bug 51384] New: Adding http codebase to catalina.policy file causes ClassLoaderLogManager access denied exception

2011-06-16 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51384

 Bug #: 51384
   Summary: Adding http codebase to catalina.policy file causes
ClassLoaderLogManager access denied exception
   Product: Tomcat 6
   Version: 6.0.32
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: mark.how...@rbs.com
Classification: Unclassified


Tomcat: 6.0.32 (freshly downloaded and unpacked)
Java: 1.6.0_25 (freshly installed)
OS: Windows XP
Env variables:
JAVA_HOME=C:\Program Files\Java\jdk1.6.0_25
JAVA_OPTS=-Xmx512m

Append the following permission to the end of catalina.policy:

grant codeBase "http://www.abc.com"; {
permission java.security.AllPermission;
};

bin/startup.bat -security

Generates (in console window, no log files generated):

Could not load Logmanager "org.apache.juli.ClassLoaderLogManager"
java.security.AccessControlException: access denied
(java.lang.RuntimePermission setContextClassLoader)
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
at
java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.Thread.setContextClassLoader(Thread.java:1394)
at java.util.logging.LogManager$Cleaner.(LogManager.java:204)
at java.util.logging.LogManager$Cleaner.(LogManager.java:198)
at java.util.logging.LogManager.(LogManager.java:235)
at
org.apache.juli.ClassLoaderLogManager.(ClassLoaderLogManager.java:64)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)

at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at java.util.logging.LogManager$1.run(LogManager.java:164)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.(LogManager.java:156)
at java.util.logging.Logger.getLogger(Logger.java:287)
at
sun.net.www.protocol.http.HttpURLConnection.(HttpURLConnection.java:57)
at sun.net.www.protocol.http.Handler.openConnection(Handler.java:44)
at sun.net.www.protocol.http.Handler.openConnection(Handler.java:39)
at java.net.URL.openConnection(URL.java:945)
at
sun.security.provider.PolicyFile.canonicalizeCodebase(PolicyFile.java:1799)
at sun.security.provider.PolicyFile.getCodeSource(PolicyFile.java:783)
at sun.security.provider.PolicyFile.addGrantEntry(PolicyFile.java:807)
at sun.security.provider.PolicyFile.init(PolicyFile.java:653)
at sun.security.provider.PolicyFile.access$400(PolicyFile.java:266)
at sun.security.provider.PolicyFile$3.run(PolicyFile.java:546)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.provider.PolicyFile.initPolicyFile(PolicyFile.java:519)
at sun.security.provider.PolicyFile.initPolicyFile(PolicyFile.java:505)
at sun.security.provider.PolicyFile.init(PolicyFile.java:464)
at sun.security.provider.PolicyFile.(PolicyFile.java:309)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)

at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at java.security.Policy.getPolicyNoCheck(Policy.java:167)
at java.security.ProtectionDomain.implies(ProtectionDomain.java:224)
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:352)
at
java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at
java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1285)
at java.lang.System.getProperty(System.java:650)
at org.apache.juli.logging.DirectJDKLog.(DirectJDKLog.java:43)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:171)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:243)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:298)
at org.apache.catalina.startup.Bootstrap.(Bootstrap.j

DO NOT REPLY [Bug 51379] The method setVar(String) in the type DataTableTag is not applicable for the arguments (JspValueExpression)

2011-06-16 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51379

Mark Thomas  changed:

   What|Removed |Added

 Status|RESOLVED|CLOSED

--- Comment #4 from Mark Thomas  2011-06-16 09:05:38 UTC ---
I did look at this. Once I fixed the broken test case (removed the JBoss
library, added all the missing libraries required by Tomcat), figured out how
to run the test (since zero information was provided) and then figured out how
to configure the database required by the test (again, zero information was
provided) everything worked and no errors were seen.

Again, Bugzilla is not a support forum. You need to use the users mailing list.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



[Tomcat Wiki] Update of "LocalBadContent" by KonstantinKolinko

2011-06-16 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change 
notification.

The "LocalBadContent" page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/LocalBadContent?action=diff&rev1=16&rev2=17

Comment:
Add recent spam addresses

  freewebpages\.org
  freewebsitehosting\.com
  g0g\.net
+ goldbetreview
  hbgm\.cn
  hfire\.cn
  homepage\.mac\.com

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [VOTE] Release Apache Tomcat 7.0.16

2011-06-16 Thread Konstantin Kolinko
2011/6/11 Mark Thomas :
> The proposed Apache Tomcat 7.0.16 release is now available for voting.
>
> It can be obtained from:
> http://people.apache.org/~markt/dev/tomcat-7/v7.0.16/
> The svn tag is:
> http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_16/
>
> The proposed 7.0.16 release is:
>
> [ ] Broken - do not release
> [ ] Alpha  - go ahead and release as 7.0.16 Alpha
> [ ] Beta   - go ahead and release as 7.0.16 Beta
> [x] Stable - go ahead and release as 7.0.16 Stable


When running the testsuite I observed an occasional failure in
org.apache.catalina.servlets.TestDefaultServlet with APR.
The cause was failing mkdirs() call

Unable to create directory [(...)\output\test-tmp\MyApp\WEB-INF]
at 
org.apache.catalina.servlets.TestDefaultServlet.testCustomErrorPageMissing(TestDefaultServlet.java:242)

When rerunning this test with all connectors separately I did not
observe the issue.

All other tests in the testsuite did run successfully:
BIO, NIO, APR, with Oracle JDK 6u25 32-bit on Windows XP

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of "PoweredBy" by DonnaDolorsendra

2011-06-16 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change 
notification.

The "PoweredBy" page has been changed by DonnaDolorsendra:
http://wiki.apache.org/tomcat/PoweredBy?action=diff&rev1=344&rev2=345

  
  == Surveys and Other Evidence of Usage ==
  === JBoss Infrastructure Survey ===
- {{http://www.jboss.com/themes/jbosstheme/img/logo.gif}} 
[[http://www.jboss.com/pdf/JBossAS-EnterpriseInfrastructure.pdf|A survey]] of 
infrastructure tools, adoption, mindshare, and more from JBoss finds Tomcat 
again among the leading products.
+ {{http://www.jboss.com/themes/jbosstheme/img/logo.gif}} 
[[http://www.jboss.com/pdf/JBossAS-EnterpriseInfrastructure.pdf|A survey]] of 
infrastructure tools, adoption, mindshare, and more from JBoss finds Tomcat 
again among the leading products and finance service - 
[[http://nofaxpayday-loans.com/|faxless payday loans]].
  
  === O'Reilly On Java ===
  {{http://www.onjava.com/images/onjava/onjava_logo.jpg}} 
[[http://www.onjava.com/pub/a/onjava/2004/05/19/2004-survey.html|Over 86%]] of 
respondents in O'Reilly's On Java 2004 Survey.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Tomcat Wiki] Update of "LocalBadContent" by KonstantinKolinko

2011-06-16 Thread Apache Wiki
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change 
notification.

The "LocalBadContent" page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/LocalBadContent?action=diff&rev1=17&rev2=18

Comment:
Add recent spam addresses

  mnsp\.cn
  mystreyguy
  nekoo\.cn
+ nofaxpayday
  oa8000\.com\.cn
  o-f\.com
  paisi\.com

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r1136231 - in /tomcat/trunk: java/org/apache/catalina/ssi/ExpressionParseTree.java webapps/docs/changelog.xml

2011-06-16 Thread Tim Funk
**
What happens if PatternSyntaxException is thrown? (bad regex is passed in)
While it is a RuntimeException - i'd assume you'd want to log.warn(with the
regex) and return -1;


-Tim

On 6/15/2011 6:44 PM, ma...@apache.org wrote:

Modified: tomcat/trunk/java/org/apache/catalina/ssi/ExpressionParseTree.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ssi/ExpressionParseTree.java?rev=1136231&r1=1136230&r2=1136231&view=diff
==
@@ -350,6 +351,21 @@ public class ExpressionParseTree {
 protected int compareBranches() {
 String val1 = ((StringNode)left).getValue();
 String val2 = ((StringNode)right).getValue();
+
+int val2Len = val2.length();
+if (val2Len > 1 && val2.charAt(0) == '/' &&
+val2.charAt(val2Len - 1) == '/') {
+// Treat as a regular expression
+String expr = val2.substring(1, val2Len - 1);
+Pattern pattern = Pattern.compile(expr);
+// Regular expressions will only ever be used with EqualNode
+// so return zero for equal and non-zero for not equal
+if (pattern.matcher(val1).find()) {
+return 0;
+} else {
+return -1;
+}
+}


Re: svn commit: r1136231 - in /tomcat/trunk: java/org/apache/catalina/ssi/ExpressionParseTree.java webapps/docs/changelog.xml

2011-06-16 Thread Mark Thomas
On 16/06/2011 11:57, Tim Funk wrote:
> **
> What happens if PatternSyntaxException is thrown? (bad regex is passed in)
> While it is a RuntimeException - i'd assume you'd want to log.warn(with the
> regex) and return -1;

Not sure. Swallowing the error and assuming a non-match seems bad too. A
syntax error in a JSP page isn't going to be that forgiving. Time to ask
"What would httpd do?".

Wasn't expecting that. It returns a match. I'll amend my patch to do the
same.

Mark



> 
> 
> -Tim
> 
> On 6/15/2011 6:44 PM, ma...@apache.org wrote:
> 
> Modified: tomcat/trunk/java/org/apache/catalina/ssi/ExpressionParseTree.java
> URL: 
> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ssi/ExpressionParseTree.java?rev=1136231&r1=1136230&r2=1136231&view=diff
> ==
> @@ -350,6 +351,21 @@ public class ExpressionParseTree {
>  protected int compareBranches() {
>  String val1 = ((StringNode)left).getValue();
>  String val2 = ((StringNode)right).getValue();
> +
> +int val2Len = val2.length();
> +if (val2Len > 1 && val2.charAt(0) == '/' &&
> +val2.charAt(val2Len - 1) == '/') {
> +// Treat as a regular expression
> +String expr = val2.substring(1, val2Len - 1);
> +Pattern pattern = Pattern.compile(expr);
> +// Regular expressions will only ever be used with EqualNode
> +// so return zero for equal and non-zero for not equal
> +if (pattern.matcher(val1).find()) {
> +return 0;
> +} else {
> +return -1;
> +}
> +}
> 




-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1136399 - /tomcat/trunk/java/org/apache/catalina/ssi/ExpressionParseTree.java

2011-06-16 Thread markt
Author: markt
Date: Thu Jun 16 12:28:01 2011
New Revision: 1136399

URL: http://svn.apache.org/viewvc?rev=1136399&view=rev
Log:
Align SSI regexp handling with htttpd

Modified:
tomcat/trunk/java/org/apache/catalina/ssi/ExpressionParseTree.java

Modified: tomcat/trunk/java/org/apache/catalina/ssi/ExpressionParseTree.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ssi/ExpressionParseTree.java?rev=1136399&r1=1136398&r2=1136399&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/ssi/ExpressionParseTree.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/ssi/ExpressionParseTree.java Thu Jun 
16 12:28:01 2011
@@ -21,6 +21,7 @@ import java.text.ParseException;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
 /**
  * Represents a parsed expression.
  * 
@@ -357,13 +358,18 @@ public class ExpressionParseTree {
 val2.charAt(val2Len - 1) == '/') {
 // Treat as a regular expression
 String expr = val2.substring(1, val2Len - 1);
-Pattern pattern = Pattern.compile(expr);
-// Regular expressions will only ever be used with EqualNode
-// so return zero for equal and non-zero for not equal
-if (pattern.matcher(val1).find()) {
+try {
+Pattern pattern = Pattern.compile(expr);
+// Regular expressions will only ever be used with 
EqualNode
+// so return zero for equal and non-zero for not equal
+if (pattern.matcher(val1).find()) {
+return 0;
+} else {
+return -1;
+}
+} catch (PatternSyntaxException pse) {
+ssiMediator.log("Invalid expression: " + expr, pse);
 return 0;
-} else {
-return -1;
 }
 }
 return val1.compareTo(val2);



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[RESULT] [VOTE] Release Apache Tomcat 7.0.16

2011-06-16 Thread Mark Thomas
This vote passed with 4 binding votes for stable from markt, rjung,
yoavs and kkolinko.

Thanks to everyone that provided feedback.

Mark



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 51386] New: @HandlingType not correctly handled at server startup leads to incorrect classes set passed to initializers

2011-06-16 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51386

 Bug #: 51386
   Summary: @HandlingType not correctly handled at server startup
leads to incorrect classes set passed to initializers
   Product: Tomcat 7
   Version: trunk
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: critical
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: etienne.mas...@gmail.com
Classification: Unclassified


The following code in
org.apache.catalina.startup.ContextConfig.checkHandlesTypes(JavaClass) looks
very buggy :

  boolean match = false;

  for (Map.Entry, Set> entry :
  typeInitializerMap.entrySet()) {
  if (entry.getKey().isAnnotation()) {
  AnnotationEntry[] annotationEntries =
javaClass.getAnnotationEntries();
  for (AnnotationEntry annotationEntry : annotationEntries) {
  if (entry.getKey().getName().equals(
  getClassName(annotationEntry.getAnnotationType( {
  match = true;
  break;
  }
  }
  } else if (entry.getKey().isAssignableFrom(clazz)) {
  match = true;
  }
  if (match) {
  for (ServletContainerInitializer sci : entry.getValue()) {
  initializerClassMap.get(sci).add(clazz);
  }
  }
  }

Shouldn't "match" variable be reset to false at each iteration ?

As it is for now, my SpringServletContainerInitializer (3.1M2), handling only
WebApplicationInitializers, will finally receive a huge set of various
applicative classes, starting from the first class parsed matching any type
handled by any previously parsed ServletContainerInitializer !!!

http://svn.apache.org/repos/asf/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51386] @HandlingType not correctly handled at server startup leads to incorrect classes set passed to initializers

2011-06-16 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51386

--- Comment #1 from Etienne Massip  2011-06-16 
14:55:12 UTC ---
Finally leading to a cast exception preventing server startup.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51386] @HandlingType not correctly handled at server startup leads to incorrect classes set passed to initializers

2011-06-16 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51386

--- Comment #2 from Mark Thomas  2011-06-16 15:54:26 UTC ---
Yep, that looks like a problem. I'll put together a test case and fix.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51379] The method setVar(String) in the type DataTableTag is not applicable for the arguments (JspValueExpression)

2011-06-16 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51379

--- Comment #5 from Kallol  2011-06-16 15:55:33 UTC 
---
The issue is still there. I have attatched the eclipse project for your
reference. data.jsp is the jsp file containing the h:dataTable tag. 

The main issue is the backing bean reads the database table and returns a list
of rows where each row contains only 1 column. In the h:dataBase tag, the var
attribute is set to receive each row of the table. The error message is
displayed because of this var attribute and it gives a type conversion error.
Details of the error message in my first comment itself.

This issue is reported by several people and seems to be a bug. 
IF NOT KINDLY PROVIDE ME A SOLUTION WITH SAMPLE CODE etc.

To repeat I am testing with eclipse 3.4.1 and Tomcat 6.0.14 on Windows XP.

Thanks a lot in advance.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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: r1136536 - /tomcat/tc6.0.x/trunk/STATUS.txt

2011-06-16 Thread schultz
Author: schultz
Date: Thu Jun 16 16:33:07 2011
New Revision: 1136536

URL: http://svn.apache.org/viewvc?rev=1136536&view=rev
Log:
Votes.

Modified:
tomcat/tc6.0.x/trunk/STATUS.txt

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1136536&r1=1136535&r2=1136536&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Thu Jun 16 16:33:07 2011
@@ -136,7 +136,7 @@ PATCHES PROPOSED TO BACKPORT:
 
 * Expose a container event for changing the session ID
   http://svn.apache.org/viewvc?view=revision&revision=1097899
-  +1: markt, kfujino
+  +1: markt, kfujino, schultz
   -1:
 
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51220
@@ -154,7 +154,7 @@ PATCHES PROPOSED TO BACKPORT:
   'recoverable' OOME in the bug is a plausible one.
   Patch provided by Ramiro
   http://svn.apache.org/viewvc?rev=1099575&view=rev
-  +1: markt, rjung
+  +1: markt, rjung, schultz
   -1:
 
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51306.
@@ -163,5 +163,5 @@ PATCHES PROPOSED TO BACKPORT:
   -When the session expiration is received, the session message is never 
transmitted to a primary node. 
   http://svn.apache.org/viewvc?rev=1135069&view=rev
-  +1: kfujino
+  +1: kfujino, schultz
   -1:



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1136550 - in /tomcat/trunk: java/org/apache/catalina/startup/ContextConfig.java test/org/apache/catalina/startup/TestContextConfigAnnotation.java webapps/docs/changelog.xml

2011-06-16 Thread markt
Author: markt
Date: Thu Jun 16 17:24:03 2011
New Revision: 1136550

URL: http://svn.apache.org/viewvc?rev=1136550&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51386
Correct code for processing @HandlesTypes annotations so only types of interest 
are reported to a ServletContainerInitializer.

Modified:
tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java

tomcat/trunk/test/org/apache/catalina/startup/TestContextConfigAnnotation.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1136550&r1=1136549&r2=1136550&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Thu Jun 16 
17:24:03 2011
@@ -1985,6 +1985,7 @@ public class ContextConfig
 for (ServletContainerInitializer sci : entry.getValue()) {
 initializerClassMap.get(sci).add(clazz);
 }
+match = false;
 }
 }
 }

Modified: 
tomcat/trunk/test/org/apache/catalina/startup/TestContextConfigAnnotation.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/TestContextConfigAnnotation.java?rev=1136550&r1=1136549&r2=1136550&view=diff
==
--- 
tomcat/trunk/test/org/apache/catalina/startup/TestContextConfigAnnotation.java 
(original)
+++ 
tomcat/trunk/test/org/apache/catalina/startup/TestContextConfigAnnotation.java 
Thu Jun 16 17:24:03 2011
@@ -16,14 +16,23 @@
  */
 package org.apache.catalina.startup;
 
+import java.beans.PropertyChangeListener;
 import java.io.File;
 import java.net.URL;
+import java.util.HashSet;
 import java.util.Set;
 
 import javax.servlet.DispatcherType;
+import javax.servlet.Servlet;
+import javax.servlet.ServletContainerInitializer;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
 
 import junit.framework.TestCase;
 
+import org.apache.catalina.Container;
+import org.apache.catalina.Loader;
+import org.apache.catalina.core.StandardContext;
 import org.apache.catalina.deploy.FilterDef;
 import org.apache.catalina.deploy.FilterMap;
 import org.apache.catalina.deploy.ServletDef;
@@ -241,6 +250,93 @@ public class TestContextConfigAnnotation
 assertNull(filterDef);
 }
 
+public void testCheckHandleTypes() throws Exception {
+ContextConfig config = new ContextConfig();
+
+// Need a Context, Loader and ClassLoader for checkHandleTypes
+StandardContext context = new StandardContext();
+context.setLoader(new TesterLoader());
+config.context = context;
+
+// Add an SCI that has no interest in any type
+SCI sciNone = new SCI();
+config.initializerClassMap.put(sciNone, new HashSet>());
+
+// Add an SCI with an interest in Servlets
+SCI sciServlet = new SCI();
+config.initializerClassMap.put(sciServlet, new HashSet>());
+config.typeInitializerMap.put(Servlet.class,
+new HashSet());
+config.typeInitializerMap.get(Servlet.class).add(sciServlet);
+
+// Add an SCI with an interest in Objects - i.e. everything
+SCI sciObject = new SCI();
+config.initializerClassMap.put(sciObject, new HashSet>());
+config.typeInitializerMap.put(Object.class,
+new HashSet());
+config.typeInitializerMap.get(Object.class).add(sciObject);
+
+// Scan Servlet, Filter, Servlet, Listener
+WebXml ignore = new WebXml();
+File file = paramClassResource(
+"org/apache/catalina/startup/ParamServlet");
+config.processAnnotationsFile(file, ignore);
+file = paramClassResource("org/apache/catalina/startup/ParamFilter");
+config.processAnnotationsFile(file, ignore);
+file = paramClassResource("org/apache/catalina/startup/TesterServlet");
+config.processAnnotationsFile(file, ignore);
+file = paramClassResource("org/apache/catalina/startup/TestListener");
+config.processAnnotationsFile(file, ignore);
+
+// Check right number of classes were noted to be handled
+assertEquals(0, config.initializerClassMap.get(sciNone).size());
+assertEquals(2, config.initializerClassMap.get(sciServlet).size());
+assertEquals(4, config.initializerClassMap.get(sciObject).size());
+}
+
+private static final class SCI implements ServletContainerInitializer {
+@Override
+public void onStartup(Set> c, ServletContext ctx)
+throws ServletException {
+// NO-OP. Just need a class that implements SCI.
+ 

DO NOT REPLY [Bug 51386] @HandlingType not correctly handled at server startup leads to incorrect classes set passed to initializers

2011-06-16 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51386

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #3 from Mark Thomas  2011-06-16 17:24:30 UTC ---
Thanks for the report. This has been fixed in 7.0.x and will be included in
7.0.17 onwards.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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: r1136551 - /tomcat/trunk/webapps/docs/changelog.xml

2011-06-16 Thread markt
Author: markt
Date: Thu Jun 16 17:25:50 2011
New Revision: 1136551

URL: http://svn.apache.org/viewvc?rev=1136551&view=rev
Log:
Release tomorrow. Mirrors should have sync'd by then.

Modified:
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1136551&r1=1136550&r2=1136551&view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Thu Jun 16 17:25:50 2011
@@ -116,7 +116,7 @@
 
   
 
-
+
   
 
   



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1136552 - /tomcat/trunk/webapps/docs/changelog.xml

2011-06-16 Thread markt
Author: markt
Date: Thu Jun 16 17:26:15 2011
New Revision: 1136552

URL: http://svn.apache.org/viewvc?rev=1136552&view=rev
Log:
Tomorrow is the 17th

Modified:
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1136552&r1=1136551&r2=1136552&view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Thu Jun 16 17:26:15 2011
@@ -116,7 +116,7 @@
 
   
 
-
+
   
 
   



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: Embedding Tomcat 7 in Apache OFBiz

2011-06-16 Thread mrisal...@libero.it
Thanks Konstantin,

I'm using tomcat 7.0.14 and the code I'm migrate is actually done in this way.
Anyway I will check if it's working with your suggestions and if it's negative 
open a bug.

Marco

2011/6/16 mrisal...@libero.it :
Hi all,

I'm one of the Apache OFBiz committer and I'm trying to migrate our embedded
version of Tomcat 6 to 7 and I have discover a small issue when try to do this
code:

StandardWrapper defaultServlet = new StandardWrapper();
defaultServlet.setServletClass("org.apache.catalina.servlets.DefaultServlet");
defaultServlet.setServletName("default");
defaultServlet.setLoadOnStartup(1);
defaultServlet.addInitParameter("debug", "0");
defaultServlet.addInitParameter("listing", "true");
defaultServlet.addMapping("/");

I'll receive an NullPointerException on org.apache.catalina.core.
StandardWrapper.addMapping(StandardWrapper.java:755).

Any hint to solve it ?

1. What exactly version of Tomcat 7.0.x ?

2. Why are you using this internal Tomcat class? What do you do with
StandardWrapper later?

3. Apparently the line that fails is the following:
(line numbers in the most recent Tomcat version differ from the one
you are mentioning)

if(parent.getState().equals(LifecycleState.STARTED))

I think it fails because parent is null.


So either
a) Add StandardWrapper as a child to a context.

- See StandardContext#createWrapper()
- See
- o.a.c.startup.Tomcat#addServlet(..) (a helper class for embedding Tomcat)
- o.a.c.deploy.WebXml#configureContext(..)
- o.a.c.core.ApplicationContext#addServlet(String, Class)

b) If you want to change Tomcat code, file an issue in Bugzilla.

It should be easy to fix:  do not see why not to add parent!=null
check there. Though I do not know whether it will fail further down
the road.
The same may be said about similar code in removeMapping() method.


Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 51388] New: SlowQueryReport should respect Statement.getQueryTimeout() value

2011-06-16 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51388

 Bug #: 51388
   Summary: SlowQueryReport should respect
Statement.getQueryTimeout() value
   Product: Tomcat Modules
   Version: unspecified
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: jdbc-pool
AssignedTo: dev@tomcat.apache.org
ReportedBy: hay_d...@yahoo.com
Classification: Unclassified


It would be nice if the threshold for slow queries could be configured on a
per-query basis.

This could be done by respecting the value returned from
Statement.getQueryTimeout() in AbstractQueryReport.StatementProxy.  If the
value returned from the Statement is non-zero and greater than the
SlowQueryReport 'threshold', the the value from the query is used instead.

This behavior should probably be something that could be toggled on or off.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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