RE: The process tomcat {pid 1488.0000 } is leaking handles

2005-09-13 Thread Wade Chandler
--- [EMAIL PROTECTED] wrote:

 I have and they put it down to being the Tomcat
 application - not much use
 at all!
 On task manager it does indicate that tomcat is at
 fault..
 
 -Original Message-
 From: Christoph Kutzinski [mailto:[EMAIL PROTECTED]
 Sent: 13 September 2005 11:40
 To: Tomcat Users List
 Subject: Re: The process tomcat {pid 1488. } is
 leaking handles
 
 
 This Peregrine Get Answers application is probably
 leaking file 
 handles. Ask their support.
 
 [EMAIL PROTECTED] wrote:
  We have a server running Peregrine Get Answers
 which use TOMCAT as part of
  its installation
  
  We are seeing (via task manager) a slow build up
 of handles for the tomcat
  app..
  
  Has anyone come across this before?
  
  This e-mail and any attachments are confidential
 and intended solely 
  for the addressee and may also be privileged or
 exempt from disclosure 
  under applicable law. If you are not the
 addressee, or have received 
  this e-mail in error, please notify the sender
 immediately, delete it 
 from your system and do not copy, disclose or
 otherwise act upon any 
  part of this e-mail or its attachments..
  
  Internet communications are not guaranteed to be
 secure or virus-free. 
  The Barclays Group does not accept responsibility
 for any loss arising 
 from unauthorised access to, or interference with,
 any Internet 
  communications by any third party, or from the
 transmission of any 
  viruses. Replies to this e-mail may be monitored
 by the Barclays 
  Group for operational or business reasons..
  
  Any opinion or other information in this e-mail or
 its attachments 
  that does not relate to the business of the
 Barclays Group is personal 
  to the sender and is not given or endorsed by the
 Barclays Group.
  
  Barclays Bank PLC.Registered in England and Wales
 (registered no.
 1026167).
  Registered Office: 1 Churchill Place, London, E14
 5HP, United Kingdom.
  
  Barclays Bank PLC is authorised and regulated by
 the Financial Services
 Authority.
  
 

-
  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]
 
 This e-mail and any attachments are confidential and
 intended solely 
 for the addressee and may also be privileged or
 exempt from disclosure 
 under applicable law. If you are not the addressee,
 or have received 
 this e-mail in error, please notify the sender
 immediately, delete it 
 from your system and do not copy, disclose or
 otherwise act upon any 
 part of this e-mail or its attachments..
 
 Internet communications are not guaranteed to be
 secure or virus-free. 
 The Barclays Group does not accept responsibility
 for any loss arising 
 from unauthorised access to, or interference with,
 any Internet 
 communications by any third party, or from the
 transmission of any 
 viruses. Replies to this e-mail may be monitored by
 the Barclays 
 Group for operational or business reasons..
 
 Any opinion or other information in this e-mail or
 its attachments 
 that does not relate to the business of the Barclays
 Group is personal 
 to the sender and is not given or endorsed by the
 Barclays Group.
 
 Barclays Bank PLC.Registered in England and Wales
 (registered no. 1026167).
 Registered Office: 1 Churchill Place, London, E14
 5HP, United Kingdom.
 
 Barclays Bank PLC is authorised and regulated by the
 Financial Services Authority.
 

All task manager can tell you is that the application
Tomcat is holding all these file handles opened.  Your
application is running inside of Tomcat, so of course
the tomcat application is holding the files open, but
if your web app is doing this then it's the code in
the web app even though the Tomcat server is holding
open the files.  The code opening the files should be
closing them.  What files are being held open?  Can
you tell this with any tools you have?  That would
help you more than anything.

Wade

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



Re: user authetication on MySql db issue need some help!

2005-09-12 Thread Wade Chandler
--- Yassine ELassad [EMAIL PROTECTED] wrote:

 hi list,
 
 iam about to set my user to a database instead of
 file and i am now trying  to get that done on a
 mysql rdbms
 i created the following tables :
 mysql use authority;
 Database changed
 mysql show tables;
 +-+
 | Tables_in_authority |
 +-+
 | user_roles  |
 | users   |
 +-+
 2 rows in set (0.00 sec)
 
 mysql describe user_roles;

+---+-+--+-+-+---+
 | Field | Type| Null | Key | Default |
 Extra |

+---+-+--+-+-+---+
 | user_name | varchar(15) |  | PRI | |  
 |
 | role_name | varchar(10) |  | | |  
 |

+---+-+--+-+-+---+
 2 rows in set (0.00 sec)
 
 mysql describe users;

+---+-+--+-+-+---+
 | Field | Type| Null | Key | Default |
 Extra |

+---+-+--+-+-+---+
 | user_name | varchar(15) |  | PRI | |  
 |
 | user_pass | varchar(32) |  | | |  
 |

+---+-+--+-+-+---+
 2 rows in set (0.00 sec)
 
 
 and this  this is my server.xml:
 
 
 =
 Server port=8005 shutdown=SHUTDOWN
  GlobalNamingResources
 !-- Used by Manager webapp --
 Resource name=UserDatabase auth=Container
  
 type=org.apache.catalina.UserDatabase
   description=User database that can be updated
 and saved
 
/Resource
 
 
ResourceParams name=UserDatabase
  parameter
 namefactory/name


valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value
  /parameter
  parameter
 namepathname/name
 valueconf/tomcat-users.xml/value
   /parameter
/ResourceParams
   /GlobalNamingResources
 
 
   Service name=Catalina
 Connector port=8080 /
 
 !-- This is here for compatibility only, not
 required --
 Connector port=8009 protocol=AJP/1.3 /
 
 Engine name=Catalina defaultHost=localhost
   Logger
 className=org.apache.catalina.logger.FileLogger /
 
   Realm

className=org.apache.catalina.realm.UserDatabaseRealm
  resourceName=UserDatabase /
 
realm
 className=org.apache.catalina.realm.JDBCRealm
 debug=99
   driverName=org.gjt.mm.mysql.Driver
   
 connectionURL=jdbc:mysql://dekold4711/authority
   connectionName=tomcat
 connectionPassword=tomcat
   userTable=users userNameCol=user_name
 userCredCol=user_pass
   userRoleTable=user_roles
 roleNameCol=role_name
   digest=md5 /
 
   Host name=localhost appBase=webapps /
 /Engine
   /Service
 /Server
 
 
 each time iam trying to login i gets an error
 message telling me wrong username or wrong password 
 catalina.out dont show any susspecious errors any
 idea what i could be doing wrong please!!
 
 regards Yassine ELassad

I'm using mysql fine.  I use a context.xml file for my
web app in META-INF and this is it:
?xml version=1.0 encoding=UTF-8?
Context path= reloadable=true
  Resource auth=Container
driverClassName=com.mysql.jdbc.Driver
maxActive=100 maxIdle=30 maxWait=1
name=jdbc/caro462 password=
removeAbandoned=true type=javax.sql.DataSource
url=jdbc:mysql://localhost:3306/caro462?autoReconnect=true
username=caro462/
  Realm
className=org.apache.catalina.realm.DataSourceRealm
dataSourceName=jdbc/caro462 debug=99
localDataSource=true roleNameCol=role
userCredCol=password userNameCol=userid
userRoleTable=USERROLELINKS userTable=USERS/
/Context

I then have my web.xml file setup with different
security constraints like this one:
   security-constraint
  display-nameAgent security
constraint/display-name
  web-resource-collection
 web-resource-nameAgents/web-resource-name
 !-- Define the context-relative URL(s) to be
protected --
 url-pattern/agents/secure/*/url-pattern
  /web-resource-collection
  auth-constraint
 !-- Anyone with one of the listed roles may
access this area --
 role-nameAdministrator/role-name
 role-nameAgencyAdministrator/role-name
 role-nameAgent/role-name
  /auth-constraint
/security-constraint


I can login fine.  You certainly have to make sure you
have your roles linking to your user name.

Wade

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



Re: Memory leak in Tomcat

2005-09-12 Thread Wade Chandler
--- Ingrid Morterud Rosvall [EMAIL PROTECTED] wrote:

 Hello.
 
 We are running an application on Tomcat 4.1.30, and
 java 1.4.2.
 
 Our application is using the struts framework with
 jsp's, and cocoon to
 render the xml's. 
 
 There seems to be a major memory leak at startup -
 the application seems
 to constantly be using between 40 - 45 mb of the
 memory. We also have
 some memory leak during runtime, when users log on
 and starts using the
 application.
 
 So far we have not been able to find anything in our
 code review that
 will explain these memory leaks, and when we monitor
 the memory used,
 there is no obvious reason, nor is there any
 connection with how the
 users use our application and the amount of memory
 being used. 
 
 We would highly appreciate any help on this topic,
 and any tips and
 hints you can provide us with. 
 
 Ingrid and Tommy
 

One, I think you might be having issues by not
understanding the java heap...just an observation by
the way you phrased the question.

Two, do you have any more information about the memory
being used?  How much were you expecting to be used? 
Are you seeing the virtual memory usage or the real
memory usage?  How did you determine the amount of
memory used?  Do you have any numbers?  Have you tried
to use a memory profiler?  Search the list for memory
profiler.

Wade

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



RE: Memory leak in Tomcat

2005-09-12 Thread Wade Chandler
--- Ingrid Morterud [EMAIL PROTECTED] wrote:

 
 
 Thanks for the quick reply. 
 
 You might be right in us not understanding the java
 heap. Still - then
 we are even more at a loss on how to fix the problem
 than if we really
 had understood how it works.
 
 We are running on a test server with 64 mb total
 memory. I know I can
 increase that, still increasing it will not solve
 the original problem.
 To be quite honest I am not quite sure what I would
 be expecting to be
 using, but I would think that the application up and
 running would use
 less than what it is using at the moment. 
 
 We are using the following code to determine the
 memory used:
 
 br

%=java.lang.Runtime.getRuntime().freeMemory()/1024%
 KB
 br
 %=java.lang.Runtime.getRuntime().maxMemory()/1024%
 KB
 br

%=java.lang.Runtime.getRuntime().totalMemory()/1024%
 KB
 br
 
 The application uses approx 40 - 45 Mb when it is
 running. During
 runtime (when users access and use the application)
 they use from zero
 to 25 Mb of memory. I still cannot find any pattern
 as to when it uses
 the memory. The amount of memory used changes not
 accordingly to the
 user input, that means that when a user does the
 same thing twice, that
 does not mean that the same amount of memory is
 used. 
 
 We haven't used a memory profiler as of yet, but we
 are going to try
 that out now. 
 
 If you have any more hints and tips, it would be
 highly appreciated. 
 
 
 Ingrid and Tommy
 

Ingrid,

I included this on the tomcat users list.  Yes, any
time you reply to a mail where you asked the question
on the list then please include the entire list.  It
will help everyone help you out as they will get the
information you give me, and if it is something they
could better help you with then the right person got
the info, and you can get helped faster.

Yeah, 64mb of memory could be enough depending on what
you are doing, but you are using struts and I don't
know what other libraries.  The jvm itself will use a
number of megs of memory simply by loading classes and
static information into what is know as Persistent
memory.  A good link would be:
http://java.sun.com/docs/performance/

where you will find a lot of information about memory
and performance.

Also see:
http://java.sun.com/docs/hotspot/gc1.4.2/

Also understand that the info you will see with the
commands you are using in your source code are not
going to show you the memory being used by the
persistent section of the JVM process nor are they
going to show you the OS reserved memory for the
process or virtual memory.  So, you might have
issues trying to use Tomcat on a 64MB machine
depending on the number of libraries used to the
number of classes loaded to the number of static
variables and things of that nature.  The OS will use
a number of memory along with what ever other
applications you are using.  After that memory is used
you start paging to disk a lot and performance will
stink at best.  You can also search the list for
JProfiler.  There have been other mailings about
memory and leaks on the list and a lot of information
for a starting point has already been provided.  I can
simply start tomcat with only the admin and manager
application running and be using 22mb of memory.  Are
you memory usage reports after your web application
has loaded.  Then after it has loaded you are using
40+mb?  You can find jstat and install it into your
1.4.2 jvm.  If you have 1.5 it will already be
available.  Then with tomcat running do a jps to
locate your PID and then jstat -class PID to explain
the classes loaded before you hit your first URL to
your web app vs after.  Might tell you something as
well.

Using:
http://java.sun.com/docs/hotspot/gc1.4.2/
and
JAVA_OPTS
you should be able to adjust the memory usage of
tomcat, and if not you might have to dig into
catalina.bat or if on windows use the configure tomcat
GUI for the service.

But, that amount of memory is so tiny I don't think
you'll have much luck if your web application expects
much usage.  It will all depend on the number of
classes being loaded and used and the number of
objects being instantiated.

You can limit your entire heap with the -mx option of
the JVM.  This will not however limit your persistent
memory usage.  You'll have to use -XX:MaxPermSize to
limit that.  Limiting your heap and your permsize
however will mean you know for a fact or good close
estimate that you should be loading x number of
classes and using x number of perm memory and limiting
your heap means you have calculated your application
and tomcats expected memory usage and number of
supported users for your needs.

Wade

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



Re: AJP connector maxthreads problem

2005-09-10 Thread Wade Chandler
--- David Wall [EMAIL PROTECTED] wrote:

 
  1) We have only a moderately busy site with about
 500 new visitors 
  entering from outside every day, so it would have
 thought it would be 
  fairly difficult for them to use up all the 75
 connections at the same 
  time, but I do have some programmes that create
 their own threads, 
  though in a fairly limited way. In your expert
 view are 75 jk2 
  connections sufficient for this kind of moderate
 use, or is it likely 
  I've some kind of problem I've got to get to the
 bottom of?
  I've been through my recent new applications, and
 there really is 
  nothing that could have created this problem
 recently.
 
 
 It sure sounds like something is not releasing the
 threads.  In low 
 volume sites, having 75 concurrent requests would be
 high.  It sounds 
 like they are not being properly released when done.
 
 
  2) I've set connectionTimeout=2, which seems
 to be what everybody 
  else was setting it to, can I reduce this without
 any problem? It 
  seems quite long, 20 seconds, why hang on to
 connections for so long, 
  or is there a lot of overhead in creating them?
 
 I believe this value is how long Tomcat will wait to
 receive the actual 
 HTTP requests after it establishes the connection. 
 So 20 seconds is 
 more than adequate.  Making it too low may cause
 people are slower dial 
 up or the like to get problems.
 
 
  3) If I want to, can I increase my max connections
 to 125 without any 
  qualms? - This would appear to be the simplest
 solution here.
 
 
 That would certainly work, but if you are running
 out because threads 
 are not being released, it just means you'll run out
 later than before.
 
 Good luck,
 David
 

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

Dump a stack trace of the JVM and see where it is
locked up in the different threads.  If you are able
to run a 1.5 VM this would be much easier as you could
use jps and jstack to dump all of this externally for
your running tomcat process.  Anyways, get a stack
trace for all of your threads, and you can get a
better idea of what is going on.

Wade

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



All users help needed to track down all access to HttpSession.getAttribute in Tomcat 5.0.x and 5.5.x

2005-09-09 Thread Wade Chandler
All,

There is an issue in Tomcat 5.0.x and 5.5.x which
affects concurrency.  The deal is
HttpSession.getAttribute is not synchronized and can
cause the failure of session variable lookup as well
as an infinite or very long running loop to occur
during a getAttribute call.  There is no guarentee
that setAttribute will remain synchronized in the
future according the information from Tomcat
developers in the original bug report and how this is
always the developers problem.  The Tomcat source code
has different places where HttpSession.getAttribute
and setAttribute are called (notibly the standard JSP
tags jsp:getAttribute and jsp:useBean) which are not
being synchronized when they need to be.  These need
to be found and reported as bugs so they can be
corrected.  Remember that access to the session in any
way where the end developer (JSP or Servlet
developers) can't synchronize and protect against
concurrency issues or where it doesn't make sense for
them to (JSP tags) needs to be found and reported as
bugs.  Any help is appreciated and it helps everybody.
 Everyone can send me their findings to mail alias
[EMAIL PROTECTED] and I can be a
point for creating the bug report in BugZilla for
these particular bugs.

Please see:
http://issues.apache.org/bugzilla/show_bug.cgi?id=36541
and
http://issues.apache.org/bugzilla/show_bug.cgi?id=36586

for more details

Thanks,

Wade

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



Re: Tomcat/JVM hangs in session.getAttribute / HashMap.get()

2005-09-07 Thread Wade Chandler
--- Remy Maucherat [EMAIL PROTECTED] wrote:

 On 9/7/05, GB Developer
 [EMAIL PROTECTED] wrote:
  coming late to the party with:
  
 

http://blogs.opensymphony.com/plightbo/archives/000175.html
 
 I had read your blog when you originally posted it,
 and thought it was
 the most interesting blog I had read in months. IMO,
 given the average
 size of the array in a typical hashmap (very small),
 they should have
 added a robstness check (typically, e != e.next).
 
 -- 
 x
 Rémy Maucherat
 Developer  Consultant
 JBoss Group (Europe) SàRL
 x
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 
Nothing shocking about HashMap.  It becomes very hard
to rely on complex Objects if they are not being
synchronized when modified especially something like
thismultiple lines of code not being
synchronized  Any map which is being put from
multiple threads should be synchronized and anything
in an inconsistant state is a bad idea period.  The
hashtable shouldn't be resizing anything when simply
calling get..and per the code it doesn't.  A put must
be called for a resize to take place no if and or but
about it, so it's not just a getAttribute call or even
50 million of them alone going to cause HashMap to
lock, but rather the Object being in an intermediate
step when get is called.  If you can use a
synchronized HashMap and the problem not occur then
the problem certainly comes from modifying the map and
reading from different threads at the same time which
makes sense when looking at the code and the javadoc
statement(Directly from the javadocs):

Note that this implementation is not synchronized. If
multiple threads access this map concurrently, and at
least one of the threads modifies the map
structurally, it must be synchronized externally. (A
structural modification is any operation that adds or
deletes one or more mappings; merely changing the
value associated with a key that an instance already
contains is not a structural modification.) This is
typically accomplished by synchronizing on some object
that naturally encapsulates the map. If no such object
exists, the map should be wrapped using the
Collections.synchronizedMap method. This is best done
at creation time, to prevent accidental unsynchronized
access to the map: 

 Map m = Collections.synchronizedMap(new
HashMap(...));

Should be enough to explain the issue and why
synchronization should be used.  I haven't looked at
the Tomcat code, but why would a Session not use
synchronized maps?  In my opinion it's not a bug in
HashMap as it's up front about it not being
synchronized.  To fix the original posters current
situation they should be able to synchronize on an
object when accessing the session...you'll just have
to track down all of your calls which are setting and
getting attributes and synchronize the code.

My 2 cents

Wade

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



RE: Tomcat/JVM hangs in session.getAttribute / HashMap.get()

2005-09-07 Thread Wade Chandler
--- Caldarale, Charles R
[EMAIL PROTECTED] wrote:

  From: Wade Chandler
 [mailto:[EMAIL PROTECTED] 
  Subject: Re: Tomcat/JVM hangs in
 session.getAttribute / HashMap.get()
  
  so it's not just a getAttribute call or even
  50 million of them alone going to cause HashMap to
  lock, but rather the Object being in an
 intermediate
  step when get is called.
 
 Or the HashMap may have been left in an
 indeterminate state due to
 concurrent unsynchronized set requests at some point
 in the past.  A
 single get can later stumble into the situation and
 hang in a loop.
 
  - 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]
 
 

Exactly.  

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



Re: AW: Tomcat/JVM hangs in session.getAttribute / HashMap.get()

2005-09-07 Thread Wade Chandler
--- Leon Rosenberg [EMAIL PROTECTED] wrote:

  
 
  -Ursprüngliche Nachricht-
  Von: Wade Chandler
 [mailto:[EMAIL PROTECTED] 
  Gesendet: Mittwoch, 7. September 2005 21:11
  An: Tomcat Users List
  Betreff: Re: Tomcat/JVM hangs in
 session.getAttribute / HashMap.get()
  
  
  Should be enough to explain the issue and why
 synchronization 
  should be used.  I haven't looked at the Tomcat
 code, but why 
  would a Session not use synchronized maps?  In my
 opinion 
  it's not a bug in HashMap as it's up front about
 it not being 
  synchronized.  To fix the original posters current
 situation 
  they should be able to synchronize on an object
 when 
  accessing the session...you'll just have to track
 down all of 
  your calls which are setting and getting
 attributes and 
  synchronize the code.
  
 
 Unfortunately no. Not only you have to rewrite all
 your calls to the
 session, you also have to rewrite all 3rd-party
 taglibs like struts,
 tapestry, pager, jstl or whatever you are using.
 Each getAttribute must
 become synchronized.
 It is simply not possible to fix it, without
 patching tomcat.
 
 Regards
 Leon
 
 
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 
Agreed after thinking about it moreI read your
comment on the bug.  I added my own comment as well. 
It definitely needs fixed.  Especially since other
Jakarta projects and many others are broken by the
issue.  I'm digging in my spec right now.

Wade

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



Re: Bug votes needed..you really should read this..Tomcat/JVM hangs in session.getAttribute / HashMap.get()

2005-09-07 Thread Wade Chandler
This bug doesn't only affect code where you access the
session using session.getAttribute() or
session.setAttribute(,), but also affects jsp tags
such as jsp:useBean with scope=session.  I'm
guessing that pages using EL and accessing the session
are going to be broken as well I didn't look that far,
but if you are using the jsp page context and using
the methods JspContext.get/setAttribute and using
SESSION_SCOPE you will be affected by the bug.

The big picture here is that we can't control the
users, and if they make multiple threads access the
session they can and more than likely crash your
server.  Remember if you access the session from your
application they can hit reload a few times and cause
this or if you use frames.  They could even have more
than one browser instance opened.  One the CPU will
start to get used up, and two your Tomcat threads will
run out.

Affected versions:
Tomcat 5.0.x
Tomcat 5.5.x

If you don't have a bugzilla account maybe you can set
one up and vote for the bug.  It helps all of us to
vote for bugs.  So, read up on it, and make a
decision.  Don't read only a few comments about the
bug as the entire picture isn't discussed.  Read them
all and know what the issue is.  Here is the bug:

http://issues.apache.org/bugzilla/show_bug.cgi?id=36541

Again, setup a bugzilla account and vote for this bug.
 If an application doesn't use the session at all it
won't be affected, but remember if you use sessions
and notice your Tomcat crashing or hanging then this
is probably your issue.

Wade

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



Re: Making a Database Image Show Up on a Jsp Page

2005-08-24 Thread Wade Chandler
--- Edmund Urbani [EMAIL PROTECTED] wrote:

 Philip Cote wrote:
 
  I'm trying to write to binary data from a MySQL
 database into a jpeg 
  file so I can show it on a jsp page but I'm not
 having much luck.  My 
  bean can create files outside the servlet / jsp
 context using the 
  usual java.io classes.  As I understand it,
 java.io classes aren't 
  allowed for EJBs.  Does this apply to plain java
 beans as well?  If 
  so, what are the alternatives for doing what I'm
 trying to do?
 
 your java classes can do anything the VM process is
 permitted to do, 
 unless you have restricted using a security manager
 and the 
 catalina.policy file (i think eg. debian tomcat
 packages do that by 
 default). i'm not sure just jow exactly you are
 trying to serve those 
 images to the client and why you want to write them
 (temporarily) to the 
 file system. i would probably want to send them back
 directly from 
 memory after reading them from the DB as a blob
 (much like Larry Meadors 
 just suggested while i was writing this ...).
 
  Edmund
 

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

I have never heard that EJB could not use java.io
classes.  That wouldn't make much sense.  Even JDBC
some times needs to use streams for it's data. 
ByteArrayOutputStream and StringWriter are at times
needed to perform a task as well for certain things. 
Sometimes people will make a servlet like this then
address this servlet for all images.  You'll need to
set the content type of your return and stream the
bytes out of your DB to the response output in your
servlet.  Depending on the type of field you have used
in the DB you can do something like:

java.io.InputStream in = null;
try
{
   in = resultSet.getBinaryStream(columnName);
   java.io.BufferedInputStream bin =
   new java.io.BufferedInputStream(in);
   java.io.BufferedOutputStream bout =
   new java.io. 
BufferedOutputStream(response.getServletOutputStream());
  int iread = bin.read();
  while(iread!=-1)
  {
bout.write(iread);
iread = bin.read();
  }
  bout.flush();
}
finally
{
   if(in!=null)
   {
  in.close();
   }
}

Just be sure you have your content type setup and all
you need to do there.  Then you can simply have a
servlet to read images and use as the endpoint in your
IMG tags.  It's not so bad.

Wade

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



RE: Has anyone used Tomcat 5.5.9 connecting to MS SQL Server usin g JNDI?

2005-08-23 Thread Wade Chandler
--- Allistair Crossley [EMAIL PROTECTED]
wrote:

 Hi Wade,
 
 Can you perhaps resend the configuration files
 
 server.xml
 web.xml
 yourapp.xml
 listing of files in common/lib
 listing of files in yourapp/WEB-INF/lib
 
 Again?
 

Allistair,

Sorry man, but I only wrote to you about reading up on
JDPA, setting up Tomcat debug, and using TCP/IP for
debugging instead of shared memory.  Other guy sent
info for the config files.

I have used MS SQL Server and a pooled data source
from inside of my web app before.  I created my own
datasource factory and didn't use context.xml for the
configuration of what I did, though the setup should
be about the same as far as where I had to put the
files.  I put the jdbc driver files in the common/lib
on one machine, and if I remember correctly on one
server for what ever reason it only seemed to work
correctly by putting the files in the common/endorsed
directoryI had to get someone to put files there
for this one machine, and I had not configured it, but
for what ever reason on this particular machine it was
the only directory the jdbc drivers would load
correctly.

I always use a context.xml file for the data source
configuration myself when I use the container managed
data sources.

Wade

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



Re: URGENT : Special Character when deployed on Linux

2005-08-22 Thread Wade Chandler
--- nitin dubey [EMAIL PROTECTED] wrote:

 Hello all,
 
 I am getting special characters when we enter spaces
 during formatting a text in a textarea.  It used to
 work perfectly in our development environment but
 when
 we moved it to production we get 'Â' character for
 every repeated blank space.
 
 The only thing changing in development and prodution
 is OS from Windows to Linux(Production).  I just
 want
 to know if anyone has faced this problem anytime
 developing their applications.
 
 Development Environment:
 OS:Windows 2K
 Browser: IE5.5+, Firefox1.0+
 Database: MYSQL (on Linux Server)
 ServletContainer: Tomcat(On windows Server)
 
 Production Environment:
 Database: MYSQL (on Linux Server)
 ServletContainer: Tomcat(On Linux Server)
 
 Note:I am also using FCKEditor for editing the
 content.   But they say its not the problem with
 FCKEditor.
 
 Cheers,
 
 
 Nitin
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam
 protection around 
 http://mail.yahoo.com 
 

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

You're getting the characters where?  Is this in your
java code or after you put into the database then read
back out?  For your MySQL connection you will probably
want to set the encoding.  See it's connection
parametersif it's after putting the data into the
database.  I've seen this happen before.  You're
default encodings are probably different.  Also if you
are using a Reader to parse anything as a stream
then you will want to setup some config to set your
encoding there as well.  Is this maybe after pasting
from Word, or is this in IE using an encoding on the
page or are you using an encoding with your form? 
You'll need to use the same encoding every where. 
JSP, Readers, MySQL, etc.

Wade

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



RE: Has anyone used Tomcat 5.5.9 connecting to MS SQL Server usin g JNDI?

2005-08-22 Thread Wade Chandler
--- Wylie, Ian [EMAIL PROTECTED] wrote:

 Allistair,
 
 My apologies for taking much longer than usual to
 get back to you but I had
 to finish some Java code that allowed us to upgrade
 our portal to PlumTree
 version 5.
 
 To clarify and answer your points below.
 
 1)  I have opted not to have a context.xml file in
 the META-INF directory
 but I am using the 
 TOMCAT_HOME/conf/Catalina/localhost/webappname.xml
 file
 instead.
 
 2)  I  have ensured that the 3 MS JAR files for the
 JDBC connection exist
 only in TOMCAT_HOME/common/lib and not in my webapp
 lib.
 
 3)  I have changed the java code to use a simple
 'DataSource' instead of a
 'ConnectionPoolDataSource' connection.  See Java
 code snippet below :-
 
 Unfortunately I still get the error below :-
 
 ERROR - NamingException - Config error with JNDI
 and
 datasource.javax.naming.NamingException: Cannot
 create resource instance
 ERROR com.webconnex.cognos.PORT.OMTLreport  : Cannot
 create resource
 instance
 
 I have attached my web.xml and
 TOMCAT_HOME/conf/Catalina/localhost/webappname.xml
 files for your perusal.
 
 
 I am of yet no further forward in solving my
 problem.
 
 Any further insight would be appreciated, as Tomcat
 5 allows me to do quite
 a few things better, not least of which is
 debugging!!
 
 
 Java Code snippet :-
 

=
 
 logger.debug(Before
 InitialContext.) ;
 InitialContext ctx = new
 InitialContext();
 if (ctx == null) { 
 log(ERROR initialising
 InitialContext.) ;  
 logger.error(ERROR initialising
 InitialContext.) ;
 }
 log(Before Context.) ;
 ds = (DataSource)
 ctx.lookup(java:comp/env/jdbc/UKportalPool);
 
 log(Before initialising
 DataSource.) ;
 
 if(ds != null) {
 con = ds.getConnection();
 if (con != null) {
   
   if ((pType != null) 
 (!pType.equals()))
 {
   userDetails = new
 pfUsersBean(pType,
 posName, typeCD, firstLineProduct);
   userSessionDetails = new
 pfUserSessionBean();
   userDetails.getPrefix(con,
 userDetails);  // See if User is in database
   
 //userDetails.getPrefix(pCon,
 userDetails);  // See if User is in database
   
  
 ptpResponse.setSettingValue(SettingType.Portlet,
 SalesCubePrefix,
 userDetails.getSalesCubePrefix() ) ;
  
 ptpResponse.setSettingValue(SettingType.Portlet,
 description,
 userDetails.getGeographyID() ) ;
  
 ptpResponse.setSettingValue(SettingType.Portlet,
 TMTLdescription,
 userDetails.getGeographyID() ) ;
  
 ptpResponse.setSettingValue(SettingType.Portlet,
 MSOdescription,
 userDetails.getGeographyID() ) ;
   }
 
 }
 else {
 log(ERROR - DB
 Connection returned was null in
 PortletHelper!) ;
 logger.error(ERROR - DB
 Connection returned was
 null in PortletHelper!) ;
 }
 }
 else {
 log(ERROR - Datasource
 returned was null in
 PortletHelper!) ;
 logger.error(ERROR -
 Datasource returned was null
 in PortletHelper!) ;
 }
 }
 
 catch (NamingException ex){
 log(ERROR - NamingException -
 Config error with JNDI and
 datasource. +ex);
 log(ex.getMessage());
 logger.error(ERROR -
 NamingException - Config error with
 JNDI and datasource. +ex);
 logger.error(ex.getMessage());
 } 
 catch (NullPointerException npE) {
 log(npE.getMessage());
 logger.error(ERROR - Null pointer
 exception.);
 logger.error(npE.getMessage());
   }
 catch (SQLException ex ){
 log(Cannot get JNDI connection from
 datasource. +ex);
 logger.error(Cannot get JNDI
 connection from datasource.
 +ex);
 logger.error(ex.getMessage());
 }
 catch(IOException IOe) {
  logger.error(ERROR - IOException
 occurred: +IOe) ;
  logger.error(IOe.getMessage()) ;
  }
 catch(Exception e) {
 log(ERROR - Exception occurred:
 +e) ;
 logger.error(ERROR - Exception
 occurred: +e) ;
 logger.error(e.getMessage()) ;  
  
 }
 ==
 
 -Original Message-
 From: Allistair Crossley
 [mailto:[EMAIL PROTECTED]
 Sent: 11 

Re: Passing parameter upon login using j_security_check

2005-08-21 Thread Wade Chandler
--- Mark Goking [EMAIL PROTECTED] wrote:

 
 
 Is it possible to pass a parameter upon login using
 j_security_check and
 passing that parameter to index.jsp?
 
 thanks
 

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

I don't think anything gets forwarded when the post is
handed off.  I tried printing all variables once and
nothing.  I was asking about this before.  You can
create your own filter and do the same thing however. 
Should be straight forward.  Then you can even
customize your security mechanism.  Just set a session
variable and if it is not set then you know to bounce
back to the security, otherwise allow the http call to
go through.

Wade

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



Re: #1578;#1605; #1575;#1587;#1578;#1604;#1575;#1605; #1575;#1604;#1585;#1587;#1575;#1604;#1607; DISABLE YOUR AUTO REPLY

2005-08-21 Thread Wade Chandler
--- #1605;#1606;#1578;#1583;#1610;#1575;#1578;
#1603;#1608;#1610;#1578;
#1575;#1604;#1582;#1610;#1585; [EMAIL PROTECTED]
wrote:

 #1578;#1605;
 #1575;#1587;#1578;#1602;#1576;#1575;#1604;
 #1585;#1587;#1575;#1604;#1578;#1603;
 #1608;#1587;#1601; #1606;#1602;#1608;#1605;
 #1576;#1575;#1604;#1585;#1583;
 #1593;#1604;#1610;#1603;
 #1576;#1587;#1585;#1593;#1607; 
 #1578;#1581;#1610;#1575;#1578;#1610; 
 
 #1575;#1582;#1608;#1603;#1605; 
 Q8CK


Please disable your auto reply or remove yourself from
the list.  I receive an email from your directly every
time I write to the list.  It's part of the rules of
the list not to use auto replies.

Wade



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



Re: Unable to access application if I am on VPN

2005-08-20 Thread Wade Chandler
--- Brian Cook [EMAIL PROTECTED] wrote:

 
 Hm Could you configure the firewall to reroute
 the JVM request 
 thought the proxy?
 
 
 Len Popp wrote:
  Can you download the DTD to the server and point
 the config file at
  the local copy?
  
  That must be possible, otherwise you couldn't run
 an application on an
  intranet that's not connected to the WWW.
 
 
 -- 
 Brian Cook
 Digital Services Analyst
 Print Time Inc.
 [EMAIL PROTECTED]
 913.345.8900
 
 
-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
[EMAIL PROTECTED]

1)
There is no guarentee the call will be from a standard
URLConnection subclass like HttpURLConnection to get
the XML entity from the XML parser, so you'll have to
figure out what is used to make the call over the web
for the XML entity (DTD/schema) Does struts use a
specific parser, or does it use the JVM standard setup
parser by calling the javax.xml classes, can you find
out which parser is used, and how it accesses the
internetcould use something like Apache HTTP
client instead of URLConnection from the JVM...setup
would be  different for changing the proxy?  

2)
If the only problem is the DTD and Schema lookups you
can ask how do I get access to the XML Entity
Resolver for Struts or Tomcat (make that the subject
in the respective lists) as I don't think their is a
way to do this specifically for a web application, so
more than likely you want the struts entity resolver,
but can't hurt to add them to the Tomcat one as well. 
For all DTD and Schema paths (URIs) you are using you
can add a local path to the entity resolver for those
http paths.  This will keep the XML parser from going
out to the internet for certain DTD/Schema locations. 
This should be more efficient anyways as the entities
won't be downloaded from the internet.

Those look like the only options for you,  obviously
your organization uses a proxy, so getting around that
probably won't be an option for you, so you have to
not go out on the net for the entity resolution
(meaning you need access to the Entity Resolver being
used or need to be able to set it) or you have to go
through your proxy.

Wade

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



RE: Session Tracking

2005-08-19 Thread Wade Chandler
I think you need to read up on the java language a
bit.  See what static and final mean.  

Wade

--- Raghaw Goswami [EMAIL PROTECTED] wrote:

 Thanks for the e-mail:
 First time it was 0 , then 1 , This is when the
 browser was closed and opened then it never
 incremented was always 0 when browser was closed and
 opened. 
 
 I am attaching the Showsession.java file for
 reference. May be i am missing some thing  if the
 variable is made static how can its value increment
 ?
 
 R
 
 --- Arup Vidyerthy [EMAIL PROTECTED] wrote:
 
  Does it not increment at all or does the increment
  counter gets reset and
  starts all over again from 0. Basically if you
 want
  to keep the counter
  incrementing everytime you access that page (or
 hit
  that that servlet) you
  need to make it a static variable in your
  servlet/jsp.
  
  -Original Message-
  From: Raghaw Goswami [mailto:[EMAIL PROTECTED] 
  Sent: 19 August 2005 14:46
  To: tomcat-user@jakarta.apache.org
  Subject: Session Tracking
  
  Hi,
  I have JDK 1.5 [J2SE 5.0 update 3], Tomcat
 5.5.9,Win
  XP SP2,  Trying a e.g.
  session tracking [The Session Tracking API] using
  HttpSession object.
  
  The program works[ accessCount increments] when I
  don't close the current
  browser and open new brwoser with CTRL + N, But if
 i
  quit the browser and
  then start again accessCount does not increment. 
  
  Would appreciate any help in this regards
  
  Thanks in Advance
  R.
  
  
  
  
  __
  Do you Yahoo!? 
  Yahoo! Mail - You care about security. So do we. 
  http://promotions.yahoo.com/new_mail
  
 

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

___
  
  Yahoo! Messenger - NEW crystal clear PC to PC
  calling worldwide with voicemail
  http://uk.messenger.yahoo.com
  
 

-
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
  
  
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam
 protection around 
 http://mail.yahoo.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 5.5.7+JRockit = windows service won't start

2005-08-18 Thread Wade Chandler
Does JRockit support the JNI standard for a native
interface?

Wade

--- Brad Baynes [EMAIL PROTECTED] wrote:

 In the meantime since the last post in this thread
 BEA has released updates
 to JRockit such that it now supports the -Xrs
 switch. Has anybody on this
 list now had success running 5.5.x as a windows
 service with JRockit as the
 jvm?
 
 I am still getting errors when trying to start the
 service (Tomcat 5.5.9).
 From the log:
 
 [2005-08-15 11:32:20] [173  javajni.c] [error] The
 specified module could
 not be found.
 [2005-08-15 11:32:20] [897  prunsrv.c] [error]
 Failed creating java C:\
 jrockit-jre1.5.0_03\jre\bin\jrockit\jvm.dll
 [2005-08-15 11:32:20] [1131 prunsrv.c] [error]
 ServiceStart returned 1
 
 I have verified the jvm path listed above is correct
 and that the jvm is
 indeed the latest JRockit release.
 
 Brad
 
 
  From: Brad Baynes [mailto:[EMAIL PROTECTED] 
  Sent: Wednesday, March 23, 2005 4:48 PM
  To: tomcat-user@jakarta.apache.org
  Subject: Re: FW: RE: Tomcat 5.5.7+JRockit =
 windows service won't start
 
  No, the -Xrs is not available in the registry
 using the tomcat5 with
  5.5.7 (or any version since 5.0.22 it seems). In
 the related Bugzilla
  entry

(http://issues.apache.org/bugzilla/show_bug.cgi?id=33777)
 Mladen
  Turk states 'If you wish to use JRockit then
 simply update your
  params'. What does this mean? Was this also a
 reference to the
  registry params?
 
 
 

-
 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: Custom tag runtime expression problem

2005-08-18 Thread Wade Chandler
Don't know exactly, but a good place to look is the
source code for the JSTL from commons.  They are
making some calls in there to transform the values of
EL and expressions.

Wade

--- Frank W. Zammetti [EMAIL PROTECTED] wrote:

 Hi all,
 
 I'm using Tomcat 5.0.29.  I've created a custom tag
 and I need to be able
 to use runtime expressions for certain attributes. 
 But it isn't working
 and I'm beating my head on the desk trying to figure
 out why.
 
 Here's my TLD:
 
 ?xml version=1.0 encoding=UTF-8?
 !DOCTYPE taglib PUBLIC -//Sun Microsystems,
 Inc.//DTD JSP Tag Library
 1.1//EN

http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd;
 taglib
 tlibversion1.2/tlibversion
 jspversion1.1/jspversion
 shortnamemytags/shortname
 uricom/company/taglib/uri
 tag
 namebutton/name

tagclasscom.company.app.taglib.ButtonTag/tagclass
 bodycontentempty/bodycontent
 attribute
 nameid/name
 requiredtrue/required
 rtexprvaluetrue/rtexprvalue
 /attribute
 attribute
 nameonClick/name
 requiredtrue/required
 rtexprvaluetrue/rtexprvalue
 /attribute
 attribute
 /tag
 /tag
 /taglib
 
 Specifically, I'm trying to do this on the page:
 
 %@ taglib uri=/WEB-INF/apptags.tld prefix=app
 %
 ...
 % String fName = (String)hm.get(name); %
 app:button id=btnSelect
 onClick=selectAll(%=fName%); /
 
 Now, the button renders its code just fine, the
 *ONLY* thing that isn't
 working is that the emitted HTML includes the string
 %=fName% instead of
 it being evaluated.  I've verified that the fName
 string *DOES* get the
 appropriate value in it.  So, as near as I can tell,
 the taglib code
 itself, all the setup, etc., is fine, *EXCEPT* for
 the ability to do
 runtime expressions like this.
 
 What am I missing?  Does this need to be turned on
 in Tomcat or something?
  I wouldn't think so, but I'm at a loss.
 
 Thanks!
 
 Frank
 

-
 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: jboss-tomcat bind issue

2005-08-14 Thread Wade Chandler
Got a firewall turned on?

Wade

--- Michael Tria [EMAIL PROTECTED] wrote:

 Please let me know if you think this e-mail belongs
 on a JBoss list 
 instead of this one...
 
 Problem
 ===
 JBoss 4.0 bundled with Tomcat 5.5, out of the box,
 will not bind to port 
 8080 for all interfaces.  i.e.  I can telnet to the
 port from the 
 localhost, but not from outside.  Please let me know
 how to bind to this 
 port properly.
 
 On local machine...
 telnet 127.0.0.1 8080
 Trying 127.0.0.1...
 Connected to 127.0.0.1.
 
 On remote machine... (IP address masked slightly)
 telnet 208.100.x.x
 Trying 208.100.x.x...
   - this will eventually time out
 
 Running a netstat -anp | grep 8080 shows this:
 Active Internet connections (servers and
 established)
 Proto Recv-Q Send-Q Local Address   Foreign
 Address 
 State   PID/Program name
 tcp0  0 :::8080 :::* 
 LISTEN  17487/java
 
  From the above, I can see that java (jboss) has a
 server socket 
 listening on port 8080, but the local address looks
 off.
 
 System
 ==
 OS:Linux, Fedora Core 2
 JBoss: 4.0.2 w/ Tomcat 5.5 (out of the box)
 Java:  1.4.2_09
 
 server.xml
 ==
 Here is the relevant sections of the server.xml (out
 of the box)
 
 Engine name=jboss.web defaultHost=localhost
...
Host name=localhost
  autoDeploy=false deployOnStartup=false
 deployXML=false
...
 
 
 I really appreciate the help.
 
 Thanks,
 Mike
 [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: * 2 Tomcat instances on same box

2005-08-09 Thread Wade Chandler
Paul,

It sounds like you have them running on the same port.
 Either the connector 8005 is the same for both or the
8080 is still being used by both.  The bind exception
is a socket server exception telling you both
instances are trying to use the same port number some
where.

Wade

--- Paul Wallace [EMAIL PROTECTED] wrote:

 Hello,
   I am trying to achieve not the unimaginable, I
 thought - to have one
 instance of Tomcat (5.5) running on port 80, and one
 - also 5.5 (using the
 same JAVA_HOME) running on port 8080 on the same box
 (Win XP). They both
 start up independently and load on localhost /
 localhost:8080 just fine. But
 when one is started, the other will not start up and
 logs the below message.
 The one is started as a service, the other a .bat:
 
 set CATALINA_HOME=jakarta-tomcat-5.5.9
 call %CATALINA_HOME%/bin/startup.bat
 
 I thought it may be a conflict of CATALINA_HOME, but
 as one is installed as
 a service, I see no reference to the variable in the
 registry.
 
 Any thoughts please? 
 
 Thanks
 
 Paul.  
 
 java.net.BindException: Address already in use:
 JVM_Bind
   at java.net.PlainSocketImpl.socketBind(Native
 Method)
   at

java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
   at
 java.net.ServerSocket.bind(ServerSocket.java:319)
   at
 java.net.ServerSocket.init(ServerSocket.java:185)
   at

org.apache.catalina.core.StandardServer.await(StandardServer.java:346)
   at

org.apache.catalina.startup.Catalina.await(Catalina.java:600)
   at

org.apache.catalina.startup.Catalina.start(Catalina.java:560)
   at
 sun.reflect.NativeMethodAccessorImpl.invoke0(Native
 Method)
   at

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
 )
   at

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
 .java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at

org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
   at

org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
 


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



RE: * 2 Tomcat instances on same box

2005-08-09 Thread Wade Chandler
One is the control port for SHUTDOWN and maybe other
control (think only shutdown), and the other is the
AJP port used to connect tomcat to other servers like
Apache and IIS.  If you are on a Linux box you can use
Pseudo IP addresses.  Linux allows more than one IP
address to be assigned to a NIC.  You can then use
these different IPs to run your multiple containers on
your internal IP addresses.  It's probably a better
solution than all different ports.  You might be able
to do this with Windows server, but I'm not sure. 
Maybe the Admin resource kit might have something to
allow this.

Wade

--- Paul Wallace [EMAIL PROTECTED] wrote:

 Hi and thank you both for your replies. It turns out
 more than the HTTP port
 number needs to be different, as Server port=8005
 shutdown=SHUTDOWN
 was common to both and thus causing the problem.
 Apart from being an
 attribute of the parent node, what is this port?
 
 Rgds
 
 Paul.
 
 It sounds like you have them running on the same
 port.
  Either the connector 8005 is the same for both or
 the 8080 is still being
 used by both.  The bind exception is a socket server
 exception telling you
 both instances are trying to use the same port
 number some where.
 
 Wade
 
 --- Paul Wallace [EMAIL PROTECTED] wrote:
 
  Hello,
  I am trying to achieve not the unimaginable, I
 thought - to have one
 
  instance of Tomcat (5.5) running on port 80, and
 one
  - also 5.5 (using the
  same JAVA_HOME) running on port 8080 on the same
 box (Win XP). They 
  both start up independently and load on localhost
 / localhost:8080 
  just fine. But when one is started, the other will
 not start up and 
  logs the below message.
  The one is started as a service, the other a .bat:
  
  set CATALINA_HOME=jakarta-tomcat-5.5.9
  call %CATALINA_HOME%/bin/startup.bat
  
  I thought it may be a conflict of CATALINA_HOME,
 but as one is 
  installed as a service, I see no reference to the
 variable in the 
  registry.
  
  Any thoughts please? 
  
  Thanks
  
  Paul.  
  
  java.net.BindException: Address already in use:
  JVM_Bind
  at java.net.PlainSocketImpl.socketBind(Native
  Method)
  at
 

java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
  at
  java.net.ServerSocket.bind(ServerSocket.java:319)
  at
 
 java.net.ServerSocket.init(ServerSocket.java:185)
  at
 

org.apache.catalina.core.StandardServer.await(StandardServer.java:346)
  at
 

org.apache.catalina.startup.Catalina.await(Catalina.java:600)
  at
 

org.apache.catalina.startup.Catalina.start(Catalina.java:560)
  at
 
 sun.reflect.NativeMethodAccessorImpl.invoke0(Native
  Method)
  at
 

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
  )
  at
 

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
  .java:25)
  at
 java.lang.reflect.Method.invoke(Method.java:585)
  at
 

org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
  at
 

org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
  
 
 

-
 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: Can I call My thread class in JSP/Java Bean??

2005-08-06 Thread Wade Chandler
You may be getting an error in your thread.  You
should not throw exceptions out of the run method. 
You should always log and update some table or static
collection so you can do something later if needed,
but throwing errors from threads is never a good idea
as you can hang up some stuff at times depending on
your JVM and you'll not know what is happening in any
case.  Use the standard java logging API, servlet
loggers, or log4j.

Wade

--- IndianAtTech [EMAIL PROTECTED] wrote:

 Hi All,
 
 Can I call thread classes in my JSP or Java Bean
 classes??
 
 The reason why I am asking is, I have a situation in
 which if a person
 registers as a consumer, then a mail shud be sent to
 providers that
 who matches the consumers requirements
 
 There is a possinbilty of sending more than 100
 mails at an instance.
 So after successful registration by consumer, I
 don't  want to put the
 consumer in wait mode, So I have created a thread
 class and I am
 trying to send the mail in the thread class
 
 But the problem is although I called thread.start
 method, my run
 method is not invoking.
 
 I thought there could be a problem with my code and
 tested with
 standalone java class. In standalone class I am able
 to send the mail.
 
 So, I don't know why tomcat is  rejecting the My
 thread execution.
 
 Any Ideas??
 
 
 here is my code
 // calling the thread
  jiya.general.results.MailThread mailThread =new
 jiya.general.results.MailThread();
 
 mailThread.start();
 
 
 //sending the mail
  private void sendMail() throws JiyaException {
 
 JiyaMailComponent jmc=new
 JiyaMailComponent();
 
 jmc.setServer(192.12.0.91);
 
 jmc.setUser([EMAIL PROTECTED]);
 
 jmc.setPassword(a);
 
 jmc.setFromAddress([EMAIL PROTECTED]);
 
 jmc.setContentType(text/plain);
 
 jmc.setTo([EMAIL PROTECTED]);
 
 jmc.setSubject(Some Subject);
 jmc.setBody(test body);
 
 jmc.send();
 
  }
 
 //this is inner class of My main class 
 class MailThread extends Thread implements Runnable
 {
   public  MailThread()
   {
 log(Entered here at mail thread
 execution); // here I am to
 see the log info in log file
   }
 public void run() {
 try{
 
 sendMail(); //not coming to this stage
 
 }
 catch(Exception ex) {
 throw new RuntimeException(ex);
 }
 }
 }
 

-
 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: Can I call My thread class in JSP/Java Bean??

2005-08-06 Thread Wade Chandler
Also , if all else fails make sure you can do what the
thread is doing from the JSP to make sure you're
emails are actually getting sent.  I have had some
funny issues sometimes with code in a servlet/JSP vs.
standalone.  Break it down to the least common
denominator firstsimplify then you will know if
it's really the thread or not.

Wade

--- Wade Chandler [EMAIL PROTECTED]
wrote:

 You may be getting an error in your thread.  You
 should not throw exceptions out of the run method. 
 You should always log and update some table or
 static
 collection so you can do something later if needed,
 but throwing errors from threads is never a good
 idea
 as you can hang up some stuff at times depending on
 your JVM and you'll not know what is happening in
 any
 case.  Use the standard java logging API, servlet
 loggers, or log4j.
 
 Wade
 
 --- IndianAtTech [EMAIL PROTECTED] wrote:
 
  Hi All,
  
  Can I call thread classes in my JSP or Java Bean
  classes??
  
  The reason why I am asking is, I have a situation
 in
  which if a person
  registers as a consumer, then a mail shud be sent
 to
  providers that
  who matches the consumers requirements
  
  There is a possinbilty of sending more than 100
  mails at an instance.
  So after successful registration by consumer, I
  don't  want to put the
  consumer in wait mode, So I have created a thread
  class and I am
  trying to send the mail in the thread class
  
  But the problem is although I called thread.start
  method, my run
  method is not invoking.
  
  I thought there could be a problem with my code
 and
  tested with
  standalone java class. In standalone class I am
 able
  to send the mail.
  
  So, I don't know why tomcat is  rejecting the My
  thread execution.
  
  Any Ideas??
  
  
  here is my code
  // calling the thread
   jiya.general.results.MailThread mailThread =new
  jiya.general.results.MailThread();
  
  mailThread.start();
  
  
  //sending the mail
   private void sendMail() throws JiyaException {
  
  JiyaMailComponent jmc=new
  JiyaMailComponent();
  
  jmc.setServer(192.12.0.91);
  
  jmc.setUser([EMAIL PROTECTED]);
  
  jmc.setPassword(a);
  
  jmc.setFromAddress([EMAIL PROTECTED]);
  
  jmc.setContentType(text/plain);
  
  jmc.setTo([EMAIL PROTECTED]);
  
  jmc.setSubject(Some Subject);
  jmc.setBody(test body);
  
  jmc.send();
  
   }
  
  //this is inner class of My main class 
  class MailThread extends Thread implements
 Runnable
  {
public  MailThread()
{
  log(Entered here at mail thread
  execution); // here I am to
  see the log info in log file
}
  public void run() {
  try{
  
  sendMail(); //not coming to this stage
  
  }
  catch(Exception ex) {
  throw new RuntimeException(ex);
  }
  }
  }
  
 

-
  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 with a Class

2005-08-04 Thread Wade Chandler
Yep...simple example of a class as a wrapper around
the Integer class.  Syntax way off and looks more like
you're trying to do it in a JSP page where you would
do it in a library.  So surejust read a good java
book for syntax and maybe some of the java tutorial
and you can get all the info you need at java.sun.com
and www.java.net and if you need a good free IDE
www.netbeans.org.  Don't know what else to say really.
 Java uses patterns so you have methods setTest1 and
getTest1 which is what you would do in C++ with the
same pattern style for setters and getters as C++
doesn't have any simpler syntax than java for setters
and getters.  Maybe to say java scripting languages
and EL in JSP pages let you access the properties
directly like 
Integer temp2 = temp.test1
and
temp.test1 = new Integer(4)
so other than that I don't know what else to say
without trying to explain java itself.

Wade

--- Charles P. Killmer
[EMAIL PROTECTED] wrote:

 Does Java provide any ability to do something like
 the following.  C#
 and C++ both allow this functionlality and I am
 hoping that Java does as
 well
  
  
 %!
 public class myInteger {
private Integer _test1;
public Integer test1
{
   set
   {
  _test1 = value;
   }
  
   get
   {
  return _test1;
   }
}
 }
 %
 %
 myInteger temp = new myInteger;
 temp.test1 = new Integer(4);
 %
  
 Charles
 


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



please ignore...test

2005-08-04 Thread Wade Chandler
test

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



Re: URLConnection.getOutputStream().write() fails

2005-08-03 Thread Wade Chandler
Not sure what you are trying to do here, but what you
are doing is attempting to POST to a text file.  One
your TC server is probably only allowing a GET on the
.txt file as it will not process the .txt file, and
two you were probably wanting to perform a PUT
command(???), but you need to do things differently
all the way around.  Were you trying to use the PUT
command?  Were you trying to make POSTs?

Wade

--- Julian Salerno [EMAIL PROTECTED] wrote:

 PROBLEM:
 
 Trying to write to URL via
 URLConnection.getOutputStream().write() fails.
 
  
 
 In the main method below, the code attempts to write
 some bytes to HYPERLINK

http://localhost:8080/temp/sample.txthttp://localhost:8080/temp/sample.txt
 .
 
 http://localhost:8080/temp/sample.txt; is
 resolvable in a web browser and
 actually points to:
 
 ${tomcat.home}/server/webapps/ROOT/temp/sample.txt
 
  
 
 Executing main does not result in any bytes being
 written.
 
 Any input appreciated, thanks :-)
 
  
 
 SERVER:
 
 Apache Tomcat/4.0.1
 
 Windows XP using Java 1.4.2_06
 
  
 
 CLIENT CODE:
 
 Windows XP using Java 1.4.2_06
 
  
 
   public static void main(String[] args)
 
   {
 
 OutputStream os = null;
 
 try
 
 {
 
   final String string =
 http://localhost:8080/temp/sample.txt;;
 
   URL url = new URL(string);
 
   final URLConnection conn =
 url.openConnection();
 
  
 System.out.println(openConnection=+conn);
 
   boolean doOutput =
 conn.getDoOutput();
 
   conn.setDoOutput(true);
 
   conn.setDoInput(true);
 
   conn.setUseCaches(false);
 
  
 conn.setAllowUserInteraction(true);
 
   doOutput = conn.getDoOutput();
 
  
 
   System.out.println(doOutput is
 enabled:+doOutput);
 
   
 
   final String data = Hello World;
 
  
 conn.setRequestProperty(Content-length,
 String.valueOf(data.length()));
 

 
   os = conn.getOutputStream();
 
   final BufferedOutputStream bos =
 new
 BufferedOutputStream(os);
 
  
 System.out.println(bos='+bos+');
 
   //now write some bytes
 
   final byte[] bytes =
 data.getBytes();
 
   bos.write(bytes);
 
 }
 
 catch (Exception e)
 
 {
 
   e.printStackTrace();
 
 }
 
 finally
 
 {
 
   if(os != null)
 
   {
 
 try
 
 {
 
   os.flush();
 
   os.close();
 
 }
 
 catch (IOException e)
 
 {
 
   e.printStackTrace();
 
 }
 
   }
 
 }
 
   }
 
  
 
 CLIENT-OUTPUT:
 

openConnection=sun.net.www.protocol.http.HttpURLConnection:http://localhost:
 8080/temp/sample.txt
 
 doOutput is enabled:true
 
 bos='[EMAIL PROTECTED]'
 
  
 
  
 
 
 --
 No virus found in this outgoing message.
 Checked by AVG Anti-Virus.
 Version: 7.0.338 / Virus Database: 267.9.9/62 -
 Release Date: 8/2/2005
 
 
 
 -- 
 No virus found in this outgoing message.
 Checked by AVG Anti-Virus.
 Version: 7.0.338 / Virus Database: 267.9.9/62 -
 Release Date: 8/2/2005
  
 


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



Re: FW: URLConnection.getOutputStream().write() fails

2005-08-03 Thread Wade Chandler
Yes this is a PUT actually.  A POST will simply send
parameters to the server as a stream with the server
some how making a process operate on the POST info
(usually the file POST to such as a .jsp or a .php
file) unless you have a special servlet for taking a
POST and dumping the input stream to file and you
stream up data directly.  

A PUT will actually put the contents directly to the
file (or is the HTTP spec operation for it), and you
have to tell the server you are attempting a PUT
command.  Using the URLConnection it isn't directly
straight forward, and I would recommend using the
Apache Commons HTTPClient to do this.  And, yes you
need to usually tell tomcat to allow PUTs as I am
pretty sure by default this is turned offnot
sure...but it's handled by the default servlet in
Tomcat, or by any servlet you may want to setupbut
for the default servlet basically you can control
access in web.xml for your web application using a
security constraintsee the servlet specification
at url 
http://www.jcp.org/aboutJava/communityprocess/final/jsr053/
example from file.you won't need so much
stuff...

security-constraint
web-resource-collection
web-resource-nameSalesInfo
/web-resource-name
url-pattern/salesinfo/*/url-pattern
http-methodGET/http-method
http-methodPOST/http-method
/web-resource-collection
auth-constraint
role-namemanager/role-name
/auth-constraint
user-data-constraint
transport-guaranteeCONFIDENTIAL
/transport-guarantee
/user-data-constraint
/security-constraint

You should get the idea.you'll have a 
http-methodPUT/http-method and this can be used to
control access to overwrite the information by certain
users and not just everyone.good idea...for
certain sections of your web applications and their
data.  See the servlet spec (PDF) and read about
Realms and security in the Tomcat docs, and you should
be able to get this going.

I hope that helps some,

Wade

--- [EMAIL PROTECTED] wrote:

 Hi Wade :)
 
  Not sure what you are trying to do here, but what
 you
  are doing is attempting to POST to a text file.
 
 Correct.
 
  One your TC server is probably only allowing a GET
 on the
  .txt file as it will not process the .txt file,
 
 So, as a Tomcat newbie, is there a configuration I
 need to make at the 
 server to
 allow posts to this directory ? And, do I need to
 set a request 
 property on the
 URLConnection to tell the server that I want to do
 this ?
 
  and two you were probably wanting to perform a PUT
  command(???), but you need to do things
 differently
  all the way around.  Were you trying to use the
 PUT
  command?  Were you trying to make POSTs?
 
 The file already exists (It is created by another
 process on the server).
 I wish to POST (not PUT) data so that the resource
 (sample.txt) is 
 updated with
 the contents I write from the client.
 
 Thanks
 Julian
 
 

-
 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: FW: URLConnection.getOutputStream().write() fails

2005-08-03 Thread Wade Chandler
You can also learn more about the default servlet
here:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/catalina/funcspecs/fs-default.html

Hope it helps,

Wade

--- [EMAIL PROTECTED] wrote:

 Hi Wade :)
 
  Not sure what you are trying to do here, but what
 you
  are doing is attempting to POST to a text file.
 
 Correct.
 
  One your TC server is probably only allowing a GET
 on the
  .txt file as it will not process the .txt file,
 
 So, as a Tomcat newbie, is there a configuration I
 need to make at the 
 server to
 allow posts to this directory ? And, do I need to
 set a request 
 property on the
 URLConnection to tell the server that I want to do
 this ?
 
  and two you were probably wanting to perform a PUT
  command(???), but you need to do things
 differently
  all the way around.  Were you trying to use the
 PUT
  command?  Were you trying to make POSTs?
 
 The file already exists (It is created by another
 process on the server).
 I wish to POST (not PUT) data so that the resource
 (sample.txt) is 
 updated with
 the contents I write from the client.
 
 Thanks
 Julian
 
 

-
 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: Basic load balancing

2005-05-11 Thread Wade Chandler
Joe Plautz wrote:
 From what I understand load balancing is done at the router, where 
clustering is a tomcat setup issue.

Joe
Faine, Mark wrote:
Tomcat 5.0.28
We seem to often have to make minor changes that cause us to have to 
restart
our tomcat server (the whole server, not just a web application) and this
has lead me to decide to research load balancing.  The idea would be 
to have
two servers that would be exact duplicates.  One of the servers would 
only
become available when the other was not running.  This way we could 
make the
change on server2 (and restart it) and then bring server1 down and 
make the
change to it as well.  This would prevent any real downtime for our 
users.
Where should I look for info on how to implement this type of failover?
Thanks for your help

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

You can also use an Apache server as a front end to multiple 
servers/tomcats.  I'm not talking about using mod_jk either, but using 
Apache as a traffic router.  It works well, and you will be using 
mod_rewrite and/or mod_proxy.  Check them out.

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


Re: Where to put version information in war file?

2005-05-11 Thread Wade Chandler
Henri Dupre wrote:
I was wondering what is the best place to put version information in a war file?
I'd like to put a build version and date at built time to my
application and have a way to retrieve them from the servlets.
I'm used to add the META-INF Implementation-version tag with jar files
but with Tomcat war files it doesn't work. Are there other
standard places where to put version information?
Henri.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

context-param is easy to access.  You could put them in your web.xml 
file and access them from Servlets and JSPs.  I'm not sure if there are 
any best pratices for it.

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


Form Based Authentication

2005-05-10 Thread Wade Chandler
I have form based authentication working.  But, I need the login form to 
be a little more dynamic.  For instance, I want to use different forms 
for different areas and not always use the same form.  Is this possible? 
 For instance, under one site I want to limit URLs to different logins. 
 I realize I should just have a login and have a userid and a password, 
but my customer wants to simply have an access code to certain pages or 
directories.  I would like to use form based authentication then I can 
have the userid as a hidden variable, and then have a password entered 
by the user, but for some admin screens I need the user to actually 
enter the userid and password both

I hope that makes sense.  I can't figure out how to setup a security 
constraint which can force a particular login form to be used if the 
user is not logged in yet.

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


Re: Form Based Authentication

2005-05-10 Thread Wade Chandler
Wade Chandler wrote:
I have form based authentication working.  But, I need the login form to 
be a little more dynamic.  For instance, I want to use different forms 
for different areas and not always use the same form.  Is this possible? 
 For instance, under one site I want to limit URLs to different logins. 
 I realize I should just have a login and have a userid and a password, 
but my customer wants to simply have an access code to certain pages or 
directories.  I would like to use form based authentication then I can 
have the userid as a hidden variable, and then have a password entered 
by the user, but for some admin screens I need the user to actually 
enter the userid and password both

I hope that makes sense.  I can't figure out how to setup a security 
constraint which can force a particular login form to be used if the 
user is not logged in yet.

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

Ok,
So I think I should be able to do this with a filter, but I need some 
help.  Basically it looks like I should be able to use a filter to some 
how get the original target before the authentication form is 
displayedis this correct?  Basically I need to some how know when a 
particular URL pattern is being displayed or is attempted to be 
accessed...before the login form is displayed.  When it is displayed 
I'll set an attribute in the request in the filters doFilter method. 
However, now I need to know how I can access the Request before the 
authentication mechanism takes over I suppose because from my login form 
accessing the getPathInfo() method is returning the login form 
information when I really need to know the actual path the user was 
attempting to access.  So, can I use a filter to do this, and if so how 
do I make sure my filter is called in time to give me the information I 
need?

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


Re: Java / Tomcat Job Abroad

2005-02-02 Thread Wade Chandler
Phillip Qin wrote:
You will be disappointed if you immigrate to Canada. You will end up with
driving a cab in best case senario.
-Original Message-
From: Aris Javier [mailto:[EMAIL PROTECTED] 
Sent: February 2, 2005 12:25 AM
To: Tomcat Users List
Subject: RE: Java / Tomcat Job Abroad

Thanks Rhino for info.
Yeah, big adjustment in climate... 
but that's one sacrifice I'm willing to take to make a living.

=)
-Original Message-
From: Rhino [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 02, 2005 1:13 PM
To: Tomcat Users List
Subject: Re: Java / Tomcat Job Abroad

I think you'll find that there are Java jobs in Canada. I've seen some at
monster.ca and workopolis.ca. I don't know about Tomcat jobs; I've never
looked for Tomcat jobs.
I hope you like living in large cities in a climate that is sometimes
miserable (-40C in winter in Winnipeg for example) ;-)
Rhino
- Original Message -
From: Aris Javier [EMAIL PROTECTED]
To: Tomcat Users List tomcat-user@jakarta.apache.org
Sent: Tuesday, February 01, 2005 8:52 PM
Subject: OT: Java / Tomcat Job Abroad
Hello!
This is an out of topic question...
Sorry, but since all of you guys are using Java and Tomcat,
and are from different countries...
im just wondering if i can land a job abroad?
I'm planning to migrate to Canada, US, or New Zealand from here in
Philippines... My skill is java programming (J2EE) and has 2 years
experience.
Is Java/Tomcat skill marketable in those countries i've mentioned? Or does
anyone of you need a java programmer that i can apply?
=)
Thanks!
Aris

-
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]
!DSPAM:4200642b202291386719112!
I'm in the U.S. and I love it.  I spent 3 months in New Zealand, and I 
loved it there also.  It's a very nice place.  I came back to my beloved 
states though.  I've lived in Tennessee and North Carolina, and was born 
in Tennessee.  I like the climate around this region.  It can get cold, 
but not too cold (sometimes it's below 0), and spring and summer are 
nice with a moderate fall/autumn.  I find there seem to be plenty of 
opportunities in NC.

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


Re: [OT]shared memory

2005-01-13 Thread Wade Chandler
Elihu Smails wrote:
--- Wade Chandler [EMAIL PROTECTED] wrote:

Elihu Smails wrote:
I have a C based application running on the same
box
as tomcat, and I want to know if I would be able
to
access the shared memory segment using Java.  The
C
program is setting up the shared memory using
shmctl,
and not using memory mapped files.  
I know that Java can support reading memory mapped
files, but not memory that is set up using the
shm*
functions in C.  Does anyone have any insight on
this
issue.
I am hoping that JNI is not my only option.
thank you.
		
__ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced
search.
http://info.mail.yahoo.com/mail_250


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

Yep.  JNI is your only solution.  But, JNI isn't
hard.  You can use JNI 
and create a wrapper class by extending ByteBuffer. 
You might also find 
 apache APR to be useful to help you out.  Don't
forget either that if 
you are going to run this application on different
endian cpu's or 
endian emulated OS you'll have to reverse your byte
order.  There may 
already be a package for doing this out there some
where (shared memory 
and reording at once).

Wade

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

Thanks for getting back to me :)
JNI is not that bad I agree, I just wish I could do
this without JNI.  As far as the endian issue, it will
all be on the same box, so I am OK there.  
Do you know if JDK 1.5 has any new shared memory
support in it?

		
__ 
Do you Yahoo!? 
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http://info.mail.yahoo.com/mail_250

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

Not that I have read or heard about.  It might though.  If it isn't in 
the release documents then I seriously doubt it though.  I know that 
doesn't help you any. :-(

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


Re: [OT]shared memory

2005-01-12 Thread Wade Chandler
Elihu Smails wrote:
I have a C based application running on the same box
as tomcat, and I want to know if I would be able to
access the shared memory segment using Java.  The C
program is setting up the shared memory using shmctl,
and not using memory mapped files.  
I know that Java can support reading memory mapped
files, but not memory that is set up using the shm*
functions in C.  Does anyone have any insight on this
issue.
I am hoping that JNI is not my only option.

thank you.
		
__ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250

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

Yep.  JNI is your only solution.  But, JNI isn't hard.  You can use JNI 
and create a wrapper class by extending ByteBuffer.  You might also find 
 apache APR to be useful to help you out.  Don't forget either that if 
you are going to run this application on different endian cpu's or 
endian emulated OS you'll have to reverse your byte order.  There may 
already be a package for doing this out there some where (shared memory 
and reording at once).

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


Re: blackdown jvm 1.4.2_01. Tomcat won't start with jpda start parameter

2005-01-08 Thread Wade Chandler
Vano Beridze wrote:
Hello
I've got
Gentoo Linux on amd 64
Blackdown jdk 1.4.2_01
java version 1.4.2-01
Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.4.2-01)
Java HotSpot(TM) 64-Bit Server VM (build Blackdown-1.4.2-01, mixed mode)
tomcat 4.1.31
I can't start tomcat with jpda start parameter.
If I remove jpda it starts perfectly.
Sun jdk 1.5.0_01 for amd 64 does not have that problem.
Thank you
Can you start other applications that way?
Wade
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: No response from Tomcat 5 when browser sends signed cookie

2005-01-06 Thread Wade Chandler
Leonard Sitongia wrote:
More information:
Looks like this is not related the the secure nature (digitally signed) 
of the cookie, but the size.  A cookie over about 3k will trigger this 
problem.

Also, it looks like Tomcat doesn't receive the request, so the problem 
may be in SSL.  It is hard to tell, since it seems like it could be that 
Tomcat isn't logging in the part of the code that this is hitting.

Is this a problem in Java SSL?
Thanks for any help you can offer!
==Leonard
On Jan 5, 2005, at 10:58 AM, Leonard Sitongia wrote:
I have configured Tomcat 5.0.27 on the localhost to accept https 
connections (I  have configured an unsigned cert under the alias 
tomcat to allow this).

I can then get to the root Tomcat page at https://localhost:8443/.
If my browser happens to have a signed cookie in it (this cookie is a 
signed S/MIME message that contains the signing certificate and so is 
3765 bytes long - it is used by some homegrown Apache httpd apps that 
are unrelated to Tomcat), then Tomcat no longer responds on 8443.  I 
can still get to the Tomcat root page with http://localhost:8080/, but 
when I try https://localhost:8443/ then Netscape 7 says document 
contains no data and Safari says bad server response 
(NSURLErrorDomain:-1011).

Nothing is logged by Tomcat about this.  There are no error messages 
at any time from Tomcat.

My browser and server are on Mac OS X.
I tried puting the signing cert that is used to sign the S/MIME 
message into the keystore for Tomcat.  That didn't help.  I don't know 
how to put the signing key into the keystore... maybe that's 
inadvisable anyway?

Is this simply a matter of the size of the cookie, or will Tomcat try 
to do something with the cookie even though it is not intended to be 
used by any apps in Tomcat?  What should I investigate and try to 
resolve this?

Thanks for your help!
==Leonard E. Sitongia
Web Engineering Group
National Center for Atmospheric Research
P.O. Box 3000 Boulder CO 80307  USA
[EMAIL PROTECTED]voice: (303)497-2454   fax: (303)497-1804
-
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]

Don't know why it is happening, but seriously doubt it's Java SSL as SSL 
doesn't know squat about your cookie...SSL is a layer well below http 
and cookiesif you can send any amount over 3k to the socket, but 
just the cookies are barfing out the server, then it's something on the 
server side besides ssl.

Are you using anything other than tomcat (i.e. a connector and apache, 
or is this straight tomcat?) this wasn't exactly clear I see where 
you are using the tomcat ports, but how did the issue start (by hitting 
tomcat contexts through apache?) Does this happen if you are not using 
https...when the cookie gets sent...will it hang http?  If using Apache 
can you test it without apache and just use tomcat to see if it still 
hangs.  The home grown httpd stuffis this standard cookies or http 
extension header type stuff, or something you came up with?  Are you 
sure the cookies are being formatted correctly per the RFC's?  Are they 
being delimited correctly \r\n?

I don't know the answer...figured I would try to give you help in 
thinking about the issue.

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


Re: [OT] Does anyone know this boy?

2005-01-06 Thread Wade Chandler
Jan Behrens wrote:
Sorry,
they were included in my original mail, looks like the list server deletes
all attachments :( I have enclosed them again - this time packed in a single
zip-file. Hopefully they pass now...
Cheers, Jan

-Original Message-
From: Rhino [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 06, 2005 8:41 PM
To: Tomcat Users List
Subject: Re: [OT] Does anyone know this boy?
Do you have a picture of this boy? That would help
*enormously*; all you have now is the fact that he is two
years old and an inference that he is not a Thai.
Rhino
- Original Message -
From: Jan Behrens [EMAIL PROTECTED]
To: 'Tomcat Users List' tomcat-user@jakarta.apache.org
Sent: Thursday, January 06, 2005 1:47 PM
Subject: [OT] Does anyone know this boy?
Hi list,
I know this is OT but I do believe that everyone out there
should take the time to read this, if one does know him it
will be worth more than all email in the world...
Cheers, Jan

PLEASE DO FOWARD TO YOUR INTERNATIONAL OPERATORS AND
CONTACTS
HE MUST HAVE BOUGHT  IS TRIP IN SOME TRAVEL AGENCY IN EUROPE...
Looking for his family.




The boy about 2 years, from Khoa Lak is missing his parents. Nobody
knows what country he comes from.
If anybody known him please contact us by phone
076-249400-4 ext. 1336,
1339 or 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]
post them on a public web server (yahoo works) and send the link.
Wade
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: timeout when reading 401 response [was: persistent HTTP 1.1 connectionswith Tomcat 5.5.4?]

2005-01-06 Thread Wade Chandler
Garret Wilson wrote:
So this is getting stranger.
Just to preclude any error on my part, I did a simple loop that output 
every character received from the response. The HTTP response status 
line and headers come down fine, including the CRLF that separates the 
headers from the body. And then---timeout after 15 seconds.

But the strange part is that if I connect using Firefox, I can view the 
entire response---an HTML document including the 401 status code. This 
document length is---you guessed it---952 bytes long, just like the 
Content-Length header says.

Why can't I read the body from Java, yet Firefox can read it? Is there a 
bug with Channels.newInputStream()?

Garret
Garret Wilson wrote:
It looks like the timeout is occurring when the first response is 
being read, so this changes the problem.

I'm receiving a 401 Unauthorized response with the following headers:
Server: Apache-Coyote/1.1
WWW-Authenticate: [...]
Content-Type: text/html;charset=utf-8
Content-Length: 952
Date: Thu, 06 Jan 2005 19:47:43 GMT
I try to read the 952 bytes, and that's when I get the 15-second hang 
before a timeout.

The response is generated on the server with:
response.sendError(401);
Where are those 952 bytes, and why can't I read them, I wonder?
Garret
Garret Wilson wrote:
Does Tomcat 5.5.4 support HTTP 1.1 persistent connections?
I'm connecting to a Tomcat servlet from a custom Java client, and the 
first request/response goes fine:

socketAddress=new InetSocketAddress(host, port);
channel=SocketChannel.open(socketAddress);
inputStream=new BufferedInputStream(newInputStream(channel));
outputStream=new BufferedOutputStream(newOutputStream(channel));
The response headers do *not* have a Connection: close header, 
which means the connection should stay open.

The response is a 401 Unauthorized, so I place credentials in the 
request and send it again to the same output stream. Then I try to 
read another response from the same input stream. My program hangs 
until the connection times out.

What the matter with persistent connections here?
Thanks,
Garret

Actually what is happening is this  You are using a buffered stream. 
 It is reading past the amount returnedand then the tcp/ip socket 
is blocking because you have it open as a keep alive.  You have to only 
read the number of bytes available and not keep trying to squeeze the 
blood out of the turnip... ;-) I'll almost bet you money that is what is 
happening.  Try to not use a buffered input stream and see what you get. 
 If I'm wrong I'm wrong let me know.  Hope it works.

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


Re: timeout when reading 401 response [was: persistent HTTP 1.1 connectionswith Tomcat 5.5.4?]

2005-01-06 Thread Wade Chandler
Wade Chandler wrote:
Garret Wilson wrote:
So this is getting stranger.
Just to preclude any error on my part, I did a simple loop that output 
every character received from the response. The HTTP response status 
line and headers come down fine, including the CRLF that separates the 
headers from the body. And then---timeout after 15 seconds.

But the strange part is that if I connect using Firefox, I can view 
the entire response---an HTML document including the 401 status code. 
This document length is---you guessed it---952 bytes long, just like 
the Content-Length header says.

Why can't I read the body from Java, yet Firefox can read it? Is there 
a bug with Channels.newInputStream()?

Garret
Garret Wilson wrote:
It looks like the timeout is occurring when the first response is 
being read, so this changes the problem.

I'm receiving a 401 Unauthorized response with the following headers:
Server: Apache-Coyote/1.1
WWW-Authenticate: [...]
Content-Type: text/html;charset=utf-8
Content-Length: 952
Date: Thu, 06 Jan 2005 19:47:43 GMT
I try to read the 952 bytes, and that's when I get the 15-second hang 
before a timeout.

The response is generated on the server with:
response.sendError(401);
Where are those 952 bytes, and why can't I read them, I wonder?
Garret
Garret Wilson wrote:
Does Tomcat 5.5.4 support HTTP 1.1 persistent connections?
I'm connecting to a Tomcat servlet from a custom Java client, and 
the first request/response goes fine:

socketAddress=new InetSocketAddress(host, port);
channel=SocketChannel.open(socketAddress);
inputStream=new BufferedInputStream(newInputStream(channel));
outputStream=new BufferedOutputStream(newOutputStream(channel));
The response headers do *not* have a Connection: close header, 
which means the connection should stay open.

The response is a 401 Unauthorized, so I place credentials in the 
request and send it again to the same output stream. Then I try to 
read another response from the same input stream. My program hangs 
until the connection times out.

What the matter with persistent connections here?
Thanks,
Garret

Actually what is happening is this  You are using a buffered stream. 
 It is reading past the amount returnedand then the tcp/ip socket is 
blocking because you have it open as a keep alive.  You have to only 
read the number of bytes available and not keep trying to squeeze the 
blood out of the turnip... ;-) I'll almost bet you money that is what is 
happening.  Try to not use a buffered input stream and see what you get. 
 If I'm wrong I'm wrong let me know.  Hope it works.

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


See the read method of the SocketChannel...as I'm sure it will be 
getting called by the InputStream wrapper from the object.  Don't think 
about trying to make the SocketChannel so that isBlocking returns false 
either because if all the data isn't there and it isn't blocking and the 
buffer doesn't have any data (at that exact moment you make a call) it 
will return as if it had read all of the data and then you'd be messed 
up that way to.

I'm writing this all assuming you are using keep alives.
Wade
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: timeout when reading 401 response [was: persistent HTTP 1.1 connectionswith Tomcat 5.5.4?]

2005-01-06 Thread Wade Chandler
Wade Chandler wrote:
Wade Chandler wrote:
Garret Wilson wrote:
So this is getting stranger.
Just to preclude any error on my part, I did a simple loop that 
output every character received from the response. The HTTP response 
status line and headers come down fine, including the CRLF that 
separates the headers from the body. And then---timeout after 15 
seconds.

But the strange part is that if I connect using Firefox, I can view 
the entire response---an HTML document including the 401 status code. 
This document length is---you guessed it---952 bytes long, just like 
the Content-Length header says.

Why can't I read the body from Java, yet Firefox can read it? Is 
there a bug with Channels.newInputStream()?

Garret
Garret Wilson wrote:
It looks like the timeout is occurring when the first response is 
being read, so this changes the problem.

I'm receiving a 401 Unauthorized response with the following headers:
Server: Apache-Coyote/1.1
WWW-Authenticate: [...]
Content-Type: text/html;charset=utf-8
Content-Length: 952
Date: Thu, 06 Jan 2005 19:47:43 GMT
I try to read the 952 bytes, and that's when I get the 15-second 
hang before a timeout.

The response is generated on the server with:
response.sendError(401);
Where are those 952 bytes, and why can't I read them, I wonder?
Garret
Garret Wilson wrote:
Does Tomcat 5.5.4 support HTTP 1.1 persistent connections?
I'm connecting to a Tomcat servlet from a custom Java client, and 
the first request/response goes fine:

socketAddress=new InetSocketAddress(host, port);
channel=SocketChannel.open(socketAddress);
inputStream=new BufferedInputStream(newInputStream(channel));
outputStream=new BufferedOutputStream(newOutputStream(channel));
The response headers do *not* have a Connection: close header, 
which means the connection should stay open.

The response is a 401 Unauthorized, so I place credentials in the 
request and send it again to the same output stream. Then I try to 
read another response from the same input stream. My program hangs 
until the connection times out.

What the matter with persistent connections here?
Thanks,
Garret

Actually what is happening is this  You are using a buffered 
stream.  It is reading past the amount returnedand then the tcp/ip 
socket is blocking because you have it open as a keep alive.  You have 
to only read the number of bytes available and not keep trying to 
squeeze the blood out of the turnip... ;-) I'll almost bet you money 
that is what is happening.  Try to not use a buffered input stream and 
see what you get.  If I'm wrong I'm wrong let me know.  Hope it works.

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


See the read method of the SocketChannel...as I'm sure it will be 
getting called by the InputStream wrapper from the object.  Don't think 
about trying to make the SocketChannel so that isBlocking returns false 
either because if all the data isn't there and it isn't blocking and the 
buffer doesn't have any data (at that exact moment you make a call) it 
will return as if it had read all of the data and then you'd be messed 
up that way to.

I'm writing this all assuming you are using keep alives.
Wade
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

And one more tad bit
If you really need to use buffering in this case it might make sense to 
do that in your read loop yourself so you can control the max number of 
bytes read...that or make a buffered input stream which you can set the 
max number of bytes to read into the buffer forover all max number 
that is.

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


Re: solved: timeout when reading 401 response [was: persistent HTTP1.1 connectionswith Tomcat 5.5.4?]

2005-01-06 Thread Wade Chandler
Garret Wilson wrote:
Wade Chandler wrote:
Actually what is happening is this  You are using a buffered 
stream.  It is reading past the amount returnedand then the tcp/ip 
socket is blocking because you have it open as a keep alive.  You have 
to only read the number of bytes available and not keep trying to 
squeeze the blood out of the turnip... ;-) I'll almost bet you money 
that is what is happening.  Try to not use a buffered input stream and 
see what you get.  If I'm wrong I'm wrong let me know.  Hope it works.

Wade, thanks so very much for responding. I was sitting here dumbfounded 
wondering what in the world could be happening.

But you're wrong. ;)
I had already thrown out the BufferedInputStream to eliminate that. I 
switched to straight sockets. I set up a simple loop that simply read 
bytes until receiving a timeout. The timeout occurred after the CRLF 
divider, even though the Content-Length said 952. Accessing the site 
from Firefox showed all the content.

Puzzled? Yeah, so was I. Then I realized that in my Java client I was 
testing my new HTTP routines with the HEAD method!

(You can start the ridicule, now...)
The whole point of the HEAD method is that it doesn't send content---it 
simply sends a Content-Length indicating how long the content would have 
been. In fact, RFC 2616 says that the server MUST NOT return a 
message-body in the response for the HEAD method (9.4).

Now, what threw me off is that the response was an error status, a 401 
Unauthorized. The Content-Length is in line with the spec, returning the 
length of the content which would have been returned if a GET had been 
used. As an error was returned, however, the Content-Length was 
returning the length of the error message---the error message that would 
have been returned had a GET been used.

Now, all this is technically to the letter of RFC 2616, but I wonder 
what would happen if a server were to send back a 405 Method Not Allowed 
for HEAD. There would be no way to get at the error message, because 
HEAD doesn't send back content. Using GET would succeed, so technically 
the Content-Length of HEAD in this case wouldn't be the content length 
of a response from GET.

I'm thinking that RFC 2616 should probably have made an exception to the 
no content rule for HEAD when an error condition is being reported. But 
that's the least of my worries. I just need to tell my client to ignore 
all content in a response to HEAD. Oddly, though, this means that a 
thread can't simply pull HTTP responses down from a persistent 
connection without knowing to which request each response belongs---i.e. 
whether to trust the Content-Length or not!

In any case, thanks for the input. It looks like your responses will be 
useful when I finally switch over to non-blocking I/O support.

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

lol.  I won't ridiculewe all make the mistakes that make us go... 
(Homer Simpson)..DOH  Glad you got it resolved.

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


Re: Handling HEAD request in servlet

2005-01-06 Thread Wade Chandler
Tennessee Leeuwenburg wrote:
Hi guys,
I have a problem where the default implementation of HttpServlet doesn't 
seem to be handling doHead(request, response) properly. I over-rode the 
method, and found the damndest thing happening. The line 
response.setContentLength(length) is just getting completely ignored. 
I can't work it out - it's like the response object is deliberately 
preventing me from setting the content-length. I tried 
setHeader(Content-Length, length) just in case but still no joy.

Note - this is a repost - the tomcat-dev people said I should post here, 
despite this relating to development issues rather than install or 
deployment problems, so please don't shoot me! I worked around the 
problem by using out.println(Content-Length: length) instead, but it's 
still bad that setContentLength() doesn't work, I think.

Help!? Please!
-
Here's the code snippet :
  FileInputStream inStream = null;
inStream = new FileInputStream(ncFile);
  int length = (int)ncFile.length();
  response.setStatus(response.SC_PARTIAL_CONTENT); 
  response.setHeader(Accept-Ranges, bytes);
  response.setContentLength(length);
  response.setHeader(Content-Length-Mimic, 
+(int)ncFile.length());
  response.setHeader(Impossible,  + length);
  response.setContentType(contentType);
out.flush();

Here's what I get back via telnet :
HTTP/1.1 206 Partial Content
Date: Thu, 06 Jan 2005 05:07:22 GMT
Server: Apache/2.0.50 (Ubuntu) mod_jk2/2.0.4
Set-Cookie: JSESSIONID=3D6C4C6EBE1AB1672E40C2933243BA3B; Path=/marslet
Accept-Ranges: bytes
Content-Length-Mimic: 36903060
Impossible: 36903060
Content-Type: application/x-netcdf
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Yeah, you should have seen another message between me and another guy. 
lol.  Anyways, head responses can't have a length as they are only a 
header.  So basically all you can send back in a head request is the 
header and the header won't have a lengthread the headers until you 
get an empty lineif that's what you are needing to do (client 
stuff)...server side...you can't really do anything with the head 
request but send headers.  I guess you can send a header for a redirect 
to a different page if needed.  So I'm sure tomcat is wiping it all out 
for you ... as it should be technically per the specification.

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


Re: Handling HEAD request in servlet

2005-01-06 Thread Wade Chandler
Tennessee Leeuwenburg wrote:
Glad to find another human! :)
 From the spec, it looked like there should be a content-length, but 
maybe you're right. I'm writing a server for a client that expects the 
content-length to be there. As I said, I did find a workaround by just 
printing to the output stream, but it had me baffled for a while. Lucky 
everyone is still on holidays, there was some swearing going on :)...

Cheers,
-T
Yeah, you should have seen another message between me and another guy. 
lol.  Anyways, head responses can't have a length as they are only a 
header.  So basically all you can send back in a head request is the 
header and the header won't have a lengthread the headers until 
you get an empty lineif that's what you are needing to do (client 
stuff)...server side...you can't really do anything with the head 
request but send headers.  I guess you can send a header for a 
redirect to a different page if needed.  So I'm sure tomcat is wiping 
it all out for you ... as it should be technically per the specification.


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

No I think you should be able to set the header..Tomcat does it for 
me on my home directory index.html file.  Here is the output from the 
head operation...

HTTP/1.1 200 OK
ETag: W/697-1078786629000
Last-Modified: Mon, 08 Mar 2004 22:57:09 GMT
Content-Type: text/html
Content-Length: 697
Date: Fri, 07 Jan 2005 06:14:26 GMT
Server: Apache-Coyote/1.1
Connection: close
That from my Tomcat 5.0.28 ~useraccount index.html file.  I used w3m to 
perform a head.

and this from a zip file I had in there
HTTP/1.1 200 OK
ETag: W/1169293-108481176
Last-Modified: Mon, 17 May 2004 16:36:00 GMT
Content-Type: application/zip
Content-Length: 1169293
Date: Fri, 07 Jan 2005 06:18:19 GMT
Server: Apache-Coyote/1.1
Connection: close
Which makes sense...why else would one want HEAD in the first place if 
not to examine the data a tad before trying to grab it.

Maybe don't try to set the content and just try to set the header itself 
without calling the method to set the content?  Have you already tried 
thatsetting the header and leaving the content property alone? 
Maybe you are calling something else after setting the header that is 
clearing it out?

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


Re: Speed issues with SQL Server 2000 and JTDS

2005-01-05 Thread Wade Chandler
Charles P. Killmer wrote:
Thanks.  I had already done this but maybe not communicated them as
concisely.  

Thanks 
Charles

-Original Message-
From: Parsons Technical Services [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 04, 2005 6:23 PM
To: Tomcat Users List
Subject: Re: Speed issues with SQL Server 2000 and JTDS
Trying a few test should help you narrow things down a bit.
1. Run without DB connection. (Done  runs fast)
2. Run with a DB connect but no query. (Done runs slow)
3. Run with a simple query and do nothing with it.
4. Run with a simple query and post results in page. Only move forward
through result set.
5. Run with a simple query and post results in page. Move around in the
result set (Only if you do this in your page).
At some point in these test you should see a dramatic jump in the
response time. If it is a steady climb, then you may have multiple
issues.
Report back what you find and we'll make suggestions from there.
Doug
- Original Message -
From: Charles P. Killmer [EMAIL PROTECTED]
To: Tomcat Users List tomcat-user@jakarta.apache.org
Sent: Tuesday, January 04, 2005 11:23 AM
Subject: RE: Speed issues with SQL Server 2000 and JTDS
Could this speed issue be caused by a poor setup?  When I remove the
database connection from my code, the pages run fast.  Though I
obviously need the database portion of the code in there.
Thanks
Charles
-Original Message-
From: David Boyer [mailto:[EMAIL PROTECTED]
Sent: Monday, January 03, 2005 9:05 AM
To: tomcat-user@jakarta.apache.org; Charles P. Killmer
Subject: RE: Speed issues with SQL Server 2000 and JTDS
You could try using something like jProfiler to see where the bottleneck
is.
I don't see anything unusual in your code example, although it looks
like the only thing it does is create the connection. I use jTDS and it
works fine without doing anything exceptional.


[EMAIL PROTECTED] 01/03 8:55 am 

This is some representative code that is being very slow.
import java.sql.*;
public class SomeClass {
   public Connection conn;
public int ID;
public String Name;
public String Address;
public String City;
public String OtherStuff;
   public SomeClass() throws Exception {
   try {
   Class.forName(net.sourceforge.jtds.jdbc.Driver);
   } catch (ClassNotFoundException ex) {
   }
   try {
   conn =
DriverManager.getConnection(jdbc:jtds:sqlserver://111.222.333.444:1433/
someDB;user=someuser;password=somepassword);
   } catch (Exception e) {
   throw e;
   }
   }
  public int Audit() throws Exception {
 return 5;
  }
  public ResultSet GetData() throws Exception {
 ResultSet rs = null;
 return rs;
  }
  public int DeleteSomething() throws Exception {
 return 2;
  }
}
I don't have anything special in any XML files.  I will try to make my
code work like yours is.  But if someone has an idea why the way I have
it written is slow, I would love to hear it.
Thank You
Charles
-Original Message- 

From: Randall Svancara [mailto:[EMAIL PROTECTED]
Sent: Monday, January 03, 2005 8:20 AM
To: Tomcat Users List
Subject: RE: Speed issues with SQL Server 2000 and JTDS
I have been using JTDS with SQL Server 2000 in conjunction with Tomcat
without any problems.  Perhaps if you post some your database connection
code, someone could provide you with assistance.  You might also try
posting to the JTDS Mailing list.  Are you using Database Connection
Pooling (DBCP)??
I am including an example the code I use to access a stored procedure on
SQL Server 2000 using DBCP.
/*  Here are the things I import */
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.naming.*;
import javax.sql.*;

Public class SomeClass{

* A public class that returns an Applicant object
* @return the applicant as applicant
*/
public Applicant SomeApplicantMethod(){
   Applicant app = new Applicant();
   Connection conn = null;
   Statement stmt = null;
   ResultSet rst = null;

   try{
   Context ctx = new InitialContext(); /* Declare initial
context */
   if(ctx == null ){
   logger.error(Error creating new context for some
reason);
   throw new Exception(No context);
   }
   /* Throw an exception if it is null */
   DataSource ds =
(DataSource)ctx.lookup(java:comp/env/jdbc/summitexec);

   conn = ds.getConnection();

   if(conn != null)  {

   stmt = conn.createStatement();

   rst = stmt.executeQuery(sp_SelectApplicant +
canidateid);

   while(rst.next()){
// Add result set to applicant object,
NOT SHOWN HERE!!!
   }

   //Make sure you close everything, else you end up
with object leaks
   if(stmt != null){
   stmt.close();
   }

   if(rst != null){
   rst.close();
   }

   if(conn != null){
   

Re: Tomcat run as a daemon: Is jsvc reliable?

2005-01-04 Thread Wade Chandler
Matteo Turra wrote:
Hi, does anybody know if jsvc included in tomcat 5.0.28 is reliable for
production environment?
Thanks, Matteo.
--
A very merry Christmas
And a happy New Year
Let's hope it's a good one
Without any fear
-- John Lennon
_
Matteo TURRA   mail: [EMAIL PROTECTED]
Analisi  sviluppo WEB tel: +39 051 61.11.430
KION Srl   web: www.kion.it
Via Cristoni, 86   tel: +39 051 61.11.411
40033 Casalecchio di Reno (BO) fax: +39 051 57.04.23
ITALIA
_


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

You need to get the version out of cvs from the commons-daemon project 
and build it yourself.  We just had a run over this recently, so you 
should be able to find talk about it in last months archive or this one.

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


Re: jsvc alternatives?

2004-12-30 Thread Wade Chandler
Michael Kastner wrote:
Hello,
it seems like jsvc runs very unstable on my linux system. Does anybody 
know any alternatives to jsvc?

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

Did you see the recent post from Bill Barker to a reply I gave to 
another list member?  He talked about the version of code for jsvc 
shipping with Tomcat as being very buggy.  I just glanced at the release 
1.0 code that I had posted about, Bill suggested downloading from the 
common daemon cvs to get some better code.  There isn't that much to the 
code really, so if you are able maybe it would be easier to get that 
code, build it, see if it works, and if it doesn't to fix it.  I haven't 
used it yet, but have been planning on it.

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


Re: JVM Crash

2004-12-30 Thread Wade Chandler
Mark wrote:
I googled around and here some good(?) news, at least somebody get
around the problem:
http://forum.java.sun.com/thread.jspa?threadID=307252tstart=210
on of solution is :
-- cut --
now I use jdk1.3.1_06 with hospot -server
and it works perfectly (and faster)
-- end cut ---
another one was a hardware problem:
-- cut --
 Some part
of the computer seemed to be not compatible with the
FSB133 standard. So I reduced the system to FSB100.
No signal 11 since that time :-
-- end cut --
and here another issue with java:
-- cut --
In this case, it was happening during the compilation of a reasonably
large JSP. A colleague found out that there was a known issue with
this version of javac compiling large methods (64Kb), which tends to
happen when you have a large JSP getting compiled into a single
service() method.
-- end cut --
--- Amit Gupta [EMAIL PROTECTED] wrote:

I am facing similar problem on user mode Linux.
Amit Gupta
Mobile: 91-9818052171
Yahoo IM: amitguptainn
MSN IM : amitguptainn
-Original Message-
From: Rodrigo Schmidt [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 28, 2004 5:05 PM
To: Tomcat Users List
Subject: Re: JVM Crash

Amit, I am using a dedicated server.
Rodrigo
Amit Gupta wrote:

You are using User mode Linux or dedicated server?
Amit Gupta
Mobile: 91-9818052171
-Original Message-
From: Rodrigo Schmidt [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 27, 2004 11:18 PM
To: tomcat-user@jakarta.apache.org
Subject: JVM Crash

Hello all,
I deployed Atlassian Jira Enterprise 3.0.3 in Tomcat 5.0.28 and I 
experienced two random JVM crashes in a period of one month. The
strange 

part is that the crashes occured when the application was at a
very low 

load, doing almost nothing.
I searched the archives for this topic, but I still can't figure
out 

what could have caused these crashes.
I have no idea whether they are related to Jira, Tomcat, J2SDK or 
RedHat. I would like to isolate the problem, so that I can ask the

proper vendor for support.
Below I will post information about my system and the JVM error
logs, 

sorry for the long message.
Any help is greatly appreciated, thanks a lot.
Rodrigo
System:
Linux 2.4.21-4.EL #1 Fri Oct 3 18:13:58 EDT 2003 i686 i686 i386
GNU/Linux
Red Hat Enterprise Linux AS release 3 (Taroon)
Tomcat 5.0.28
java version 1.4.2_06
Java(TM) 2 Runtime Environment, Standard Edition (build
1.4.2_06-b03)
Java HotSpot(TM) Server VM (build 1.4.2_06-b03, mixed mode)
JAVA_OPTS=-server -Xmx512m
1GB RAM
CPU: Intel(R) Pentium(R) 4 CPU 2.40GHz stepping 09
Error log 1:
Unexpected Signal : 11 occurred at PC=0xB7289E78
Function=(null)
Library=/usr/local/j2sdk1.4.2_06/jre/lib/i386/server/libjvm.so
NOTE: We are unable to locate the function name symbol for the
error
just occurred. Please refer to release documentation for
possible
reason and solutions.
Current Java thread:
  at java.lang.String.intern(Native Method)
  at java.lang.Class.searchMethods(Class.java:1877)
  at java.lang.Class.getDeclaredMethod(Class.java:1262)
  at 
org.apache.commons.logging.impl.LogFactoryImpl.isJdk14Available(LogFactoryImpl.java:489)
  at 
org.apache.commons.logging.impl.LogFactoryImpl.getLogClassName(LogFactoryImpl.java:331)
  at 
org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(LogFactoryImpl.java:368)
  at 
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
  at 
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
  at 
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
  at
org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
  at 
org.apache.commons.beanutils.ConvertUtilsBean.init(ConvertUtilsBean.java:130)
  at 
org.apache.commons.beanutils.BeanUtilsBean.init(BeanUtilsBean.java:110)
  at 
org.apache.commons.beanutils.BeanUtilsBean$1.initialValue(BeanUtilsBean.java:68)
  at 
org.apache.commons.beanutils.ContextClassLoaderLocal.get(ContextClassLoaderLocal.java:80)
  - locked 0x925030d0 (a 
org.apache.commons.beanutils.BeanUtilsBean$1)
  at 
org.apache.commons.beanutils.BeanUtilsBean.getInstance(BeanUtilsBean.java:78)
  - locked 0xaeeb91a0 (a java.lang.Class)
  at 
org.apache.commons.beanutils.ConvertUtilsBean.getInstance(ConvertUtilsBean.java:115)
  at 
org.apache.commons.beanutils.ConvertUtils.convert(ConvertUtils.java:217)
  at 
org.apache.commons.digester.CallMethodRule.end(CallMethodRule.java:457)
  at org.apache.commons.digester.Rule.end(Rule.java:276)
  at 
org.apache.commons.digester.Digester.endElement(Digester.java:1058)
  at 
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)
  at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown

Source)
  at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown

Source)
  at 

Re: jsvc alternatives?

2004-12-30 Thread Wade Chandler
Wade Chandler wrote:
Michael Kastner wrote:
Hello,
it seems like jsvc runs very unstable on my linux system. Does anybody 
know any alternatives to jsvc?

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

Did you see the recent post from Bill Barker to a reply I gave to 
another list member?  He talked about the version of code for jsvc 
shipping with Tomcat as being very buggy.  I just glanced at the release 
1.0 code that I had posted about, Bill suggested downloading from the 
common daemon cvs to get some better code.  There isn't that much to the 
code really, so if you are able maybe it would be easier to get that 
code, build it, see if it works, and if it doesn't to fix it.  I haven't 
used it yet, but have been planning on it.

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

Just noticed by reading another message you did just that.  Sorry for 
the late and un-needed post.

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


Re: ANN: Tomcat for RiA (Rich Internet Application) example live. [OT]

2004-12-30 Thread Wade Chandler
Vic wrote:
check out boardVU.com (only in IE for now).
Tomcat is hosting Hessian + iBatis  as services to JNLP for JDNC (RiA) 
application at above.
So ... tomcat does not have to be just browser dhtml apps (try that 
PHP!)

.V

OT
I do something similar.  I have a package I wrote I call JMapMethods. 
It's easier than RMI and doesn't use SOAP like Axis, plus it's a lot 
easier than Axis, yet not as portable to remote applications considering 
I use serialized java objects, though it doesn't have to, which is 
nice...one could use something to serialize to XML and then other 
languages could use it.

I made a map like class housing a HashMap underneith for the method call 
data.  I have a client and a controller side.  Every class has a client 
and a controller.  The parameters are wrapped up in serialized maps and 
sent to the backend, and the return is always a JMapMethodData object. 
It's up to each client/controller combo to decide how best to know which 
method to call.  I usually use Strings with method names in the 
map...just easier to debug.  I thought about taking the framework and 
breaking out the specific bits and giving it to some open source.

Anyways, the coolest part of it's design is that it's simple.  It's 
secured with logins and interfaces and the works.  Yet doesn't really 
have many complex pieces to get going with.  One can take a base setup 
and have remote methods and local methods being called in minutes.

The way the client and controller model is setup I have a 
LocalJMapMethodCaller and I also have an HttpJMapMethodCaller.  The 
client uses the caller to make the method calls.  JMapMethodCaller is an 
interface, so I guess you can see where I'm going with thatyou can 
write one application and run it stand alone or over the internet as 
long as you don't count on certain things likeobject references 
consistantly pointing to the same object.  So, except for pieces that 
require file operations and threads it's all the same application.  A 
simple test of whether or not if it's stand alone or internet based and 
you know if you have to send the file or large data to the backend.

I built in zip capabilities, large multi-threaded/cross-server 
capabilites...the works all event driven for large operation watching. 
It's scalable basically.  For instance, I have event handlers for a 
class which can zip and send a file to the backend.  The directory can 
be a network drive it is stored on, and status is kept in a database.  I 
call a method telling it what file to zip, where to send it, and to 
extract it.  It does all of this automatically and my ui gets updated by 
a thread watching the event handler.  So theirs another idea to go along 
with that type of a concept.

Anyways, I hate browsers.  They just don't have near as much 
functionality...like try to browse through a large list of data with a 
browser compared to a JTable...or try to manage a large amount of data 
remotely using a browser doing something like data entry or 
accounting...ick...I hate that.  With java you can have a rich interface 
and still have a nice web appdeserialize the object and set 
parameters.  It works like a charm.

Maybe one day I'll actually get around to breaking it out enough so it 
can be a stand alone package and I can allow it to be used by others.

If I do or don't...Java rulesof course don't forget you could always 
use SOAP, XML-RPC, or just use XML through PHP for the data and what not 
and do the same thing using a java front end for the PHP, or use 
ASP.net, ISAPI dlls, cgi (perl or C)...you name it.  Though it makes 
more sense to use java on both ends:-P

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


Re: Forwarding *all* webapps with mod_jk

2004-12-29 Thread Wade Chandler
Mladen Turk wrote:
Simon MARTIN wrote:
Hi,
I've integrated Tomcat successfully into Apache using mod_jk, but 
there's something I've found nothing about: forwarding *all* webapps 
with only one static statement in the configuration files.

I've thought about something like this:
JkMount /tomcat/* ajp13:*  (which of course is wrong I know)
You can use the mod_rewrite:
RewriteEngine On
RewriteRule   ^/tomcat/(.+)$  /$1 [R,L]
JkMount /* ajp13
But this will map everything to the tomcat.
You can not do (for now):
/tomcat/examples/* - /examples/*
and then back to:
/examples/* - /tomcat/examples/*
This would require that mod_jk when forwarding the request
to Tomcat strips the '/tomcat' from the URL, and then
after receiving the response add the '/tomcat' prefix to
the url. Of course you will be forced to use only the
relative url's inside your application, so the usage
is dubious.
Mladen.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Could he not do something like this...doesn't mod_jk now have the 
mod_jk2 stuff in it?

I do this in mod_jk2 in the workers2.properties file
#this will allow all rsg servlets to be run through tomcat.
[uri:/*.jrsg]
info=jrsg (extension for RSG controller servlets)
context=/
I give all of my servlets an extension in their name.  Though I assume 
this could be done like:

#this will allow all rsg servlets to be run through tomcat.
[uri:/*servlet*]
info= for all servlets in a servlet directory
context=/
I then make sure that the native server has the same context/path what 
ever you want to call it as the tomcat web app will have.  This means 
the url path will be correct for both servers.
If I have /someapp in Apache or IIS then my webapp name will be /someapp 
and /someapp/servlets will house the servlets

Can he not do something like this in mod_jk?  What would the equivalent 
be?  Also, if he isn't using the version of mod_jk which has the mod_jk2 
stuff merged in, I would still like to know if the merged version still 
has this capability?

Hope that might help, and thanks for any other info given to the list of 
a similar nature on the same topic.

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


Re: Session restart replication when using jsvc

2004-12-29 Thread Wade Chandler
Trond G. Ziarkowski wrote:
Hi Wolfgang!
by using signal 9 you give Tomcat no chance to perform any further 
action. Maybe you omit -9 from your kill command.

Thanks for the tip. Tried it, but same results.
Trond
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Hmmm.  Here is the source code of the jsvc-unix.c which is called upon a 
signal.

static void handler(int sig) {
switch (sig) {
case SIGTERM: {
log_debug(Caught SIGTERM: Scheduling a shutdown);
if (stopping==true) {
log_error(Shutdown or reload already scheduled);
} else {
stopping=true;
}
if (handler_trm!=NULL) (*handler_trm)(sig);
break;
}
case SIGINT: {
log_debug(Caught SIGINT: Scheduling a shutdown);
if (stopping==true) {
log_error(Shutdown or reload already scheduled);
} else {
stopping=true;
}
if (handler_int!=NULL) (*handler_int)(sig);
break;
}
case SIGHUP: {
log_debug(Caught SIGHUP: Scheduling a reload);
if (stopping==true) {
log_error(Shutdown or reload already scheduled);
} else {
stopping=true;
doreload=true;
}
if (handler_hup!=NULL) (*handler_hup)(sig);
break;
}
default: {
log_debug(Caught unknown signal %d,sig);
break;
}
}
}
So, from the text I would assume SIGINT and SIGTERM should perform the 
same shutdown behavior, but you can try to use

kill -s SIGTERM pid
or
kill -s SIGINT pid
and see what results you get.  If it isn't behaving correctly then you 
need to maybe

1) You might want to make sure you don't have the serialization of 
session turned off some how...is it behaving correctly if you don't use 
jsvc?

2) You are using the right tomcat class to start it up...surely or you 
should get an errorI would imagine anywaysso  maybe forget 
this altogether.

3) You might want to search the tomcat source code for the Daemon 
implementer class and locate the method stop to see if you can figure 
out if it is being called.  It should be I would imagine since tomcat is 
stopping, but if it is not, then I guess it's a Daemon/jsvc error and 
you need to talk to that list. On another note same subject.You can 
look in the daemon src at the file /src/native/unix/native/java.c and 
you could put some code into the java_stop function to see if you can 
figure out if the function is going to call (through jni) the Daemon 
stop method correctly or not.  REMEMBER: The Daemon startup code does 
not force the class used as a Daemon to actually implemnt the interface 
through source code, but the class can simply have the correct 
methods.only know this because of the source code not any 
docsdon't know if Tomcat does this or not.

4) You might look in your jsvc error file...where ever you have put it 
and look for the text 'Cannot stop daemon' or 'Cannot found Daemon 
Loader stop entry point'that mis type of Cannot foundis really 
in the logging of the 1.0 release source code.  Because even though you 
get this text and tomcat goes awaythe method to stop may not have 
been found and the jsvc process is going to kill the JVM anyways.

Hope some of that helps
Wade
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: FW: j2sdk problems

2004-12-29 Thread Wade Chandler
Warron French wrote:
That's the problem, the j2sdk/jboss services fail after about a week and there 
is no log entries in the /var/log/mod_jk.log file.  Or anywhere else I 
mentioned in my original email.

Merry Christmas  Happy New Year!
Warron French
Sr. Network Engineer
Xtria, LLC
8045 Leesburg Pike #400
Vienna, VA 22182
Desk: 703-821-6110
Main: 703-821-6000
Fax:  703-827-0374
Do you have any information about your memory usage on your computer? 
Do you know which version of Tomcat it is in the JBoss distro?  Which 
version of mod_jk/2?

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


Re: Changing Stack Size in Tomcat 4.130

2004-12-29 Thread Wade Chandler
Sweta Kapadia wrote:
Hi,
How would I go about increasing the stack size in Tomcat? Im gettig a 
StackOverflowError, thanks in advance.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

A lot of times when I see this I think about a loop running out of 
control.  Are you getting this from tried and true code, and are you 
getting this when you are debugging (so to see what is going on)?  Maybe 
put in some logging and things before you have to rearrange the stack size.

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


Re: Changing Stack Size in Tomcat 4.130

2004-12-29 Thread Wade Chandler
Wade Chandler wrote:
Sweta Kapadia wrote:
Hi,
How would I go about increasing the stack size in Tomcat? Im gettig a 
StackOverflowError, thanks in advance.

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

A lot of times when I see this I think about a loop running out of 
control.  Are you getting this from tried and true code, and are you 
getting this when you are debugging (so to see what is going on)?  Maybe 
put in some logging and things before you have to rearrange the stack size.

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


That being a recursion loopbe sure you check for that.
Wade
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Query on Upgrade of tomcat 4.0.6 to 5.0.x

2004-12-27 Thread Wade Chandler
Murthy Tetali wrote:
Hi,
 
We would like to upgrade our production Tomcat Server from 4.0.6 to 5.0.x 
Our application is higly multi-threaded, having 2000 concurrent users. 
This Application is running on tomcat 4.0.6 from last 2 years without any problem.
 
I will be looking forward for your recommendation/suggestions for more 
stable tomcat 5.0.x version and is appreciated.
 
Thanks  Regards
 
Satish


-
Do you Yahoo!?
 Dress up your holiday email, Hollywood style. Learn more.
Well,
If I wasn't having any problems,and I did not have any real reason to 
upgrade then I would stay confortably where I am at.  If, however, you 
are doing this because you want to move up in the servlet spec or jsp 
spec, and have been planning on doing so then I would go ahead and move 
to 5.0.28 or .29.  I've been using 5.0.28 for a while now without 
having any issues.  I've been happy with it.

Of course I go by the adage:  If it isn't broken don't fix it.  So, if I 
didn't have any better reason to upgrade tomcat other than it's a newer 
version and I have been running happily for 2 years.I would stay 
right where I'm at.

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


Re: JVM Crash

2004-12-27 Thread Wade Chandler
Rodrigo Schmidt wrote:
snip
Local Time = Sun Dec 26 13:39:24 2004
Elapsed Time = 437787
#
# HotSpot Virtual Machine Error : 11
# Error ID : 4F530E43505002EF
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Server VM (1.4.2_06-b03 mixed mode)
#
/snip
From the logs it looks like some code is exploiting a bug in the JVM. 
The first place I would search is the JVM bug database...
http://bugs.sun.com/bugdatabase/index.jsp

See if you can find anything relative to the information given.  Also 
look for the error id.  The next thing to do if you do not find the bug 
is to report it.

You can find other options to fix the issue here:
http://bugs.sun.com/services/bugreport/index.jsp
Wade
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: JVM Crash

2004-12-27 Thread Wade Chandler
Wade Chandler wrote:
Rodrigo Schmidt wrote:
snip
Local Time = Sun Dec 26 13:39:24 2004
Elapsed Time = 437787
#
# HotSpot Virtual Machine Error : 11
# Error ID : 4F530E43505002EF
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Server VM (1.4.2_06-b03 mixed mode)
#
/snip
 From the logs it looks like some code is exploiting a bug in the JVM. 
The first place I would search is the JVM bug database...
http://bugs.sun.com/bugdatabase/index.jsp

See if you can find anything relative to the information given.  Also 
look for the error id.  The next thing to do if you do not find the bug 
is to report it.

You can find other options to fix the issue here:
http://bugs.sun.com/services/bugreport/index.jsp
Wade
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Looking at the bugreports it looks like you might try to drop the 
-server from your startup and see if you can at least stay up and 
running.  All the bug reports I saw for this error were caused by the 
server vm.

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


Re: JVM Crash

2004-12-27 Thread Wade Chandler
Rodrigo Schmidt wrote:
Hi Wade, thanks for your reply.
I already reported the bug, but they can take a long time to send an 
answer.
Searching the bug database I found some posts that reported the problem 
happening with the client vm as well.
I am considering trying another vm. I've just tested BEA JRockit 
1.4.2_05, but it seems that Jira doesn't like it that much, or 
vice-versa : )
So, does anyone has experience with Tomcat 5.0.x running on JDK 1.5? Are 
there performace/stability issues?
Thanks in advance,

Rodrigo
Wade Chandler wrote:
Wade Chandler wrote:
Rodrigo Schmidt wrote:
snip
Local Time = Sun Dec 26 13:39:24 2004
Elapsed Time = 437787
#
# HotSpot Virtual Machine Error : 11
# Error ID : 4F530E43505002EF
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Server VM (1.4.2_06-b03 mixed mode)
#
/snip
 From the logs it looks like some code is exploiting a bug in the 
JVM. The first place I would search is the JVM bug database...
http://bugs.sun.com/bugdatabase/index.jsp

See if you can find anything relative to the information given.  Also 
look for the error id.  The next thing to do if you do not find the 
bug is to report it.

You can find other options to fix the issue here:
http://bugs.sun.com/services/bugreport/index.jsp
Wade
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Looking at the bugreports it looks like you might try to drop the 
-server from your startup and see if you can at least stay up and 
running.  All the bug reports I saw for this error were caused by the 
server vm.

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

I'm not sure if version 5.0.x will run with JDK1.5 or not.  I think I've 
seen where it will not.  I might be wrong.  It might have been 5.5.x 
won't run on 1.4.x vms  If I were you I would try not specifying 
server and at least see how it behaves before I tried something else.

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


Re: Automated reply from bulletproof@www.bulletproofsoft.com

2004-12-22 Thread Wade Chandler
[EMAIL PROTECTED] wrote:
BulletProofSoft.com Support Ticket Reply.
DO NOT REPLY TO THIS EMAIL
Please use our Online Support system for faster results to your questions.
You can monitor the status of your ticket online where you can add follow up replies. 

http://www.bulletproofsoft.com/cgi-bin/custquest/quest_desk.cgi
If the URL above splits into two lines, please visit:
http://www.bulletproofsoft.com/support.html 

and click on the Contact Customer Support link
Rest assured we will do our best to respond to your query promptly. 
You will receive a further email notification when one of our technicians has replied.

Tech Support
BulletProofSoft.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Now only if the employees had bullet proof minds.  Who in their right 
mind signed up to a mailing list with their tech support email address? 
 :-)  Seriously though, you need to unsubscribe this email address and 
use a different one.

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


Re: Scripts

2004-12-22 Thread Wade Chandler
Charles P. Killmer wrote:
I am trying to write a function in a script file and having a lot of
trouble.
%
function String test() {
return test;
}
out.print(test());
%
Is there a way to do this without using a class?  Also along these lines
would something like this be possible.
%
function void test() {
%
This should just be echoed to the screen.
%
}
test();
%
Thanks for any help
Charles Killmer
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Don't confuse java/jsp with javascript.  Unless you have a special 
container that supports java script in the language parameter for the 
page context.

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


Re: Tomcat/JVM crashes on Linux

2004-12-21 Thread Wade Chandler
Greg Lappen wrote:
That's a good idea, I'm going to try that.  Its a cheap way to confirm  
or deny my suspicions.

Thanks!
On Dec 21, 2004, at 9:20 AM, Eric Rotick wrote:
I've not tried this myself but you could add a Runtime.addShutdownHook
and get it to print out anything which will give you a clue.
On Tue, 21 Dec 2004 08:47:49 -0500, Greg Lappen [EMAIL PROTECTED]  
wrote:

Well, turns out the RAM is fine in the server.  Our hosting provider
tested it last night and said it checked out fine.  Is there any other
reason that the JVM/Tomcat would just exit like this?  Could
System.exit() be called somewhere?  Isn't there a way to prevent
System.exit() from being called?  I know I'm grasping at straws, but
what else is there to do in this situation?
Greg
On Dec 20, 2004, at 1:57 PM, Eric Rotick wrote:
I had a similar problem with an almost identical setup to yours which
turned out to be bad memory. An extra 1GB stick was added which had a
bad section in the top of the memory map. This memory only got used
when things got busy so everyone suspected some threading issue. We
got lucky and spotted something totally absurd in the logs which
prompted a memtest86 run and hey presto we got our answer.
On Mon, 20 Dec 2004 13:28:56 -0500, Wade Chandler
[EMAIL PROTECTED] wrote:
Greg Lappen wrote:
Hello-
Has anyone had a problem with Tomcat 5.0.28 crashing on Linux 
with  no
error messages?

My production server running with JDK 1.4.2_06, RedHat EL 3.0 just
crashes, no core dump, no errors in catalina.out, no clues.
Sometimes
it goes for days, sometimes it happens several times in one day.  I
am
running the tomcat process behind Apache 2 with mod_proxy.  Setting
ulimit -c unlimited in the catalina.sh startup file still did not
produce a core file.
If nobody else has experienced this, do you have any suggestions on
how
to debug it further?
Thanks,
Greg
--- 
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:  [EMAIL PROTECTED]


I'm using the same setup as you less Apache2.  I use tomcat as the  
web
server.  Using TC5.0.28 and JDK1.4.2_06, and I have yet to have the
server crash once.  Not much help, but might give you some clues  
where
to look.

Connector log (mod_proxyassuming you mean you're using the new
connector code)is there anything in the Apache2 log?  I assume
from
your post you mean that the java process just completely goes away.
You
might find (depending on the running directory of the java process
running tomcat) a pid dump log file or something...not sure if the  vm
produces one of these or not.  You also might check in
/var/log/messages
file to see if for some reason the kernel or some lib got some error
it
logged.
Wade
 -
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]

Yoav would be able to answer this much better than I, but you should be 
able to modify the security settings of Tomcat to not allow that call 
from any of the web apps.  I think tomcat has it's own policy file, and 
you can also add your own policies to only allow the call from certain 
code bases.  In the java docs for the jdk 1.4.x look up Policy file 
and from there you'll find all kinds of information on permissions and 
code security.  You can limit only certain jar files specifically to be 
able to call this method.  Which Tomcat 5.0.x might already do thisI 
haven't actually tried to tell you the truth.

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


Re: [OT] Java developer friendly Linux distro

2004-12-21 Thread Wade Chandler
Nat Gross wrote:
Antony Paul wrote:
Hi all,
  Which distro (free) is most friendly for Java development. I need
J2SE 1.4.2 to work on it plus Eclipse 3.x(Linux dont have a good text
editor in which I can run Ant builds).
I use JEDIT for quick simple editing of files, and Eclipse for the real 
stuff. A great combination. I would not advise using JEDIT instead of 
Eclipse but I don't want to start a war now.
Although I am currently using Fedora Core 2, I am looking to upgrade, 
and the folks in various Linux/Unix newsgroups are pushing me towards 
the new Solaris 10, free from Sun. (My main Eclipse work though, for 
now, is still on a WinXP machine.)
fwiw,
-nat

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

I have tried Solaris on intel over the past recent years, and I love 
Sun, but my gripe with Solaris on intel is lack of drivers.  Look at 
CentOS or White Box Linux (www.centos.org and www.whiteboxlinux.org 
respectfully) if you like Red Hat as they are free and use the Red Hat 
source SRPMs with only stripping out the RH branding, so they are 
Advanced and Enterprise RH for free using the same source code.  SuSE is 
also very good.  I am using 9.1 at the moment.  You can purchase SuSE9.2 
Professional for 90.00US and get like 7-8 cd's and a DVD with all kinds 
of nice applications.  I've been happy with all the ones I've mentioned. 
 I run Tomcat on all of them, I use Netbeans 4.0 without issue on all 
of them, and have been developing java on all of them for years.  SuSE 
has been using the 2.6 kernel since their 9.1 release.  I've been 
pleased with it.  I've got some friends who like the Debian based 
distros.  To install a VM on them download the non RPM version of the 
install.  That's about it really.

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


Re: How to run servlet for every 30 minutes in Tomcat 4.1.30

2004-12-21 Thread Wade Chandler
Shilpa Nalgonda wrote:
Hi,
I am using Tomcat4.1.30 version.
I have to develop a client application which looks in the database every 30
minutes,
to retrieve the status of an order and send the status to the remote client.
Again waits for the
The client's response and insert the repsonse back to the database.
I wanted to do this in a servlet, so is there any way that i could run this
servlet automatically inside the
Tomcat container, or is it configurable in servlet mapping? if so can
someone please suggest me with examples...
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Wellit's kind of not extremely clear what you are asking, but why 
does the servlet need to do anything except listen for a client which is 
threaded to do this every 30 minutes, in other words...why not have the 
servlet do what it naturally does...sit there and get hit by client 
requestsget the infoand send it back?  I mean...the servlet 
can't push to the client unless you want to use something besides http, 
or unless you are using servlets on both ends and http servers on both 
ends.  You could use keep alives I guess.I wouldn't thoughonly 
so many tcp/ip connections.

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


Re: Why is tomcat (java) so memory intensive?

2004-12-21 Thread Wade Chandler
Dakota Jack wrote:
Why, then, does the Tomcat 5.0 say in the RELEASE-NOTES JAVAC leaking
memory is an issue?
On Tue, 21 Dec 2004 16:06:13 -, Allistair Crossley
[EMAIL PROTECTED] wrote:
i think (from memory) it had to do with registering requests with jk. anyway, 
like i say, upgrade and you'll see that leak go away i am pretty sure.

-Original Message-
From: Allistair Crossley
Sent: 21 December 2004 16:00
To: Tomcat Users List; [EMAIL PROTECTED]
Subject: RE: Why is tomcat (java) so memory intensive?
you are right, tomcat 5.0.19 did have a memory leak. some
dispute it, but it is there, i had it also and used a
profiler to show it. you should upgrade to 5.0.28.


Thanks,
Jack
That's during compilation.  I always setup tomcat to fork when compiling 
jsp.  That means it runs a seperate process to compile pages.  I do this 
in both production and testing.  I just like the feeling it gives me :-P 
...  well it's just better to not worry about it for me.  The bug is 
supposed to be gone in 1.4.2, but I still fork.

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


Re: Tomcat/JVM crashes on Linux

2004-12-20 Thread Wade Chandler
Greg Lappen wrote:
Hello-
Has anyone had a problem with Tomcat 5.0.28 crashing on Linux with no 
error messages?

My production server running with JDK 1.4.2_06, RedHat EL 3.0 just 
crashes, no core dump, no errors in catalina.out, no clues.  Sometimes 
it goes for days, sometimes it happens several times in one day.  I am 
running the tomcat process behind Apache 2 with mod_proxy.  Setting 
ulimit -c unlimited in the catalina.sh startup file still did not 
produce a core file.

If nobody else has experienced this, do you have any suggestions on how 
to debug it further?

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

I'm using the same setup as you less Apache2.  I use tomcat as the web 
server.  Using TC5.0.28 and JDK1.4.2_06, and I have yet to have the 
server crash once.  Not much help, but might give you some clues where 
to look.

Connector log (mod_proxyassuming you mean you're using the new 
connector code)is there anything in the Apache2 log?  I assume from 
your post you mean that the java process just completely goes away.  You 
might find (depending on the running directory of the java process 
running tomcat) a pid dump log file or something...not sure if the vm 
produces one of these or not.  You also might check in /var/log/messages 
file to see if for some reason the kernel or some lib got some error it 
logged.

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


Re: Tomcat/JVM crashes on Linux

2004-12-20 Thread Wade Chandler
Greg Lappen wrote:
What kind of load does your application handle?  I am not processing a 
HUGE amount of requests, but we server about 6000 visitors a day, 15,000 
pages.

Greg
On Dec 20, 2004, at 1:28 PM, Wade Chandler wrote:
Greg Lappen wrote:
Hello-
Has anyone had a problem with Tomcat 5.0.28 crashing on Linux with no 
error messages?
My production server running with JDK 1.4.2_06, RedHat EL 3.0 just 
crashes, no core dump, no errors in catalina.out, no clues.  
Sometimes it goes for days, sometimes it happens several times in one 
day.  I am running the tomcat process behind Apache 2 with mod_proxy. 
 Setting ulimit -c unlimited in the catalina.sh startup file still 
did not produce a core file.
If nobody else has experienced this, do you have any suggestions on 
how to debug it further?
Thanks,
Greg
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

I'm using the same setup as you less Apache2.  I use tomcat as the web 
server.  Using TC5.0.28 and JDK1.4.2_06, and I have yet to have the 
server crash once.  Not much help, but might give you some clues where 
to look.

Connector log (mod_proxyassuming you mean you're using the new 
connector code)is there anything in the Apache2 log?  I assume 
from your post you mean that the java process just completely goes 
away.  You might find (depending on the running directory of the java 
process running tomcat) a pid dump log file or something...not sure if 
the vm produces one of these or not.  You also might check in 
/var/log/messages file to see if for some reason the kernel or some 
lib got some error it logged.

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

No where that load on the system I wrote about though it stays up and I 
haven't rebooted the system or restarted the process in a good number of 
days.  It's only in the hundreds a day.

I have another application which runs over http using rpc with 
serialized classes, and it processes quite a bit of information, plus it 
spawns it's own threads.  It uses apache and/or iis as the front end. 
Though if it were up to me we would only be using tomcat.  We were using 
an ISAPI c++ application for everything at one time.  We are adding more 
and more functionality to it.  I'm sure it uses more process and memory 
resources as it will run backend import processes, a ton of logic 
processing, and report generation, and the pure nature of the 
application will have more hits a day with more fire power per hit than 
your web site.  In testing it hasn't crashed.

What are your memeory settings for your tomcat process?  If you don't 
give the process enough memory to do what it has to do it won't be able 
to behave correctly.  Though catalina.out should show you out of memory 
errors like that.  Have you used any testing environment to profile the 
system and gathered any information about the state of the machine when 
it will crash?  Have you been able to reproduce the issue with any valid 
results yet?  I'd be asking myself how best to do this.

You can write a simple application to test your web application, or you 
could purchase some software to hit a bunch of web pages.  Basically you 
can spawn a bunch of threads from a given machine randomly hitting 
different links and try to reproduce the issue if you don't have any 
real hard logic there to test.  Do you have any application logic in 
your site?  If so, do you perform any logging or anything of that 
nature?  You may be getting some exception you could have caught and 
logged yourself like an out of memory error before tomcat barfed out.

Something obviously has to be happening for the process to just go away. 
 Do you have to use Apache2 as a front end to the application?  If not 
see if you are able to produce the same issue using only tomcat.  Be 
sure you edit your memory settings for tomcat.  Don't try to run it in 
128MB of memory or something like that. ulimit is fine as far as linux 
goes, but you still need to be sure and not have any limits on the JVM. 
 For instance, the default value for -Xmx is 64 which means 64 mega 
bytes.

Depending on how much memory you have on your computer you probably want 
to up this (orin your case you definitely want to up this).  With 
that many hits you may very well be getting enough hits at the same time 
during the busy moments of the day to crash you out as I'm not sure how 
tomcat will behave if it is hammered and doesn't have any room to play. 
 You can add something like (granted you aren't already using -Xmx)
JAVA_OPTS=$JAVA_OPTS -Xmx1000m

to your catalina.sh file so that you can give

Re: Olen joululomalla, palaan 4.1.2005

2004-12-17 Thread Wade Chandler
[EMAIL PROTECTED] wrote:
I will be out of the office starting  17.12.2004 and will not return until
04.01.2005.

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

we.. I guess we have to put up with this until the new 
year ay.  People...if you are on a mailing list.don't setup 
automatic replies unless you can filter out where they get sent.  ...   :-(

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


Re: Olen joululomalla, palaan 4.1.2005

2004-12-17 Thread Wade Chandler
Mark Thomas wrote:
No worries. I'll kick them off the list.
Mark
 


-Original Message-
From: Wade Chandler [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 17, 2004 9:30 PM
To: Tomcat Users List
Subject: Re: Olen joululomalla, palaan 4.1.2005

[EMAIL PROTECTED] wrote:
I will be out of the office starting  17.12.2004 and will 
not return until
04.01.2005.


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

we.. I guess we have to put up with this 
until the new 
year ay.  People...if you are on a mailing list.don't setup 
automatic replies unless you can filter out where they get 
sent.  ...   :-(

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

Yeah I normally wouldn't say something if it happened a couple of times, 
but his message says this will be happening until April of 2005.   Thanks.

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


Re: Tomcat Administration Application

2004-12-10 Thread Wade Chandler
Kelly, Steve wrote:
I've just installed Tomcat 5.5.4. I also downloaded the separate Tomcat
Administration application. But when I click the Tomcat Administration
button I still get the message saying the web application is no longer
installed by default. From the Tomcat manager it says that application
'admin' is running. What else do I need to do to get into it ?
 
TIA,
 
Steve.

Well, I assume that first page you are talking about is static, so it 
has no idea about the management app.  You could probably find and 
modify the link, and the other thing is from your manager application 
find the context for the admin app and type in 
http://yourservername:yourport/contextname

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


Re: Performace differences when running application in Tomcat and JBuilder

2004-12-09 Thread Wade Chandler
Alex Pointer wrote:
I have a problem to do with the performance of a server process I 
developed when used in Tomcat, in comparison with running it in JBuilder X

I have a JAR file that is the server process, that when a method is called 
from Tomcat takes 35 seconds to run, while the same method called in 
JBuilder X takes 12.5 seconds

Why does Tomcat take over twice as long to run the same code as when run 
from JBuilder X, and is there a way I can make Tomcat run the code faster?

Any help, explanation would be appreciated
Details can be found bellow:
The complexities of the method are:
- using a Oracle JDBC Thin driver, it will connect to a remote 
Oracle database over a 10Mbit connection and run a single SELECT query 
that will return 85 records. (The SELECT query is always the same)
- each record in the resultset will have a object created that 
represents it (each record has 129 fields).
- the record is copied out of the resultset and into the object by 
using the meta-data provided with the resultset to identify the correct 
setter method for the correct field for each record.
- the resultset is kept open during the entire action and is 
passed with its cursor set to each object that then populates itself.
- after each object is populated the resultset cursor is moved to 
the next record.
- this is done in a single thread (one object after the other), 
and stored in an array of objects.
- the array of objects are then returned by the method.

The first and last line of the called method are logging the current time.
To run this method in Tomcat (I have tried versions 4.1.24, 5.0.18, 
5.0.28, 5.5.4)
I write a web application that I deploy as a .war file in the webapps 
directory.
I copy the JAR file into the shared\lib folder, because it need to be 
accessed by more than one web application.
When a link on the website is clicked it calls the server process. 
(because I am only looking at the times within the server process any 
delay caused by the webapp calling the server process is ignored).
It takes the same amount of time (to within a few milliseconds) every time 
the link is clicked, so the compilation of any files cannot be causing the 
problem.

To run this method in JBuilder X
I run a main method in a separate project that has the JAR file added into 
its Included Libraries.
(I assume running this way is the same as running it directly to the JVM 
at the command line)
The code is run automatically.

Both Tomcat, and JBuilder X are running on the same Windows 2000 machine, 
and no error or exception is reported during the execution.
***
This email has originated from Steria Limited, Registration No: 2706218.

Privileged, confidential and/or copyright information may be contained in this 
email, and is only for the use of the intended addressee. To copy, forward, 
disclose or otherwise use it in any way if you are not the intended recipient 
or responsible for delivering to him/her is prohibited.
If you receive this email by mistake, please advise the sender immediately, by 
using the reply facility in your email software.
We may monitor the content of emails sent and received via our network for the 
purposes of ensuring compliance with policies and procedures.
This message is subject to and does not create or vary any contractual 
relationships between Steria Limited and the recipient.
Office registered at: Three Cherry Trees Lane, Hemel Hempstead, Hertfordshire, 
HP2 7AH
www.steria.co.uk
**
Well, I don't know anything about your method other than it is code.  Do 
you yield in your code?  Do you sleep for any amount of time in your 
code?  Threading can influence the time it takes to run code.  Also, 
even though you may not yield in your code, it is still being run in 
another thread.  On the JVM there is nothing else happening in your 
process.  Are you timing from the beginning of the method to the end, or 
is your timing in different locations throughout the code?  You really 
need to offer as much information as you can possible think of when you 
start getting into questions like: Why does this code take X amount of 
time when run in this process vs this process?  Give all the details and 
you might get a better answer, but I can certainly tell you threading in 
a process will affect the timing of a section of code.

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


Re: Problem with Sessions...is this a Tomcat bug?

2004-12-09 Thread Wade Chandler
Gabriel Belingueres wrote:
Hi,
I just discovered a weird thing:
I have a Tomcat 4.1.12 running in my machine, which is called
ale2000, and I test my app using http://localhost:8080/xx as the
url (not the machine name configured in Windows)
When some of the html page make a request to the app, using
http://ale2000:8080/xx, Tomcat creates other session object,
instead of reusing the same session originally created when I call it
the first time using http://localhost:8080/xx
Is this behavior correct?
Doesn't it better to create other session based on different IP
addresses, instead of different machine names?
TIA,
Gabriel
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Well think about what you are asking, and think how session work. 
Sessions either have to work from URL rewriting or from cookies.  URL 
rewriting stinks (personal opinion), and cookies work on domains.  So 
basically you're limited to web technologies.  You could use URL 
rewriting, but I don't like that.

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


Re: Apache locks up

2004-12-09 Thread Wade Chandler
Dola Woolfe wrote:
Everything is locked up, including the static resources!
		
__ 
Do you Yahoo!? 
The all-new My Yahoo! - What will yours do?
http://my.yahoo.com 

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

Ok,
I guess what I meant to ask is.  Do you use a context for Tomcat, and is 
everyting from that context served through tomcat, or is the static 
content served through Apache?  Can you access some static image file 
from some where other than the context path of your webapplication? 
Other than that you'll need to put up different logs.  One the apache 
log file, two tomcat, and three the connectors log file.  Those might help.

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


Re: Apache locks up

2004-12-09 Thread Wade Chandler
Dola Woolfe wrote:
--- Wade Chandler [EMAIL PROTECTED] wrote:

Dola Woolfe wrote:
Everything is locked up, including the static
resources!
		
__ 
Do you Yahoo!? 
The all-new My Yahoo! - What will yours do?
http://my.yahoo.com 



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

Ok,
I guess what I meant to ask is.  Do you use a
context for Tomcat, and is 
everyting from that context served through tomcat,
or is the static 
content served through Apache?  Can you access some
static image file 
from some where other than the context path of your
webapplication? 
Other than that you'll need to put up different
logs.  One the apache 
log file, two tomcat, and three the connectors log
file.  Those might help.

Wade


You know, I will follow an earlier advice and switch
from 1.2.* and 3.3.* to 2.0.* and 5.5.*; Why be
several years behind?
Dola
		
__ 
Do you Yahoo!? 
Send holiday email and support a worthy cause. Do good. 
http://celebrity.mail.yahoo.com

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

I use 5.0.28 right now.  I'm waiting on 5.5.x to stabilize a bit more 
myself.  It's just a precaution that I take.  I haven't had any issues 
out of 5.0.28, and I actually use it for my web server and java server. 
 I have gotten rid of httpd (Apache) all together.  I do use Apache2 
sometimes as a forward proxy.  I can hide multiple machines behind one 
domain that way.  I am happy with Tomcat as my web server.  Plus my 
configuration is much simpler.

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


Re: Classloading issue

2004-12-09 Thread Wade Chandler
Yu, John wrote:
Hi,
I'm using Struts plugin, however, I think the issue mostly related to Tomcat
ClassLoading.
I have a class (in a jar) under WEB-INF/lib, which loads properties from 
a file located under WEB-INF/classes. 

 ClassLoader cl = getClass().getClassLoader();
 InputStream stream = cl.getResourceAsStream(plugin.properties);
I have tried different versions of path, with the results I couldn't totally
explain:
1. plugin.properties: not work
2. WEB-INF/classes/plugin.properties: work
3. /WEB-INF/classes/plugin.properties: not work
4. /plugin.properties: not work
Also, I'm using Tomcat 4.0.6 (NB3.5.1). Does anyone have an answer
for this? Is / bad? It may apply to Tomcat 5 as well, isn't it?
Regards,
John

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it. 

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

Me and another gentleman had this conversation just a little while 
ago...well one similar to it.  I always have a package which I put my 
files in.  I never have a problem doing that.  I always use 
Class.class.getResourceAsStream and getResource (should be roughly the 
same...usage is a little different).  I have a web app that has multiple 
installations on the same server and they always find their files.  But, 
I always use a package so I can access the files that way.  I quit using 
an empty package for everything when I started having goofy problems 
with different app servers.  I run into the same thing on Oracle 9iAS once.

/plugin.properties
and
plugin.properties
Are very different when you are using ClassLoader.getResource(AsStream), 
and the same thing applies to Class.getResource(AsString)...see java 
docs.  Again, I never have a problem, and I load property files from 
under the classes directory all the time.

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


Re: Classloading issue

2004-12-09 Thread Wade Chandler
Yu, John wrote:
Wade,
Thanks for sharing. When you say using package, you mean
for resource files?
One specific thing you didn't mention is where the calling
class is located. In my case, it's a class from within a 
jar in lib. That really made the difference. My 
conclusion so far is similar: when using /, CL could
make a big difference. Better stay away from it?

Regards,
John

-Original Message-
From: Wade Chandler [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 09, 2004 4:31 PM
To: Tomcat Users List
Subject: Re: Classloading issue
Yu, John wrote:
Hi,
I'm using Struts plugin, however, I think the issue mostly 
related to Tomcat
ClassLoading.
I have a class (in a jar) under WEB-INF/lib, which loads 
properties from 

a file located under WEB-INF/classes. 

ClassLoader cl = getClass().getClassLoader();
InputStream stream = 
cl.getResourceAsStream(plugin.properties);
I have tried different versions of path, with the results I 
couldn't totally
explain:
1. plugin.properties: not work
2. WEB-INF/classes/plugin.properties: work
3. /WEB-INF/classes/plugin.properties: not work
4. /plugin.properties: not work
Also, I'm using Tomcat 4.0.6 (NB3.5.1). Does anyone have an answer
for this? Is / bad? It may apply to Tomcat 5 as well, isn't it?
Regards,
John

The contents of this e-mail are intended for the named 
addressee only. It
contains information that may be confidential. Unless you 
are the named
addressee or an authorized designee, you may not copy or 
use it, or disclose
it to anyone else. If you received it in error please 
notify us immediately
and then destroy it. 


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

Me and another gentleman had this conversation just a little while 
ago...well one similar to it.  I always have a package which I put my 
files in.  I never have a problem doing that.  I always use 
Class.class.getResourceAsStream and getResource (should be 
roughly the 
same...usage is a little different).  I have a web app that 
has multiple 
installations on the same server and they always find their 
files.  But, 
I always use a package so I can access the files that way.  I 
quit using 
an empty package for everything when I started having goofy problems 
with different app servers.  I run into the same thing on 
Oracle 9iAS once.

/plugin.properties
and
plugin.properties
Are very different when you are using 
ClassLoader.getResource(AsStream), 
and the same thing applies to Class.getResource(AsString)...see java 
docs.  Again, I never have a problem, and I load property files from 
under the classes directory all the time.

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


The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it. 

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

Using the / on the classloader call will be like trying to access a file 
on your root drive or your / directory on *nix.  But yes, I usually put 
my properties files in a folder under classes and access them that way 
just like accessing a file on the classpath...even though they are 
files.  Under classes I'll have a com/redesetgrow directory and I'll put 
config files in there.

Yes I use a class from one of my packages that I know will only be with 
my webapp.  I always use the full classpath path to the resource and use 
a class instead of a ClassLoader.  I always do 
com.redesetgrow.util.io.IO.class.getResource(/com/redesetgrow/config.properties);
or
com.redesetgrow.util.io.IO.class.getResourceAsStream(/com/redesetgrow/config.properties);

I always use that full path because a certain vm had a weird bug that 
bit me before (java 1.3 on IBM AIX using Oracle 9iAS got me like that 
one time).  So I used the full path thing and the class call and that 
did the trick for me.  Since then just out of habit I use that call, and 
the full path, and I never have problems.  I figure it helps me not 
forget anything, plus I just use one method of getting resources on the 
classpath.  To me it's more readable now.  Using the / at the front 
tells that call to not replace the slashes with .'s when it goes to find 
my file.  Not putting the / in the front would make the call replace all 
the / with .'s.  Another cool thing about that is I have one resource 
class I use for looking up everything since I use the full classpath 
to the resource.  Though it won't work well for relative paths.

My favorite

Re: I don't know what's wrong.

2004-12-08 Thread Wade Chandler
Peter Crowther wrote:
From: Phillip Qin [mailto:[EMAIL PROTECTED] 
If you want to test the MySQL connectivity, make sure that 
MySQL server
allows your IP to remote login otherwise you will have to 
GRANT PRIVILEDGE.

The original poster specified MSSQL noy mySQL.  Two irritatingly close
acronyms, I agree!
- Peter
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

This is quoted from his orginal post:
I am running mysqld, but as far as I know... the mysqld isn't 
supporting ANY websites yet.

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


Re: I don't know what's wrong.

2004-12-08 Thread Wade Chandler
Warron French wrote:
Wade that was true originally, but I also stated that I recently discovered the 
data was being housed on a MS MSSQL database.
I am very sorry for the confusion.
Merry Christmas  Happy New Year!
Warron French
Sr. Network Engineer
Xtria, LLC
-Original Message-
From: Wade Chandler [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 08, 2004 10:51 AM
To: Tomcat Users List
Subject: Re: I don't know what's wrong.
Peter Crowther wrote:
From: Phillip Qin [mailto:[EMAIL PROTECTED] 
If you want to test the MySQL connectivity, make sure that 
MySQL server
allows your IP to remote login otherwise you will have to 
GRANT PRIVILEDGE.

The original poster specified MSSQL noy mySQL.  Two irritatingly close
acronyms, I agree!
- Peter
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


This is quoted from his orginal post:
I am running mysqld, but as far as I know... the mysqld isn't 
supporting ANY websites yet.

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

That's ok.  I just saw another email that I had not noticed where you 
said MSSQL instead of MySQL.  No problem.

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


Re: I don't know what's wrong.

2004-12-07 Thread Wade Chandler
Warron French wrote:
I can tell you that JBoss is indeed running but I don't know how it is 
configured, I would assume that I don't need a different version of JBoss 
installed if I am running different versions of Apache.

Merry Christmas  Happy New Year!
Warron French
Sr. Network Engineer
Xtria, LLC
8045 Leesburg Pike #400
Vienna, VA 22182
Desk: 703-821-6110
Main: 703-821-6000
Fax:  703-827-0374
-Original Message-
From: Phillip Qin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 07, 2004 4:37 PM
To: 'Tomcat Users List'
Subject: RE: I don't know what's wrong.
Jboss is an application server (EJB container). Do you have any EJB
application installed? Tomcat renders the pages. Those pages are the front
end of your EJB application.

-Original Message-
From: Warron French [mailto:[EMAIL PROTECTED] 
Sent: December 7, 2004 4:35 PM
To: Tomcat Users List
Subject: RE: I don't know what's wrong.

So, how does JBoss fit into the whole situation?
Merry Christmas  Happy New Year!
Warron French
Sr. Network Engineer
Xtria, LLC
8045 Leesburg Pike #400
Vienna, VA 22182
Desk: 703-821-6110
Main: 703-821-6000
Fax:  703-827-0374
-Original Message-
From: Phillip Qin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 07, 2004 4:34 PM
To: 'Tomcat Users List'
Subject: RE: I don't know what's wrong.
Mod_jk is the bridge between Apache and Tomcat. Consult jk 1.x documentation
on how to configure it.
Mysqld is the MySQL daemon on linux. Many websites use MySQL along with
Apache and PHP.
-Original Message-
From: Warron French [mailto:[EMAIL PROTECTED] 
Sent: December 7, 2004 4:22 PM
To: User Tomcat (E-mail)
Subject: I don't know what's wrong.

We have a JBoss application?  That uses .jsp files to interact with a
supposedly searchable database.
Can someone explain to me the concepts behind Tomcat, mod_jk, JBoss, and
Apache, and if maybe I am missing something like the database.
I am running mysqld, but as far as I know... the mysqld isn't supporting ANY
websites yet.
Here is my url I am trying to get to work.  I really don't know enough to
figure out what is missing and what I need to be done.
http://www.nrcitcw.org/nrcitcw/SearchCategory.jsp
I can send snippets of my Virtual Host config from my apache server if
anyone is willing to help me.
please.  This is driving me nuts.  It was implemented before I knew it
existed.

Merry Christmas  Happy New Year!
Warron French
Sr. Network Engineer
Xtria, LLC
8045 Leesburg Pike #400
Vienna, VA 22182
Desk: 703-821-6110
Main: 703-821-6000
Fax:  703-827-0374
-
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]
!DSPAM:41b621f721551697314170!
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

JBoss.org sells full documentation.  I would suggest purchasing a copy 
if you are going to have to support it.  www.mysql.org has all the stuff 
you need to know and understand about that.  Tomcat has a set of docs. 
Apache has pretty good documentation.  That's the first place I would 
start.  The biggest pieces of your setup if you don't know anything 
about databases, java servers, and apache are going to be configuring 
your database, setting up JBoss (tomcat itself is pretty easy), and 
configuring the communication link between apache and tomcat.

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


Re: Slightly OT: Yet another IE woe...

2004-12-07 Thread Wade Chandler
Robert Hunt wrote:
Weider still, I comment out only the user-data-constraint tag and the 
download works fine; no-cache http headers are still in place.  So, it may be 
something with https, but how?
-- RH
- Original Message - 
From: rh
To: tc-u
Sent: Tuesday, December 07, 2004 10:42 PM
Subject: Slightly OT: Yet another IE woe...

Under Tomcat 5.0.25, I've got a web-app creating a file on-the-fly.  I've 
got the servlet surrounded by the following security constraint:
--
 security-constraint
  web-resource-collection
   url-pattern/registration/file.xls/url-pattern
  /web-resource-collection
  auth-constraint
   role-name20040490/role-name
  /auth-constraint
  user-data-constraint
   transport-guaranteeCONFIDENTIAL/transport-guarantee
  /user-data-constraint
 /security-constraint
--

Without the security constraint, IE (6.0) can save the file just fine.  With 
the constraint, IE gags with the error the file could not be written to 
cache.  I noticed that Tomcat was adding these items to the HTTP response:
| 20041207220031203043 | contentLength| -1
| 20041207220031203043 | contentType  | application/vnd.ms-excel
| 20041207220031203043 | hdr.Cache-Control[0] | no-cache
| 20041207220031203043 | hdr.Content-Type[0]  | application/vnd.ms-excel
| 20041207220031203043 | hdr.Date[0]  | Wed, 08 Dec 2004 
03:00:31 GMT
| 20041207220031203043 | hdr.Expires[0]   | Wed, 31 Dec 1969 
19:00:00 EST
| 20041207220031203043 | hdr.Pragma[0]| No-cache
| 20041207220031203043 | hdr.Server[0]| Apache-Coyote/1.1
| 20041207220031203043 | hdr.Transfer-Encoding[0] | chunked
| 20041207220031203043 | status   | 200

How can one get IE to download a file, over a HTTPs connection without 
having to strip the no-cache headers?   Is there a way or will I have to 
filter the no-cache headers?



There was in at least one version of IE a bug when the stream was too 
large in an https request.  I ran into this with somethings I was doing 
at one time.  Does it work if you try it over an http url?

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


Re: Apache locks up

2004-12-06 Thread Wade Chandler
Dola Woolfe wrote:
Hi
I'm using Tomcat 3.4 (I think) with Apache 1.2x (I
think) and a mod_jk.dll.
When someone bombards my servlet from a WXP machine
then my Apache server stops responding to that machine
for about 5 minutes. During that span of time, going
to myserver:8080/mywebapp still works!
This does not happen when the bombardment takes place
from a W2K machine.
By bombardment I mean about 1000 sequential requests.
Any ideas on what is going on?
Thank you very much!
Dola Chin
		
__ 
Do you Yahoo!? 
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250

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

Maybe in your connector setings you don't have enough connections 
permitted for the communication between apache and tomcat?  Or is 
everything on the Apache server locked up?  i.e. Can you get to static 
resources you know are being served by Apache?

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


Re: Tomcat/Java and SMP

2004-12-03 Thread Wade Chandler
Dan Foreman wrote:
10 application servers. 

-Original Message-
From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 03, 2004 6:53 AM
To: Tomcat Users List
Subject: Re: Tomcat/Java and SMP

Dan,
U have 10 application servers on one machine or 10 application on 10 
distinct machines ?
Dan Foreman wrote:
Hi,
I have a setup of 10 application servers using Tomcat 4/5, jsdk 
1.4.2_02, SMP, win2k.  In watching the performance under load I am 
concerned that only one CPU is being utilized at a time.  To validate 
my theory I try hitting the application server with a request to 
generate a large report and then making another connection.  The 
second connection is painfully slow and task manager only reports a 
50% CPU utilization.  After doing some reading on SMP/native threads 
and windows, I wrote a test java application that spawns n infinite 
loop threads from a single JVM with a delay between each creation.  
Sure enough one cpu (task manager reporting
50%) and then the other cpu are consumed (task manager reporting 
100%).  This test tells me that Java is capable of using both CPU's via native threading and some black magic in the windows dll's
but that this scenario isn't happening in tomcat.
Is it possible for tomcat to use more than one CPU or is there a critical flaw 
in my logic?
-Dan
-
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]

Hmm do you mean you have 10 webapps and/hosts?  To me application 
servers means you are running multiple instances of tomcat which means 
you should have 10 different java.exe processes running.

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


Re: Tomcat/Java and SMP

2004-12-03 Thread Wade Chandler
Dan Foreman wrote:
Yes, 10 separate boxes with a single JVM (tomcat instance) running on each box. 
 All boxes are SMP.
-Original Message-
From: David Boyer [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 03, 2004 12:32 PM
To: [EMAIL PROTECTED]
Subject: RE: Tomcat/Java and SMP

So these are 10 separate boxes?
 
I think the clarification is necessary because application server in the context of java usually refers to the J2EE or (sometimes)
servlet container. Are you taling about 10 instances of tomcat each running on their own box?


[EMAIL PROTECTED] 12/3/2004 11:20:55 AM 

10 application servers. 

-Original Message-
From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED]
Sent: Friday, December 03, 2004 6:53 AM
To: Tomcat Users List
Subject: Re: Tomcat/Java and SMP
Dan,
U have 10 application servers on one machine or 10 application on 10 
distinct machines ?
Dan Foreman wrote:
Hi,
I have a setup of 10 application servers using Tomcat 4/5, jsdk 
1.4.2_02, SMP, win2k.  In watching the performance under load I am 
concerned that only one CPU is being utilized at a time.  To validate

my theory I try hitting the application server with a request to 
generate a large report and then making another connection.  The 
second connection is painfully slow and task manager only reports a 
50% CPU utilization.  After doing some reading on SMP/native threads

and windows, I wrote a test java application that spawns n infinite 
loop threads from a single JVM with a delay between each creation.
Sure enough one cpu (task manager reporting
50%) and then the other cpu are consumed (task manager reporting 
100%).  This test tells me that Java is capable of using both CPU's
via native threading and some black magic in the windows dll's but that 
this scenario isn't happening in tomcat.
Is it possible for tomcat to use more than one CPU or is there a
critical flaw in my logic?
-Dan

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

Hmm.  I would write a small test to hit my http url to cause tomcat to 
fire up more threads just to get a feel for it.  Also maybe make a JSP 
page and call Runtime.getRuntime().availableProcessors() and print that 
to the screen and see how many processors the JVM thinks it has 
available.  You might want to loop for something like 30seconds reading 
this number every few milliseconds in your jsp page and print out all 
unique values.  You could then hit tomcat server multiple times by some 
client your write.  Write a simple java app that spawns off multiple 
threads and have each thread record it's own findings from the jsp page. 
 This could give you some insight as to whether it is working right or 
not.  I would make the jsp page for a starter and let it run 30 seconds 
and record unique values and see what I end up with.  Maybe then you can 
change it up to see how many times the value changes if you find you get 
weird results.

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


Re: Moving from 4.1.27 to 5.0.28?

2004-12-01 Thread Wade Chandler
Bjørn T Johansen wrote:
I am thinging of upgrading our prod Tomcat server from 4.1.27 to 5.0.28 
(or is 5.5.4 a safer bet?) and I was wondering if there would be any 
problems when upgrading?
Anything particular I should think of?

Regards,
BTJ
Personally I'm using 5.0.28 and I love it.  I usually wait a couple of 
iterations after a major release like 5.5.x because of new things and 
bugs.  5.5.x is a rewrite of a bunch of underlying code said to improve 
performance, stabilization, and TOC.  I usually give them time to air 
out some bugs, so I might switch to 5.5.x around 5.5.7/8/9 something 
like that.  That's just a personal measure from my own experience with a 
code base and major changes.  As far as being stable, I haven't had to 
restart Tomcat 5.0.28 in a long time.  Not sure the number of days, but 
it's in the months, and that was just because of having to reboot the 
computer.

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


Re: Moving from 4.1.27 to 5.0.28?

2004-12-01 Thread Wade Chandler
Shapira, Yoav wrote:
Hi,
I'd say go to 5.0.28 first.  One major revision at a time ;)
TOC?  Table of Contents?  

Yoav Shapira http://www.yoavshapira.com
 


-Original Message-
From: Wade Chandler [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 01, 2004 8:35 AM
To: Tomcat Users List
Subject: Re: Moving from 4.1.27 to 5.0.28?
Bjørn T Johansen wrote:
I am thinging of upgrading our prod Tomcat server from 4.1.27 to 5.0.28
(or is 5.5.4 a safer bet?) and I was wondering if there would be any
problems when upgrading?
Anything particular I should think of?
Regards,
BTJ
Personally I'm using 5.0.28 and I love it.  I usually wait a couple of
iterations after a major release like 5.5.x because of new things and
bugs.  5.5.x is a rewrite of a bunch of underlying code said to improve
performance, stabilization, and TOC.  I usually give them time to air
out some bugs, so I might switch to 5.5.x around 5.5.7/8/9 something
like that.  That's just a personal measure from my own experience with a
code base and major changes.  As far as being stable, I haven't had to
restart Tomcat 5.0.28 in a long time.  Not sure the number of days, but
it's in the months, and that was just because of having to reboot the
computer.
Wade
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Total ownership cost.  I guess that should have been TCO. Total cost of 
ownership.  :-P.  That was one of the things the tomcat web site said 
about Tomcat 5.5.  I assume that means it has some improvements to the 
manager and the administrator...?, or is the TCO reduction or assumed 
reduction a result of it being more stable with better performance, so 
lower resources are needed?

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


Re: weird tomcat5.0.30 behaviour with jar in WEB-INF/classes

2004-12-01 Thread Wade Chandler
Simone Pierazzini wrote:
Hi,
I use URLClassLoader to create class loaders that manage jars in WEB-INF/classes
In WEB-INF/classes I have many jars that are incompatible each other
(they have different classes with the same name inside).
Suppose I want to load the following files as resources from a classLoader:
- pippo.txt
- pippo.jar
In the first case I tried the line:
classLoader.getResource(pippo.txt) 

and correctly the returned URL was:
 file:/ ... /myapp/WEB-INF/classes/pippo.txt
where ... stands for $CATALINA_HOME
while, trying to get the second file:
classLoader.getResource(pippo.jar)
tomcat returned the following url:
 file:/ ... /work/Catalina/localhost/myapp/loader/pippo.jar
but the directory ... /work/Catalina/localhost/myapp/loader/ does
not contain pippo.jar
that is placed in  .../myapp/WEB-INF/classes/pippo.jar
thanks in advance
Simone Pierazzini
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

I never try to use relative paths in getResource.  I always do this 
getResource(/pippo.jar);  Also, I usually pick a class in my package 
that I know will certainly be in my web-app classes folder or one of 
it's jars.  This way the classloader used for my call will know about my 
objects and classes at it's levelso it doesn't make delegate 
calls...and I use com.mydomain.mypackage.MyClass.class.getResource 
instead of using the classloader call though that should not matter

Maybe try to prepend a / to that file name.  Read the javadoc 
documentation for the method Class.getResource to understand the / 
before the name of the file.  Anyways, I always use the 
Class.getResource call as I mentioned above and I never have 
problemsI also am sure to use the / to make it an absolute 
classpath.  Read those java docs to understand more.

Hope you have some luck with that.
Wade
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: weird tomcat5.0.30 behaviour with jar in WEB-INF/classes

2004-12-01 Thread Wade Chandler
Simone Pierazzini wrote:
On Wed, 01 Dec 2004 09:49:33 -0500, Wade Chandler
[EMAIL PROTECTED] wrote:

I never try to use relative paths in getResource.  I always do this
getResource(/pippo.jar);  Also, I usually pick a class in my package
that I know will certainly be in my web-app classes folder or one of
it's jars.  This way the classloader used for my call will know about my
objects and classes at it's levelso it doesn't make delegate
calls...and I use com.mydomain.mypackage.MyClass.class.getResource
instead of using the classloader call though that should not matter

asking resources to classes or classloaders is the same thing:
absolute paths for classes are relative paths for classloaders so the
following lines are equivalent:
com.mydomain.mypackage.MyClass.class.getResource(/xx.txt)
com.mydomain.mypackage.MyClass.class.getClassLoader().getResource(xx.txt)
I pick a class in my package too: if you pick another class you don't
know which classloader you 're using (common/shared/ etc.)
bye
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Right, thought you were creating your own URLClassLoader instance to 
locate your jars dynamically (not getting the current).  Barring that 
and looking at your post and then looking at one of Yoavs, then my guess 
is the ClassLoader in tomcat is for what ever reason doing something like:
if( name.endsWith(.jar) )
{
   //resolve to the home work dir.
}

regardless of the directory being lib or classesseems like a bug to 
me as any file in the classpath should just be a file as a jar file 
should have to be added to the classpath like it's a directory.

Anyways, are the file names hard coded in your app?  You can always come 
up with your own file name extension to work around the issue I suppose. 
 A jar is a jar by any other name .zip, .foo, .mar (?)  What ever...the 
point I guess is the class loader for what ever reason is resolving on 
purpose the .jar ext instead of checking first if the file is under lib 
or a sub dir.  So you should be able to just rename the file ext unless 
for some reason you have an app that has to have the .jar on the end. 
The jar classes should still work against files with different ext.

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


Re: Can I send response to browser even after the doGet returned?

2004-11-27 Thread Wade Chandler
Santhosh Thomas wrote:
Or, are you trying to run some long-running process and think it would 
be better off as it's own thread? If that's the case, you probably want 
to look into some sort of queueing mechanism with either status polling 
or some sort of callback when the task is complete. Again, more details 
would be helpful. 

No my process is not time consuming. It will finish in milliseconds and in the worst case can take a few seconds.  I am not spawning a thread from each servlet request, but the request processor is another independent thread(started at  web init) proecssing a queue of requests. I am only putting the request into the queue from doGet(). After putting into queue, the doGet() returns.  The request processor thread then forms the response and tries to flush the output later. My experience is, sometimes I get the output in the browser, sometimes not. I thought it was a broser catching problem (I am not sure..).  
I cant do a polling in the servlet, bacause it will block my servlet. 

Has there any way to implement asynchronous request/response using servlets?
thanks and regards
Santhosh

-
 Couple of things... 

No, I don't believe you can do anything with request/response after you 
exit doGet(). Well, let me amend that... you MIGHT be able to get away 
with it, but I wouldn't expect it to work all the time. What I mean is, 
once your servlet is done it's work, the container takes over again, and 
even if you do have a valid reference to the object, I wouldn't expect 
that you could make any safe assumptions about the state of that object. 
You might get away with it sometimes, but probably not every request. 

The other point I wanted to make is that there is a pretty standard rule 
against spawning threads to service requests. Simply stated, you aren't 
supposed to do it. The container is supposed to spawn threads as 
appropriate to service requests, and if your doing it on your own you 
are more or less competing with the container. Bad Things (tm) tend 
to happen under those circumstances. 

I'm not really sure what you are trying to accomplish, but I'm taking a 
guess that you think that by spawning the threads you will be able to 
handle more requests concurrently. If that's not the case, please 
explain you goals further. 

But, assuming that is correct, I think you may have a fundamental 
misunderstanding at work... A servlet is supposed to be thread-safe, and 
the reason for that is that the container will spawn as many instances 
of it as needed to service requests (to whatever configured limits there 
are of course). In other words, every request essentially has it's own 
thread executing your servlet, hence the need for it to be thread-safe. 

In other words, you spwaning threads is superfluous because the 
container is already doing essentially what your trying to do on your 
own. So, just make sure your code is thread-safe, and your fine. 

Or, are you trying to run some long-running process and think it would 
be better off as it's own thread? If that's the case, you probably want 
to look into some sort of queueing mechanism with either status polling 
or some sort of callback when the task is complete. Again, more details 
would be helpful. 

As I said, I'm making assumptions here, so I could be completely wrong! 

Why can't you just perform your work?   The request processor already 
has your request at the time of doGet.  If you are not using 
multi-threading to perform some special type of task then you should 
have no problem.  It sounds like you haven't used servlets and jsp's 
very much because if you are simply building the return to a get request 
you just perform your work from your servlet method doGet or doPost and 
that is really all there is to it.  It shouldn't be any more complicated 
than that other than maybe something like...if variable this then do 
this...hand off to another class to process and add to the request or 
you use another framework that handles passing the request to the 
correct method depending on some form variable or something like that. 
That's it.you shouldn't be appending to the request queue yourself 
as that is already done for you by tomcat.  Standard jsp/servlet 
container operation.

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


Re: JDBC

2004-11-23 Thread Wade Chandler
Charles P. Killmer wrote:
Looking for concensus on how people, with much more experience than I
have, use to connect to SQL Server 7.  I have been planning on using
Datadirect's JDBC Connect until I saw the price tag for a server.  

So with that does any body have a preferred JDBC connector to SQL Server
7?
Any help is greatly appreciated.
Thanks
Charles
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Don't know about 7, but for 2000 I use the JDBC driver from Microsoft in 
our applications and it seems to work fine.  They have one for 
unix/linux and one for windows.  You can go to the SQL Server website. 
It might work with a version 7 servernever tried.  It's a free 
download.  Also, jTDS works good as long as you don't use a - in your 
database name.

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


testing my account please ignore.

2004-10-22 Thread Wade Chandler
Testing my account.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: apache problem

2004-10-07 Thread Wade Chandler
Nandish Rudra wrote:
Hi,
I am running Apache 2.0.49 and Tomcat 5.0.28 on RedHat 9.0. The users are
unable to get the images when using the link
http://test.test.net/images/test.gif but can get to it using
http://test.test.net:8080/images/test.gif. I am new to Apache and would
appreciate some help.
Regards,
Nandish Rudra
ECI Conference Call Services, LLC
Phone: (973) 796-5043
Cell: (732) 794 5362
Email: [EMAIL PROTECTED]
Email2: [EMAIL PROTECTED]

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

You need to read up on modjk2 first I guess.  That will start you on a 
path to understanding the purpose of each server in this context.  If 
you don't have a reason to use Apache and Tomcat together you could just 
use Tomcat soley.  Either way.  I use Tomcat by itself on some servers 
and I've been very happy with it.

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


Re: [OT] Webapp upgrades and browser caching

2004-10-07 Thread Wade Chandler
Justin Ruthenbeck wrote:
I'm looking for some advice about how to handle the following situation.
(1) Apache 2.x in front of Tomcat 5.x
(2) Deploy new web application.  Bunch of servlets, bunch of jsps, bunch 
of static content (mainly js, css).
(3) Many users use the application, during which time their browsers 
cache lots of static content
(4) We do a major version upgrade of the webapp, including (almost) all 
new static content, but URLs stay the same (to alleviate 
bookmark-maintenance requirements).

The problem arises when the browsers continue to use their cached 
version of the static content.  Now, the browsers eventually get 
updated, but immediately after deployment there are huge numbers of 
graphical and functional (js files) problems.  It seems like behavior in 
this area is widely different amongst browsers and/or their settings.

I have only come up with the following option:
(1) Play with URLs.  New deployments can be deployed under
a different url domain like:
http://www.server.com/myapp/v1/main.css
http://www.server.com/myapp/v2/main.css
This would force browsers to get new content since the
content appears as totally new content to the browser.
Aside from disabling static content caching, are there any other options 
out there?

Much thanks for the help!
justin

__
Justin Ruthenbeck
Lead Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential. See:
http://www.nextengine.com/confidentiality.php
__
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

For static web pages you can use a tag like this:
META HTTP-EQUIV=EXPIRES CONTENT=TUE, 2 OCT 1998 12:42:00 GMT
If the browsers still have a problem you might be able to configure 
Apache to output a header will all content called EXPIRES.  I think you 
can if I remember right from some docs I read.  You will have to look at 
Apache for that.  I'm not sure about tomcat being able to handle that or 
not, but the apache bit should prepend the header I believe.  The only 
other way would be to output all images and static pages from a servlet 
of some kind and add the header yourself to the request.  Browsers 
should honor that tag or header for all images down the line from your 
html or jsp pages, but may not.

Some browsers may be able to be set to ignore this all together though. 
 Sometimes it is even worse than that.  I have seen ISP's who think 
they are slick who install a cache in their systems, and they basically 
become a proxy for the users.  If they are ignoring such things your 
users would have to contact them.  I have seen some who do this for 
different protocols even http and https differently.  That one irked me 
pretty good.

Anyways, I use expires in all my jsp and html files.  I haven't ever 
tried the other stuff for the headers from Apache, but think I remember 
reading about it in the Apache docs.  I have output that header from 
servlets and ISAPI dlls before.

Someone else may be able to offer more help.
Wade
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Which version of Tomcat and Apache for my UNIX sparc Computer?

2004-09-26 Thread Wade Chandler
Daxin Zuo wrote:
My computer:
#uname -a
SunOS sunbox 5.8 Generic_108528-17 sun4u sparc SUNW, Sun-Blade-100
I see the latest Apache for my computer is
   httpd-2.0.43-sparc-sun-solaries2.8.tat.gz
  What Tomcat and Tomcat-connector should I use with this version of Apache?
Please help.
Thanks.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

IMHO there is no good reason why you shouldn't use the latest release of 
Tomcat.  As far as connectors go you'll either have to get some binaries 
built from someone else with a Solaris box with the version of apache or 
build them yourself from the source.

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


Re: AW: Tomcat Hanging up !!!

2004-09-23 Thread Wade Chandler
Steffen Heil wrote:
Hi

If I install Apache 2.0 and Tomcat 4.1 and use mod_jk that is compatible
for that I don't what issues will be raised by that.
Right, that is why I suggest using tomcat ONLY.
This works, and even when tomcat 3.2.1 might be slower that ibm_httpd,
tomcat 5.0 is really fast and is at almost at the level of apache.
Just put tomcat 5 on a test mashine, put your app in and test, you will see,
this works within a few minutes!
Regards,
  Steffen
I only use Tomcat any more except cases where I have to run some other 
things on certain servers.  Tomcat 5 branch.  I haven't had any issues yet.

Wade

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


Re: java.util.zip.ZipException: Permission denied

2004-09-15 Thread Wade Chandler
Shilpa Nalgonda wrote:
When i restart tomcat 4.1 server i am getting this error any clue of why we
get this...
Using CATALINA_BASE:
 /usr/share/tomcat4
Using CATALINA_HOME:   /usr/share/tomcat4
Using CATALINA_TMPDIR: /usr/share/tomcat4/temp
Using JAVA_HOME:   /usr/local/j2sdk1.4.2_03
java.util.zip.ZipException: Permission denied
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.init(ZipFile.java:112)
at java.util.jar.JarFile.init(JarFile.java:127)
at java.util.jar.JarFile.init(JarFile.java:65)
at
org.apache.catalina.loader.StandardClassLoader.addRepositoryInternal(Standar
dClassLoader.java:1082)
at
org.apache.catalina.loader.StandardClassLoader.init(StandardClassLoader.ja
va:200)
at
org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoader
Factory.java:202)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:140)
Bootstrap: Class loader creation threw exception
java.lang.IllegalArgumentException: addRepositoryInternal:
java.util.zip.ZipException: Permission denied
at
org.apache.catalina.loader.StandardClassLoader.addRepositoryInternal(Standar
dClassLoader.java:1110)
at
org.apache.catalina.loader.StandardClassLoader.init(StandardClassLoader.ja
va:200)
at
org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoader
Factory.java:202)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:140)
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

It sounds like some of the jar files being added to the classpath do not 
have permissions for the user tomcat is being ran as.

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


Re: Fatal: relocation error: file libapr-0.so.0: symbol __divdi3: referenced symbol not found

2004-09-03 Thread Wade Chandler
Jonathan Rengifo wrote:
I made the test with succesful results, I guess it is a linking
problem, but don't know how to solve it..
On Fri, 03 Sep 2004 16:18:13 -0400, John Villar
[EMAIL PROTECTED] wrote:
Try to make a small java test (without tomcat) that use the unix sockets
and see what happens maybe you can debug it and find what/where is
happenning
Jonathan Rengifo escribió:


Hi, all...
My problem is definitive related with the libjkjni.so lib, when I add
the path of the library to the LD_LIBRARY_PATH I get the error
message:
ld.so.1: /usr/java/bin/java: fatal: relocation error: file
/usr/local/apache-httpd-2.0.50/lib/libapr-0.so.0: symbol __divdi3:
referenced symbol not found
But, when take this path out of the LD_LIBRARY_PATH the error
disappears, but also disappears the AF_SOCKET support of the
connector, and got this message:
INFO: APR not loaded, disabling jni components: java.io.IOException:
java.lang.UnsatisfiedLinkError: no jkjni in java.library.path
Because of this error I did put the libjkjni.so lib on the LD_LIBRARY_PATH...
Any suggestions??
Regards
Jonathan

On Fri, 3 Sep 2004 11:50:11 -0400, Jonathan Rengifo [EMAIL PROTECTED] wrote:

Hi, thanks for your very important help..
I ran the ldd utility on the libapr-0.so.0 lib, with the following results:
/usr/local/apache-httpd-2.0.50/lib ldd libapr-0.so.0
  libsendfile.so.1 =  /usr/lib/libsendfile.so.1
  librt.so.1 =/usr/lib/librt.so.1
  libm.so.1 = /usr/lib/libm.so.1
  libsocket.so.1 =/usr/lib/libsocket.so.1
  libnsl.so.1 =   /usr/lib/libnsl.so.1
  libresolv.so.2 =/usr/lib/libresolv.so.2
  libpthread.so.1 =   /usr/lib/libpthread.so.1
  libdl.so.1 =/usr/lib/libdl.so.1
  libc.so.1 = /usr/lib/libc.so.1
  libaio.so.1 =   /usr/lib/libaio.so.1
  libmd5.so.1 =   /usr/lib/libmd5.so.1
  libmp.so.2 =/usr/lib/libmp.so.2
  libthread.so.1 =/usr/lib/libthread.so.1
  /usr/platform/SUNW,Sun-Fire-V210/lib/libc_psr.so.1
  /usr/platform/SUNW,Sun-Fire-V210/lib/libmd5_psr.so.1
Then I  those libs for the symbol, and don't find it... What does this mean?
Thanks ..
Jonathan

On Fri, 3 Sep 2004 10:01:01 -0500, QM [EMAIL PROTECTED] wrote:

On Fri, Sep 03, 2004 at 10:44:13AM -0400, Jonathan Rengifo wrote:
: nm /usr/local/apache-httpd-2.0.50/lib/libapr-0.so.0 | grep div
: [337]   | 0|   0|FUNC |GLOB |0|UNDEF  |.div
: [640]   | 0|   0|FUNC |GLOB |0|UNDEF  |.udiv
: [909]   | 0|   0|NOTY |GLOB |0|UNDEF  |__divdi3
: [938]   | 0|   0|NOTY |GLOB |0|UNDEF  |__udivdi3
:
: So it seems that the problem is on the libapr-0.so.0 because there
: is the variable __divdi3 wich is reporting the relocation error
What happens when you run ldd on libapr-0.so.0, and skim those libs for
the symbol?
Note especially any libs that ldd claims it can't find.

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


--
John Villar
Gerente de Proyectos
Computadores Flor Hard Soft 2058 C.A.
www.florhard.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]

Are you building the .so youself, or did you get a binary from someone else?
Wade
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: RHEL 3.0, Tomcat 4.x and IPTables

2004-09-02 Thread Wade Chandler
Sean Finkel wrote:
Greetings all,
I had posted earlier about an issue with Tomcat hanging, and also 
holding Apache processes hostage. I have narrowed the problem down to 
some kind of conflict with Tomcat/JVM and IPTables on RedHat Enterprise 
Linux 3.0 ES.

When Tomcat hangs, what happens is, half the page is returned to the 
browser and the status bar sits at waiting for domain.com. As Soon as 
I issue service iptables stop the page finishes loading, and I cannot 
make any other pages half-load. Any apache process that were tied up 
waiting on tomcat stay hung though, and I have to either manually kill 
those PIDS or issue a SIGHUP to Apache. When only a few are hung, I kill 
them, as to not interrupt downloads for other users. However, when 92 
are hung, I just SIGHUP apache.

Obviously, this is an issue with not being able to run a firewall, as we 
don't have a hardware firewall in place.

Does anyone know what kind of interference/issue IPTables would be 
causing Tomcat? I will note, this one website is the only Host on this 
instance. We do also have another tomcat instance which hosts 3 other 
domains, and those never hang. I am starting to think it might be some 
of the customers code, though I am not sure what it would be as I am 
certainly not a Java guru. I have asked him if he contacts outside 
services in his code, but he has not replied yet. I doubt it is this as 
I have started the firewall with ports 0-32767 open and it still hangs. 
Could this be some kind of memory collision between IPTables and Tomcat?

As well, this setup worked flawlessly under RH 9.0 and RH 7.3.
Just looking for ideas here, as this honestly makes no sense to me.
thanks!
-Sean Finkel
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

I would take a small machine and make a firewall out of that.  You pose 
yourself more of a security risk having your app server stuck on the 
same machine as your security.  I assume you are running your mail 
services and all on the same machine.  Probably not a good idea. 
Anyways, other than that are you getting any messages in /var/log files? 
 Maybe there is something being shared causing an issue.  On the Redhat 
lists there has been discussion about this.  It has something to do with 
 i686 kernel vs i586.  Search the redhat help lists about this.  As 
people haven't exactly fixed the issue, but there are work arounds 
available in the archives.

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


Re: Java process growth under Linux...leak?

2004-08-31 Thread Wade Chandler
Mark Maigatter wrote:
We have a Tomcat 5.0.25 based web site for uploading images and assorted
files and managing them.
 
We have found that the Java process that Tomcat is running under is
gradually growing when repetitively processing files uploaded and stripped
out of the form submissions by the Apache FileUpload component.  All signs
point to a memory leak?
 
Upon the submission of about 500 files we had a 31MB growth in the size of
the java process using top.  
 
However, the Sun Java jvmstat shows that the Java heap is staying relatively
constant.  The -gc numbers fluctuate in a manner that shows reasonable
garbage collection activity and the total used across the s0/s1/eden/old
stay with the range for the initial numbers.
 
My question is what would you recommend to isolate the process growth?
 
Is there a way within Java to see the underlying process growth to help
isolate it in the processing cycle?
 
--mark

How large were the files you were uploading?  I mean  you just said you 
uploaded 500 files.  You should expect to see process memory growth. 
The JVM has it's own object heap where it manages it's internal 
memory.  Then there is the process and it's memory which is a C heap.

I see that you uploaded 500 files.  Were these one right after the 
other, or were they close to simultaneous?  Also, how are you uploading 
the files?  Are you using some type of a parser?  Are you using the 
commons file upload control?  If the JVM reports good memory collection, 
then there is no memory leak in Tomcat.  31MB of growth for a process 
uploading 500 files shouldn't be that bad depending on how they were 
uploaded and file sizes.

Think about it. If the files were between 100kb and 60kb then you have a 
total of 30mb to 50mb of memory just in that data alone not including 
your application and other buffers you may or may not be creating while 
uploading.

For perforamnce reasons the VM isn't going to suddenly resize the heap 
as soon as it frees a group of java objects because as far as it knows 
you may come along and upload 50mb worth of data immediately after the 
first.  This is a performance thing.  Resizing the heap takes time and 
cpu resources and affects performance.  The VM will reuse this memory 
over and over again.

I would look at any loops I might have reading from the stream.  Do you 
create a bunch of small byte array's while uploading the files?  Maybe 
you could increase the buffer size, be sure to null them out after you 
perform a read to tell them VM you are done with the variable now (for 
when the vm collects), and then see if that affects the memory growth. 
  This should help speed the file upload a bit and get rid of some 
buffers in loops a little quicker if you aren't nulling the array.  If 
however you are simultaneously uploading much of this data, then a 31mb 
spike in memory usage shouldn't be a suprise no matter what.

Basically you can impose limits on the VM and you can use switches to do 
this.  You can also devote more memory to eden or survivor objects so 
that the VM can make better use of the most commonly used memory.  You 
can find more info on this topic and others at this url:
http://java.sun.com/docs/performance/
Many docs.  One for you might be:
http://java.sun.com/docs/hotspot/VMOptions.html
scroll down to the bottom and check out options:
-XX:NewRatio
-XX:NewSize
-XX:SurvivorRatio

Basically the defaults for the -server VM are to allow the best 
performance for a multi user multi threaded application such as tomcat. 
 So, unless you are running out of memory or you need to cripple the 
app servers performance by limiting it's growth because you have a bunch 
of other applications running on the same server, then I suggest 
sticking with the defaults.

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


  1   2   >