Re: tomcat-native: multicast on win32

2009-02-16 Thread Mladen Turk

Lorenz Breu wrote:

Try Multicast.loopback if Multicast.join fails.
Win32 is pretty weired, and not sure why the join doesn't work.
I suppose the multicast group needs to exists before joining.


no cigar. i first expected an APR_ENOTIMPL or even a failure, but i get
APR_SUCCESS all the way... but nothing actually happens... works fine
with linux though, so i guess it's either me being lucky that linux is
catching my mistake, or there being a problem with the apr code on my
win32 machine (xp pro).

do i need to specify a source when i join a group? isn't NOT specifying
one safer than specifying one, as i want to accept all muslticast
messages to that address, no matter where they come from??

here is what i have been doing:
i actually used 0 instead of the specific interface, then i thought
windows may need to be specified an address, but both approaches do the
same thing: return success and do nothing. all individual steps below
return APR_SUCCESS.


long ifa = Address.info("192.168.2.100", Socket.APR_INET, 0, 0, pool);


You can use "0.0.0.0" here.


Multicast.ointerface(handle, ifa);


No need to call this.


long ra;
ra = Address.info("234.255.255.253", 0, 0, 0, pool);


You need a port here.


Multicast.loopback(handle, true);
Multicast.join(handle, ra, ifa, 0);
Socket.optSet(handle, Socket.APR_SO_NONBLOCK, 1);
Socket.timeoutSet(handle, 0);
Socket.optSet(handle, Socket.APR_SO_REUSEADDR, 1);
Socket.optSet(handle, Socket.APR_SO_RCVBUF,
getSessionConfig().getReceiveBufferSize());
long sa;
sa = Address.info(la.getAddress().getHostAddress(), Socket.APR_INET,
la.getPort(), 0, pool);
result = Socket.bind(handle, sa);




Here is the correct algo for sender:

ifa = Address.info(null, Socket.APR_INET, Socket.APR_UNSPEC, 0, pool).
mca = Address.info("234.255.255.253", Socket.APR_INET, 
Socket.APR_UNSPEC, 25000, pool);

Socket.optSet(handle, Socket.APR_SO_REUSEADDR, 1);
result = Socket.bind(handle, ifa);
Multicast.join(handle, mca, ifa, 0);


Regards
--
^(TM)

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



svn commit: r744951 - in /tomcat/tc6.0.x/trunk: STATUS.txt java/org/apache/coyote/ajp/AjpAprProcessor.java java/org/apache/coyote/ajp/AjpProcessor.java webapps/docs/changelog.xml

2009-02-16 Thread remm
Author: remm
Date: Mon Feb 16 15:58:00 2009
New Revision: 744951

URL: http://svn.apache.org/viewvc?rev=744951&view=rev
Log:
- Fix HTTP/1.0 handling.

Modified:
tomcat/tc6.0.x/trunk/STATUS.txt
tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpProcessor.java
tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=744951&r1=744950&r2=744951&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Mon Feb 16 15:58:00 2009
@@ -159,11 +159,6 @@
   +1: markt
   -1: 
 
-* Fix HTTP/1.0 handling in the new AJP connectors
-  http://svn.apache.org/viewvc?rev=742962&view=rev
-  +1: remm, jfclere, markt
-  -1: 
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=4
   keepAliveTimeout should be used regardless of setting of disableUploadTimeout
   http://svn.apache.org/viewvc?rev=744160&view=rev

Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java?rev=744951&r1=744950&r2=744951&view=diff
==
--- tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Mon 
Feb 16 15:58:00 2009
@@ -839,9 +839,13 @@
 
 if (valueMB == null || (valueMB != null && valueMB.isNull()) ) {
 // HTTP/1.0
-// Default is what the socket tells us. Overriden if a host is
-// found/parsed
-request.setServerPort(endpoint.getPort());
+request.setServerPort(request.getLocalPort());
+try {
+request.serverName().duplicate(request.localName());
+} catch (IOException e) {
+response.setStatus(400);
+error = true;
+}
 return;
 }
 

Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpProcessor.java?rev=744951&r1=744950&r2=744951&view=diff
==
--- tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpProcessor.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpProcessor.java Mon Feb 
16 15:58:00 2009
@@ -845,9 +845,13 @@
 
 if (valueMB == null || (valueMB != null && valueMB.isNull()) ) {
 // HTTP/1.0
-// Default is what the socket tells us. Overriden if a host is
-// found/parsed
-request.setServerPort(endpoint.getPort());
+request.setServerPort(request.getLocalPort());
+try {
+request.serverName().duplicate(request.localName());
+} catch (IOException e) {
+response.setStatus(400);
+error = true;
+}
 return;
 }
 

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=744951&r1=744950&r2=744951&view=diff
==
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Mon Feb 16 15:58:00 2009
@@ -329,6 +329,9 @@
   
 Enable the thread pool limits to be modified via JMX. (markt)
   
+  
+   Fix HTTP/1.0 redirects handling with APR AJP connector. (remm)
+  
 
   
   



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



Re: tomcat-native: multicast on win32

2009-02-16 Thread Lorenz Breu

> Here is the correct algo for sender:
>
> ifa = Address.info(null, Socket.APR_INET, Socket.APR_UNSPEC, 0, pool).
> mca = Address.info("234.255.255.253", Socket.APR_INET,
> Socket.APR_UNSPEC, 25000, pool);
> Socket.optSet(handle, Socket.APR_SO_REUSEADDR, 1);
> result = Socket.bind(handle, ifa);
> Multicast.join(handle, mca, ifa, 0);
>
>   
thanks again for the help. unfortunately using your code suggestion
still doesn't work. the same code on the same machine booted to linux
(ubunut heron) works fine, but when booted to winXP it doesn't, as
mentioned before. no errors reported...
i will try on a different windows machine when i get the time, maybe
it's a driver problem?? the box does send out igmp join messages and
talks with the router, so multicasting must somehow work, just not with
the APR code. i also tried contacting the APR user list, however it
seems to have been discontinued?

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



Re: DO NOT REPLY [Bug 46694] New: Servlet Facets when running multiple application on one tomcat instance

2009-02-16 Thread Karl San Gabriel

Hi Igor,

Could it be the version of Java you are using to compile the codes?

I encountered something like this before few days ago.
My Java classes compiled with jdk1.6 don't work in production.

I needed to re-compile everything using jdk1.5 and it worked.

I hope this helps.

Regards,
Karl

bugzi...@apache.org wrote:

https://issues.apache.org/bugzilla/show_bug.cgi?id=46694

   Summary: Servlet Facets when running multiple application on one
tomcat instance
   Product: Tomcat 6
   Version: 6.0.18
  Platform: PC
OS/Version: Windows Vista
Status: NEW
  Severity: minor
  Priority: P2
 Component: Servlet & JSP API
AssignedTo: dev@tomcat.apache.org
ReportedBy: i...@amplio.si


For quite some time i couldn't figure out why some of the applications could
start on local server and not on production servers (all servers the same
version 6.0.18) which run multiple tomcat applications, giving ERROR:
SEVERE: Error configuring application listener of class
si.amplio.web.filters.OnLoadContextListener
java.lang.ClassNotFoundException: si.amplio.web.filters.OnLoadContextListener
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3786)

I'm using Eclipse for development. 
If there are applications on tomcat running with facets (JS API) set to 2.5

then all deploying apps must have the same facets else error mentioned above
stops new application from being started after deploy. The same goes when the
first app is deployed on tomcat with facets set to 2.4. All following apps must
have set facets to 2.4.

I've scanned all the documentation and google to figure this out...Couldn't
find it. Is this documentation bug or is it tomcat servlet container bug ?


  



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



start a secure connector on embedded tomcat 6.0

2009-02-16 Thread

Hi every body,

this code seems to not execute anymore on a tomcat 6.0

final Connector httpsConnector = 
_embedded.createConnector( address, httpsPort, "https");
   IntrospectionUtils.setProperty(httpsConnector, 
"sslProtocol", "TLS");
   IntrospectionUtils.setProperty(httpsConnector, 
"keystoreFile", "conf/tomcat.jks");
   IntrospectionUtils.setProperty(httpsConnector, 
"keystoreType", "JKS");
   IntrospectionUtils.setProperty(httpsConnector, 
"clientAuth", "false");

   _embedded.addConnector(httpsConnector);


Does anybody has a pointer on a correct documentation.


Regards




DO NOT REPLY [Bug 19970] Unable to get a database connection in a servlet via a JDBC datasource defined as JNDI resource

2009-02-16 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=19970


Mark Thomas  changed:

   What|Removed |Added

   Attachment #6374|Here is the new war with the|New test case
description|request parameter that  |
   |allows the user to get  |
   |either the datasource alone |
   |or both the datasource and  |
   |connection  |
   |Here are the URLS:  |
   |/jdbctest/DBConnServlet?getC|
   |onn=true - For getting the  |
   |connection  |
   |/jdbctest/DBConnServ|




-- 
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 46717] New: Wrong Session Expiration because of non thread-safe code

2009-02-16 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=46717

   Summary: Wrong Session Expiration because of non thread-safe code
   Product: Tomcat 5
   Version: 5.5.27
  Platform: All
OS/Version: All
Status: NEW
  Severity: major
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: rob...@schmelzer.cc


This issues documneted and fixed in 6.0 does also affect 5.5.27:

https://issues.apache.org/bugzilla/show_bug.cgi?id=46085

This problem occures very often with JVM IBM / Multi-Core Maschine becuase its
bascially related to the Java Memory Modell and this combination uses Memory
Optimization much more.


-- 
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



Re: tomcat-native: multicast on win32

2009-02-16 Thread David Knox
I saw something like this once. It turned out to be a firewall on  
XP.  Just a thought.


cheers,

David Knox
Information System Architect
+1 303-748-8906
http://pragmaticis.blogspot.com




On Feb 16, 2009, at 9:16 AM, Lorenz Breu wrote:




Here is the correct algo for sender:

ifa = Address.info(null, Socket.APR_INET, Socket.APR_UNSPEC, 0,  
pool).

mca = Address.info("234.255.255.253", Socket.APR_INET,
Socket.APR_UNSPEC, 25000, pool);
Socket.optSet(handle, Socket.APR_SO_REUSEADDR, 1);
result = Socket.bind(handle, ifa);
Multicast.join(handle, mca, ifa, 0);



thanks again for the help. unfortunately using your code suggestion
still doesn't work. the same code on the same machine booted to linux
(ubunut heron) works fine, but when booted to winXP it doesn't, as
mentioned before. no errors reported...
i will try on a different windows machine when i get the time, maybe
it's a driver problem?? the box does send out igmp join messages and
talks with the router, so multicasting must somehow work, just not  
with

the APR code. i also tried contacting the APR user list, however it
seems to have been discontinued?

-
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