Apache-Tomcat on different machines

2002-04-24 Thread Adam Myatt

Hi,

Quick question - I checked the DOCS and Archive, but to no avail. I'm
looking to run Apache on 1 machine and Tomcat on another machine. Any quick
hints as to which config files I would need to modify? Thanks.

 - Adam


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: how to set env varible

2002-03-06 Thread Adam Myatt

Try:

JAVA_HOME=/usr/java
export JAVA_HOME


 - Adam

At 06:23 PM 3/6/02 -0500, you wrote:
I have redhat 7.2.
I am istalling tomcat which need an env varible JAVA_HOME point to JDK
I need to set an env varible JAVA_HOME point to directoy /usr/java

I did this by adding 2 line to etc/profile

JAVA_HOME=/usr/java:$JAVA_HOME
export JAVA_HOME

I used source profile, it's fine.
But I try to start tomcat, it gives me error message:
JAVA_HOME env varible is not defined 



Any suggetion?
Thanks

Jianping Zhu
Department of Computer Science
Univerity of Georgia 
Athens, GA 30602
Tel 706 5423900



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]





--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




JSPInterceptor Option Affecting Performance???

2002-02-12 Thread Adam Myatt

Greetings,

I have an interesting question that hopefully someone can answer.

I was reading the DOCs about JspInterceptor in server.xml and came upon
[what I thought] was a great concept. Setting the largeFile option to
true extracts the HTML and puts it in a separate .dat file. I thought this
was great since it made the .java's created smaller and in turn the
compiled class files smaller. After examining the code though, I see to do
this, it uses a char[][] called _jspx_html_data. I'm assuming this is bad
since using such a large data structure residing in memory would hinder
performance, especially if more than several files are doing so (and with
many simultaneous users as well).

 Does this indeed cause worse performance (as opposed to leaving
largeFile=false and therefore the HTML as out.print statements in the
class) or does the JVM garbage collector handle the cleanup after the
compiled JSP page is output to the browser.? I would appreciate it if
someone could clear this up and perhaps give me any ideas/info on real
pros/cons to doing it either way. Many thanks.

 - Adam

--
Tomcat 3.3
JDK: Sun Java 1.3.1
System: Wink2k SP2
---


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: Problems with a simple JSP and mySQL connect

2001-07-19 Thread Adam Myatt

To further expand on the last answer below: if you look at the MANUAL that
comes in the DOC folder of the MySQL installation, section 6.16 Causes of
Access Denied Errors:

'If you can't get your password to work, remember that you must use the
PASSWORD() function if you set the password with the INSERT, UPDATE, or SET
PASSWORD statements. The PASSWORD() function is unnecessary if you specify
the password using the GRANT ... INDENTIFIED BY statement or the mysqladmin
password command. See section 6.15 Setting Up Passwords. '

A sample would be:

insert into mysql.user
values('larry','root',password('larrys_password'),'Y','Y','Y',etc)

When you try to compare against the password field in mysql.user, the
password passed in is automatically encrypted and the encrypted value is
compared against whatever is in the mysql.password field. A more detailed
explanation is in section 6.15 Setting Up Passwords of the manual.

Hope that helps. Sorry if my answer was long and redundant, but I had this
same problem a while ago and it stressed me to the point where I don't want
anyone else to have to suffer it. :)

 - Adam


At 11:22 AM 7/19/2001 +0800, you wrote:

This is actually a mysql question.  What you can do as follows:

insert a row into mysql.user such that host = larry, user = root, password
= encrypted pwd (you can copy from the
existing row -- localhost | root | ... )

skc





RE: mysteriously dying connections (Oracle - tomcat)

2001-06-21 Thread Adam Myatt

Bill,

What if the V_$OPEN_CURSOR is not present in the SYS schema. Using the DBA
Studio, I looked through all the schemas and users and V_$OPEN_CURSOR
doesn't exist anywhere. Would it be under an alternative name?

 - Adam

At 08:32 AM 6/21/2001 -0700, you wrote:
These look like two different issues:

1) Oracle is running out of cursors.

  a) Make sure you close every ResultSet, Statement and Connection when
you're done with them.  One trick you can use on Oracle is to log into the
database in SQL*Plus as SYS while your application is running, and do,
   SELECT SQL_TEXT FROM V_$OPEN_CURSOR;
to see the SQL for the cursors you have open.

  b) Try reusing connections and (prepared) statements wherever possible
(assuming you use a common Oracle logon for all your accesses).

  c) Up the number of allowed open cursors, by putting
   open_cursors = 500
or so in your database's init.ora file.

2) Tomcat is running out of threads.

  Are you actually getting dozens of people connecting at the same time?
Try increasing the max_threads parameter for PoolTcpConnector in your
server.xml.

-- Bill K. 

-Original Message-
From: Jan M. STANKOVSKY [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 21, 2001 8:16 AM
To: [EMAIL PROTECTED]
Subject: Re: mysteriously dying connections (Oracle - tomcat)


Same here but we have the stopping of the tomcatserver very frequently.
At the end of the term when the students (aprox 50 working at the same time)
got very busy the tomcatserver
stoped replying frequently. We have a configuration with
 Two Sun Sparc Solaris 7 Servers both tomcat 3.2.1  3.2.2 and one Oracle817
Server on Soalris 7 

Once I traped this error:
--
2001-06-19 07:41:23 - ThreadPool: Pool exhausted with 100 threads.
2001-06-19 09:02:25 - ThreadPool: Caught exception executing
org.apache.tomcat.service.TcpWorkerThread@3598c3, terminating thread - 
java.lang.IllegalStateException
at org.apache.tomcat.util.ThreadPool.runIt(ThreadPool.java:227)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:405)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)
---

As you can see between 07:41:23  09:02:25 (the shutdown of the tomcat
server) there was no activity except angry students (times are pm).

And this:
-
2001-06-20 04:51:10 - Ctx( /a9303541 ): Exception in: R( /a9303541 +
/servlet/shop1 + null) - java.lang.NullPointerException
at shopmanager.init(shopmanager.java:16)
at shop1.init(shop1.java:14)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at
org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java:268)
at
org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:289)
at org.apache.tomcat.core.Handler.service(Handler.java:254)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)

2001-06-20 05:01:12 - ThreadPool: Caught exception executing
org.apache.tomcat.service.TcpWorkerThread@2c7887, terminating thread - 
java.lang.IllegalStateException
at org.apache.tomcat.util.ThreadPool.runIt(ThreadPool.java:224)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:405)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)

2001-06-20 05:01:12 - ContextManager: Removing context Ctx( /examples )


5:01:12 was the time where I shutdowned the tomcat server


I now shutdown/restart the server hourly and it seems we don't have
unsheduled stoppings.

Another thing is, that the servlets dont get refreshed when they are
changed/deleted (I have reload in server.xml)..


Thanks

jan



~|
~|problem:
~|
~|
~|database access is managed via a java class that is
~|instantiated and loaded into each clients session. every
~|PL/SQL function and/or SQL statement a client needs is
~|called in a method of this class.
~|first, a connection is opened, the statement is called,
~|all resultsets and statements are closed and finally the
~|connection is closed. (or returned back to the
~|connection pool if one is used)
~|
~|the driver we use is the Oracle jdbc ThinDriver (jdbc
~|driver type 4). after running the system for 

RE: mysteriously dying connections (Oracle - tomcat)

2001-06-21 Thread Adam Myatt


All right. I found the sql_text listing in the open cursor view. Is there a
sure fire way to have the cursors close when the servlet is done using
them. (And if so is using connection pooling and closing the recordset and
statement one way?)


At 07:33 PM 6/21/2001 +0300, you wrote:
 you can use v$parameter view for getting OPEN_CURSORS paremeter value. 
or in sql plus or svrmgrl type 
show parameter OPEN_CURSORS  
  -Original Message- 
From: William Kaufman [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, June 21, 2001 7:12 PM 
To: '[EMAIL PROTECTED]' 
 tomcat)  
  Eh,... It might have a different name on your version of Oracle, or be
under 
  Try running,   SELECT OWNER, VIEW_NAME 
 FROM ALL_VIEWS 
 WHERE VIEW_NAME LIKE '%OPEN%CURSOR%';   and see what pops up. 
 -- Bill K.-Original
Message- 
From: Adam Myatt [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, June 21, 2001 8:54 AM 
To: [EMAIL PROTECTED] 
 tomcat)  
  Bill,   What if the V_$OPEN_CURSOR is not present in the SYS schema.
Using the DBA 
Studio, I looked through all the schemas and users and V_$OPEN_CURSOR 
doesn't exist anywhere. Would it be under an alternative name?- Adam  
At 08:32 AM 6/21/2001 -0700, you wrote: 
These look like two different issues: 
 
1) Oracle is running out of cursors. 
 
  a) Make sure you close every ResultSet, Statement and Connection when 
  One trick you can use on Oracle is to log into the 
database in SQL*Plus as SYS while your application is running, and do, 
   SELECT SQL_TEXT FROM V_$OPEN_CURSOR; 
to see the SQL for the cursors you have open. 
 
  b) Try reusing connections and (prepared) statements wherever possible 
(assuming you use a common Oracle logon for all your accesses). 
 
  c) Up the number of allowed open cursors, by putting 
   open_cursors = 500 
or so in your database's init.ora file. 
 
2) Tomcat is running out of threads. 
 
  Are you actually getting dozens of people connecting at the same time? 
 parameter for PoolTcpConnector in your 
server.xml. 
 
-- Bill K.  
 
-Original Message- 
From: Jan M. STANKOVSKY [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, June 21, 2001 8:16 AM 
To: [EMAIL PROTECTED] 
 tomcat) 
 
 
Same here but we have the stopping of the tomcatserver very frequently. 
At the end of the term when the students (aprox 50 working at the same 
time) 
got very busy the tomcatserver 
stoped replying frequently. We have a configuration with 
 3.2.2 and one 
Oracle817 
Server on Soalris 7  
 
Once I traped this error: 
-- 
2001-06-19 07:41:23 - ThreadPool: Pool exhausted with 100 threads. 
2001-06-19 09:02:25 - ThreadPool: Caught exception executing 
org.apache.tomcat.service.TcpWorkerThread@3598c3, terminating thread -  
java.lang.IllegalStateException 
at org.apache.tomcat.util.ThreadPool.runIt(ThreadPool.java:227) 
at 
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:405) 
at 
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501) 
at java.lang.Thread.run(Thread.java:484) 
--- 
 
 09:02:25 (the shutdown of the tomcat 
server) there was no activity except angry students (times are pm). 
 
And this: 
- 
2001-06-20 04:51:10 - Ctx( /a9303541 ): Exception in: R( /a9303541 + 
/servlet/shop1 + null) - java.lang.NullPointerException 
   (shopmanager.java:16) 
   (shop1.java:14) 
at java.lang.Class.newInstance0(Native Method) 
at java.lang.Class.newInstance(Class.java:237) 
at 
org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java:268) 
at 
org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:289) 
at org.apache.tomcat.core.Handler.service(Handler.java:254) 
at 
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) 
at 
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:7 
9 
7) 
at 
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) 
at 
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(Http 
C 
onnectionHandler.java:210) 
at 
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) 
at 
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) 
at java.lang.Thread.run(Thread.java:484) 
 
2001-06-20 05:01:12 - ThreadPool: Caught exception executing 
org.apache.tomcat.service.TcpWorkerThread@2c7887, terminating thread -  
java.lang.IllegalStateException 
at org.apache.tomcat.util.ThreadPool.runIt(ThreadPool.java:224) 
at 
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:405) 
at 
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498) 
at java.lang.Thread.run(Thread.java:484) 
 
2001-06-20 05:01:12

RE: mysteriously dying connections (Oracle - tomcat)

2001-06-21 Thread Adam Myatt

I do something extremely similar to the code below but at the end I return
the connection to the connection pool. I do not at any tiem use
conn.close()... should I just close the connection instead of using
connection pooling? Would closing the connection instead of returning them
to the pool free up the cursors?


At 11:21 AM 6/21/2001 -0700, you wrote:
 Is there a sure fire way to have the cursors close when the servlet is
done using them. 

I haven't used connection pooling (it's too easy to write your own that does
what you want).

But the only sure-fire way to close your ResultSets and Statements is,...
call the close() method.  The safest way to do that is to use try/finally
blocks, like,

   Statement stmt = ...;
   try
   {
 ResultSet rs = stmt.executeQuery(...);
 try
 {
   // use the results,...
 }
 // catch whatever you want here
 finally
 {
   rs.close();
 }
   }
   // catch whatever you want here
   finally
   {
 stmt.close();
   }

-- Bill K. 

-Original Message-
From: Adam Myatt [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 21, 2001 9:51 AM
To: [EMAIL PROTECTED]
Subject: RE: mysteriously dying connections (Oracle - tomcat)



All right. I found the sql_text listing in the open cursor view. Is there a
sure fire way to have the cursors close when the servlet is done using
them. (And if so is using connection pooling and closing the recordset and
statement one way?)


At 07:33 PM 6/21/2001 +0300, you wrote:
 you can use v$parameter view for getting OPEN_CURSORS paremeter value.

or in sql plus or svrmgrl type 
show parameter OPEN_CURSORS  
  -Original Message- 
From: William Kaufman [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, June 21, 2001 7:12 PM 
To: '[EMAIL PROTECTED]' 
 tomcat)  
  Eh,... It might have a different name on your version of Oracle, or be
under 
  Try running,   SELECT OWNER, VIEW_NAME 
 FROM ALL_VIEWS 
 WHERE VIEW_NAME LIKE '%OPEN%CURSOR%';   and see what pops up. 
 -- Bill K.-Original
Message- 
From: Adam Myatt [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, June 21, 2001 8:54 AM 
To: [EMAIL PROTECTED] 
 tomcat)  
  Bill,   What if the V_$OPEN_CURSOR is not present in the SYS schema.
Using the DBA 
Studio, I looked through all the schemas and users and V_$OPEN_CURSOR 
doesn't exist anywhere. Would it be under an alternative name?- Adam  
At 08:32 AM 6/21/2001 -0700, you wrote: 
These look like two different issues: 
 
1) Oracle is running out of cursors. 
 
  a) Make sure you close every ResultSet, Statement and Connection when 
  One trick you can use on Oracle is to log into the 
database in SQL*Plus as SYS while your application is running, and do, 
   SELECT SQL_TEXT FROM V_$OPEN_CURSOR; 
to see the SQL for the cursors you have open. 
 
  b) Try reusing connections and (prepared) statements wherever possible 
(assuming you use a common Oracle logon for all your accesses). 
 
  c) Up the number of allowed open cursors, by putting 
   open_cursors = 500 
or so in your database's init.ora file. 
 
2) Tomcat is running out of threads. 
 
  Are you actually getting dozens of people connecting at the same time? 
 parameter for PoolTcpConnector in your 
server.xml. 
 
-- Bill K.  
 
-Original Message- 
From: Jan M. STANKOVSKY [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, June 21, 2001 8:16 AM 
To: [EMAIL PROTECTED] 
 tomcat) 
 
 
Same here but we have the stopping of the tomcatserver very frequently. 
At the end of the term when the students (aprox 50 working at the same 
time) 
got very busy the tomcatserver 
stoped replying frequently. We have a configuration with 
 3.2.2 and one 
Oracle817 
Server on Soalris 7  
 
Once I traped this error: 
-- 
2001-06-19 07:41:23 - ThreadPool: Pool exhausted with 100 threads. 
2001-06-19 09:02:25 - ThreadPool: Caught exception executing 
org.apache.tomcat.service.TcpWorkerThread@3598c3, terminating thread -  
java.lang.IllegalStateException 
at org.apache.tomcat.util.ThreadPool.runIt(ThreadPool.java:227) 
at 
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:405) 
at 
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)

at java.lang.Thread.run(Thread.java:484) 
--- 
 
 09:02:25 (the shutdown of the tomcat 
server) there was no activity except angry students (times are pm). 
 
And this: 
- 
2001-06-20 04:51:10 - Ctx( /a9303541 ): Exception in: R( /a9303541 + 
/servlet/shop1 + null) - java.lang.NullPointerException 
   (shopmanager.java:16) 
   (shop1.java:14) 
at java.lang.Class.newInstance0(Native Method) 
at java.lang.Class.newInstance(Class.java:237