Re: cvs commit: jakarta-tomcat-connectors/jni/native/include tcn.h
Now I am not sure that the right correction: - sablevm uses short names first so it should work without the additional __J - tracing in sableVM shows that the JNI_OnLoad fails. That probably a classloader problem (org/apache/tomcat/jni/FileInfo is not found but java/lang/String is found), any hint? Cheers Jean-Frederic [EMAIL PROTECTED] wrote: jfclere 2005/08/27 09:14:50 Modified:jni/native/include tcn.h Log: Add support for sableVM. Revision ChangesPath 1.31 +6 -1 jakarta-tomcat-connectors/jni/native/include/tcn.h Index: tcn.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/include/tcn.h,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- tcn.h 12 Jul 2005 14:56:10 - 1.30 +++ tcn.h 27 Aug 2005 16:14:50 - 1.31 @@ -100,8 +100,13 @@ #define TCN_IMPARGS JNIEnv *e, jobject o, void *sock #define TCN_IMPCALL(X) e, o, X->opaque +#ifdef HAVE_SABLEVM +#define TCN_IMPLEMENT_CALL(RT, CL, FN) \ +JNIEXPORT RT JNICALL Java_org_apache_tomcat_jni_##CL##_##FN##__J +#else #define TCN_IMPLEMENT_CALL(RT, CL, FN) \ JNIEXPORT RT JNICALL Java_org_apache_tomcat_jni_##CL##_##FN +#endif #define TCN_IMPLEMENT_METHOD(RT, FN)\ static RT method_##FN - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jni/native/include tcn.h
jfclere 2005/08/27 09:14:50 Modified:jni/native/include tcn.h Log: Add support for sableVM. Revision ChangesPath 1.31 +6 -1 jakarta-tomcat-connectors/jni/native/include/tcn.h Index: tcn.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/include/tcn.h,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- tcn.h 12 Jul 2005 14:56:10 - 1.30 +++ tcn.h 27 Aug 2005 16:14:50 - 1.31 @@ -100,8 +100,13 @@ #define TCN_IMPARGS JNIEnv *e, jobject o, void *sock #define TCN_IMPCALL(X) e, o, X->opaque +#ifdef HAVE_SABLEVM +#define TCN_IMPLEMENT_CALL(RT, CL, FN) \ +JNIEXPORT RT JNICALL Java_org_apache_tomcat_jni_##CL##_##FN##__J +#else #define TCN_IMPLEMENT_CALL(RT, CL, FN) \ JNIEXPORT RT JNICALL Java_org_apache_tomcat_jni_##CL##_##FN +#endif #define TCN_IMPLEMENT_METHOD(RT, FN)\ static RT method_##FN - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jni/native/include tcn.h
mturk 2005/06/11 11:21:12 Modified:jni/native/include tcn.h Log: Temporary enable statistics. Revision ChangesPath 1.16 +2 -1 jakarta-tomcat-connectors/jni/native/include/tcn.h Index: tcn.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/include/tcn.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- tcn.h 10 Jun 2005 07:06:10 - 1.15 +++ tcn.h 11 Jun 2005 18:21:12 - 1.16 @@ -26,6 +26,7 @@ #error "Missing APR_HAS_THREADS support from APR." #endif +#define TCN_DO_STATISTICS 1 #include #if defined(_DEBUG) || defined(DEBUG) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jni/native/include tcn.h
mturk 2005/06/08 00:16:33 Modified:jni/native/include tcn.h Log: Fix pointer to int conversion warnings. Revision ChangesPath 1.13 +9 -4 jakarta-tomcat-connectors/jni/native/include/tcn.h Index: tcn.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/include/tcn.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- tcn.h 6 Jun 2005 06:54:19 - 1.12 +++ tcn.h 8 Jun 2005 07:16:33 - 1.13 @@ -45,12 +45,17 @@ #define TCN_ERROR_CLASS TCN_CLASS_PATH "Error" #define UNREFERENCED(P) (P) -#define P2J(P) ((jlong)(P)) -#define J2P(P, T) ((T)((jlong)(P))) +#ifdef WIN32 +#define LLT(X) (X) +#else +#define LLT(X) ((long)(X)) +#endif +#define P2J(P) ((jlong)LLT(P)) +#define J2P(P, T) ((T)LLT((jlong)P)) /* On stack buffer size */ #define TCN_BUFFER_SZ 8192 #define TCN_STDARGS JNIEnv *e, jobject o -#define UNREFERENCED_STDARGS{ e; o; } +#define UNREFERENCED_STDARGSe; o #define TCN_IMPLEMENT_CALL(RT, CL, FN) \ JNIEXPORT RT JNICALL Java_org_apache_tomcat_jni_##CL##_##FN - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jni/native/include tcn.h
mturk 2005/05/28 01:29:14 Modified:jni/native/include tcn.h Log: Add classpath prefix to easily change the classpath if desired. Revision ChangesPath 1.8 +5 -4 jakarta-tomcat-connectors/jni/native/include/tcn.h Index: tcn.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/include/tcn.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- tcn.h 28 May 2005 08:24:59 - 1.7 +++ tcn.h 28 May 2005 08:29:14 - 1.8 @@ -39,9 +39,10 @@ #define APR_MAX_IOVEC_SIZE 1024 #endif -#define TCN_FINFO_CLASS "org/apache/tomcat/jni/FileInfo" -#define TCN_AINFO_CLASS "org/apache/tomcat/jni/Sockaddr" -#define TCN_ERROR_CLASS "org/apache/tomcat/jni/Error" +#define TCN_CLASS_PATH "org/apache/tomcat/jni/" +#define TCN_FINFO_CLASS TCN_CLASS_PATH "FileInfo" +#define TCN_AINFO_CLASS TCN_CLASS_PATH "Sockaddr" +#define TCN_ERROR_CLASS TCN_CLASS_PATH "Error" #define UNREFERENCED(P) (P) #define P2J(P) ((jlong)(P)) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jni/native/include tcn.h
mturk 2005/05/28 01:24:59 Modified:jni/native/include tcn.h Log: Refuse to compile the native if APR_HAS_THREADS is missing. Revision ChangesPath 1.7 +5 -1 jakarta-tomcat-connectors/jni/native/include/tcn.h Index: tcn.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/include/tcn.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- tcn.h 27 May 2005 16:39:13 - 1.6 +++ tcn.h 28 May 2005 08:24:59 - 1.7 @@ -22,6 +22,10 @@ #ifndef TCN_H #define TCN_H +#ifndef APR_HAS_THREADS +#error "Missing APR_HAS_THREADS support from APR." +#endif + #include #if defined(_DEBUG) || defined(DEBUG) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jni/native/include tcn.h
please deleted my email from your list - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jni/native/include tcn.h
mturk 2005/05/24 02:17:50 Modified:jni/native/include tcn.h Log: Remove unused 'min' macro and simplify the int64<->pointer conversion. Revision ChangesPath 1.4 +2 -7 jakarta-tomcat-connectors/jni/native/include/tcn.h Index: tcn.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/include/tcn.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- tcn.h 18 Apr 2005 12:30:54 - 1.3 +++ tcn.h 24 May 2005 09:17:49 - 1.4 @@ -26,11 +26,6 @@ #define TCN_ASSERT(x) (void)0 #endif -#ifdef min -#undef min -#endif -#define min(a, b) ((a) < (b) ? (a) : (b)) - #ifndef APR_MAX_IOVEC_SIZE #define APR_MAX_IOVEC_SIZE 1024 #endif @@ -40,8 +35,8 @@ #define TCN_ERROR_CLASS "org/apache/tomcat/jni/Error" #define UNREFERENCED(P) (P) -#define P2J(P) ((jlong)(long)(void *)P) -#define J2P(P, T) ((T)(void *)(long)P) +#define P2J(P) ((jlong)(P)) +#define J2P(P, T) ((T)((jlong)(P))) /* On stack buffer size */ #define TCN_BUFFER_SZ 8192 #define TCN_STDARGS JNIEnv *e, jobject o - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jni/native/include tcn.h
mturk 2005/04/18 05:30:54 Modified:jni/native/include tcn.h Log: Added ASSERT macro for DEBUG build to track the invalid params. Revision ChangesPath 1.3 +7 -0 jakarta-tomcat-connectors/jni/native/include/tcn.h Index: tcn.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/include/tcn.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- tcn.h 17 Jan 2005 07:22:50 - 1.2 +++ tcn.h 18 Apr 2005 12:30:54 - 1.3 @@ -19,6 +19,13 @@ #include +#if defined(_DEBUG) || defined(DEBUG) +#include +#define TCN_ASSERT(x) assert((x)) +#else +#define TCN_ASSERT(x) (void)0 +#endif + #ifdef min #undef min #endif - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jni/native/include tcn.h
mturk 2005/01/16 23:22:50 Modified:jni/native/include tcn.h Log: See if APR_MAX_IOVEC_SIZE is already defined. Revision ChangesPath 1.2 +2 -0 jakarta-tomcat-connectors/jni/native/include/tcn.h Index: tcn.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jni/native/include/tcn.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- tcn.h 14 Jan 2005 13:47:23 - 1.1 +++ tcn.h 17 Jan 2005 07:22:50 - 1.2 @@ -24,7 +24,9 @@ #endif #define min(a, b) ((a) < (b) ? (a) : (b)) +#ifndef APR_MAX_IOVEC_SIZE #define APR_MAX_IOVEC_SIZE 1024 +#endif #define TCN_FINFO_CLASS "org/apache/tomcat/jni/FileInfo" #define TCN_AINFO_CLASS "org/apache/tomcat/jni/Sockaddr" - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jni/native/include tcn.h tcn_version.h
mturk 2005/01/14 05:47:23 Added: jni/native/include tcn.h tcn_version.h Log: Initial upload Revision ChangesPath 1.1 jakarta-tomcat-connectors/jni/native/include/tcn.h Index: tcn.h === /* Copyright 2000-2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef TCN_H #define TCN_H #include #ifdef min #undef min #endif #define min(a, b) ((a) < (b) ? (a) : (b)) #define APR_MAX_IOVEC_SIZE 1024 #define TCN_FINFO_CLASS "org/apache/tomcat/jni/FileInfo" #define TCN_AINFO_CLASS "org/apache/tomcat/jni/Sockaddr" #define TCN_ERROR_CLASS "org/apache/tomcat/jni/Error" #define UNREFERENCED(P) (P) #define P2J(P) ((jlong)(long)(void *)P) #define J2P(P, T) ((T)(void *)(long)P) /* On stack buffer size */ #define TCN_BUFFER_SZ 8192 #define TCN_STDARGS JNIEnv *e, jobject o #define UNREFERENCED_STDARGS{ e; o; } #define TCN_IMPLEMENT_CALL(RT, CL, FN) \ JNIEXPORT RT JNICALL Java_org_apache_tomcat_jni_##CL##_##FN void tcn_Throw(JNIEnv *env, const char *cname, const char *msg); void tcn_ThrowException(JNIEnv *env, const char *msg); void tcn_ThrowAPRException(JNIEnv *env, apr_status_t err); jstring tcn_new_string(JNIEnv *env, const char *str); char *tcn_get_string(JNIEnv *env, jstring jstr); char *tcn_dup_string(JNIEnv *env, jstring jstr); apr_status_t tcn_load_finfo_class(JNIEnv *env); apr_status_t tcn_load_ainfo_class(JNIEnv *env); #define J2S(V) c##V #define J2L(V) p##V #define J2T(T) (apr_time_t)((T)) #if 1 #define TCN_BEGIN_MACRO { #define TCN_END_MACRO } (void *)(0) #else #define TCN_BEGIN_MACRO do { #define TCN_END_MACRO } while (0) #endif #define TCN_ALLOC_CSTRING(V) \ const char *c##V = V ? (const char *)((*e)->GetStringUTFChars(e, V, 0)) : NULL #define TCN_FREE_CSTRING(V) \ if (c##V) (*e)->ReleaseStringUTFChars(e, V, c##V) #define TCN_ALLOC_JSTRING(V) \ char *c##V = tcn_get_string(e, (V)) #define AJP_TO_JSTRING(V) (*e)->NewStringUTF((e), (V)) #define TCN_FREE_JSTRING(V) \ TCN_BEGIN_MACRO \ if (c##V)\ free(c##V); \ TCN_END_MACRO #define TCN_THROW_IF_ERR(x, r) \ TCN_BEGIN_MACRO \ apr_status_t R = (x); \ if (R != APR_SUCCESS) { \ tcn_ThrowAPRException(e, R);\ (r) = 0;\ goto cleanup; \ } \ TCN_END_MACRO #define TCN_THROW_OS_ERROR(E) \ tcn_ThrowAPRException((E), apr_get_os_error()) #define TCN_LOAD_CLASS(E, C, N, R) \ TCN_BEGIN_MACRO \ jclass _##C = (*(E))->FindClass((E), N);\ if (_##C == NULL) { \ (*(E))->ExceptionClear((E));\ return R; \ } \ C = (*(E))->NewGlobalRef((E), _##C);\ (*(E))->DeleteLocalRef((E), _##C); \ TCN_END_MACRO #define TCN_UNLOAD_CLASS(E, C) \ (*(E))->DeleteGlobalRef((E), (C)) #define TCN_IS_NULL(E, O) \ ((*(E))->IsSameObject((E), (O), NULL) == JNI_TRUE) #define TCN_GET_METHOD(E, C, M, N, S, R)\ TCN_BEGIN_MACRO \ M = (*(E))->GetMethodID((E), C, N, S); \ if (M == NULL) {\ return R; \ } \ TCN_END_MACRO struct tcn_callback { JNIEnv *env; jobject obj; jmethodID mid; void*opaque; }; typedef struct tcn_callback tcn_callback_t; #endif /* TCN_H */ 1.1 jakarta-tomcat-connectors/jni/native/include/tcn_version.h Index: tcn_version.h === /* Copyright 2