RE: java.library.path when running as a service

2005-07-13 Thread Benson Margulies
Are all your dependents in  $CATALINA_HOME\common\lib? Are you sure that
the PATH for the service is, indeed, including that dir? PATH management
for services is a pain.

Look up -delayload in the Win32 link.exe doc, and follow from there into
the hooks.


-Original Message-
From: Michael Ivanov [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 12, 2005 10:02 PM
To: Benson Margulies; tomcat-user@jakarta.apache.org
Subject: Re: java.library.path when running as a service

My PATH variable already includes $CATALINA_HOME\common\lib, and it
definitely has worked in the past.  Wouldn't this also affect Tomcat
launched from the command line?  My problem only occurs when Tomcat is a
service.  Also, can you elaborate on what the delay loader hook is? 
Thank you.

On 7/12/05, Benson Margulies [EMAIL PROTECTED] wrote:
 Due to a bug in the JRE/JVM, your dependent DLLs have to either be in 
 PATH or in the directory containing java.exe. My personal favorite 
 solution to this is to use the delay loader hook to get around it.
 
 -Original Message-
 From: Michael Ivanov [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, July 12, 2005 7:13 PM
 To: tomcat-user@jakarta.apache.org
 Subject: java.library.path when running as a service
 
 I have been running a servlet with Tomcat 5.5.7 for a few months, I 
 left it alone for a while, and now I get an UnsatisfiedLinkError when 
 the servlet tries to load a native DLL.  The error says the DLL cannot

 be found in java.library.path.  The DLL I want to load is located in 
 $CATALINA_HOME\common\lib.  When I just run Tomcat from the command 
 line, everything works great, no complaints.  When run as a service, I

 get this problem.  I tried setting java.library.path via the 
 JvmOptions in service.bat, but in that case I get an 
 UnsatisfiedLinkError which refers to dependent libraries for the DLL.
 Thanks in advance for any suggestions.
 
 Michael Ivanov
 
 Tomcat 5.5.7
 Windows XP
 
 -
 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]



RE: java.library.path when running as a service

2005-07-13 Thread Benson Margulies
It can only be set in the system environment for all services as once.
The tomcat service integration does not include any help in this area. 

-Original Message-
From: Michael Ivanov [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 13, 2005 12:51 PM
To: Benson Margulies; tomcat-user@jakarta.apache.org
Subject: Re: java.library.path when running as a service

Thank you for the reply.  I was not aware, is the PATH variable
different for each service?  How can it be set?  This would likely be
the cause of my problem if it's true.

On 7/13/05, Benson Margulies [EMAIL PROTECTED] wrote:
 Are all your dependents in  $CATALINA_HOME\common\lib? Are you sure 
 that the PATH for the service is, indeed, including that dir? PATH 
 management for services is a pain.
 
 Look up -delayload in the Win32 link.exe doc, and follow from there 
 into the hooks.
 
 
 -Original Message-
 From: Michael Ivanov [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, July 12, 2005 10:02 PM
 To: Benson Margulies; tomcat-user@jakarta.apache.org
 Subject: Re: java.library.path when running as a service
 
 My PATH variable already includes $CATALINA_HOME\common\lib, and it 
 definitely has worked in the past.  Wouldn't this also affect Tomcat 
 launched from the command line?  My problem only occurs when Tomcat is

 a service.  Also, can you elaborate on what the delay loader hook is?
 Thank you.
 
 On 7/12/05, Benson Margulies [EMAIL PROTECTED] wrote:
  Due to a bug in the JRE/JVM, your dependent DLLs have to either be 
  in PATH or in the directory containing java.exe. My personal 
  favorite solution to this is to use the delay loader hook to get
around it.
 
  -Original Message-
  From: Michael Ivanov [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, July 12, 2005 7:13 PM
  To: tomcat-user@jakarta.apache.org
  Subject: java.library.path when running as a service
 
  I have been running a servlet with Tomcat 5.5.7 for a few months, I 
  left it alone for a while, and now I get an UnsatisfiedLinkError 
  when the servlet tries to load a native DLL.  The error says the DLL

  cannot
 
  be found in java.library.path.  The DLL I want to load is located in

  $CATALINA_HOME\common\lib.  When I just run Tomcat from the command 
  line, everything works great, no complaints.  When run as a service,

  I
 
  get this problem.  I tried setting java.library.path via the 
  JvmOptions in service.bat, but in that case I get an 
  UnsatisfiedLinkError which refers to dependent libraries for the
DLL.
  Thanks in advance for any suggestions.
 
  Michael Ivanov
 
  Tomcat 5.5.7
  Windows XP
 
  
  - 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]



RE: java.library.path when running as a service

2005-07-12 Thread Benson Margulies
Due to a bug in the JRE/JVM, your dependent DLLs have to either be in
PATH or in the directory containing java.exe. My personal favorite
solution to this is to use the delay loader hook to get around it.

-Original Message-
From: Michael Ivanov [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 12, 2005 7:13 PM
To: tomcat-user@jakarta.apache.org
Subject: java.library.path when running as a service

I have been running a servlet with Tomcat 5.5.7 for a few months, I
left it alone for a while, and now I get an UnsatisfiedLinkError when
the servlet tries to load a native DLL.  The error says the DLL cannot
be found in java.library.path.  The DLL I want to load is located in
$CATALINA_HOME\common\lib.  When I just run Tomcat from the command
line, everything works great, no complaints.  When run as a service, I
get this problem.  I tried setting java.library.path via the
JvmOptions in service.bat, but in that case I get an
UnsatisfiedLinkError which refers to dependent libraries for the DLL. 
Thanks in advance for any suggestions.

Michael Ivanov

Tomcat 5.5.7
Windows XP

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



RE: Arabic encoding

2005-05-17 Thread Benson Margulies
You can only store and retrieve byte values from 0 to 127 in an Oracle
US7ASCII database, as far as the Oracle JDBC driver is concerned. Crappy
C programs that call OCI can store other byte values, but they are
inaccessible from Java, in my experience. You will have to create JNI
code for your database access instead of using JDBC.

-Original Message-
From: Fadwa Barham [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 17, 2005 2:36 AM
To: Tomcat Users List
Subject: RE: Arabic encoding

I agree with you that I have to change my oracle encoding, and
everything will work fine, but it is not easy to change the
configuration of oracle in my company, cause we are upgrading an old
system, and cause we are in an intermediat stage, I need to use oracle
with us7ascii now, in the future we will change the configuration of
oracle. and until we change the oracle configuration, I need to make
advantage of the new versions of Java and tomcat.
 
thanks

Benson Margulies [EMAIL PROTECTED] wrote:
Why do you expect this to work with the us7 oracle encoding? The JDBC
driver will work very hard to force all your Arabic characters to turn
into ? marks with this configuration. You must use UTF-8 or CP1256 or
ISO-8869-6 in Oracle.

-Original Message-
From: Fadwa Barham [mailto:[EMAIL PROTECTED]
Sent: Saturday, May 14, 2005 12:56 AM
To: Tomcat Users List
Subject: Re: Arabic encoding

thanks for your reply.

I agree with you that utf-8 encoding is suitable for all cases, but in
tc4 with jdk1.3, I write the servlets and compile them and use data from
oracle with us7ascii encoding, and I don't set any encoding except:
pw.println(content=\ar-sa\);
pw.println(content=\text/html;charset=windows-1256\);
and the page display all the characters correctly.
I think sun microsystems and tomcat made changes to the new packages
about encoding.
but how to deal with the new changed? Is there special setup I've to do?

thanks
Fadwa


Mark Thomas wrote:
There are lots of potential pitfalls when using non-default character 
encodings. It is easy to make mistakes both with Tomcat settings and 
with your code.

To sort out the tomcat settings, get the following index.jsp to work for

whatever text you supply to the form. I have tested this with the latest

TC4 and TC5 code and it works for me with any text I choose to enter.

Once you have this working, you can look at your application and see 
what is different.

Mark









Data posted to this form was:
request.setCharacterEncoding(UTF-8);
out.print(request.getParameter(mydata));
%



enctype=application/x-www-form-urlencoded
[input] 
[input] 
[input] 




Fadwa Barham wrote:
 While I was searching for a solution for the encoding, I found this
 
 There is a standard for encoding URIs
(http://www.w3.org/International/O-URL-
 code.html) but this standard is not consistently followed by clients.
This 
 causes a number of problems.
 
 The functionality provided by Tomcat (4 and 5) to handle this less
than ideal 
 situation is described below.
 
 1. The Coyote HTTP/1.1 connector has a useBodyEncodingForURI attribute
which 
 if set to true will use the request body encoding to decode the URI
query 
 parameters.
 - The default value is true for TC4 (breaks spec but gives consistent 
 behaviour across TC4 versions)
 - The default value is false for TC5 (spec compliant but there may be 
 migration issues for some apps)
 2. The Coyote HTTP/1.1 connector has a URIEncoding attribute which
defaults to 
 ISO-8859-1.
 3. The parameters class (o.a.t.u.http.Parameters) has a
QueryStringEncoding 
 field which defaults to the URIEncoding. It must be set before the
parameters 
 are parsed to have an effect.
 
 Things to note regarding the servlet API:
 1. HttpServletRequest.setCharacterEncoding() normally only applies to
the 
 request body NOT the URI.
 2. HttpServletRequest.getPathInfo() is decoded by the web container.
 3. HttpServletRequest.getRequestURI() is not decoded by container.
 
 Other tips:
 1. Use POST with forms to return parameters as the parameters are then
part of 
 the request body.
 
 
 Is this means that the changes between tc4 and tc5 about encoding is
the reason why I can't have the write encoding in the new versions of
tomcat? and if so, how to solve the problem?
 
 Thanks
 
 - Original Message - 
 From: Fadwa Barham 
 To: Tomcat Users List 
 Sent: Tuesday, March 01, 2005 3:24 AM
 Subject: Re: Arabic encoding
 
 
 
As tomcat 4.1.31 is suitable for arabic and it seems until now that
tomcat 
4.1.31 solved the jndi datasource problems: Intermittent dB connection

Failures and Random Connection closed Exceptions
I will use tomcat 4.1.31 until I can configure the latest versions of 
tomcat.
I feel not lucky
- Original Message - 
From: Fadwa Barham 
To: Tomcat Users List 
Sent: Tuesday, March 01, 2005 2:39 AM
Subject: Re: Arabic encoding



I tested many tomcat versions, I found until tomcat 4.1.31 no
problems 
with arabic, but when I tried tomcat-4.1.18 and newer

RE: Arabic encoding

2005-05-15 Thread Benson Margulies
Why do you expect this to work with the us7 oracle encoding? The JDBC
driver will work very hard to force all your Arabic characters to turn
into ? marks with this configuration. You must use UTF-8 or CP1256 or
ISO-8869-6 in Oracle.

-Original Message-
From: Fadwa Barham [mailto:[EMAIL PROTECTED] 
Sent: Saturday, May 14, 2005 12:56 AM
To: Tomcat Users List
Subject: Re: Arabic encoding

thanks for your reply.
 
I agree with you that utf-8 encoding is suitable for all cases, but in
tc4 with jdk1.3, I write the servlets and compile them and use data from
oracle with us7ascii encoding, and I don't set any encoding except:
  pw.println(meta http-equiv=\Content-Language\
content=\ar-sa\);
  pw.println(META http-equiv=Content-Type
content=\text/html;charset=windows-1256\);
and the page display all the characters correctly.
I think sun microsystems and tomcat made changes to the new packages
about encoding.
but how to deal with the new changed? Is there special setup I've to do?
 
thanks 
Fadwa


Mark Thomas [EMAIL PROTECTED] wrote:
There are lots of potential pitfalls when using non-default character 
encodings. It is easy to make mistakes both with Tomcat settings and 
with your code.

To sort out the tomcat settings, get the following index.jsp to work for

whatever text you supply to the form. I have tested this with the latest

TC4 and TC5 code and it works for me with any text I choose to enter.

Once you have this working, you can look at your application and see 
what is different.

Mark









Data posted to this form was:
   request.setCharacterEncoding(UTF-8);
   out.print(request.getParameter(mydata));
 %



enctype=application/x-www-form-urlencoded
 [input] 
 [input] 
 [input] 




Fadwa Barham wrote:
 While I was searching for a solution for the encoding, I found this
 
 There is a standard for encoding URIs
(http://www.w3.org/International/O-URL-
 code.html) but this standard is not consistently followed by clients.
This 
 causes a number of problems.
 
 The functionality provided by Tomcat (4 and 5) to handle this less
than ideal 
 situation is described below.
 
 1. The Coyote HTTP/1.1 connector has a useBodyEncodingForURI attribute
which 
 if set to true will use the request body encoding to decode the URI
query 
 parameters.
 - The default value is true for TC4 (breaks spec but gives consistent 
 behaviour across TC4 versions)
 - The default value is false for TC5 (spec compliant but there may be 
 migration issues for some apps)
 2. The Coyote HTTP/1.1 connector has a URIEncoding attribute which
defaults to 
 ISO-8859-1.
 3. The parameters class (o.a.t.u.http.Parameters) has a
QueryStringEncoding 
 field which defaults to the URIEncoding. It must be set before the
parameters 
 are parsed to have an effect.
 
 Things to note regarding the servlet API:
 1. HttpServletRequest.setCharacterEncoding() normally only applies to
the 
 request body NOT the URI.
 2. HttpServletRequest.getPathInfo() is decoded by the web container.
 3. HttpServletRequest.getRequestURI() is not decoded by container.
 
 Other tips:
 1. Use POST with forms to return parameters as the parameters are then
part of 
 the request body.
 
 
 Is this means that the changes between tc4 and tc5 about encoding is
the reason why I can't have the write encoding in the new versions of
tomcat? and if so, how to solve the problem?
 
 Thanks
 
 - Original Message - 
 From: Fadwa Barham 
 To: Tomcat Users List 
 Sent: Tuesday, March 01, 2005 3:24 AM
 Subject: Re: Arabic encoding
 
 
 
As tomcat 4.1.31 is suitable for arabic and it seems until now that
tomcat 
4.1.31 solved the jndi datasource problems: Intermittent dB connection

Failures and Random Connection closed Exceptions
I will use tomcat 4.1.31 until I can configure the latest versions of 
tomcat.
I feel not lucky
- Original Message - 
From: Fadwa Barham 
To: Tomcat Users List 
Sent: Tuesday, March 01, 2005 2:39 AM
Subject: Re: Arabic encoding



I tested many tomcat versions, I found until tomcat 4.1.31 no
problems 
with arabic, but when I tried tomcat-4.1.18 and newer versions, I
faced 
the same problem.

- Original Message - 
From: Benson Margulies 
To: Tomcat Users List 
Sent: Sunday, February 27, 2005 4:08 PM
Subject: RE: Arabic encoding



It depends on what the Oracle JDBC driver does with byte values that
are
not legitimate US7ASCII. If, for some reason, it treated the data as
ISO-8859-1 instead of US7ASCII, then it might have streamed out
through
tomcat, and the browser would have auto-detected the CP1256
pretending
to be ISO-8859-1.

-Original Message-
From: Fadwa Barham [mailto:[EMAIL PROTECTED]
Sent: Sunday, February 27, 2005 1:43 PM
To: Tomcat Users List
Subject: Re: Arabic encoding

But I wonder why the old tomcat and java displayed arabic correctly,
and
I use the same classes12.jar in both of the old and the new.
I want to know what is the differance, what encoding they stopped to
support? It looks like that tomcat

MBeans?

2005-03-28 Thread Benson Margulies
I'm a little puzzled by Mbeans. JMX self-describes as a management
technology, but it seems as if people (and particularly JBoss) are using
Mbeans as building blocks for services in the app server that are not
well-modeled as EJBs. Can anyone offer a pointer to some information on
this?


RE: php and apache tomcat

2005-03-20 Thread Benson Margulies
Apache isn't the same thing as 'Apache Software Foundation / Jakarta
Tomcat'. The usual PHP requires plain old Apache, not Tomcat.  

-Original Message-
From: peter smith [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 20, 2005 5:59 PM
To: tomcat-user@jakarta.apache.org
Subject: php and apache tomcat

I have an apache tomcat server 4.1 running on my PC, I tried to install
PHP using hte installer adn it came up with the option to allow it to
run with an apache server.  but when I choose it, there was an error
message saying that a config file was missing..the file it was
requesting wasnt on my system at all.  Anyone else get this problem?

Pete

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



RE: Redhat Tomcat support

2005-03-14 Thread Benson Margulies
Personally, I've never gotten anything from Redhat but a bill. Their
support agreement is a masterpiece of extracting the maximum money for
the minimum in actual support. Pretty much anything you might actually
need help with is carefully excluded. 

-Original Message-
From: QM [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 14, 2005 5:07 PM
To: Tomcat Users List
Subject: Re: Redhat Tomcat support

On Mon, Mar 14, 2005 at 03:57:28PM -0600, Trice, Jim wrote:
: [snip]
: RedHat support for Tomcat? We're currently running Tomcat 4.1 and
would have
: to upgrade to 5.5 to get support from RedHat. Is it worth it?

by the way, in response to your question Is it worth it? -- did you
mean RedHat's Tomcat Support or just upgrading from 4.1 - 5.5?

The upgrade has several benefits, including all of the new servlet spec
2.4/JSP 2.0 features.  That, and sticking with a recent release
increases your chances of list-based support (because you'd be running
the same version as most other list members).

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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



RE: Tomcat on Cygwin

2005-03-06 Thread Benson Margulies
You aren't going to accomplish this by 'running tomcat under Cygwin'.
The Java VM is not a cygwin application, it's a Win32 application.

What you need to do is build a JNI library that links to the cygwin DLL
and is callable from Java. 

-Original Message-
From: Rahul Joshi [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 04, 2005 9:52 PM
To: Tomcat Users List
Subject: Re: Tomcat on Cygwin

Here is what I am doing: 

I have an application which runs on Cygwin (but not directly on
Windows). I have to access this application through JSP page i.e., the
Java code from the JSP will invoke this application. In order to invoke
and run this application, it have to execute on Cygwin. 

--- Jason Bainbridge [EMAIL PROTECTED] wrote:

 On Fri, 4 Mar 2005 18:41:33 -0800 (PST), Rahul Joshi [EMAIL PROTECTED]

 wrote:
  
  I want to run JSP/servlets using Tomcat on Cygwin.
 Is
  there a special version of Tomcat that I need to download?
 
 Can I ask why exactly? I can't think of any benefit in doing so.
  
  Is there any documentation about running Tomcat on Cygwin?
 
 None that I know of and a Google didn't turn up any.
 
 --
 Jason Bainbridge
 http://kde.org - [EMAIL PROTECTED]
 Personal Site - http://jasonbainbridge.com
 

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





__
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web
http://birthday.yahoo.com/netrospective/

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



RE: Arabic encoding

2005-02-27 Thread Benson Margulies
It depends on what the Oracle JDBC driver does with byte values that are
not legitimate US7ASCII. If, for some reason, it treated the data as
ISO-8859-1 instead of US7ASCII, then it might have streamed out through
tomcat, and the browser would have auto-detected the CP1256 pretending
to be ISO-8859-1. 

-Original Message-
From: Fadwa Barham [mailto:[EMAIL PROTECTED] 
Sent: Sunday, February 27, 2005 1:43 PM
To: Tomcat Users List
Subject: Re: Arabic encoding

But I wonder why the old tomcat and java displayed arabic correctly, and
I use the same classes12.jar in both of the old and the new.
I want to know what is the differance, what encoding they stopped to
support? It looks like that tomcat cannot understand the old Java cause
I have to change the encoding to arabic windows in the internet explorer
each time I request the servlet, and when I do this, every arabic
character is displayed correctly.
I think it is better to understand the problem and the changes so I can
handle the problem if I faced it again in the newer versions of tomcat
or Java.
I know that being the database in us7ascii is not good, but changing the
database encoding each time I face the problem is not the right way. I
may change it this time, but I need to understand.
thanks

- Original Message -
From: Benson Margulies [EMAIL PROTECTED]
To: Tomcat Users List tomcat-user@jakarta.apache.org
Sent: Sunday, February 27, 2005 12:44 AM
Subject: RE: Arabic encoding


 Oracle's ODBC driver will transcode from the database to UTF-16 based
on
 the databse encoding. If the database is in US7ASCII, this is a
 destructive process for Arabic. The only alternative I can think of is
 to do all your database I/O in hex.

 -Original Message-
 From: Fadwa Barham [mailto:[EMAIL PROTECTED]
 Sent: Saturday, February 26, 2005 1:20 PM
 To: Tomcat Users List
 Subject: Re: Arabic encoding

 I use oracle 7 database, and the NLS language is
 American_America.US7ASCII, and it is not easy to change it to utf-8.
 Beside, the question is, a servlet work fine on tomcat 4.0.6 why it
 stopped with the new versions, what changes made to the encoding of
 tomcat??
 do I need tomcat-i18n-ar.jar? and if so, from where to get it?
 I can't determine where is the problem, is it from the new Java or the
 new tomcat.
 thanks in advanced

 - Original Message -
 From: Benson Margulies [EMAIL PROTECTED]
 To: Tomcat Users List tomcat-user@jakarta.apache.org
 Sent: Wednesday, February 23, 2005 11:26 PM
 Subject: RE: Arabic encoding


 What database? Do you have the database set up to deliver Unicode, or
 CP1256, correctly? Note that not all Arabic fits into CP1256, you
 might
 really be better off with UTF-8.

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


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


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



RE: Question for Tomcat Developers - How to Plug In Encryption for JDBC passwords

2005-02-27 Thread Benson Margulies
Why do you give your webapp access to a sql user with all this dangerous
and unneccessary access? The user name / password on the
externally-accessible machine could have a sql login that only granted
access to views (or better yet) procedures, that allowed for the minimal
necessary access: that's hardly 'enough access to dump all the credit
card numbers'.

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



RE: Arabic encoding

2005-02-26 Thread Benson Margulies
Oracle's ODBC driver will transcode from the database to UTF-16 based on
the databse encoding. If the database is in US7ASCII, this is a
destructive process for Arabic. The only alternative I can think of is
to do all your database I/O in hex. 

-Original Message-
From: Fadwa Barham [mailto:[EMAIL PROTECTED] 
Sent: Saturday, February 26, 2005 1:20 PM
To: Tomcat Users List
Subject: Re: Arabic encoding

I use oracle 7 database, and the NLS language is
American_America.US7ASCII, and it is not easy to change it to utf-8.
Beside, the question is, a servlet work fine on tomcat 4.0.6 why it
stopped with the new versions, what changes made to the encoding of
tomcat??
do I need tomcat-i18n-ar.jar? and if so, from where to get it?
I can't determine where is the problem, is it from the new Java or the
new tomcat.
thanks in advanced

- Original Message -
From: Benson Margulies [EMAIL PROTECTED]
To: Tomcat Users List tomcat-user@jakarta.apache.org
Sent: Wednesday, February 23, 2005 11:26 PM
Subject: RE: Arabic encoding


 What database? Do you have the database set up to deliver Unicode, or
 CP1256, correctly? Note that not all Arabic fits into CP1256, you
might
 really be better off with UTF-8.

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


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



RE: JNI loading problem

2005-02-24 Thread Benson Margulies
Does ldd of your .so show dependencies? Where are they?

Generally, the Java classes with the native methods have to be in a
classloader other than webapp to get useful results. 

-Original Message-
From: vaheesan selvarajah [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 23, 2005 1:03 PM
To: tomcat-user@jakarta.apache.org
Subject: JNI loading problem

Hi folks,

I am trying to load a simple JNI based .so lib file with Tomcat
5.5.4.(on linux) I am trying to load the .so file within the JSP page.
I am not sure if this is allowed. I have tried all the following
methods..

1. putting the .so file in JAVA_HOME//jre/lib/i386/

2. setting the LD_LIBRARY_PATH to where my lib is and exporting it

3. inside the catelina.sh file added an extra
-Djava.library.path=mylibpath

Inside the JSP i tried the following options...

1.   try {
 //System.loadLibrary(AriaJava);   // the name of the file is
libAriaJava.so
 } catch (UnsatisfiedLinkError e) {
   System.err.println(Native code library failed to load.\n + e);  }

2.
try {
 System.load( /home/path_to_lib/libAriaJava.so);
 } catch (UnsatisfiedLinkError e) {
   System.err.println(Native code library failed to load.\n + e);  }

in all these trials it fails with unsatisfied link error !!

Any help is appreciated !!

r
-Vaheesan

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



RE: Arabic encoding

2005-02-23 Thread Benson Margulies
What database? Do you have the database set up to deliver Unicode, or
CP1256, correctly? Note that not all Arabic fits into CP1256, you might
really be better off with UTF-8.

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



RE: HttpServletInputStream is corrupting data?

2005-02-21 Thread Benson Margulies
I'd worry about character encoding if I were you. I bet someone is
transcoding. 

-Original Message-
From: Varley, Roger [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 21, 2005 11:00 AM
To: Tomcat Users List (E-mail)
Subject: HttpServletInputStream is corrupting data?

Hi

I don't think that this is a Tomcat problem per-se, but it involves
Tomcat so I'm asking here in the hope that someone else has seen this
before.

An external program reads XML from a file on disk into a
ByteArrayOutputStream to calculate the length of the data. The byte
array is extracted from the stream and written to the OutputStream of a
URLConnection object which is pointing to my servlet running under
Tomcat 4.1.31. The servlet reads the XML from the HttpServletRequest
InputStream and performs an XSLT transformation on it.

If I point the URL to the normal port 80, the request is routed through
Microsoft IIS server and passed to Tomcat. The input stream read by
Tomcat is corrupt - parts of the file are missing. However, if I point
the URL to Tomcat directly via port 8080 everything works fine. I've
verified that the original disk file is valid, the byte array created by
the external program is correct and contains correct data and that all
the correct data is written to the URLConnection by the external
program. Has anyone either seen something like this before or have any
suggestions as to where to start looking.

Regards
Roger



__
This e-mail and the documents attached are confidential and intended
solely for the addressee; it may also be privileged. If you receive this
e-mail in error, please notify the sender immediately and destroy it.
As its integrity cannot be secured on the Internet, the Atos Origin
group liability cannot be triggered for the message content. Although
the sender endeavours to maintain a computer virus-free network, the
sender does not warrant that this transmission is virus-free and will
not be liable for any damages resulting from any virus transmitted.

__

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



RE: 5.0.28 catalina.properties file

2005-02-16 Thread Benson Margulies
The files show as lowercase in windows. Is there any way to get Tomcat
to dump out the classpath as it perceives it? 

-Original Message-
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 15, 2005 11:28 AM
To: Tomcat Users List
Subject: RE: 5.0.28 catalina.properties file

 From: Benson Margulies [mailto:[EMAIL PROTECTED]
 Subject: RE: 5.0.28 catalina.properties file
 
 What didn't work looked like
 
 common.loader=${catalina.home}/common/classes,${catalina.home}
 /common/endorsed/*.jar,{catalina.home}/common/lib/*.jar,c:/esri/lib/bt
 nm.jar

Grasping at straws here - could there be a case sensitivity issue with
the spelling of btnm.jar?  (I know it's Windows, but not all Java code
respects the case insensitivity of that platform.)

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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



RE: 5.0.28 catalina.properties file

2005-02-15 Thread Benson Margulies


This works:

common.loader=${catalina.home}/common/classes,${catalina.home}/common/en
dorsed/*.jar,{catalina.home}/common/lib/*.jar,c:/esri/lib/*.jar

What didn't work looked like  

common.loader=${catalina.home}/common/classes,${catalina.home}/common/en
dorsed/*.jar,{catalina.home}/common/lib/*.jar,c:/esri/lib/btnm.jar

The error was 'class not found' for a class called out in a
GlobalResource description.

-Original Message-
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 14, 2005 10:46 PM
To: Tomcat Users List
Subject: RE: 5.0.28 catalina.properties file

 From: Benson Margulies [mailto:[EMAIL PROTECTED]
 Subject: 5.0.28 catalina.properties file
 
 I just converted a non-working to a working configuration by replacing

 a set of jar file pathnames with a pathname to x/*.jar where x is a 
 dir containing the same two jars.

How about posting your exact before and after config lines? What exactly
was the result of attempting to use the non-working configuration?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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



5.0.28 catalina.properties file

2005-02-14 Thread Benson Margulies
It appears that listing a specific jar file, as opposed to *.jar in a
directory, doesn't work right in catalina.properties in 5.0.28. At
least, I just converted a non-working to a working configuration by
replacing a set of jar file pathnames with a pathname to x/*.jar where x
is a dir containing the same two jars.
 
This seems so unlikely that I don't want to go to bugzilla before giving
someone a chance to give me some idea what I must have missed.
 


RE: Tomcat 5.6 / Eclipse / no startup.bat

2005-02-09 Thread Benson Margulies
Sysdeo imposes a rather particular development methodology.

Anything you can do with setenv.bat you can do with VM and application
arguments in the application launch department of eclipse. 

-Original Message-
From: Vamsee Kanakala [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 08, 2005 11:52 PM
To: Tomcat Users List
Subject: Re: Tomcat 5.6 / Eclipse / no startup.bat

Geoff Wiggs wrote:

Trying to integrate Tomcat 5.6 and Eclipse.  Without the startup.bat
and
[...] 
Anyone have any ideas?
 
  

Have you tried Sysdeo Tomcat Plugin for Eclipse?

Vamsee.

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



RE: using shared objects from tomcat

2005-02-09 Thread Benson Margulies
Andreas,

You need to apply the javap command to your third-party code.

Perhaps first, you need to read the Sun JNI book.

There are two levels of naming. First, when some Java code calls
System.loadLibrary(foo), the JVM will look for libfoo.so in
java.library.path.

Then, unless the library manually registers native function, the JVM
will dlsym for functions based on the fully-packaged-name of the classes
containing the native functions. The test application's package doesn't
matter. The classes with native methods matter. 

-Original Message-
From: Andreas Andersson [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 09, 2005 3:49 AM
To: Tomcat Users List
Subject: Re: using shared objects from tomcat

Benson Margulies wrote:

 -- Tomcat can't 'ignore' LD_ environment variables. They control how
 ld.so loads the JVM into the process address space and links it. You
put
 env settings in bin/setenv.sh. You will need such a setting for
 LD_LIBRARY_PATH, at least.

Thanks! The LD_DEBUG environment variable told me tomcat was looking for

the wrong .so-file. Apperently it's looking for the file including the 
package structure Java_com_mycompany_myClass_myLib instead of myLib. The

test applications has no package (except the default package) and tomcat

on windows seams to ignore them.

So, I'm off to relink the .so with a packagestructure (thats my next 
problem :).

Thanks for the help!


-- 
Andreas Andersson
IT Dept.
Travelstart Nordic
[EMAIL PROTECTED]
http://www.travelstart.se

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



RE: Support Information Regarding - CD-Key Issues

2005-02-09 Thread Benson Margulies
Some lunatic has added a blizzard support alias to the list. This
happens constantly. I don't know if some IIS-head out there does it to
annoy the tomcat community. I used to think that it was an email address
harvesting trick, but I haven't been able to figure out how. The result
is that every blessed posting solicits one of these replies. They are
more amusing when the list in question replies in dutch. 

-Original Message-
From: Didier McGillis [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 09, 2005 1:16 PM
To: tomcat-user@jakarta.apache.org
Subject: RE: Support Information Regarding - CD-Key Issues

who? what? and where?

From: [EMAIL PROTECTED]
Reply-To: Tomcat Users List tomcat-user@jakarta.apache.org
To: tomcat-user@jakarta.apache.org
Subject: Support Information Regarding - CD-Key Issues
Date: Wed, 9 Feb 2005 09:56:00 -0800

Thank you for emailing Blizzard Entertainments Technical Support 
Department. In order to provide you with greater assistance, we have 
developed an automated reply system which evaluates your message and 
generates a detailed response towards it.

Please read through this message as our automated reply system has
helped 
many of our customers. If the response given below does not assist you
or 
it is not relevant towards your message, please reply back to this
email 
and a live technician will respond to you as soon as possible.


==
Support Information Regarding - CD-Key Issues:
==

For information regarding your CD-Key, please check out our web site on

CD-Key issues:
Diablo II - (http://www.blizzard.com/support/?id=mdt000p)
Warcraft II Battle.net Edition - 
(http://www.blizzard.com/support/?id=mwb000p)
StarCraft - (http://www.blizzard.com/support/?id=msc000p)
Warcraft III - (http://www.blizzard.com/support/?id=mwr000p)

Blizzard employees will not ask for your CD-Key unless you are
contacting 
us about problems specific to your CD-Key (Blizzard employees on
Battle.net 
have a Blizzard logo or a blue cape and plate mail, depending on the
game 
title).

If you are inquiring about your World of Warcraft Authentication Key, 
please go to our Billing Support site at 
(http://www.blizzard.com/support/wowBilling/?id=mbl000p#43).


Again, if the response given above has not assisted you or it was not 
relevant towards your message, please reply back to this email and a
live 
technician will respond to you as soon as possible.

Best Regards,
Blizzard Support Team
http://www.blizzard.com/support
Blizzard Entertainment

If you respond to this email, please attach all previous messages and
files 
relating to this issue.

-Original Message-
From: tomcat-user@jakarta.apache.org
Sent: 2/9/2005 9:50:39 AM
To: tomcat-user@jakarta.apache.org
Subject: Tomcat 5.0.28 build from source

Hi,

first of all I would like to tell you that I'm now the maintainer for 
Tomcat inside of Gentoo Linux (www.gentoo.org). We already have Tomcat 
integrated into the portage tree (i.e. we already have a Gentoo Linux 
specific Tomcat package) but the old one is pretty unmaintained.
Nobody has integrated new features and nobody has bumped the version
for 
quite a long time. Therefor, I'm now going to restructure the Tomcat 
package for Gentoo Linux. Gentoo is a source based distribution and
we'er 
trying to build as much from source as possible, even Java based
programs. 
Why we do that?:

http://gentoo-wiki.com/Why_Build_Java_Code_From_Source

Since we're a Linux distribution , or generally speaking an operating 
system, we have to avoid that a user has to keep multiple copies of an 
archive or an library on his system. If there are problems with a
specific 
library (in the Java case with an jar
archive) which can also be security related it can take a long time
until 
all copies would get updated. As you now may see, in the case of Tomcat
we 
really have to avoid that a user has to checkout and download the
dependend 
libraries out of the internet before he builds and installs tomcat
itself. 
We've got all dependencies in our portage tree which are required and
yes, 
I know it's possible to specify the path to all required jars via an 
build.properties file for example. I've done that and everything works
fine 
but I've it comes to the ant target build-webapps-precompile the build 
process bails out:

build-webapps-precompile:
 [mkdir] Created dir: 
/var/tmp/portage/tomcat-5.0.28/work/jakarta-tomcat-5.0.28-src/jakarta-t
omcat-5/build/server/webapps/admin/WEB-INF/src/admin
 [mkdir] Created dir: 
/var/tmp/portage/tomcat-5.0.28/work/jakarta-tomcat-5.0.28-src/jakarta-t
omcat-5/build/webapps/ROOT/WEB-INF/src
 [mkdir] Created dir: 
/var/tmp/portage/tomcat-5.0.28/work/jakarta-tomcat-5.0.28-src/jakarta-t
omcat-5/build/webapps/ROOT/WEB-INF/classes
 [mkdir] Created dir: 
/var/tmp/portage/tomcat-5.0.28/work/jakarta-tomcat-5.0.28-src/jakarta-t
omcat-5/build/webapps/jsp-examples/WEB-INF/src
 

RE: using shared objects from tomcat

2005-02-08 Thread Benson Margulies
1) Your monitoring options depend on what unix(-like) system you are
running on. On Linux, there's strace. On Solaris, truss. On HPUX and
AIX? I forget. To do this PROGRAMMATICALLY to create a sandbox? Forget
it. The Unix Approach is this:

A) create a uid/gid with only the access that you want your code to
have.
B) Run tomcat under that UID/GID. If you want the shared lib code to
have less access than Java code, you need to introduce a process
boundary instead of using JNI.

2) Generally, you can get some clues on UnsatisfiedLinkError, in a
pinch, by using LD_DEBUG or strace (or truss or whatever).

3) Read the JNDI-howto. I happen to have left behind some useful clues
in there. However, the following might also be useful.

A) Any .so has to be in java.library.path and in LD_LIBRARY_PATH. Any
dependencies of the .so (visible with 'ldd', likewise).

B) A native class can only be loaded in One Classloader. Tomcat has a
bunch of classloaders. If you run without a security manager, you \can/
load a native class in a webapp class loader, but it will often cause
you pain and suffering. If you undeploy and redeploy the webapp, chances
are that the old classloader will still be around with the native class
in it, unless you were amazingly careful with reference management.

Thus, I always put native classes in the 'common' classloader by adding
the jars to common.loader in catalina.properties.

4) I have come to believe that the shared objects that you use for JNI
should be thin wrappers that make their own calls to dlopen/dlsym to
find the guts of your code. This insulates you from the various stupid
things that the JVM makers do from time to time in picking the wrong
arguments to dlopen.

5) Consider using an RPC protocol to talk to a server written in C/C++
instead of using JNI in the first place. If the performance is
acceptable, your life could be a lot simpler.



-Original Message-
From: Andreas Andersson [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 08, 2005 3:32 PM
To: Tomcat Users List
Subject: using shared objects from tomcat

Hi (again)!

I still have problems useing a shared library from within a tomcat
webapp. The same code works from a standalone appication but not from
tomcat.

If anyone can answer one or more of the following questions I would be
happy.

1) Is there any way to log what a .so-file attempts to do without
altering the source? This so that I can see if the .so tries anything
funny thats not allowed from within tomcat.

2) Is there any way to get more information from an
UnsatisfiedLinkError. Now that error is all I get, no reason or root
cause at all.

3) What differs in how tomcat and a standalone java application loads
libraries? And what is the restrictions on loading subsekvent libraris
(ie the first one loads the ones it depends on).

If I could assigne Duke Dollars, Expert Exchange Dollars or some kind of
Tomcat Dollars I would.

--
Andreas Andersson
IT Dept.
Travelstart Nordic
[EMAIL PROTECTED]
http://www.travelstart.se

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



RE: using shared objects from tomcat

2005-02-08 Thread Benson Margulies


This is a debian suggesting strace to be the one for me. Can I attach
strace to my .so-file or do I have to start tomcat via strace?

-- .so.s don't have independent existence. You run strace on a process.
I recommend using the -p option to attach it to the JVM after the JVM is
up but before you try to touch your code.

 2) Generally, you can get some clues on UnsatisfiedLinkError, in a 
 pinch, by using LD_DEBUG or strace (or truss or whatever).

If I'm not misstaken tomcat ignores environment variables so how can I
set LD_DEBUG? 

-- Tomcat can't 'ignore' LD_ environment variables. They control how
ld.so loads the JVM into the process address space and links it. You put
env settings in bin/setenv.sh. You will need such a setting for
LD_LIBRARY_PATH, at least.

 A) Any .so has to be in java.library.path and in LD_LIBRARY_PATH. Any 
 dependencies of the .so (visible with 'ldd', likewise).

java.library.path _AND_ LD_LIBRARY_PATH? Thats intersting and might very
well be the solution to my problem. As I just wrote I think tomcat
ignores these evironment variabels. I was under the impression that
LD_LIBRARY_PATH was the same as java.library.path, if that is not the
case then how do I set LD_LIBRARY_PATH?

-- you set the environment variable in bin/setenv.sh or the equivalent.
You also set java.library.path there, generally.

 Thus, I always put native classes in the 'common' classloader by 
 adding the jars to common.loader in catalina.properties.

Is it also OK to add .so-files? I have

grant codeBase file:${catalina.home}/common/- {
   permission java.security.AllPermission; };

in my catalina.properties. Would that suggest that if I only placed all
.so-files under /common they would be loaded or at least accessable?


-- you can never 'add a .so' to a classpath. You add the Java class with
the 'native' methods, and when it calls System.loadLibrary, the fun
begins. The jar containing the native-method classes is the important
one.

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



JNI + Tomcat 5.0.28 + Solaris 2.8 - splat

2005-01-04 Thread Benson Margulies
I have a heap of JNI code, written in C++. It works fine on Windows,
inside and outside Tomcat, when compiled with VC++ 7.1. The underlying
C++ is clean in Purify, or as clean as any code that uses STL ever gets.

 
On Solaris 2.8, compiled with Forte6u2 (5.3), current patches, + JDK
1.4.2_05, it works. If I then add in Tomcat to the mix, as soon as I run
it, the JRE collapses with an invalid SIGSEGV in the middle of the GC
someplace. I can run a Java command-line program exercising the same JNI
functions in a loop for an hour with no errors, but one call from inside
Tomcat and the JVM turns into kibbles.
 
(Compiling the C++ with gcc leads to horrible memory leaks even in a
standalone Java app, so that's not an alternative.)
 
Anyone have any ideas?
 
 


RE: How Do I Install A Valve

2004-12-30 Thread Benson Margulies
To begin with, unless you are planning to submit your valve as a patch
for inclusion, I wouldn't recommend putting it in org.apache.anything.

Since Valves run inside the server, not inside the web app, they need to
be in the server classpath. You can either do what you did or edit
catalina.properties. 

-Original Message-
From: Mark Anderson [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 30, 2004 4:48 PM
To: Tomcat Users List
Subject: Re: How Do I Install A Valve

Through some trial and error, I solved the problem.

The class file apparently needs to be under
CATALINA_HOME/server/classes. 
If one bundles it into a jar file, the jar needs to be in
CATALINA_HOME/server/lib.

I'm real new to Tomcat, so I don't know if this is really the place to
put it.  Is there anyone who can advice on best practices?  Is there a
better (or another) place to put this valve?

Thanks,

- Mark

Mark Anderson wrote:

 Hi.
 
 I've written a Valve that I will configure inside the Engine element

 in server.xml.  I've made my valve class part of the 
 org.apache.catalina.valves package. My questions is this:
 
 Where to I put the class file so that Tomcat can use it?
 
 (I'm using Tomcat 5.0.27.)
 
 - Mark
 
 
 -
 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]


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



RE: How to access web-app context-params from Servlet.init()?

2004-12-27 Thread Benson Margulies
You need a ServletContextListener, and you can get to them from there. 

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Shankar Unni
Sent: Monday, December 27, 2004 5:47 PM
To: tomcat-user@jakarta.apache.org
Subject: How to access web-app context-params from Servlet.init()?

I'd like to configure a set of web-app-level parameters for use by both
Java-based Servlets, and JSP pages.  I thought of setting these up as
context-params at the web-app level in web.xml.

For JSPs, all is cool: %= application.getInitParameter(foo) %
returns these parameters.

For Servlets, how do I get at them from the init() method? (I need them
there!). I find that calling config.getInitParameter() doesn't return
these (where config is the parameter to init() - it only returns the
actual init-params configured within the servlet).

Also, this.getServletConfig() is null, and this.getServletContext()
throws an NPE from within javax.servlet.GenericServlet.

(All this with Tomcat 5.0.27).

How do I get at a context-param from within Servlet.init()?


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



RE: Virtual Hosts and SSL

2004-12-18 Thread Benson Margulies
Some posters misunderstand virtual hosts.

The first step in creating a virtual host is to assign it a unique IP
address and host name. 

The second step is to configuring the machine's ethernet adapter to have
several IP addresses. This is done on Unix/Linux by creating additional
devices with the : syntax and on Windows by adding them to the config
dialog box.

The third step is to configure the web server to know about all this.


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



RE: JNDI object not shared among TC instances

2004-12-13 Thread Benson Margulies
Why would you expect this to be possible?

JNDI defines an API for a directory. Inside one JVM, it's simple
technology to use that API to look up Java objects. Once you involve
multiple JVMs, you need some sort of object sharing and/or persistence
system to allow code in multiple JVM's to look up 'the same' objects.
Some of us used to work on Object Oriented Databases for this purpose
--- EJBs are another view.

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


RE: Help: Windows Server on Linux Client

2004-12-08 Thread Benson Margulies
You don't need IIS to get rid of 8080.  You need to shut down IIS and
reconfigure server.xml to put tomcat on port 80.

However, if you get rid of IIS, you can't possibly have domain login
unless you want to write your own NTLM realm.

-Original Message-
From: Aris Javier [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 07, 2004 10:25 PM
To: Tomcat Users List
Subject: RE: Help: Windows Server on Linux Client

but where to type [EMAIL PROTECTED] or foo\domain in linux? 
sorry im a newbie in linux...

thanks!
aris

-Original Message-
From: Benson Margulies [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 08, 2004 10:12 AM
To: Tomcat Users List
Subject: RE: Help: Windows Server on Linux Client

The user can type [EMAIL PROTECTED] in as their user name to the basic auth
box, and their domain password, or foo\domain. And then the IIS will
cheerfully authenticate them to the domain.

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


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



RE: Help: Windows Server on Linux Client

2004-12-08 Thread Benson Margulies
Now you have to turn on security in Tomcat. If you want to talk to the
AD for this purpose, well, lots of luck. You will need a custom realm or
to implement this by hand in your servlets.

Once you have security enabled at all, the browser (on Linux or
wherever) will pop up a 'basic auth' dialog, and the user can type in a
domain-qualified name. Unless you want to use forms authentication, for
which there are some packages that someone else can help you with. 

-Original Message-
From: Aris Javier [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 08, 2004 12:10 AM
To: Tomcat Users List
Subject: RE: Help: Windows Server on Linux Client

Thanks!

I've got Tomcat to work on port 80 with IIS service disabled! 

The problem now is request.getRemoteUser() returns NULL?
Before, when I'm integrating it with IIS, request.getRemoteUser()
returns the login name of the user...

I need to get the user's domain login name... afterwhich, I will use
that login name to verify in Active Directory if he/she exists... 

you mentioned a login box appears when I hit a site with security...?
how to make my site secured then?

So sorry to cause you too much trouble.. im the only java programmer
here.. =|

Thanks again!
aris

-Original Message-
From: Parsons Technical Services [mailto:[EMAIL PROTECTED]

Sent: Wednesday, December 08, 2004 12:34 PM
To: Tomcat Users List
Subject: Re: Help: Windows Server on Linux Client

1. Is IIS shutdown (Stop the service and disable it)?

2. Is Tomcat up and running?

3. http://localhost returns what?

If you get the default start page there is a link to the manager.

As for the login Benson is speaking of the authentication (login) box
that appears when you hit a site with security.

Doug

- Original Message -
From: Aris Javier [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, December 07, 2004 11:16 PM
Subject: RE: Help: Windows Server on Linux Client


thanks Chuck!

I've changed my server.xml to port 80 and disconnected IIS...
but page cannot be displayed appeared...?

http://server/myApp

then, how to go to Tomcat web manager? http://server:80?

aris

-Original Message-
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 08, 2004 11:51 AM
To: Tomcat Users List
Subject: RE: Help: Windows Server on Linux Client

 From: Aris Javier [mailto:[EMAIL PROTECTED]
 Subject: RE: Help: Windows Server on Linux Client

 if I will not use IIS, how to remove 8080 in URL then?

Tomcat's HTTP connector is configured in server.xml.  By default, Tomcat
ships with the port number set to 8080 so you can test without
interfering with any HTTP server you might already have installed.  Once
you're ready to put Tomcat in production, change the 8080 in server.xml
to 80.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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





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


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



RE: Help: Windows Server on Linux Client

2004-12-07 Thread Benson Margulies
The user can type [EMAIL PROTECTED] in as their user name to the basic auth
box, and their domain password, or foo\domain. And then the IIS will
cheerfully authenticate them to the domain.

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



RE: Bug using nbsp;?

2004-11-23 Thread Benson Margulies
JSP 2.0 is an XML file. There's no such entity as nbsp; in XML by
default. The result of running the JSP process is an HTML file. There is
an nbsp; entity in HTML. To get the HTML entity, you have to escape the
XML entity process. 

-Original Message-
From: Gili [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 22, 2004 11:13 PM
To: [EMAIL PROTECTED]
Subject: Re: Bug using nbsp;?


Solved by replacing nbsp; with amp;nbsp;. Under JSP 2.0 you
apparently need to double-escape entity tags.

Gili

On Mon, 22 Nov 2004 21:38:15 -0500, Gili wrote:

Hi,

   I've got a small testcase using JSP 2.0:

html xmlns=http://www.w3.org/1999/xhtml;
  xmlns:jsp=http://java.sun.com/JSP/Page;
  version=2.0
  jsp:directive.page contentType=text/html;charset=UTF-8/
  nbsp;
/html

   When I try compiling this I get:

org.apache.jasper.JasperException:  The entity nbsp was referenced,
but not declared.

   Other entity tags seems to work fine. I'm new to JSP 2.0 but I
haven't 
found a solution for this problem online. Is this a bug in Tomcat? I 
saw multiple refereces online where they say you need to add

[!ENTITY nbsp #160;]

   to the !DOCTYPE ... declaration, but as far as I know, JSP 2.0

doesn't *have* a DOCTYPE declaration so I can't insert an !ENTITY
anywhere. Could someone please help? How would I fix this code?

Thanks,
Gili





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



RE: Servlets and debugging

2004-11-23 Thread Benson Margulies
Two thoughts:

1: startup time can be further shrunk by lightly editing the config to
remove the default load balancing app and the like.

2: I do all this using eclipse + MyEclipse, and I've found it quite
satisfactory. 

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



RE: Tomcat startup time delay in Windows 95/98

2004-11-17 Thread Benson Margulies
Use an actual operating system :) 

-Original Message-
From: Pragyan Padmini Misra [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 17, 2004 6:48 AM
To: 'Tomcat Users List'
Subject: Tomcat startup time delay in Windows 95/98

HI,
  I had posted this earlier and again am resending as am still not
getting any solution. Can any one help me out on this. The application
which we have developed has a performance related issue in Windows
95/98. We install the application and when we click on the aplication
icon it internally invokes a Flash screen displaying the application is
loading and internally calls the startup.bat file in tomcat\bin for the
server startup process, which internally calls the catalina.bat file and
so on and so forth. We cannot startup Tomcat as a service in Win 95/98.
The problem basically which we are facing is the time taken for the load
of the application. The load time takes up about 1 1/2 to 2 minutes.
This doesnt seem to be a feasible solution for the product acceptance.
Is there any way we can decrease the tomcat startup load time? Can we
manipulate on the processes so as to reduce the load time? Or is there
any solution for the same?

  Regards
  Pragyan

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



RE: Please help...

2004-11-12 Thread Benson Margulies
Just run a standalone tomcat. Connecting to Apache is real work and you
don't need it.

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



RE: Where do context end?

2004-11-01 Thread Benson Margulies
You need a ResourceLink in your context. See the JNDI howto document. 

-Original Message-
From: Roland Carlsson [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 01, 2004 1:51 AM
To: TomcatUsers
Subject: Where do context end?

Hi!

I encounterd what I thought to be a little curiosity this weekend. I
tried to call a GlobalNamingResource from a class that I'm using as
homegrown PersistenceManager, ie it doesn't have anything to do with the
webapplication except that it is packaged inside the webapp that uses
it.

I do the usual InitalContext and try to get the JNDI but it says that
comp:java isn't bound for this context.

If I try from the StrutsAction that is calling my class it works nice.
(cut
n'paste)

So, why can't I use the JNDI-lookup from my persistencemanager that runs
inside a web-app?

I apologize if this question belongs in a JNDI forum.

Thanks in advance
Roland Carlsson



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



RE: Where do context end?

2004-11-01 Thread Benson Margulies
No, once your Context has a ResourceLink, the same code thatwords in
an action should work anywhere else. You start with an InitialContext
and do a lookup; the HttpServletRequest has nothing to do with the
process. 

-Original Message-
From: Roland Carlsson [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 01, 2004 7:15 AM
To: TomcatUsers
Subject: SV: Where do context end?

I have a resourcelink. ..

I can successfully perform my lookup from a struts-action but not from a
class that my struts-action uses.

Do you say that I have to define a resource-link to classes that doesn't
have access to HttpServletRequest or some other class?

Regards
Roland Carlsson




Den 04-11-01 13.10, skrev Benson Margulies [EMAIL PROTECTED]:

 You need a ResourceLink in your context. See the JNDI howto document.
 
 -Original Message-
 From: Roland Carlsson [mailto:[EMAIL PROTECTED]
 Sent: Monday, November 01, 2004 1:51 AM
 To: TomcatUsers
 Subject: Where do context end?
 
 Hi!
 
 I encounterd what I thought to be a little curiosity this weekend. I 
 tried to call a GlobalNamingResource from a class that I'm using as 
 homegrown PersistenceManager, ie it doesn't have anything to do with 
 the webapplication except that it is packaged inside the webapp that 
 uses it.
 
 I do the usual InitalContext and try to get the JNDI but it says that 
 comp:java isn't bound for this context.
 
 If I try from the StrutsAction that is calling my class it works nice.
 (cut
 n'paste)
 
 So, why can't I use the JNDI-lookup from my persistencemanager that 
 runs inside a web-app?
 
 I apologize if this question belongs in a JNDI forum.
 
 Thanks in advance
 Roland Carlsson
 
 
 
 -
 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]
 


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



RE: Internationalization of characters --UTF8 encoding

2004-10-30 Thread Benson Margulies
Look up the base64 encoding support in the javamail API.

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



RE: Upload MS DOC or Image file errors.

2004-10-29 Thread Benson Margulies
Of course, 'it seems to me that convert a byte array of the contents of
a MS DOC file to a string cause error'.

The contents of an MS doc file are not a set of bytes in a single
character encoding. They can't be 'converted to a string'.  

-Original Message-
From: Daxin Zuo [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 29, 2004 12:25 PM
To: Tomcat Users List
Subject: RE: Upload MS DOC or Image file errors.

I changed to store the file into a byte array to instead a string. it
seems to me that convert a byte array of the contents of a MS DOC file
to a string cause error. The byte array is passed to another server via
socket. the file is stored at the destination correctly.
I use  FileOutputStream to see if the buffer stores a file correctly. it
is not a necessary part of my application.
Thanks.

-Original Message-
From: Steffen Heil [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 28, 2004 2:47 PM
To: 'Tomcat Users List'
Subject: AW: Upload MS DOC or Image file errors.


 Thanks. It works.

Fine.

But what? Switching to FileOutputStream or just using item.write?
(They should both work, though the second seems to make more sence. Just
asking for interest.)

Regards,
  Steffen



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



RE: Internationalization of characters --UTF8 encoding

2004-10-29 Thread Benson Margulies
UTF-7. Or any other ACE. 

-Original Message-
From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 29, 2004 3:38 PM
To: Tomcat Users List
Subject: RE: Internationalization of characters --UTF8 encoding 

Our java Application takes UTF-8 encoded unicode data and sores in a
Java String , and should insert that into Oracle8.1.7 database.
Oracle database has US7ASCII encoding.
So when i insert data some of the characters are being lost, and i see
'?'
being inserted into database.
How can i convert this UTF-8 encoded java String into ASCII so that
database can load it.

Can anyone suggest what to do...









--- Shilpa Nalgonda [EMAIL PROTECTED] wrote:

 can u point me to a resource how i can do it.

 -Original Message-
 From: Evgeny Gesin [mailto:[EMAIL PROTECTED]
 Sent: Friday, October 29, 2004 9:42 AM
 To: Tomcat Users List
 Subject: Re: Internationalization of characters
 --UTF8 encoding


  .. is supposed to take japanese characters an
 insert
  them into database. Is there any setting in
 Tomcat4
  where i should be giving the encoding option.

 You can specify parameters for SQL driver when you define DataSource 
 in Tomcat's server.xml. I think most of Oracle drivers can process 
 UTF-8, without the needs for such parameters, but MySQL 3.xx, for 
 example, needs such parameters...

 Evgeny
 Javadesk / AllTelescopes



 __
 Do you Yahoo!?
 Yahoo! Mail Address AutoComplete - You start. We finish.
 http://promotions.yahoo.com/new_mail


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






__
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail

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


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



RE: JNDI Resources in web.xml

2004-10-28 Thread Benson Margulies
The question is not 'DTD or schema'. The question is, 'does the 2.4
schema relax the order, and does Tomcat comply?'  

-Original Message-
From: David Smith [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 28, 2004 7:49 AM
To: Tomcat Users List
Subject: Re: JNDI Resources in web.xml

Hi.

As I understand it from lurking on this list a very long time, servlet
spec 2.3 and earlier validated the web.xml file on a DTD.  DTDs require
the elements be in the right order and tomcat will throw an exception
when the webapp is deployed with elements out of order.  Servlet Spec
2.4 web.xml files are validated against a schema and don't suffer that
limitation.

--David

Steve Kirk wrote:

that section opens by talking about the web-app element and says All 
sub elements under this element can be in an arbitrary order.  so it 
seems that even if orderingused to be an issue, it's not any longer.

  

Also, the docs caution that I should respect element ordering in the 
web.xml file, but they don't tell me what the ordering should be.
Where is this ordering documented?
  


  

SRV.13.4 of the Servlet Spec lists the order.
http://www.jcp.org/aboutJava/communityprocess/final/jsr154/





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


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



RE: Re[2]: JNDI DataSource GlobalResources problem

2004-10-28 Thread Benson Margulies
The standard make a series of provisions for the case in which there is
no 'pathname' corresponding to some resource in a web application. These
provisions were intended to support a model where a WAR file is never
exploded into a native file system. Conceptually, you can model this as
supporting unexploded WAR, but that's just a conceptual model. The
conspicuous practical case is Oracle, which unpacks the WAR into the
database.

However, I respecfully submit that all of this is beside your original
point.

I think that the important point is that the specifications only deal
with self-contained web applications, whether or not anyone ever
assembles one into a WAR file. Tomcat is not trying to be a full J2EE
container (c.f. jboss). The designers are willing to add functionality
to permit the use of the J2EE resource model, but they are very
protective of Tomcat's status as a relatively tight, lightweight device.


The META-INF/server.xml thing isn't, currently, a WAR feature. It's
narrower than that. It's restricted to a particular tool for deploying
from a WAR. This very narrow view is much more a reflection of the
desire to avoid feature bloat than any particular tilt to or from WAR
files.

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



RE: JNDI DataSource GlobalResources problem

2004-10-28 Thread Benson Margulies
I think that JNI is the only counter-example. Forgive me if the
following is well know but seen as unimportant to all concerned.

There is a JVM restriction: any given class with native members can only
be loaded into one classloader of a JVM. So, if two webapps both try to
include a native class, the second fails. If you load a webapp with a
native class, and then reload it later during development, you are
likely (at least, you used to be very likely) to fail and have to
restart tomcat. I confess I haven't tried this lately.

So, if you have a class library with native classes, and you want to use
it in more than one webapp, you are, as far as I know, stuck with the
common directory. Using JNDI to coordinate the use of this sort of thing
just seemed to me to be an example of using the materials at hand.

If tomcat wanted to take the design approach that 'we're not a J2EE
container, we don't have any support for shared resources, go find a big
fat J2EE container if you want that', you'd get no squeaking from me,
whatever difference that makes. I am, however,  stuck with the practical
problem of JNI, and more than willing to lend a hand to an alternative
scheme.

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



RE: Upload MS DOC or Image file errors.

2004-10-28 Thread Benson Margulies
This is much more than a character encoding problem.

Extracting text from a Microsoft Word file is a very complex process.
Microsoft provides 'IFilter' support for this purpose. Various vendors
sell more portable solutions. I don't know of a full open-source
solution.

You can tell the user to save as .txt and then upload that, and THEN you
merely have a character encoding problem.

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



RE: JNDI DataSource GlobalResources problem

2004-10-28 Thread Benson Margulies
I'm reading this thread as the following meta-discussion. I may be
confused.

Steve and others: Help us, we've having trouble making global resources
work due to poor documentation and problems deciding what to put in the
'common' classpath and what to put in the webapp class path.

Yoav and others: Well, OK, here's some help, but why do you want to use
global resources anyway?

Steve: Wait a minute, now I see, I don't really need any global
resources, I can let each webapp get its own database connection, and
configure the whole business in the Context element.

Benson: That's all well and good for those of you who were using global
resources to pool DB connections. However, us poor suckers who use JNI
are forced into global resources for other reasons.

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



RE: JNDI DataSource GlobalResources problem

2004-10-28 Thread Benson Margulies
Whoops, I missed a point: 

'counter-example' to the general idea that anything you can do as a
global resource you can do just as well as a per-web-app resource.

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



RE: How to Display a byte array (contents of a MS DOC fie, Excel, ..) in web browser

2004-10-28 Thread Benson Margulies
What do you want to see? Hex digits?  

-Original Message-
From: Daxin Zuo [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 28, 2004 9:12 PM
To: Tomcat Users List; [EMAIL PROTECTED]
Subject: How to Display a byte array (contents of a MS DOC fie, Excel,
..) in web browser

I receive a byte array from a remote server, and the servlet will
display it on the browser. The byte array contains a MS DOC file. If I
simply convert it to a String, the contents will be meaningless.
Please forward instruction.


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



RE: Tomcat 5.0.27 hangs in windows 2000

2004-10-27 Thread Benson Margulies
This is usually the symptom of a TS-unaware application popping up a
dialog box on the real console. Perhaps the JVM suffers from this
tendency?

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



RE: JNDI DataSource GlobalResources problem

2004-10-27 Thread Benson Margulies
The specifications specify how a webapp declares the resources that it
uses, but not how those resources are configured in the container and
made accessible to the webapp. So, whatever we have in here is going to
be tomcat-specific. 

The question is, are the arbiters of taste interested in considering
making the administrative configuration process more convenient?

It seems to me that there is a tension here: from a security standpoint,
administrative configuration has to be outside the webapp. From a
convenience standpoint, it sure would be nice to have a single package. 

Further, a global resource is, by definition, global, and so shouldn't
travel with the webapp.

I might be willing to code a contribution in this area if there was some
consensus on a design that would be acceptable to them-that-vote. Ideas
bandied about in the past include allowing META-INF/server.xml for
auto-deployed WAR files, thought I believe that them-that-vote have
strong feelings against this idea.


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



RE: Re[2]: JNDI DataSource GlobalResources problem

2004-10-27 Thread Benson Margulies
As I read the discussion, I don't think that anyone claimed that only
WAR's are interesting or important.

Yoav, in one posting, explained that the servlet spec is written from a
point of view that only requires support for applications in unexploded
WAR files. That is not the same thing as stating that only WARs are
interesting. It is just a way of illuminating some requirements for
behaviors of the container.

In another posting, Yoav expressed a generic distaste for Global
resources -- all other things being equal.

Of late, there's been a rash of people wanting to use global resources,
either for database pooling or for JNI reasons. The commercial
containers have various kinds of adminstrative UI arrangements for this
purpose. No one that I know of supports a self-contained package that
bundles a web app with administrative/resource/global configuration, but
I haven't made a comprehensive survey. Semi-seriously, I wonder about a
GRaR -- a Global Resource aRchive, as a way to package up a set of
global classlibs and the config to deploy them into JNDI.

I've experimented with writing a simple Java command-line application to
set up an application with global resources. It assumes that the app
will deploy outside the webapps dir. It edits server.xml and creates the
context file to point to the tree. It wasn't very complex. 

I have some ideas as to why them-that-vote are not enthused about
META-INF/server.xml as a generic feature of a web application tree. If
there is also context file in Catalina/HOST/xxx.xml, which one wins? How
loudly will someone yell when a WAR file has unexpected implications
because it has a server.xml? As things are, META-INF/server.xml is a
feature of a particular management path, not a feature of webapps. 

Mostly, I end up feeling that this is more of a documentation problem.
Developer after developer reads the servlet spec, which is quite murky
in this area since it defers important stuff to the container. Then,
they either never read the relevant tomcat howtos, or fail to understand
them. As a recent contributor to them I get some of the blame for the
later turn of events.

In big letters, someplace, people need to see 'if your webapp needs
resources from the container, and especially if you need container-wide
shared resources, you are not in Kansas any longer'.





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



RE: JNDI DataSource GlobalResources problem

2004-10-26 Thread Benson Margulies
As a recent patcher of this document, I wish that I had made all the
references to ResourceLink say 'of the Context or DefaultContext'
element to stop people from accidently trying to put them into the
Global...

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



RE: RE: JNDI DataSource GlobalResources problem

2004-10-26 Thread Benson Margulies
Webapps can only see GlobalNamingResource resources if there is a
ResourceLink in the Context or DefaultContext. By default, the global
context is only visible to global code. This is explained in the how-to,
though my wording in there turns out to be less clear than I had hoped.

-Original Message-
From: sven morales [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 26, 2004 9:54 AM
To: [EMAIL PROTECTED]
Subject: RE: JNDI DataSource GlobalResources problem

 Stever Kirk:  Did I read that right, Resource
nested inside GlobaNamingResource is not visible to
the webapp?  I thought that was the whole purpose to
make it visible globally naming resources under
GlobalNamingResource noh?  If Im wrong I stand
corrected.




__
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

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



RE: split mod_jk2 configuration file for vhosts

2004-10-22 Thread Benson Margulies
Run a web service in the other JVM? 

-Original Message-
From: Matteo Turra [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 22, 2004 4:32 AM
To: Tomcat Users List
Subject: split mod_jk2 configuration file for vhosts

I tell apache httpd where is the workers2.properties file with

JkSet config.file /etc/httpd/conf/workers2.properties

Now I have multiple ip virtual host webapps and each one has a file
included in httpd.conf with

Include /etc/httpd/conf/vhosts/*.conf

How can I configure Jk2 configuration file (workers2.properties) for
each host separately?

Can I use 

JkSet config.file /etc/httpd/conf/workers2.properties

in each vhosts/xxx.conf file even if I have only one instance of httpd?

Thanks, Matteo Turra


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



RE: Tomcat classloading...a theory question..

2004-10-21 Thread Benson Margulies
.5 additional cents:

JNI also drives the use of common/lib, due to the restriction of only
loading a native class in one ClassLoader.

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



RE: encoding problems with UTF-8

2004-10-20 Thread Benson Margulies
Who is processing the style sheet, tomcat or the browser?

If you are calling TRaX in the browser, there is a problem with the
interaction of Jasper and Xalan, such that you can't get TRaX to write
directly to the JspWriter and get UTF-8 to come out.

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



RE: how to send \u characters to tomcat

2004-10-20 Thread Benson Margulies
See HttpServletRequest.setCharacterEncoding.

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



RE: Run a war file without unpacking?

2004-10-19 Thread Benson Margulies
One item for emphasis: the JRE provides the feature of adding a JAR to
the classpath. The JRE does not offer direct support for WAR semantics,
such as JAR files in the WEB-INF/lib directory. Tomcat would have to,
for example, have a classloader that searched the WAR file in the
specified order. This would be a massive effort. That's the difference
between 'stuff in a JAR' and 'stuff in a WAR'. 

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



RE: Debugging startup in 5.0.28 with eclipse 3.0/myeclipse

2004-10-19 Thread Benson Margulies
In case it's helpful to anyone, I found the answer to this.

Adding classes to the classpath in the Eclipse preferences leads to
pretty serious confusion, not too surprisingly. If one pulls them into a
jar and drops them into common/lib, all is well, including breakpoints.
I wish I could find a way to, in effect, add my own directory to the
same classpath that common\classes goes into. There probably is one that
I'm missing. 

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



Debugging startup in 5.0.28 with eclipse 3.0/myeclipse

2004-10-18 Thread Benson Margulies
I need to debug a JNDI resource factory configured in server.xml. I'm
running eclipse 3.0.

I'd like to just use eclipse's ability to launch tomcat in the debugger,
but breakpoints aren't breaking.

Anyone else been down this path?


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



Not using the admin app

2004-06-29 Thread Benson Margulies
I'd like to build a completely wired-down webapp with an Axis soap
service included therein.

The default wsdd includes some machine-specific pathnames, so I can't
just capture it send it around.

I'm poking gently at the axix-specific api, but I'm not finding the
right thing if there is one. I'm looking for something I could call from
a ServletContextListener.


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



RE: Not using the admin app

2004-06-29 Thread Benson Margulies
Oh, sorry, sorry, this was supposed to be directed to axis. 

 -Original Message-
 From: Benson Margulies [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, June 29, 2004 12:46 PM
 To: Tomcat Users List
 Subject: Not using the admin app
 
 I'd like to build a completely wired-down webapp with an Axis 
 soap service included therein.
 
 The default wsdd includes some machine-specific pathnames, so 
 I can't just capture it send it around.
 
 I'm poking gently at the axix-specific api, but I'm not 
 finding the right thing if there is one. I'm looking for 
 something I could call from a ServletContextListener.
 
 
 -
 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]



Anyone really using JAX-RPC?

2004-06-28 Thread Benson Margulies
Folks,

Is anyone out there running a deployed application using JAX-RPC for
soap/wsi? If so, are you using Axis, or the Sun JWSDP stuff? Or
something else entirely?


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



RE: UTF-8 character encoding and Tomcat 5.0.25

2004-06-27 Thread Benson Margulies
What, exactly, is going wrong? Are the JSP pages mishandled? The request
parameters? 

 -Original Message-
 From: Jason Novotny [mailto:[EMAIL PROTECTED] 
 Sent: Sunday, June 27, 2004 7:59 AM
 To: Tomcat Users List
 Subject: UTF-8 character encoding and Tomcat 5.0.25
 
 
 Hi,
 
 In upgrading my webapp from Tomcat 4.1.X to Tomcat 
 5.0.25, it seems
 UTF-8 character encoding no longer works as it did before. 
 I've already read and followed advice from the Tomcat FAQ 
 http://jakarta.apache.org/tomcat/faq/tomcatuser.html and read 
 the bug reports related to this problem with no clues.
 
 Here's what I've done so far:
 
 1) Add a filter which does the request.setCharacterEncoding(UTF-8);
 
 2) Use res.setContentType(text/html; charset=utf-8); and
 out.println(meta http-equiv=\Content-Type\ 
 content=\text/html; charset=utf-8\/);
 
 in my servlet when creating the html page to be output
 
 3) Add %@ page contentType=text/html; charset=UTF-8 
 pageEncoding=UTF-8 %
 
 to the top of JSP files containing strings to be localized
 
 What else could I missing? What I would like to know is 
 why is it possible for my code to work fine on Tomcat 4 but 
 not Tomcat 5-- it would seem either something is in fact 
 broken, or instructions need to be updated on adding some bit 
 of information that wasn't necessary before.
 
 Thanks, Jason
 
 
 
 
 
 
 -
 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]



RE: UTF-8 character encoding and Tomcat 5.0.25

2004-06-27 Thread Benson Margulies
In which direction? If you write %= \u % for an accented char,
does it display in the browser? What does 'View/Encoding reveal for the
browser's idea?
 

 -Original Message-
 From: Jason Novotny [mailto:[EMAIL PROTECTED] 
 Sent: Sunday, June 27, 2004 3:29 PM
 To: Tomcat Users List
 Subject: Re: UTF-8 character encoding and Tomcat 5.0.25
 
 
 It seems all the accented characters in any language show 
 up as ?..
 
 Thanks, Jason
 
 Benson Margulies wrote:
 
 What, exactly, is going wrong? Are the JSP pages mishandled? The 
 request parameters?
 
   
 
 -Original Message-
 From: Jason Novotny [mailto:[EMAIL PROTECTED]
 Sent: Sunday, June 27, 2004 7:59 AM
 To: Tomcat Users List
 Subject: UTF-8 character encoding and Tomcat 5.0.25
 
 
 Hi,
 
 In upgrading my webapp from Tomcat 4.1.X to Tomcat 5.0.25, it 
 seems
 UTF-8 character encoding no longer works as it did before. 
 I've already read and followed advice from the Tomcat FAQ 
 http://jakarta.apache.org/tomcat/faq/tomcatuser.html and 
 read the bug 
 reports related to this problem with no clues.
 
 Here's what I've done so far:
 
 1) Add a filter which does the 
 request.setCharacterEncoding(UTF-8);
 
 2) Use res.setContentType(text/html; charset=utf-8); and
 out.println(meta http-equiv=\Content-Type\ 
 content=\text/html; charset=utf-8\/);
 
 in my servlet when creating the html page to be output
 
 3) Add %@ page contentType=text/html; charset=UTF-8 
 pageEncoding=UTF-8 %
 
 to the top of JSP files containing strings to be localized
 
 What else could I missing? What I would like to know is 
 why is it 
 possible for my code to work fine on Tomcat 4 but not Tomcat 5-- it 
 would seem either something is in fact broken, or 
 instructions need to 
 be updated on adding some bit of information that wasn't necessary 
 before.
 
 Thanks, Jason
 
 
 
 
 
 
 
 -
 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]
 
 
   
 
 
 
 -
 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]



Parameterizing a web app via resources

2004-06-24 Thread Benson Margulies
I'd like to give people a webapp to run by telling them: 

- drop the .war file
- add some parameters
- stand back

If I focus on Tomcat, I see how to do that: I can tell them to create a
Context element in the outboard XML file and configure some resources
there.

This is, of course, Tomcat-specific.

Have anyone any experience with the equivalent functionality in other
possible deployment targets?

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



RE: Bizarre parse error

2004-06-22 Thread Benson Margulies
See http://issues.apache.org/bugzilla/show_bug.cgi?id=23357. Perhaps if
you vote for it, someone would fix it? 

 -Original Message-
 From: Jonathan Melhuish [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, June 22, 2004 11:44 AM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: Bizarre parse error
 
 In the absence of any more logical suggestions, I've been 
 randomly fiddling and have found that:
 
 * I only get the error when I successfully retreive XML 
 from the database and pass it to Xalan, it works or fails 
 elegantly in all other cases
 * The XML data is returned correctly and is valid, 
 because I can output it, save it and parse it using Mozilla
 * The simple XSL stylesheet that I have created (which 
 just matches the document root) is valid because I am using 
 it successfully on another very similar page that returns a 
 smaller subset of the XML data
 * If I copy and paste the outputted XML from the saved 
 file into my JSP page and assign it to a string, it works
 
 So, in summary:
 
 * The bit that gets the XML from the database appears to 
 work correctly
 * The bit that processes the XML (Xalan) appears to work 
 correctly when the above XML is hard-coded into a string
 * It doesn't work when I try to pass the XML directly 
 from one to the other
 
 Any ideas?!
 
 Cheers,
 
 Jon
 
 Jonathan Melhuish wrote:
 
  I've got a rather bizarre problem which I can't quite get my head 
  around, and was wondering if anybody might be able to help.
 
  I'm using Xalan to transform XML into HTML4 using an XSLT 
 stylesheet.
  The page appears to be generated correctly, from looking at 
 the source 
  code.  However, upon loading, Internet Explorer (5 and 6) gives the
  error:
 
 The character '' was expected. Error processing resource 
  'http://www.w3.org/TR/html4/strict.dtd'. Line 81, Position 5
 -- media type, as per [RFC2045]
 ^
 
  The line number referenced is not related to the source code of my 
  page.  Mozilla, meanwhile gives the error XML Parsing Error: 
  mismatched tag. Expected: /link which would imply that 
 it is trying 
  to parse it as XHTML.  Changing the DOCTYPE declaration 
 from Strict to 
  Transitional changes the line number in IE but not the 
 error given by Mozilla.
  Removing the DOCTYPE definition completely brings IE's 
 error in line 
  with Mozilla's.
 
  However, all of this would perhaps seem rather irrelevant, 
 as I found 
  that saving the file to disk and re-opening it causes it to be 
  displayed correctly in both browsers.  Similarly, saving 
 the resultant 
  HTML and serving it through Tomcat also works, regardless 
 of whether 
  the filename extension is .html or .jsp.  My only 
 suggestion was that 
  perhaps it was something to do with the MIME type, but presumably 
  Tomcat would decide that based on the filename extension if my JSP 
  pages were not to contain the line:
 
  %@ page language=java contentType=text/html %
 
  This presumption is supported by the fact that removing this line 
  makes no difference to either error.
 
  Which leaves me completely out of ideas... help!
 
  TIA,
 
  Jon
 
 
 
 
 
 
 -
 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]



RE: Tomcat Logging.. whats the best way ?

2004-06-22 Thread Benson Margulies
Sure, but the other question is this:

ServletContext.log allows a webapp to log. Wouldn't It Be Nice if that
same log was somehow available to any old bit-o-java when running in the
environment?


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



RE: Bizarre parse error

2004-06-22 Thread Benson Margulies
Here's what I've seen.

The TRaX API, as implemented by xalan, has a thing called
javax.xml.transform.stream.StreamResult.

The xalan implementation of this looks at the type of the object passed
in to decide what sort of character handling is desired.

When you pass in a JspWriter, it gets confused, because JspWriter is not
one of the fixed set of classes that were wired into the xalan source as
of the time I read the xalan source.


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



Overenthusiastic use of 'exit' in .bat files in 5.0.25?

2004-06-21 Thread Benson Margulies
I just dropped a clean install of 5.0.25 onto Windows Server 2003, and I
did not install ask for a service from the installer. I don't have
'start and stop tomcat' links in my Start menu at all.

I then tried to run 'TOMCAT_ROOT\bin\catalina run'

to test out my configuration.

It didn't locate the JRE. Unfortunately for me, this caused my entire
command prompt window to *disappear*, instead of just spewing the error
message and returning to command level. This may be because the test for
OS=Windows_NT doesn't' 

Adding a JAVA_HOME setting to setenv.bat cured the problem. However, the
disappearing window is rather unkind. A bug? The use of 'exit' in
setclasspath.bat, which is 'called' is what causes this problem, I
think. Setclasspath should set something to indicate success or failure
which can be checked by catalina.bat. 

Meanwhile, according to the GUI for configuring tomcat, it has picked up
the default installation of the JRE in c:\program files. Should that be
visible to any of the command-line mechanisms for launching tomcat, or
is that purely for services?




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



RE: Overenthusiastic use of 'exit' in .bat files in 5.0.25?

2004-06-21 Thread Benson Margulies
I left a really bad typo in this message. Here's the fixed version:

I just dropped a clean install of 5.0.25 onto Windows Server 2003, and I
did not install ask for a service from the installer. I don't have
'start and stop tomcat' links in my Start menu at all.

I then tried to run 'TOMCAT_ROOT\bin\catalina run'

to test out my configuration.

It didn't locate the JRE. Unfortunately for me, this caused my entire
command prompt window to *disappear*, instead of just spewing the error
message and returning to command level. 

Adding a JAVA_HOME setting to setenv.bat cured the problem. However, the
disappearing window is rather unkind. A bug? The use of 'exit' in
setclasspath.bat, which is 'called' is what causes this problem, I
think. Setclasspath should set something to indicate success or failure
which can be checked by catalina.bat. 

Meanwhile, according to the GUI for configuring tomcat, it has picked up
the default installation of the JRE in c:\program files. Should that be
visible to any of the command-line mechanisms for launching tomcat, or
is that purely for services?



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



RE: ConnectionPool timeout

2004-06-21 Thread Benson Margulies
I'm seeing evidence of several odd auto-responses. It looks like someone
thinks that it is a fun prank to add random addresses of unsuspecting
people to this list.


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



RE: JNDI Question

2004-06-21 Thread Benson Margulies
Have a look at http://issues.apache.org/bugzilla/show_bug.cgi?id=29584.

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



RE: Configuring JNDI for tomcat

2004-06-18 Thread Benson Margulies
It would seem a lot less work to fill up a hashtable with parameters and
get a vanilla JNDI context for your external nameserver independent of
the internal context used for web-app resources. What's the point of
looking up web-app resources in an external directory when they can't be
shared anyhow?

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



RE: JNDI frustration

2004-06-18 Thread Benson Margulies
Patches submitted. 

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



RE: Configuring JNDI for tomcat

2004-06-16 Thread Benson Margulies
Tomcat does not expose a naming service on any port at all, so far as I
know. It just offers an internal API to JNDI in which it populates a
namespace.


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



RE: JNDI frustration

2004-06-15 Thread Benson Margulies
Yoav,

I figured out what happened to me, but I'm not sure I understand your
reply.

I have a resource that must be one-per-process. It's unfortunate, but
that's the case. So, I thought that the Global... resources was the
place to define it.

Perhaps this is obvious to everyone else, but I didn't realize that the
JNDI context for the Global... resources is not the same as that for any
web app. So, I needed a ResourceLink / construct in the
DefaultContext to connect the webapps up to the global resource.

If I read you correctly, I think you are recommending that just move the
entire resource definition into web.xml and out of server.xml, and use
Shared to allow multiple web apps to share the same object.

Is that the situation?

--benson


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



RE: JNDI frustration

2004-06-15 Thread Benson Margulies

1) Would it be appropriate to bugzilla a request to clarify the
documentation on the use of custom factories for resources in JNDI? The
doc didn't turn out to be exactly incorrect, but I think that it is
somewhat misleading, and could be improved by some explicit annotations.
I expected to be able to use a resource-env-ref in web.xml against
parameters in the global resources, and it took very close reading in
several places to figure out that this required a link.

2) There's this nice structure now where you can define jdbc, ejb, or
mail resources globally and consume them locally. I got into this
situation trying to extend that to my own factory-produced beans. 


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



RE: JNDI frustration

2004-06-15 Thread Benson Margulies
Yoav,

I wrote up the material in bz 29584. However, I end up wondering if
there is, after all, either a bug or a possible desirable feature here.

The documentation in globalresources.html describing the purpose of
GlobalMakingResources:

You can declare the characteristics of the resource to be returned for
JNDI lookups of resource-ref and resource-env-ref elements in the
web application deployment descriptor.

I believe that this statement is true for the standard factories, and
false for custom factories. I debugged into the code, and found that the
resource-env-ref in my web.xml was unconnected to the
GlobalNameingResources declaration, and so lacked the factory
attribute necessary to actually create the object.

Until, that is, I added the ResourceLink

If you like the behavior the way it is, then the bugzilla gives what I
hope are sufficiently specific suggestions to improve the doc.

--benson

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



JNDI frustration

2004-06-13 Thread Benson Margulies
Tomcat 5.0.25
JDK 1.4.1

I'm following the instructions to create a custom bean factory for use
with JNDI.

At server initialization, the MBean code calls into my ObjectFactory to
create, successfully, the first bean.

Then, my webapp has a resource manager listener. It tries to use the
standard lookup mechanism, and gets a NamingException, with no
interesting details, with no call to my ObjectFactory.

I followed all the instructions with respect to the web.xml and
server.xml contents.


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



RE: JNDI frustration

2004-06-13 Thread Benson Margulies
I believe I have found my error in web.xml. I will send a more complete
cry for help if I turn out to be wrong.

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



RE: JNDI frustration

2004-06-13 Thread Benson Margulies
THanks, but I wasn't using the 'mail' factory, I was trying to use my
own factory, and put the factory class name where the bean class name
belonged. I'd volunteer to write more doc if I understood how all the
parts interacted. 

 -Original Message-
 From: Jim Hopp [mailto:[EMAIL PROTECTED] 
 Sent: Sunday, June 13, 2004 10:22 PM
 To: Tomcat Users List
 Subject: Re: JNDI frustration
 
 Take a look at 
 http://nagoya.apache.org/bugzilla/show_bug.cgi?id=29255.
 
 Benson Margulies wrote:
 
  Tomcat 5.0.25
  JDK 1.4.1
  
  I'm following the instructions to create a custom bean 
 factory for use 
  with JNDI.
  
  At server initialization, the MBean code calls into my 
 ObjectFactory 
  to create, successfully, the first bean.
  
  Then, my webapp has a resource manager listener. It tries 
 to use the 
  standard lookup mechanism, and gets a NamingException, with no 
  interesting details, with no call to my ObjectFactory.
  
  I followed all the instructions with respect to the web.xml and 
  server.xml contents.
  
  
  
 -
  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]
 
 

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



RE: JNDI frustration

2004-06-13 Thread Benson Margulies
OK, I am stuck. Here are the details:

server.xml, adding to the existing GlobalNamingResources:

  GlobalNamingResources

!-- Test entry for demonstration purposes --
Environment name=simpleValue type=java.lang.Integer
value=30/

  Resource name=bean/RLPEnvironmentFactory auth=Container
type=com.basistech.rex.j2ee.EnvironmentBean/
  ResourceParams name=bean/RLPEnvironmentFactory
parameter
  namefactory/name
  valuecom.basistech.rex.j2ee.EnvironmentFactory/value
/parameter
parameter
  nameRLPRoot/name
  valued:/rlp-arabic/rlp/value
/parameter
  /ResourceParams
/GlobalNamingResources

web.xml:

 resource-env-ref
descriptionObject factory for the RLP
Environment./description
 
resource-env-ref-namebean/RLPEnvironmentFactory/resource-env-ref-name

 
resource-env-ref-typecom.basistech.rex.j2ee.EnvironmentBean/resource-
env-ref-type
/resource-env-ref

resource listener class:

try {   
Context initCtx = new InitialContext();
Context envCtx = (Context)
initCtx.lookup(java:comp/env);
EnvironmentBean bean = (EnvironmentBean)
envCtx.lookup(bean/RLPEnvironmentFactory);
rlp = bean.environment();
} catch(NamingException ne) {
throw new RuntimeException(Failed to create RLP
environment bean via JNDI., ne);
}

I've traced into the call in envCtx.lookup. It finds the name, finds
that it is a reference, and then tries to defererence it. My SPI class
isn't called at this point, instead I just get a NamingException that
does not detail whatever has gone amiss.

I would be less helpless if I understood why this has to be configured
in web.xml at all. If the global config has defined that JNDI has the
ability to come up with an object of my class at a particular name by
calling my factory, what's the web.xml angle?




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



logging versus ant tasks

2002-11-20 Thread Benson Margulies
I can't figure out how to specify context options such as the existence
of a logger for a context established with the ant tasks.
 



disappearing tomcat 4.1.12-LE-jsk14

2002-11-19 Thread Benson Margulies
I am setting up a webapp that uses some JNI class. When it gets to the
crucial point, the tomcat VM just disappears. No errors, no log message,
no nuthin.
 
I'm on Windows XP at the moment. 
 
Very soon, I expect to move this show to Linux, and I more-or-less
anticipate seeing JVM coredumps resulting from some unfortunate error or
another in the JNI code, but I send this email in case someone can offer
some clue for how to get some information in the short term.