Re: mod_jk inprocess worker and Apache 2.0 not working

2001-12-04 Thread costinm

Hi Julius,

 I am trying to make inprocess tomcat work with Apache 2.0 without much
 success.

 I am using j-t-c mod_jk from cvs. First I noticed that since Apache calls
 module initialization twice jni worker fails when trying to load jvm the
 second time.

The main problem with JNI and apache is that we can't support sessions
corectly. Apache is a multi-process server ( even apache2.0 - each process
has multiple threads, but it's still multiprocess ).

All other issues ( starting up vm, etc ) are relatively easy to solve.

In jk2 I hope to have the jni worker fixed ( i.e. use 'lb' to migrate the
request to the right server if in a session ).


Costin


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: mod_jk inprocess worker and Apache 2.0 not working

2001-12-04 Thread GAWLAS,JULIUS (HP-Cupertino,ex1)

Costin,

 The main problem with JNI and apache is that we can't support sessions
 corectly. Apache is a multi-process server ( even apache2.0 - 
 each process
 has multiple threads, but it's still multiprocess ).

Thanks for quick answer, but I don't think I can quite see 
contradiction here - I would appreciate very much if you can 
expand on the explanation. 

BTW, few days ago I posted a patch to t-j-c mod_jk.c for Apache 2.0. 
Most important is the change in prototype of jk_post_config 
which used to be void but now needs to return success code, 
also changes to types of some variables to better confirm to 
Apache 2.0 types. I am attaching it again since as it stands now mod_jk
does not work with Apache 2.0.

Thanks again
Julius


Index: mod_jk.c
===
RCS file:
/home/cvspublic/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c,v
retrieving revision 1.37
diff -u -r1.37 mod_jk.c
--- mod_jk.c2001/11/21 00:09:21 1.37
+++ mod_jk.c2001/11/30 23:58:13
@@ -110,9 +110,8 @@
 #define ADD_SSL_INFO
 
 /* module MODULE_VAR_EXPORT jk_module; */
-AP_DECLARE_DATA module jk_module;
+AP_MODULE_DECLARE_DATA module jk_module;
 
-
 typedef struct {
 
 /*
@@ -326,7 +325,7 @@
 
 /* Debug - try to get around rwrite */
 while( ll  0 ) {
-long toSend=(llCHUNK_SIZE) ? CHUNK_SIZE : ll;
+size_t toSend=(llCHUNK_SIZE) ? CHUNK_SIZE : ll;
 r = ap_rwrite((const char *)bb, toSend, p-r );
 jk_log(main_log, JK_LOG_DEBUG, 
writing %ld (%ld) out of %ld \n,toSend, r, ll );
@@ -535,7 +534,7 @@
 }
 
 if(conf-envvars_in_use) {
-apr_array_header_t *t = apr_table_elts(conf-envvars);
+const apr_array_header_t *t = apr_table_elts(conf-envvars);
 if(t  t-nelts) {
 int i;
 apr_table_entry_t *elts = (apr_table_entry_t *)t-elts;
@@ -563,7 +562,7 @@
 s-num_headers  = 0;
 if(r-headers_in  apr_table_elts(r-headers_in)) {
 int need_content_length_header = (!s-is_chunked 
s-content_length == 0) ? JK_TRUE : JK_FALSE;
-apr_array_header_t *t = apr_table_elts(r-headers_in);
+const apr_array_header_t *t = apr_table_elts(r-headers_in);
 if(t  t-nelts) {
 int i;
 apr_table_entry_t *elts = (apr_table_entry_t *)t-elts;
@@ -1514,7 +1513,7 @@
 return;
 }
 
-static void jk_post_config(apr_pool_t *pconf, 
+static int jk_post_config(apr_pool_t *pconf, 
apr_pool_t *plog, 
apr_pool_t *ptemp, 
server_rec *s)
@@ -1528,6 +1527,7 @@
 init_jk( pconf, conf, s );
 }
 }
+   return OK;
 }
 
 /** Use the internal mod_jk mappings to find if this is a request for

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: mod_jk inprocess worker and Apache 2.0 not working

2001-12-04 Thread costinm

Hi Julius,

Thanks for the patch - I've already added it to jk2. I did the rollback on
jk ( removing all jk_env, jk_registry, adding back ajp12 ), now
the 'main' tree should have the stable jk.

Sorry for the delay.

  The main problem with JNI and apache is that we can't support sessions
  corectly. Apache is a multi-process server ( even apache2.0 -
  each process
  has multiple threads, but it's still multiprocess ).

 Thanks for quick answer, but I don't think I can quite see
 contradiction here - I would appreciate very much if you can
 expand on the explanation.

Apache has several (unix) processes. A request can go to either of
them for processing.

With JNI, each apache process will have it's own VM and will process
requests. If a session is created, it'll be in one of the VMs,
and the servlet spec requires that all further requets within that
session go to the same VM.

This is not possible right now - a second request can be received
by another process/VM and jniworker can't forward it right now.

We have most of the code ( in lb_worker ), but we need to enable it.

Costin


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: mod_jk inprocess worker and Apache 2.0 not working

2001-12-04 Thread GAWLAS,JULIUS (HP-Cupertino,ex1)

Costin,

 With JNI, each apache process will have it's own VM and will process
 requests. If a session is created, it'll be in one of the VMs,
 and the servlet spec requires that all further requets within that
 session go to the same VM.
 
 This is not possible right now - a second request can be received
 by another process/VM and jniworker can't forward it right now.

Ahhh, of course - I guess I was not really connecting correctly, was
not thinking about that; thanks for explanations.
 
 We have most of the code ( in lb_worker ), but we need to enable it.

cool, looking forward to seeing it

Julius

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]