web hosting software

2006-01-20 Thread Michal Kwiatek
Dear All,

Is it possible to download a complete java web hosting solution, i.e. software 
that would let me run a java web hosting service?
Do you know any particular vendor who offers such a solution?

Thanks in advance,
Michał.



 -Original Message-
 From: Chris Abajian [mailto:[EMAIL PROTECTED] 
 Sent: Friday, January 20, 2006 8:34 AM
 To: users@tomcat.apache.org
 Subject: Shutdown problem in Tomcat Version 5.5.12 (Protocol 
 handler pausefailed)
 
 A variant on many postings I've found, unfortunately none of 
 the remedies work.  Been googling furiously to no avail.  
 Surely tomcat on Fedora can't be this broken out of the box, can it?
 
 Problem:
 Tomcat fails to shut down in response to shutdown.sh script.  
 Hangs, eventually throws exception with dreaded Protocol 
 handler pause failed
 message.  I have tried both values for LD_ASSUME_KERNEL as 
 per release notes.  It changes the behavior slightly, but the 
 problem remains (more below).
 
 Environment:
 
 - A freshly built  updated fedora RC4 install: 2.6.14-1.1656_FC4
 
 - A completely unmodified Tomcat Version 5.5.12 - I untarred 
 it and ran it.
 
 - Sun's jdk1.5.0_06
 
 Repro:
 
 1) run startup.sh
 2) hit localhost:8080 in browser, works
 3) run shutdown.sh
 4) log shows:
 
 Jan 19, 2006 11:08:27 PM 
 org.apache.coyote.http11.Http11BaseProtocol pause
 INFO: Pausing Coyote HTTP/1.1 on http-8080
 
 It hangs for a minute or so, then throws:
 
 Jan 19, 2006 11:03:48 PM org.apache.catalina.connector.Connector pause
 SEVERE: Protocol handler pause failed
 java.net.ConnectException: Connection timed out
 at java.net.PlainSocketImpl.socketConnect(Native Method)
 at 
 java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
 at 
 java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
 at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
 at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
 at java.net.Socket.connect(Socket.java:507)
 at java.net.Socket.connect(Socket.java:457)
 at java.net.Socket.init(Socket.java:365)
 at java.net.Socket.init(Socket.java:207)
 at 
 org.apache.jk.common.ChannelSocket.unLockSocket(ChannelSocket.
 java:463)
 at 
 org.apache.jk.common.ChannelSocket.pause(ChannelSocket.java:270)
 at org.apache.jk.server.JkMain.pause(JkMain.java:679)
 at 
 org.apache.jk.server.JkCoyoteHandler.pause(JkCoyoteHandler.java:162)
 at 
 org.apache.catalina.connector.Connector.pause(Connector.java:1031)
 at 
 org.apache.catalina.core.StandardService.stop(StandardService.
 java:491)
 at 
 org.apache.catalina.core.StandardServer.stop(StandardServer.ja
 va:714)at 
 org.apache.catalina.startup.Catalina.stop(Catalina.java:586)
 at 
 org.apache.catalina.startup.Catalina.start(Catalina.java:561)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
 orImpl.java:39)
 at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
 odAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at 
 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275)
 at 
 org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
 
 Interestingly enough, lsof shows different behaviors 
 depending on the value of the LD_ASSSUME_KERNEL variable.  
 With no variable set, 
 
 # lsof -P | grep java | grep 8080
 java  6555   chris   10u IPv6 329120  
 TCP *:8080 (LISTEN)
 
 setting LD_ASSUME_KERNEL=2.2.5 results in about 40 threads 
 listening on the port (in the hung state):
 
 # lsof -P | grep java | grep 8080
 java  6652   chris   12u IPv6 331547  
 TCP *:8080 (LISTEN)
 java  6653   chris   12u IPv6 331547  
 TCP *:8080 (LISTEN)
 ...etc
 
 setting it to 2.4.1 yields the more entertaining:
 
 # lsof -P | grep java | grep 8080
 java  6779   chris  mem   REG  253,0   1465636
 4980808 /lib/obsolete/linuxthreads/i686/libc-2.3.5.so
 java  6779   chris   12u IPv6 334251  
 TCP *:8080 (LISTEN)
 java  6780   chris  mem   REG  253,0   1465636
 4980808 /lib/obsolete/linuxthreads/i686/libc-2.3.5.so
 java  6780   chris   12u IPv6 334251  
 TCP *:8080 (LISTEN)
 ...
 
 but the behavior is the same.
 
 This is awful, I'm losing faith.  I actually booted the XP 
 partition today...
 
 --
 Chris Abajian [EMAIL PROTECTED] thePlatform, Inc.
 (206) 839-0600 ext. 216
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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

RE: Absolute Guide for config of JDBC Connection Pool ?

2006-01-20 Thread g m
Agreed!   Simple no-nonsense description - I shall give it a 'whirl' .
   
  Thanks Len - your on my Xmas list ;-)

Durfee, Bernard [EMAIL PROTECTED] wrote:
  Excellent! That is the exact documentation that should be on the Tomcat
site. It would also be nice to see a quick description of how Tomcat
processes the sections, what exactly it does with the
attributes, so that other drivers and pools can be configured.

There are also other parameters that DBCP accepts...

http://jakarta.apache.org/commons/dbcp/configuration.html

Bernie Durfee 



 -Original Message-
 From: Len Popp [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, January 19, 2006 12:58 PM
 To: Tomcat Users List
 Subject: Re: Absolute Guide for config of JDBC Connection Pool ?
 
 
 I don't know if there's a complete top-to-bottom guide, but here's
 what I know from setting up connection pooling under 5.5.12:
 
 1. The JDBC driver JAR must go in the common/lib directory (because
 for connection pooling it needs to be accessible to both Tomcat and
 the web app).
 
 2. DBCP is built into Tomcat so you don't need to install a 
 JAR for that.
 
 3. The tag goes inside the tag for the web app,
 wherever it is (server.xml, webapps//META-INF/context.xml or
 conf/Catalina/localhost/.xml)
 Note that the syntax for has changed from earlier versions
 - see the Tomcat documentation. Here's a sample:
 
  type=javax.sql.DataSource
 auth=Container
 driverClassName=com.mysql.jdbc.Driver
 url=jdbc:mysql://localhost:3306/???
 username=???
 password=???
 maxIdle=15
 maxActive=50
 maxWait=1
 factory=org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory
 removeAbandoned=true
 removeAbandonedTimeout=60
 logAbandoned=true/
 
 The ??? bits are installation-dependent. Some of the parameters will
 be different for Sybase (driverClassName and url for sure).
 
 4. Yes, it is supposed to say ... .dbcp.dbcp ... in the 
 factory= line.
 
 5. The code to get a DB connection is:
 InitialContext initCtx = new InitialContext();
 DataSource ds = (DataSource) 
 initCtx.lookup(java:comp/env/jdbc/???);
 Connection conn = ds.getConnection();
 Make sure that jdbc/??? is the same here as in the tag.
 
 6. Always close the connection when you're done with it. Use a
 finally block to make sure.
 
 7. If you're trying to decide where to put the declaration,
 the choices are:
 - server.xml - Don't put it here. We're told it's bad.
 - webapps//META-INF/context.xml - If you put it here, it will be
 bundled up in the app's WAR file. That makes it easier to install, but
 harder to configure if every installation has different details for
 the database tag.
 - conf/Catalina/localhost/.xml - If you put it here, it's easier
 to edit the tag, but it's an extra file to be installed in
 addition to the WAR.
 
 Hope this helps. At least it's shorter than
 http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-exampl
es-howto.html.
:-)

On 1/19/06, g m wrote:
 There seems to be 'truckloads' of information on just as many forums
on how best to setup a JDBC connection pool, varying from which file to
put what entries (server.xml, context.xml, web.xml) etc

 It looks like the same questions be asked in a slightly different
fashion and for different environments.

 Does anyone happen to know where there is a definative guide on how
to do this and what jar files one needs ?... or does this sort of 'clean
doc' not exist ?

 FYI: My environment: Tomcat 5.5.9, Sybase, Windows .
 Many thanks!

--
Len

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

  



-
 Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews,  more on new 
and used cars.

Please consider this.

2006-01-20 Thread Jack
I have read your reply. It is valuable to me. Thanks.
May I suggest this idea:

 Server certificate:
  The certificate for the engine with alias tomcat
  The certificate for a specific host
  The certificate for a specific web-app
 If a web-app doesn't have a certificate, it can be configured to use the 
 certificate of the host. Similarly, if a host doesn't have a certificate, 
 it can be configured to use the certificate of the engine. However, when 
 a web-app has a certificate, then this one should be used rather than 
 always using tomcat.
 Pretty much a pipe-dream, since the SSL protocol requires that the server 
 send it's cert before it even knows the Host, much less the webapp :). 
 There is pretty much no other place it can go other than with the 
 Connector.
SSL component is a resource. The engine, virtual hosts, and web-apps are its 
users. The resource could ask a certificate from its current user. The 
engine is a subject, so it has a certificate in its own user context 
(EngineUserConext). Each host is a subject, too. They all have their 
respective certificates in their user contexts (HostUserConext). If a host 
doesn't have a certificate, the engine certificate could be used. Any 
web-app is a subject, too. Every web-app has its own certificate in 
WebAppUserContext. If a web-app doesn't have a certificate, it could use 
that of its host. Accessing all the information about a 
user/entity/subject/program should be done with UserManager which in turn 
will access the right UserContext. UserContext will access KeyManager  
TrustManager.



The SSL component should deal with UserManager to get information about its 
users (Engine/Host/Web-app), and authenticate web clients.



I have post another thread suggesting to add the UserManager component.



Thank you for consideration!



[EMAIL PROTECTED]






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



Re: Database Connectivity of JSP(Tomcat 4.x) with Oracle 8i

2006-01-20 Thread gupta vidhi
hello,
   
  i was searching Oracle 8i driver for jdk1.5, but not getting.i had downloaded 
classes12.jar from oracle.com and saved in my
   
   c:\Program Files\Tomcat\jakarta-tomcat-1.4.31\webapps\ROOT\WEB-INF\lib\

  Is this path correct or i've to store it in my ORACLE_H0ME\jdbc\lib ?
  may be ojdbc14.jar is for jdk1.4?
  is it possible to download both in the lib folder?
   
  Thanks  Regards,
  Vidhi
   
  
Anto Paul [EMAIL PROTECTED] wrote:
  On 1/20/06, gupta vidhi wrote:
 my problem of Tomcat is been solved.now my simple JSP pages(without DB 
 connectivity) is been solved.
 but when i'm executing my JSP page(with DB Connectivity) is creating problems 
 and showing the following error :

 javax.servlet.ServletException: No suitable driver
 at 
 org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:498)
 at org.apache.jsp.test_DB1_jsp._jspService(test_DB1_jsp.java:98)
 and so on.


Are you sure that the classes12.jar is not corrupted ?.

 i'd set the CLASSPATH of classes12.jar as:

 C:\Program Files\Tomcat\jakarta-tomcat-4.1.31\webapps\ROOT\WEB-INF\lib



There is no use of setting the CLASSPATH variable. Tomcat wont take
this for running the application.

If it is not solving your problem you may have to download ojdbc14.jar
from oracle.com and use it as it may be due to the JDK 1.5.


 Kindly help.

 Regards,
 Vidhi
 David Smith wrote:
 I'd recommend checking that your classes12.jar file is valid. This
 should work:

 $JAVA_HOME/bin/jar -v -t -f webapps/ROOT/WEB-INF/lib/classes12.jar

 It'll list the table of contents of the archive and be verbose about it.
 Replace -t with -x to extract files for further inspection.

 --David

 gupta vidhi wrote:

 i'm sending you the whole localhost file:
  2006-01-19 12:11:09 HostConfig[localhost]: Deploying configuration 
  descriptor admin.xml
 2006-01-19 12:11:29 HostConfig[localhost]: Deploying configuration 
 descriptor manager.xml
 
 

 ... on and on and on .
 

 2006-01-19 12:11:31 HostConfig[localhost]: Deploying web application 
 directory ROOT
 2006-01-19 12:11:31 StandardHost[localhost]: Installing web application at 
 context path from URL file:C:\Program 
 Files\Tomcat\jakarta-tomcat-4.1.31\webapps\ROOT
 2006-01-19 12:11:31 WebappLoader[]: Deploying class repositories to work 
 directory C:\Program 
 Files\Tomcat\jakarta-tomcat-4.1.31\work\Standalone\localhost\_
 2006-01-19 12:11:31 WebappLoader[]: Deploy JAR /WEB-INF/lib/classes12.jar to 
 C:\Program 
 Files\Tomcat\jakarta-tomcat-4.1.31\webapps\ROOT\WEB-INF\lib\classes12.jar
 2006-01-19 12:11:31 StandardHost[localhost]: ContainerBase.addChild: start:
 LifecycleException: start: : java.lang.ClassCastException: 
 org.apache.naming.resources.FileDirContext
  at org.apache.catalina.loader.WebappLoader.start(WebappLoader.java:631)
  at org.apache.catalina.core.StandardContext.start(StandardContext.java:3486)
  at 
  org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:774)
  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:760)
  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:548)
  at 
  org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:260)
  at org.apache.catalina.core.StandardHost.install(StandardHost.java:741)
  at 
  org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:512)
  at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:354)
  at org.apache.catalina.startup.HostConfig.start(HostConfig.java:671)
  at 
  org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
  at 
  org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
  at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1149)
  at org.apache.catalina.core.StandardHost.start(StandardHost.java:707)
  at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
  at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:316)
  at org.apache.catalina.core.StandardService.start(StandardService.java:450)
  at org.apache.catalina.core.StandardServer.start(StandardServer.java:2143)
  at org.apache.catalina.startup.Catalina.start(Catalina.java:463)
  at org.apache.catalina.startup.Catalina.execute(Catalina.java:350)
  at org.apache.catalina.startup.Catalina.process(Catalina.java:129)
  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.main(Bootstrap.java:156)
 - Root Cause -
 java.lang.ClassCastException: org.apache.naming.resources.FileDirContext
  at 
  org.apache.catalina.loader.WebappLoader.setRepositories(WebappLoader.java:1012)
  at 

RE: mod_jk connection problem after couple of days or a week

2006-01-20 Thread Jonathon Reeve
Well I'm glad someone else is getting this, even if you have no idea
either. We wondered if we were missing some configuration from
workers.properties, since the quick start section
(http://tomcat.apache.org/connectors-doc/howto/quick.html) on
Tomcat's site gives an example minimum workers.properties:

 # Define 1 real worker using ajp13
  worker.list=worker1
  # Set properties for worker1 (ajp13)
  worker.worker1.type=ajp13
  worker.worker1.host=localhost
  worker.worker1.port=8009
  worker.worker1.lbfactor=50
  worker.worker1.cachesize=10
  worker.worker1.cache_timeout=600
  worker.worker1.socket_keepalive=1
  worker.worker1.reclycle_timeout=300

... which is a lot more than we had:

worker.list=eOrig,eOrigUAT, jkstatus
# Status worker
worker.jkstatus.type=status 
# eOriginations
worker.eOrig.port=8991
# eOriginations UAT
worker.eOrigUAT.host=uklxfcocr
worker.eOrigUAT.port=8991

We looked at the documentation for the settings in this file, here:
http://tomcat.apache.org/connectors-doc/howto/workers.html
and here:
http://tomcat.apache.org/connectors-doc/config/workers.html
...but it doesn't really help too much. It tells you quite precisely
what each property does, but it would be more useful to have a series of
examples along the lines of, for a typical server doing X, you might
want something like this, and if you set this too high / low / whatever,
it will have effect Y. That said, there were a couple of things we
thought might help:

  # worker worker2 ask operating system to send KEEP-ALIVE signal on
the connection
  worker.worker2.socket_keepalive=1
  worker.worker2.recycle_timeout=300

...since the sockets seem to be sort of dying and then hanging around.
We thought perhaps the OS should be keeping them alive and was dropping
them instead, and if they were dead that they should be recycled. With
all changes, out workers.properties file now looks like this:

worker.list=eOrig,eOrigUAT,jkstatus
# Status worker
worker.jkstatus.type=status 
## eOriginations
worker.eOrig.port=8991
worker.eOrig.cachesize=50
worker.eOrig.cache_timeout=600
worker.eOrig.socket_keepalive=1
worker.eOrig.recycle_timeout=300
## eOriginations UAT
worker.eOrigUAT.host=uklxfcocr
worker.eOrigUAT.port=8991
worker.eOrigUAT.cachesize=20
worker.eOrigUAT.cache_timeout=600
worker.eOrigUAT.socket_keepalive=1
worker.eOrigUAT.recycle_timeout=300


We're also thinking about trying worker.maintain, since it sounds
like it might help with the recycling, but we're seeing how it goes with
these changes first.

Fingers crossed...

This mail has been checked at MSXI for all known virus'.
You open this at your own risk. Please make sure all replies are virus free.
Also, we do not accept or send attachments of the type exe, vbs, scr or bat due 
to the increased virus risk they contain.
These types of attachments will be stripped from the message.

MSXI


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



Re: mod_jk connection problem after couple of days or a week

2006-01-20 Thread Mladen Turk

Jonathon Reeve wrote:

Well I'm glad someone else is getting this, even if you have no idea
either. We wondered if we were missing some configuration from
workers.properties, since the quick start section
(http://tomcat.apache.org/connectors-doc/howto/quick.html) on
Tomcat's site gives an example minimum workers.properties:




Huh, you really tried everything :)

Couple of notes:
1. AJP connection is supposed to last forever.
2. cache_timeout, recycle_timeout, MaxRequestsPerClient
   tend to close the socket, so you have half-closed
   sockets, and that's why you are leaking resources.
3. Whenever there is a need to recycle one end of the
   channel the other end must be recycled too.
   This is done by setting connectionTimeout=milliseconds
   in server.xml for AJP/1.3 connector.
4. If you need full failover add 'connection_timeout' and
   'prepost_timeout' to each worker.
   This implicates that CPING/CPONG packets will be send
   before each request is forwarded to Tomcat.

Regards,
Mladen.

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



Oracle 8i JDBC Driver for jdk1.5?

2006-01-20 Thread gupta vidhi
hello,
   
  i got the following info. from oracle.com : -
   
  Setting Up Your Environment
---  On Windows platforms:
- Add [ORACLE_HOME]\jdbc\lib\classes12.jar to your CLASSPATH if you
use JDK 1.2 or 1.3.
  - Add [ORACLE_HOME]\jdbc\lib\ojdbc14.jar to your CLASSPATH if you use JDK 1.4.
- Add [ORACLE_HOME]\jdbc\lib\orai18n.jar to your CLASSPATH if
you use any NLS features.
- Add [ORACLE_HOME]\bin to your PATH if you are using the JDBC OCI
driver
   
  but i'm not getting the info. regarding Oracle 8i JDBC Driver for jdk1.5.
   
  Kindly help.
   
  Thanks  Regards,
  Vidhi



-
 
 What are the most popular cars?  Find out at Yahoo! Autos

Re: Oracle 8i JDBC Driver for jdk1.5?

2006-01-20 Thread David Delbecq
Did you try using the 1.4 version on 1.5 jvm?

Le Vendredi 20 Janvier 2006 11:23, gupta vidhi a écrit :
 hello,

   i got the following info. from oracle.com : -

   Setting Up Your Environment
 ---  On Windows platforms:
 - Add [ORACLE_HOME]\jdbc\lib\classes12.jar to your CLASSPATH if you
 use JDK 1.2 or 1.3.
   - Add [ORACLE_HOME]\jdbc\lib\ojdbc14.jar to your CLASSPATH if you use JDK 
 1.4.
 - Add [ORACLE_HOME]\jdbc\lib\orai18n.jar to your CLASSPATH if
 you use any NLS features.
 - Add [ORACLE_HOME]\bin to your PATH if you are using the JDBC OCI
 driver

   but i'm not getting the info. regarding Oracle 8i JDBC Driver for jdk1.5.

   Kindly help.

   Thanks  Regards,
   Vidhi
 
 
   
 -
  
  What are the most popular cars?  Find out at Yahoo! Autos

-- 
David Delbecq
Royal Meteorological Institute of Belgium

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



RE: Absolute Guide for config of JDBC Connection Pool ?

2006-01-20 Thread g m
Ok, I have tried itit fails ..or maybe I am helping it fail?
   
  Been fighting with it all morning..I followed your email and the 
doc...here are my entries/values..any opinions on what else to try?
   
   
  1. Resource entry values
  
 Context path=/DBS3 docBase=DBS3 reloadable=true  
   Resource name=jdbc/deebee  
  type=javax.sql.DataSource 
  auth=Container 
  driverClassName=com.sybase.jdbc3.jdbc.SybDriver  
  url=jdbc:sybase:Tds:10.xx.xxx.xx:5001
  username=x 
  password= 
  maxIdle=15 
  maxActive=50 
  maxWait=1 
  factory=org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory 
  removeAbandoned=true 
  removeAbandonedTimeout=60 
  logAbandoned=true/
/Context 
  
2. web.xml entry
   
   descriptionSybase Connection Resource/description
 resource-ref
  res-ref-namejdbc/deebee/res-ref-name
  res-typejavax.sql.DataSource/res-type
  res-authContainer/res-auth
 /resource-ref
  
3. Java code - error checking left out...
   
  Context ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup(java:comp/env/jdbc/deebee);
Connection dbconn = ds.getConnection() ;
  
5. Put resource entry in file conf/Catalina/localhost/DBS3.xml with following 
error:
  
 WARNING: A docBase C:\Program Files\Apache Software Foundation\
 Tomcat 5.5\webapps\DBS3 inside the host appBase has been 
 specified, and will be ignored
   
  6. Put resource entry in server.xml with error.
   
  SQLState: null
Code: 0
Message: Cannot create JDBC driver of class '' for connect URL 'null'
 
  
7. Put it in webapps/DBS3/META-INF/context.xml with error.
   
  SQLState: null
Code: 0
Message: Cannot create JDBC driver of class '' for connect URL 'null'
   
   
  any suggestions gladly taken 
Thanks!
   
   
   
   
  

g m [EMAIL PROTECTED] wrote:
  Agreed! Simple no-nonsense description - I shall give it a 'whirl' .

Thanks Len - your on my Xmas list ;-)

Durfee, Bernard wrote:
Excellent! That is the exact documentation that should be on the Tomcat
site. It would also be nice to see a quick description of how Tomcat
processes the sections, what exactly it does with the
attributes, so that other drivers and pools can be configured.

There are also other parameters that DBCP accepts...

http://jakarta.apache.org/commons/dbcp/configuration.html

Bernie Durfee 



 -Original Message-
 From: Len Popp [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, January 19, 2006 12:58 PM
 To: Tomcat Users List
 Subject: Re: Absolute Guide for config of JDBC Connection Pool ?
 
 
 I don't know if there's a complete top-to-bottom guide, but here's
 what I know from setting up connection pooling under 5.5.12:
 
 1. The JDBC driver JAR must go in the common/lib directory (because
 for connection pooling it needs to be accessible to both Tomcat and
 the web app).
 
 2. DBCP is built into Tomcat so you don't need to install a 
 JAR for that.
 
 3. The tag goes inside the tag for the web app,
 wherever it is (server.xml, webapps//META-INF/context.xml or
 conf/Catalina/localhost/.xml)
 Note that the syntax for has changed from earlier versions
 - see the Tomcat documentation. Here's a sample:
 
  type=javax.sql.DataSource
 auth=Container
 driverClassName=com.mysql.jdbc.Driver
 url=jdbc:mysql://localhost:3306/???
 username=???
 password=???
 maxIdle=15
 maxActive=50
 maxWait=1
 factory=org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory
 removeAbandoned=true
 removeAbandonedTimeout=60
 logAbandoned=true/
 
 The ??? bits are installation-dependent. Some of the parameters will
 be different for Sybase (driverClassName and url for sure).
 
 4. Yes, it is supposed to say ... .dbcp.dbcp ... in the 
 factory= line.
 
 5. The code to get a DB connection is:
 InitialContext initCtx = new InitialContext();
 DataSource ds = (DataSource) 
 initCtx.lookup(java:comp/env/jdbc/???);
 Connection conn = ds.getConnection();
 Make sure that jdbc/??? is the same here as in the tag.
 
 6. Always close the connection when you're done with it. Use a
 finally block to make sure.
 
 7. If you're trying to decide where to put the declaration,
 the choices are:
 - server.xml - Don't put it here. We're told it's bad.
 - webapps//META-INF/context.xml - If you put it here, it will be
 bundled up in the app's WAR file. That makes it easier to install, but
 harder to configure if every installation has different details for
 the database tag.
 - conf/Catalina/localhost/.xml - If you put it here, it's easier
 to edit the tag, but it's an extra file to be installed in
 addition to the WAR.
 
 Hope this helps. At least it's shorter than
 http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-exampl
es-howto.html.
:-)

On 1/19/06, g m wrote:
 There seems to be 'truckloads' of information on just as many forums
on how best to setup a JDBC connection pool, varying from which file to
put what entries (server.xml, context.xml, web.xml) etc

 It looks like the same questions be asked 

Re: Database Connectivity of JSP(Tomcat 4.x) with Oracle 8i

2006-01-20 Thread Anto Paul
On 1/20/06, gupta vidhi [EMAIL PROTECTED] wrote:
 hello,

   i was searching Oracle 8i driver for jdk1.5, but not getting.i had 
 downloaded classes12.jar from oracle.com and saved in my

c:\Program Files\Tomcat\jakarta-tomcat-1.4.31\webapps\ROOT\WEB-INF\lib\

   Is this path correct or i've to store it in my ORACLE_H0ME\jdbc\lib ?
   may be ojdbc14.jar is for jdk1.4?
   is it possible to download both in the lib folder?

You need to use either one. and put it in WEB-INF\lib and not
ORACLE_HOME\jdbc\lib. You should check the log files there may be more
errors in it. First stop Tomcat delete log files start Tomcat and test
and post the log files. Check Tomcat console also if you have one.
There are other log files mainly stdout, stderr other than localhost*.
and post the relevant error messages.


   Thanks  Regards,
   Vidhi


 Anto Paul [EMAIL PROTECTED] wrote:
   On 1/20/06, gupta vidhi wrote:
  my problem of Tomcat is been solved.now my simple JSP pages(without DB 
  connectivity) is been solved.
  but when i'm executing my JSP page(with DB Connectivity) is creating 
  problems and showing the following error :
 
  javax.servlet.ServletException: No suitable driver
  at 
  org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:498)
  at org.apache.jsp.test_DB1_jsp._jspService(test_DB1_jsp.java:98)
  and so on.


 Are you sure that the classes12.jar is not corrupted ?.

  i'd set the CLASSPATH of classes12.jar as:
 
  C:\Program Files\Tomcat\jakarta-tomcat-4.1.31\webapps\ROOT\WEB-INF\lib
 


 There is no use of setting the CLASSPATH variable. Tomcat wont take
 this for running the application.

 If it is not solving your problem you may have to download ojdbc14.jar
 from oracle.com and use it as it may be due to the JDK 1.5.


  Kindly help.
 
  Regards,
  Vidhi
  David Smith wrote:
  I'd recommend checking that your classes12.jar file is valid. This
  should work:
 
  $JAVA_HOME/bin/jar -v -t -f webapps/ROOT/WEB-INF/lib/classes12.jar
 
  It'll list the table of contents of the archive and be verbose about it.
  Replace -t with -x to extract files for further inspection.
 
  --David
 
  gupta vidhi wrote:
 
  i'm sending you the whole localhost file:
   2006-01-19 12:11:09 HostConfig[localhost]: Deploying configuration 
   descriptor admin.xml
  2006-01-19 12:11:29 HostConfig[localhost]: Deploying configuration 
  descriptor manager.xml
  
  
 
  ... on and on and on .
  
 
  2006-01-19 12:11:31 HostConfig[localhost]: Deploying web application 
  directory ROOT
  2006-01-19 12:11:31 StandardHost[localhost]: Installing web application at 
  context path from URL file:C:\Program 
  Files\Tomcat\jakarta-tomcat-4.1.31\webapps\ROOT
  2006-01-19 12:11:31 WebappLoader[]: Deploying class repositories to work 
  directory C:\Program 
  Files\Tomcat\jakarta-tomcat-4.1.31\work\Standalone\localhost\_
  2006-01-19 12:11:31 WebappLoader[]: Deploy JAR /WEB-INF/lib/classes12.jar 
  to C:\Program 
  Files\Tomcat\jakarta-tomcat-4.1.31\webapps\ROOT\WEB-INF\lib\classes12.jar
  2006-01-19 12:11:31 StandardHost[localhost]: ContainerBase.addChild: start:
  LifecycleException: start: : java.lang.ClassCastException: 
  org.apache.naming.resources.FileDirContext
   at org.apache.catalina.loader.WebappLoader.start(WebappLoader.java:631)
   at 
   org.apache.catalina.core.StandardContext.start(StandardContext.java:3486)
   at 
   org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:774)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:760)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:548)
   at 
   org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:260)
   at org.apache.catalina.core.StandardHost.install(StandardHost.java:741)
   at 
   org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:512)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:354)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:671)
   at 
   org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at 
   org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1149)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:707)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:316)
   at 
   org.apache.catalina.core.StandardService.start(StandardService.java:450)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:2143)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:463)
   at org.apache.catalina.startup.Catalina.execute(Catalina.java:350)
   at org.apache.catalina.startup.Catalina.process(Catalina.java:129)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at 
   

Re: Oracle 8i JDBC Driver for jdk1.5?

2006-01-20 Thread David Delbecq
I don't think oracle has 1.5 specific drivers. ojdbc14 should suit well on 1.5 
jvm

Le Vendredi 20 Janvier 2006 12:52, gupta vidhi a écrit :
 i'm using jdk1.5.0.02, Tomcat 4.1.31  JDBC 8.1.7.0.0 on WIN 
 2000  Oracle 8i.

   
 
 David Delbecq [EMAIL PROTECTED] wrote:
   Did you try using the 1.4 version on 1.5 jvm?
 
 Le Vendredi 20 Janvier 2006 11:23, gupta vidhi a écrit :
  hello,
  
  i got the following info. from oracle.com : -
  
  Setting Up Your Environment
  --- On Windows platforms:
  - Add [ORACLE_HOME]\jdbc\lib\classes12.jar to your CLASSPATH if you
  use JDK 1.2 or 1.3.
  - Add [ORACLE_HOME]\jdbc\lib\ojdbc14.jar to your CLASSPATH if you use JDK 
  1.4.
  - Add [ORACLE_HOME]\jdbc\lib\orai18n.jar to your CLASSPATH if
  you use any NLS features.
  - Add [ORACLE_HOME]\bin to your PATH if you are using the JDBC OCI
  driver
  
  but i'm not getting the info. regarding Oracle 8i JDBC Driver for jdk1.5.
  
  Kindly help.
  
  Thanks  Regards,
  Vidhi
  
  
  
  -
  
  What are the most popular cars? Find out at Yahoo! Autos
 

-- 
David Delbecq
Royal Meteorological Institute of Belgium

-
Pingouins dans les champs, hiver méchant

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



RE: Oracle 8i JDBC Driver for jdk1.5?

2006-01-20 Thread Tim Lucia
I'm using Tomcat 5.5, JDK 1.5, JDBC 8.1.7.0.0 on 8i on W2K SP4 + RHEL V.4
with zero problems (using classes12.jar)

Tim

-Original Message-
From: gupta vidhi [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 20, 2006 6:52 AM
To: Tomcat Users List
Subject: Re: Oracle 8i JDBC Driver for jdk1.5?


i'm using jdk1.5.0.02, Tomcat 4.1.31  JDBC 8.1.7.0.0 on WIN
2000  Oracle 8i.
   
  

David Delbecq [EMAIL PROTECTED] wrote:
  Did you try using the 1.4 version on 1.5 jvm?

Le Vendredi 20 Janvier 2006 11:23, gupta vidhi a écrit :
 hello,
 
 i got the following info. from oracle.com : -
 
 Setting Up Your Environment
 --- On Windows platforms:
 - Add [ORACLE_HOME]\jdbc\lib\classes12.jar to your CLASSPATH if you 
 use JDK 1.2 or 1.3.
 - Add [ORACLE_HOME]\jdbc\lib\ojdbc14.jar to your CLASSPATH if you use 
 JDK 1.4.
 - Add [ORACLE_HOME]\jdbc\lib\orai18n.jar to your CLASSPATH if
 you use any NLS features.
 - Add [ORACLE_HOME]\bin to your PATH if you are using the JDBC OCI
 driver
 
 but i'm not getting the info. regarding Oracle 8i JDBC Driver for 
 jdk1.5.
 
 Kindly help.
 
 Thanks  Regards,
 Vidhi
 
 
 
 -
 
 What are the most popular cars? Find out at Yahoo! Autos

-- 
David Delbecq
Royal Meteorological Institute of Belgium

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

  











-
 
 What are the most popular cars?  Find out at Yahoo! Autos


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



RE: mod_jk connection problem after couple of days or a week

2006-01-20 Thread Robert Neumann
Thanks Mladen for your suggestions.

But I have to make clear that we just started with a minimum configuration
for the workers.

So we had 3 workers defined using the following config:

worker.worker_1.host=localhost
worker.worker_1.port=8009
worker.worker_1.type=ajp13

worker.worker_2.host=localhost
worker.worker_2.port=8109
worker.worker_2.type=ajp13

worker.worker_3.host=localhost
worker.worker_3.port=8209
worker.worker_3.type=ajp13

There was nothing about connection recycling - just using the standard.
So I am not sure about that what you have said about making sure that not
only one endpoint of the connection is dropped, which should not happen in
this case?!

Afterwards, we've checked the manuals again and set up a quite similar
configuration just as Jonathon did (except the keep_alive parameter, since
we were running Apache and Tomcat on the same host). That's where I could
follow your objection.

But furthermore I cannot imagine how the whole setup could be running for
about 2 weeks and then go down after a couple of minutes (after a server
reboot). Even under heavy load conditions this seems very mysterious, since
even with the recycle configuration, the connections should not be dropped
that fast, so that there are dead sockets hanging around.

Even the problem with server reboot at all is quite strange, since it
doesn't seem to be a problem with the OS. After Tomcat was down, I could
connect to the server remotely using the MS Terminal Client (RDP -
Connection). So no general socket problem at all, in my opinion...

Is it possible that after Tomcat shutdown any Java related thread or process
is still keeping the dead sockets and no connections can be made until this
thread/process is killed during server shutdown?

Additional information:
Tomcat is running with jdk1.5.0_04, using the server JVM.

@Jonathon:
Do you use any special switches for the JVM? We're using the same switches
which worked fine for us when running the system on Win2K Server (where the
system ran fine before using mod_jk 1.2.6 - ;) ), such as settings PermSize
etc.

Regards,
Robert.

Jonathon Reeve wrote:
 Well I'm glad someone else is getting this, even if you have no idea
 either. We wondered if we were missing some configuration from
 workers.properties, since the quick start section
 (http://tomcat.apache.org/connectors-doc/howto/quick.html) on
 Tomcat's site gives an example minimum workers.properties:
 


Huh, you really tried everything :)

Couple of notes:
1. AJP connection is supposed to last forever.
2. cache_timeout, recycle_timeout, MaxRequestsPerClient
tend to close the socket, so you have half-closed
sockets, and that's why you are leaking resources.
3. Whenever there is a need to recycle one end of the
channel the other end must be recycled too.
This is done by setting connectionTimeout=milliseconds
in server.xml for AJP/1.3 connector.
4. If you need full failover add 'connection_timeout' and
'prepost_timeout' to each worker.
This implicates that CPING/CPONG packets will be send
before each request is forwarded to Tomcat.

Regards,
Mladen.

-
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: Oracle 8i JDBC Driver for jdk1.5?

2006-01-20 Thread David Smith
The classpath should not be used in tomcat except where abolutely 
necessary.  Tomcat has it's own classloader hierarchy to find jar files 
and dynamically add them.  To that end, the tomcat start-up scripts 
explicitly ignore classpath on startup.  Put your classes12.jar or 
ojdbc14.jar in just one of two places:


1) WEB-INF/lib of your webapp if you are not using tomcat's built-in 
database pooling.


2) common/lib of your tomcat installation if you are using tomcat's 
built-in database pooling.  You will also need to properly configure a 
resource in your server.xml file and a resource-ref in your webapp's 
web.xml.  Restart tomcat to make the jar file visible to tomcat.  See 
the tomcat docs for further info.


The orai18n.jar file should most likely be placed where ever the 
ojdbc14.jar is if you need it's functions.


--David

gupta vidhi wrote:


hello,
  
 i got the following info. from oracle.com : -
  
 Setting Up Your Environment

---  On Windows platforms:
- Add [ORACLE_HOME]\jdbc\lib\classes12.jar to your CLASSPATH if you
use JDK 1.2 or 1.3.
 - Add [ORACLE_HOME]\jdbc\lib\ojdbc14.jar to your CLASSPATH if you use JDK 1.4.
- Add [ORACLE_HOME]\jdbc\lib\orai18n.jar to your CLASSPATH if
you use any NLS features.
- Add [ORACLE_HOME]\bin to your PATH if you are using the JDBC OCI
driver
  
 but i'm not getting the info. regarding Oracle 8i JDBC Driver for jdk1.5.
  
 Kindly help.
  
 Thanks  Regards,

 Vidhi



-

What are the most popular cars?  Find out at Yahoo! Autos
 




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



Re: SSL Failure on Tomcat 5.5.12

2006-01-20 Thread David Smith
The port number should not be necessary in the URL if connecting to the 
default web ssl port of 443.  Virtually all browsers know 443 is the 
default port to use for https protocol connections.  Doesn't hurt to 
specify the port -- just shouldn't be necessary.  It's like having to 
spec port 80 for a standard http request. 

I'd recommend taking a look at the tomcat server logs.  They may shed 
some light on what happened from the server end.


--David

Philipp Jäggi wrote:

Hey Tony 

Sounds like you forget to add the port when you connect. I tried this out 
on my tomcat installation. When I connect without specifying the port, I 
get the same error message. So, in your case, connect to 
https://localhost:443/[mywebappdocbase].



bye Philipp







[EMAIL PROTECTED] 
01/20/2006 12:59 AM

Please respond to
Tomcat Users List users@tomcat.apache.org


To
users@tomcat.apache.org
cc

Subject
SSL Failure on Tomcat 5.5.12






I just installed Tomcat 5.5.12 on Windows XP (from the .exe install). I 
created and have a working webapp with servlets on the http port (80). I 
carefully followed the instructions on the apache tomcat website for 
setting up a SSL https connection. I followed it in every detail, creating 
my own certificate using keytool (as explained both on the apache site and 
right there in the server.xml file).  In server.xml I set the http 
connector to port 80 and the https connector to port 443. All normal http 
requests work fine. But when I try to connect to https://localhost, the 
browser (Firefox) just displays Loading and ultimately I get a popup 
alert of The connection to localhost has terminated unexpectedly. Some 
data may have been transferred. While the browser is loading I can 
bring up a Command Window and issue a netstat -a -n command and I can see 
that there is an established socket connection on port 443. But nothing 
happens. Any help is surely appreciated. By the way, o
n a different PC (also Windows XP) I used netbeans (4.1) to develop a 
webapp, and on that I did the same SSL procedure and it worked perfectly.

--thanks
--Tony C.

-
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: Why WEB-INF folder has to be in capital letters

2006-01-20 Thread David Delbecq
Yes
Le Vendredi 20 Janvier 2006 14:36, Dhaval Patel a écrit :
 Hello all Tomcat Guys,
 
This is just curiousity.
 
Why WEB-INF folder has to be in capital letters? Is it becuase of J2EE 
 specification? 
 
 Regards,
 D
 
 __
 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]
 
 

-- 
David Delbecq
Royal Meteorological Institute of Belgium

-
Pingouins dans les champs, hiver méchant

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



Re: Why WEB-INF folder has to be in capital letters

2006-01-20 Thread David Smith
It is specified in the servlet spec as all caps WEB-INF.  See SRV.9.5 of 
servlet spec 2.4 for more info.  I don't know where this would be in any 
previous servlet spec, but do know it's been this way for a few previous 
servlet specs.


--David

Dhaval Patel wrote:


Hello all Tomcat Guys,

  This is just curiousity.

  Why WEB-INF folder has to be in capital letters? Is it becuase of J2EE specification? 


Regards,
D

__
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: Absolute Guide for config of JDBC Connection Pool ?

2006-01-20 Thread Durfee, Bernard
Since the context element is outside of the server.xml file, you don't
need the 'path' attribute. From
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

The value of this field [path] must not be set except when statically
defining a Context in server.xml, as it will be inferred from the
filenames used for either the .xml context file or the docBase.

Also, the docBase is only needed when your web application is outside of
the 'webapps' directory.

You may specify an absolute pathname for this directory or WAR file, or
a pathname that is relative to the appBase directory of the owning
Host.

But those are probably unrelated to the JDBC issue. Make sure that your
JDBC driver is in the common/lib directory with the DBCP jar files.
Since the Tomcat DBCP library will be instantiating the driver, it needs
to be able to find the driver in the same classloader. See
http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html

Now as far as the message itself, most would scoff at the idea that a
non-useful error message is a critical bug, but your frustration
demonstrates how poor error messages are just as damaging as real
bugs!

SQLState: null
Code: 0
Message: Cannot create JDBC driver of class '' for connect URL 'null'

How useful! DBCP is not much better, their error logging is nearly
non-existent.

Bernie Durfee 



 -Original Message-
 From: g m [mailto:[EMAIL PROTECTED] 
 Sent: Friday, January 20, 2006 6:22 AM
 To: Tomcat Users List
 Subject: RE: Absolute Guide for config of JDBC Connection Pool ?
 
 
 Ok, I have tried itit fails ..or maybe I am helping it fail?

   Been fighting with it all morning..I followed your 
 email and the doc...here are my entries/values..any opinions 
 on what else to try?


   1. Resource entry values
   
  Context path=/DBS3 docBase=DBS3 reloadable=true  
Resource name=jdbc/deebee  
   type=javax.sql.DataSource 
   auth=Container 
   driverClassName=com.sybase.jdbc3.jdbc.SybDriver  
   url=jdbc:sybase:Tds:10.xx.xxx.xx:5001
   username=x 
   password= 
   maxIdle=15 
   maxActive=50 
   maxWait=1 
   factory=org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory 
   removeAbandoned=true 
   removeAbandonedTimeout=60 
   logAbandoned=true/
 /Context 
   
 2. web.xml entry

descriptionSybase Connection Resource/description
  resource-ref
   res-ref-namejdbc/deebee/res-ref-name
   res-typejavax.sql.DataSource/res-type
   res-authContainer/res-auth
  /resource-ref
   
 3. Java code - error checking left out...

   Context ctx = new InitialContext();
 DataSource ds = (DataSource) 
 ctx.lookup(java:comp/env/jdbc/deebee);
 Connection dbconn = ds.getConnection() ;
   
 5. Put resource entry in file 
 conf/Catalina/localhost/DBS3.xml with following error:
   
  WARNING: A docBase C:\Program Files\Apache Software Foundation\
  Tomcat 5.5\webapps\DBS3 inside the host appBase has been 
  specified, and will be ignored

   6. Put resource entry in server.xml with error.

   SQLState: null
 Code: 0
 Message: Cannot create JDBC driver of class '' for 
 connect URL 'null'
  
   
 7. Put it in webapps/DBS3/META-INF/context.xml with error.

   SQLState: null
 Code: 0
 Message: Cannot create JDBC driver of class '' for 
 connect URL 'null'


   any suggestions gladly taken 
 Thanks!




   
 
 g m [EMAIL PROTECTED] wrote:
   Agreed! Simple no-nonsense description - I shall give it a 
 'whirl' .
 
 Thanks Len - your on my Xmas list ;-)
 
 Durfee, Bernard wrote:
 Excellent! That is the exact documentation that should be on 
 the Tomcat
 site. It would also be nice to see a quick description of how Tomcat
 processes the sections, what exactly it does with the
 attributes, so that other drivers and pools can be configured.
 
 There are also other parameters that DBCP accepts...
 
 http://jakarta.apache.org/commons/dbcp/configuration.html
 
 Bernie Durfee 
 
 
 
  -Original Message-
  From: Len Popp [mailto:[EMAIL PROTECTED] 
  Sent: Thursday, January 19, 2006 12:58 PM
  To: Tomcat Users List
  Subject: Re: Absolute Guide for config of JDBC Connection Pool ?
  
  
  I don't know if there's a complete top-to-bottom guide, but here's
  what I know from setting up connection pooling under 5.5.12:
  
  1. The JDBC driver JAR must go in the common/lib directory (because
  for connection pooling it needs to be accessible to both Tomcat and
  the web app).
  
  2. DBCP is built into Tomcat so you don't need to install a 
  JAR for that.
  
  3. The tag goes inside the tag for the web app,
  wherever it is (server.xml, webapps//META-INF/context.xml or
  conf/Catalina/localhost/.xml)
  Note that the syntax for has changed from earlier versions
  - see the Tomcat documentation. Here's a sample:
  
   type=javax.sql.DataSource
  auth=Container
  driverClassName=com.mysql.jdbc.Driver
  

Re: Oracle 8i JDBC Driver for jdk1.5?

2006-01-20 Thread Glen Mazza

gupta vidhi wrote:

hello,
   
  i got the following info. from oracle.com : -
   
  Setting Up Your Environment

---  On Windows platforms:
- Add [ORACLE_HOME]\jdbc\lib\classes12.jar to your CLASSPATH if you
use JDK 1.2 or 1.3.
  - Add [ORACLE_HOME]\jdbc\lib\ojdbc14.jar to your CLASSPATH if you use JDK 1.4.
- Add [ORACLE_HOME]\jdbc\lib\orai18n.jar to your CLASSPATH if
you use any NLS features.
- Add [ORACLE_HOME]\bin to your PATH if you are using the JDBC OCI
driver
   
  but i'm not getting the info. regarding Oracle 8i JDBC Driver for jdk1.5.
   


I've used ojdbc14.jar on jdk1.5 without difficulty.

Glen



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



Re: web hosting software

2006-01-20 Thread Glen Mazza
I don't know the answer to your question, but out of curiosity, what 
additional services beyond a servlet container (Tomcat) or application 
server (JBoss, etc.) are you looking for?


I would guess, to run a java web hosting service, you're going to need 
to be pretty Tomcat- or JBoss-knowledgable, because of all the quick 
troubleshooting that will need to be done over time.  Software that 
wraps TC/JB might end up doing more harm than good as you end up 
substituting helpful knowledge learned about the servlet container for 
less useful knowledge about the software controlling it instead.


Glen

Michal Kwiatek wrote:

Dear All,

Is it possible to download a complete java web hosting solution, i.e. software 
that would let me run a java web hosting service?
Do you know any particular vendor who offers such a solution?

Thanks in advance,
Michał.





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



tomcat realm with digest password configuration help

2006-01-20 Thread philguillard

Hi,

I use tomcat-5.5.12, a Realm in memory, and decided a DIGEST password 
with MD5, i use firefox 1.0.6. I can't pass the authentication. Have 
nothing in logs. Any idea for what i missed there or what i should try?

Regards,

Phil

In conf/server.xml :
Realm className=org.apache.catalina.realm.MemoryRealm debug=2 
digest=MD5/


In my web.xml :
login-config
 !--auth-methodBASIC/auth-method--
 auth-methodDIGEST/auth-method
 realm-nameProtected area/realm-name
/login-config

#  ./digest.sh -a MD5 admin
admin:21232f297a57a5a743894a0e4a801fc3

In conf/tomcat-users.xml :
tomcat-users
 role rolename=admin/
 user username=admin password=21232f297a57a5a743894a0e4a801fc3 
roles=admin/




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



RE: Absolute Guide for config of JDBC Connection Pool ?

2006-01-20 Thread g m
Hi Bernard,
   
  This problem is 'windows' (yes, spealt...B:A:D)..related.
   
  This application needs to run on a HP Unix box but the development is 
happening on a XP pc using Eclipse (don't ask...;-)) .  It actually works if I 
place the exact resource entry I posted in the 
catalina/localhost/appname.xml file - on Unix.
   
  I have the 'exact' same tomcat version running on the XP box. I went back to 
basics and found that not even a standard DB connection creation in the servlet 
works:
   
  Class.forName(com.sybase.jdbc3.jdbc.SybDriver);
Connection conn = DriverManager.getConnection( 
jdbc:sybase:Tds:xx.xxx.xxx.xx:5001, foobar, badabing);

  Same code works on the unix box. Not sure why it be different. The XP box in 
question can talk to Sybase using the Sybase openclient - so I am guessing it 
is related to the JDBC/jar file on the PC?
   
  Having said that, what you suggest below is interesting and I will address 
once I have hello world on XP working
   
  Thanks for your help.
   
  Jack
  
Durfee, Bernard [EMAIL PROTECTED] wrote:
  Since the element is outside of the server.xml file, you don't
need the 'path' attribute. From
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

The value of this field [path] must not be set except when statically
defining a Context in server.xml, as it will be inferred from the
filenames used for either the .xml context file or the docBase.

Also, the docBase is only needed when your web application is outside of
the 'webapps' directory.

You may specify an absolute pathname for this directory or WAR file, or
a pathname that is relative to the appBase directory of the owning
Host.

But those are probably unrelated to the JDBC issue. Make sure that your
JDBC driver is in the common/lib directory with the DBCP jar files.
Since the Tomcat DBCP library will be instantiating the driver, it needs
to be able to find the driver in the same classloader. See
http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html

Now as far as the message itself, most would scoff at the idea that a
non-useful error message is a critical bug, but your frustration
demonstrates how poor error messages are just as damaging as real
bugs!

SQLState: null
Code: 0
Message: Cannot create JDBC driver of class '' for connect URL 'null'

How useful! DBCP is not much better, their error logging is nearly
non-existent.

Bernie Durfee 



 -Original Message-
 From: g m [mailto:[EMAIL PROTECTED] 
 Sent: Friday, January 20, 2006 6:22 AM
 To: Tomcat Users List
 Subject: RE: Absolute Guide for config of JDBC Connection Pool ?
 
 
 Ok, I have tried itit fails ..or maybe I am helping it fail?
 
 Been fighting with it all morning..I followed your 
 email and the doc...here are my entries/values..any opinions 
 on what else to try?
 
 
 1. Resource entry values
 
 
  type=javax.sql.DataSource 
 auth=Container 
 driverClassName=com.sybase.jdbc3.jdbc.SybDriver 
 url=jdbc:sybase:Tds:10.xx.xxx.xx:5001
 username=x 
 password= 
 maxIdle=15 
 maxActive=50 
 maxWait=1 
 factory=org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory 
 removeAbandoned=true 
 removeAbandonedTimeout=60 
 logAbandoned=true/
 
 
 2. web.xml entry
 
 Sybase Connection Resource
 
 jdbc/deebee
 javax.sql.DataSource
 Container
 
 
 3. Java code - error checking left out...
 
 Context ctx = new InitialContext();
 DataSource ds = (DataSource) 
 ctx.lookup(java:comp/env/jdbc/deebee);
 Connection dbconn = ds.getConnection() ;
 
 5. Put resource entry in file 
 conf/Catalina/localhost/DBS3.xml with following error:
 
 WARNING: A docBase C:\Program Files\Apache Software Foundation\
 Tomcat 5.5\webapps\DBS3 inside the host appBase has been 
 specified, and will be ignored
 
 6. Put resource entry in server.xml with error.
 
 SQLState: null
 Code: 0
 Message: Cannot create JDBC driver of class '' for 
 connect URL 'null'
 
 
 7. Put it in webapps/DBS3/META-INF/context.xml with error.
 
 SQLState: null
 Code: 0
 Message: Cannot create JDBC driver of class '' for 
 connect URL 'null'
 
 
 any suggestions gladly taken 
 Thanks!
 
 
 
 
 
 
 g m wrote:
 Agreed! Simple no-nonsense description - I shall give it a 
 'whirl' .
 
 Thanks Len - your on my Xmas list ;-)
 
 Durfee, Bernard wrote:
 Excellent! That is the exact documentation that should be on 
 the Tomcat
 site. It would also be nice to see a quick description of how Tomcat
 processes the sections, what exactly it does with the
 attributes, so that other drivers and pools can be configured.
 
 There are also other parameters that DBCP accepts...
 
 http://jakarta.apache.org/commons/dbcp/configuration.html
 
 Bernie Durfee 
 
 
 
  -Original Message-
  From: Len Popp [mailto:[EMAIL PROTECTED] 
  Sent: Thursday, January 19, 2006 12:58 PM
  To: Tomcat Users List
  Subject: Re: Absolute Guide for config of JDBC Connection Pool ?
  
  
  I don't know if there's a complete top-to-bottom guide, but here's
  what I know from setting up 

Connection Pool Woes

2006-01-20 Thread Alex Turner
I am using Tomcat 5.5.12 on RedHat ES 4.

I have a server that is set to maxThreads=5, maxSpareThreads=5,
and when I use a Simply Data Source, that does not pooling, if I hit
the page a lot, I get over 30 connections opened, with database
connections that are not closing quickly at all.  If this runs in
production, I'm going to run out of database connections.

If I try a pooling datasource, the same thing happens, except the
server hangs on what I assume is the process to open a new connection
once it hit's the connection pool's maxConnections number.

I am using JSTL sql and core to do database queries, and I have a
servlet called InitServlet that instantiates a DataSource and sets it
as the default datasource.

I am using Postgresql as my database, and using Jdbc3PoolingDataSource
as my pooling datasource, and PGSimpleDataSource for my simple data
source.

What can I do to get these connections to close once a servlet or JSP
has finished running?  The plan is do have dozens of applications
running on this server, and if each app has it's own connection set,
I'm gonna run out of connections really fast.

Alex

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



RE: RELEASE NOTES wording/JNI

2006-01-20 Thread Caldarale, Charles R
 From: jerome lacoste [mailto:[EMAIL PROTECTED] 
 Subject: RELEASE NOTES wording/JNI
 
 Let's call:
 - conditionA code inside the web app
 - conditionB application is reloaded
 
 so that the text says:
 
   if (conditionA AND conditionB)
   then the issue appears
 
   if (!conditionA AND !conditionB)
  then the issue does not appear
 
 that doesn't seem to cover the full problem space.

To me, the wording does not explicitly include your second if clause, nor 
does it need to.  The first is explicit in the text, and therefore its negative 
also applies:

  if (!conditionA OR !conditionB)
 then the issue does not appear

and that does cover the full problem space.

Clearly, if you never reload the webapp, you don't care (a variation on 
Schrödinger's cat, perhaps); similarly, if the loadLibrary() call is outside 
the webapp, you're safe.

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



TomCat - SSL CA Certification

2006-01-20 Thread Demian L

Hi all,

I am having some problems to import to TomCat one certificate already 
installed on IIS. The .PFX file (backup certificate) was created, I exported 
it to one .PEM file thru openssl but I can't import it to my keystore 
because the error Public keys in reply and keystore don't match is 
happening. I don’t know if am making something wrong.
What kind of information of the IIS Certificate I need to import it? I guess 
that I need the alias. Anything else?

What are the steps to import it?

Can someone help-me with this issue?

Thanks in advanced.

With Best Regards,
Dmyan

_
MSN Messenger: instale grátis e converse com seus amigos. 
http://messenger.msn.com.br



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



RE: Connection Pool Woes

2006-01-20 Thread Caldarale, Charles R
 From: Alex Turner [mailto:[EMAIL PROTECTED] 
 Subject: Connection Pool Woes
 
 I have a server that is set to maxThreads=5, maxSpareThreads=5,
 and when I use a Simply Data Source, that does not pooling, if I hit
 the page a lot, I get over 30 connections opened, with database
 connections that are not closing quickly at all.  If this runs in
 production, I'm going to run out of database connections.

This is nearly always a problem in the webapp.  Make sure you explicitly
close all result sets, statements, and connections in finally clauses.
See the section on Preventing dB Connection Pool Leaks at:
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.h
tml

You should be able to use the techniques in there to track down the
problem.

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



RE: Windows XP SP2 - design question

2006-01-20 Thread Peter Crowther
 From: Snow white [mailto:[EMAIL PROTECTED] 
 We use a
 cookie to maintain the state that determines what is sent to the
 client, and we update the cookie in every response of this URL
 request.

So, presumably, your app already breaks if a user uses the 'Refresh'
button on the page, even pre-SP2?

 This is an old application that has been working fine for many years,
 so I would like to change it minimal. Let me know if anyone has any
 thoughts to handle this.

You'll have to modify your app.

One approach would be to have one change of state going into the page
that requires the control, and another once you know the control is
active - but that's difficult to do if the control stays installed
between sessions.

- Peter

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



Re: Absolute Guide for config of JDBC Connection Pool ?

2006-01-20 Thread Hassan Schroeder
g m wrote:

   This problem is 'windows' (yes, spealt...B:A:D)..related.

probably. :-)

   Same code works on the unix box. Not sure why it be different. 

WARNING: A docBase C:\Program Files\Apache Software Foundation\
Tomcat 5.5\webapps\DBS3 inside the host appBase ...

Many people have reported problems on Windows boxes with Tomcat and
Java installed in directories with spaces in the names; you might
reinstall using e.g. `C:\java` and `C:`tomcat_5.5` or whatever...

   Having said that, what you suggest below is interesting and I 
 will address once I have hello world on XP working

I'll fix the broken configuration after I have it running? Maybe
not the ideal approach. :-)

FWIW!
-- 
Hassan Schroeder - [EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

  dream.  code.



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



Re: Windows XP SP2 - design question

2006-01-20 Thread Snow white
 So, presumably, your app already breaks if a user uses the 'Refresh'
 button on the page, even pre-SP2?

Its a quickly passing intermediate page, that checks for a few things
on the end user pC and sends a report back to the server. Ofcourse the
app breaks if the user uses the 'Refresh' button, but this page is
there only for hardly a few seconds and the user is advised not to
refresh. In fact, we also have a seperate 'click here to continue if
you are stuck here' on this page that takes the user out of this page
in a graceful manner.



  This is an old application that has been working fine for many years,
  so I would like to change it minimal. Let me know if anyone has any
  thoughts to handle this.

 You'll have to modify your app.

 One approach would be to have one change of state going into the page
 that requires the control, and another once you know the control is
 active - but that's difficult to do if the control stays installed
 between sessions.



Exactly. Once the control is installed it is not much of a problem
using it next time.

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



Windows XP SP2 - design question

2006-01-20 Thread Snow white
Hello fellow tomcat users,
I have a problem with how IE works on Win XP SP2. I did not find
anything in the archives so posting it here.

I have a web page with an activex control in it served through a
servlet. the javascript in the webpage interfaces with the activex and
then refreshes the page to proceed on to the next page. We use a
cookie to maintain the state that determines what is sent to the
client, and we update the cookie in every response of this URL
request.

The problem is that on windows xp sp2, IE does not install activex 
control automatically but rather shows the end user an yellow bar on
the top to install the AX control. But when the user clicks on this to
install the AX, IE sends a request for the same URL again, but with
the latest set of cookies. This is a problem because my application
logic requires the earlier value of the cookie to send the same page
again.


Ideally, IE should just have sent the same http request and not
request the same url.

This is an old application that has been working fine for many years,
so I would like to change it minimal. Let me know if anyone has any
thoughts to handle this.

Thanks!

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



Remote address filter for host Alias

2006-01-20 Thread Patricio Keilty
Hi,
I need to restrict access to my webapp to some IP adresses on a per-domain name
basis. In our tomcat server we are using an Alias/ element to serve both
domains from same host as the following config shows:

Host name=www.mydomain.com  .. 
Aliaswww-i.mydomain.com/Alias
Context path= docBase= debug=0 . /
/Host

Is it possible to use a RemoteAddrValve for each domain, each which different IP
address sets? Using RemoteAddrValve as Host/ subelement won't work, as will
apply to both, any suggestions?

Thanks,
--p



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



Re: MultipartFileUploadApp succeeds uploading file - but not upploaded

2006-01-20 Thread Markus Schönhaber
Geir Ove Skjaervik wrote:
 I am running Tomcat 5.5 locally on my computer under Windows XP Pro. I
 am trying to upload a simple 1 line text file to the server to a
 directory called uploads located directly under ROOT.

 I am uses the Jakarta HTTPClient and the MultipartFileUploadApp example
 to do this. The uploads directory is not username / password
 protected:  I have successfully downloaded contents of files from this
 directory using a simple Http Connection in a Java program.

 MultipartFileUploadApp says the upload succeded, and returns the Server
 (Tomcat) response which is simply Html that lists the contents of the
 uploads directory: It does NOT contain the file I tried to uplad.
 Checking the directory in the FIle Explorer confirms the file is not
 there.

To make uploads work you'll have to provide the appropriate functionality on 
the server side - for example create a servlet that handles the upload. You 
might want take a look at
http://jakarta.apache.org/commons/fileupload/

Regards
  mks

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



RE: MultipartFileUploadApp succeeds uploading file - but not upploaded

2006-01-20 Thread Geir Ove Skjaervik
Hello,

Thanks a lot for your answer! I am suprprised that HTTPClient then does
not give an error message!

I will take a look at FileUpload!

Thanks again.

Geir Ove

-Original Message-
From: Markus Schönhaber [mailto:[EMAIL PROTECTED] 
Sent: 20. januar 2006 17:33
To: Tomcat Users List
Subject: Re: MultipartFileUploadApp succeeds uploading file - but not
upploaded


Geir Ove Skjaervik wrote:
 I am running Tomcat 5.5 locally on my computer under Windows XP Pro. I

 am trying to upload a simple 1 line text file to the server to a 
 directory called uploads located directly under ROOT.

 I am uses the Jakarta HTTPClient and the MultipartFileUploadApp 
 example to do this. The uploads directory is not username / password
 protected:  I have successfully downloaded contents of files from this

 directory using a simple Http Connection in a Java program.

 MultipartFileUploadApp says the upload succeded, and returns the 
 Server
 (Tomcat) response which is simply Html that lists the contents of the
 uploads directory: It does NOT contain the file I tried to uplad.
 Checking the directory in the FIle Explorer confirms the file is not
 there.

To make uploads work you'll have to provide the appropriate
functionality on 
the server side - for example create a servlet that handles the upload.
You 
might want take a look at http://jakarta.apache.org/commons/fileupload/

Regards
  mks

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



All endpoints are disconnected or dead

2006-01-20 Thread Edward Quick

Hi,

I've been getting the following mod_jk errors and wondered whether they were 
serious or not because the Tomcat I use is running for about 10 minutes then 
falls over with a coredump. This has been happening all day.


[Fri Jan 20 17:16:49 2006] [info]  jk_ajp_common.c (1225): All endpoints are 
disconnected or dead
[Fri Jan 20 17:16:49 2006] [info]  jk_ajp_common.c (1749): Sending request 
to tomcat failed,  recoverable operation attempt=1
[Fri Jan 20 17:17:05 2006] [info]  jk_ajp_common.c (1178): Socket 20 is not 
connected any more (errno=-1)
[Fri Jan 20 17:17:05 2006] [info]  jk_ajp_common.c (1202): Error sending 
request. Will try another pooled connection
[Fri Jan 20 17:17:05 2006] [info]  jk_ajp_common.c (1225): All endpoints are 
disconnected or dead
[Fri Jan 20 17:17:05 2006] [info]  jk_ajp_common.c (1749): Sending request 
to tomcat failed,  recoverable operation attempt=1
[Fri Jan 20 17:17:10 2006] [info]  jk_ajp_common.c (1178): Socket 21 is not 
connected any more (errno=-1)
[Fri Jan 20 17:17:10 2006] [info]  jk_ajp_common.c (1202): Error sending 
request. Will try another pooled connection


I'm using apache 2.0.54. tomcat 4.1.31 with jdk 1.4.2_10, and mod_jk 1.2.15.

Thanks for any help.

Ed.



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



File descriptors vs. CGI execution

2006-01-20 Thread Martin Dubuc
 I am running Tomcat 5.5.12.

I have noticed with lsof that every time a CGI script is executed within 
Tomcat, the number of file descriptors used by Tomcat increases by 1. Once in a 
while, the number of file descriptors drops to its initial level. However, I am 
seeing many instances where the number of file descriptors increases steadily 
until it reaches a large number (around 1000 files). At that point, when the 
script executes, the web server generates an HTTP status 500 error page. If I 
execute the script after the Web server has done some maintenance work and the 
number of file descriptors is back to an acceptable level, then, the CGI script 
executes without any issues.

I have done some experiments by running some java code as part of an 
application that runs on the Web server. If I run a system call (unsing 
Runtime.getRuntime().exec) and grab the input/output/error streams, but do not 
explicitly close them, the number of file descriptor in use increases and stays 
to this level for some time. Eventually, it comes back to the original number. 
I have the impression that there is a link between garbage collection and the 
recylcing of file descriptors.

Anybody has experienced something similar? Is this an issue that should be 
solved in Tomcat. Are there workarounds?

Martin



-
Yahoo! Photos
 Got holiday prints? See all the ways to get quality prints in your hands ASAP.

reload when class file is updated

2006-01-20 Thread Scott Purcell
Hello,

 

I am working on a webapp that was originally a war file. The war
extracted to abc context.

 

Some background:

The war file when deflated (automatically) created a
/abct/META-INF/context.xml  and inside had the abc context information.
I added reloadable=true like so there inside the META-INF directory.

Context reloadable=true path=/abc

 

Also, it put a context here:

$TOMCAT_HOME/conf/Catalina/localhost/abc.xml

And inside I added the reloadable=true here it is:

Context reloadable=true path=/abc /

 

Now also, I am using JNDI, so I added my JNDI Resource ... stuff under
web.xml and the context @ META-INF. But for whatever reason the JNDI
could not find the databaseURL definition.

 

So I added it to the $TOMCAT_HOME/conf/Catalina/localhost/abc.xml and
added the Resource stuff there. Still no luck.

 

Going against my grain, I added the full context under conf/server.xml
and all is happy.

So my database problem was solved.

 

Anyway, now when I dump a new java class into the webapp, it does not
reload ... it does something to the webserver and basically I end up
with a 404 until I restart the webserver?

 

This is killing me. I gave you the history above, because maybe having
different context entries is screwing things up.

 

Could someone please give a hand?

 

Thanks,



Re: Connection Pool Woes

2006-01-20 Thread Alex Turner
How do you deal with this when using pure JSTL sql calls using a
connection?  How does JSTL sql library release the connection at the
end of a page to ensure that connections don't get leaked?  For the
case when I'm using a servlet, I have put in an explicit close() call
on the connection, but some pages are pure JSP.

Alex.

On 1/20/06, Caldarale, Charles R [EMAIL PROTECTED] wrote:


  -Original Message-
  From: Alex Turner [mailto:[EMAIL PROTECTED]
  Subject: Re: Connection Pool Woes
 
  It looks like the connection object was not being garbage collected
  promptly (imagine that), and because it wasn't explicitly closed, it
  was just hanging open until garbage collection happened (I'm more used
  to python's garbage collector that is a bit more prompt).

 Garbage collection should have nothing to do with it; don't confuse
 finalizers with finally clauses.  If your application operation is
 dependent on a finalizer, you're in a world of hurt.  There is no
 guarantee that a finalizer will _ever_ be run.

  - Chuck


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

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



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



Re: Tomcat5 and LDAP authentication

2006-01-20 Thread Derrick
Hi Pulkit,

Thanks for the suggestions. After MUCH testing and searching, it did turn
out to be the LDAP's configuration and not Tomcat.  I verified this by
authenticating to another test LDAP server we had.  The original LDAP we
were authenticating to isn't commercial or publicly distributed software,
but something someone in the department put together.

Derrick

On 1/9/06, Pulkit Singhal [EMAIL PROTECTED] wrote:

 Hello,

  However, if we enter in a
  correct username/password combination, it binds correctly, however it
 just
  hangs there as if it were awaiting response.  The LDAP logs indicate
 that
  it did successfully bind correctly with the username/password
 combination,
  but no search was performed.
  How can we get it so that if the correct username/password is entered,
 it
  lets us pass the login page?

 Seeing how nobody seems to have responded to your message yet...I do have
 a
 suggestion for you:
 - Try to find forums and/or mailing lists for your Directory Server and
 posting this issue there
 - for ex: if you happen to be using Sun ONE DS 5.2 then you can use their
 forums at http://swforum.sun.com/jive/forum.jspa?forumID=13
 - Or if you have a proprietary DS...try contacting their support...I think
 tomcat *should be* popular enough for them to have run into this with
 another client at least once.
 - Oh and by the way...do post the solution/progress here...should you
 find/make any.

 Cheers,
 - Pulkit

 On 1/9/06, Derrick [EMAIL PROTECTED] wrote:
 
  Nobody?
 
  On 1/6/06, Derrick Woo [EMAIL PROTECTED] wrote:
  
   I'm having a bit of a tough time getting Tomcat5 to authenticate
  correctly
   to our LDAP server.  It connects using the service account, and then
   attempts to bind using the username and password entered at the login
  page
   to confirm if it is valid.
  
   As it is set up right now, if an invalid username/password is entered,
   catalina_log confirms that bind attempt failed and Username XXX NOT
   successfully authenticated just as we expect.  However, if we enter
 in
  a
   correct username/password combination, it binds correctly, however it
  just
   hangs there as if it were awaiting response.  The LDAP logs indicate
  that
   it did successfully bind correctly with the username/password
  combination,
   but no search was performed.
  
   Here is the relevent section of my server.xml file:
  
 Realm className=org.apache.catalina.realm .JNDIRealm
 debug=99
connectionURL=ldap://ldap.domain.com;
connectionName=uid=admin,ou=ldapadmin,o=domain.com
connectionPassword=xx
userPattern=uid={0},ou=it,o=domain.com
userBase=ou=it,o=domain.com
/
  
   Am I missing out on something here?  I tried playing around with some
 of
   the different attributes mentioned in the Jakarta Tomcat JNDIRealm
   documentation, but still get the same results.  We are not using any
  roles.
  
   How can we get it so that if the correct username/password is entered,
  it
   lets us pass the login page?
  
 
 




Re: Remote address filter for host Alias

2006-01-20 Thread Pulkit Singhal
 Using RemoteAddrValve as Host/ subelement won't work, as will
apply to both, any suggestions?

Why not just do:

Host name=www.mydomain.com  .. 
   Context path= docBase= debug=0 . /
/Host
Host name=www-i.mydomain.com http://www.mydomain.com/  .. 
   Context path= docBase= debug=0 . /
/Host

Ofcourse I'm pretty new to this so you might see some cons to this :)

Cheers,
- Pulkit

On 1/20/06, Patricio Keilty [EMAIL PROTECTED] wrote:

 Hi,
 I need to restrict access to my webapp to some IP adresses on a per-domain
 name
 basis. In our tomcat server we are using an Alias/ element to serve both
 domains from same host as the following config shows:

 Host name=www.mydomain.com  .. 
 Aliaswww-i.mydomain.com/Alias
 Context path= docBase= debug=0 . /
 /Host

 Is it possible to use a RemoteAddrValve for each domain, each which
 different IP
 address sets? Using RemoteAddrValve as Host/ subelement won't work, as
 will
 apply to both, any suggestions?

 Thanks,
 --p



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




(newb) Tomcat servlet mapping problem

2006-01-20 Thread Darren Hall
I'm running Tomcat 5.0.30 and Apache 2.0 (both are running fine and without
errors).

I've connected them using mod_jk2, and I can see that apache is correctly
forwarding URLs specified in the workers2.properties file correctly.

 

I am now attempting to map a test servlet called SimpleServlet to an URL.

I've deployed the servlet in the directory SimpleServlet. In the
webapps/SimpleServlet/WEB-INF directory I've added the following web.xml
file:

 

?xml version=1.0 encoding=ISO-8859-1?

web-app xmlns=http://java.sun.com/xml/ns/j2ee;

xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;

xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;

version=2.4

 

servlet

servlet-nameSimpleServlet/servlet-name

servlet-classus.souther.simple.SimpleServlet/servlet-class

/servlet

 

servlet-mapping

servlet-nameSimpleServlet/servlet-name

url-pattern/simple-servlet/url-pattern

/servlet-mapping

 

/web-app

 

In the ${catalina.home}/conf/Catalina/localhost directory, I've added the
following SimpleServlet.xml file:

 

?xml version='1.0' encoding='utf-8'?

!-- Make the servlet reloadable --

Context path=/simple-servlet docBase=SimpleServlet reloadable=true
debug=99

  Logger className=org.apache.catalina.logger.FileLogger

  directory=logs  prefix=simple. suffix=.log

  timestamp=true/

/Context

 

In the workers2.properties file (on the Apache side), I've added the
following entry:

 

[uri:localhost/simple-servlet/*]

worker=ajp13:localhost:8009

debug=99

 

When I try to hit the URL http://localhost/simple-servlet I get back this
response from Tomcat:

 

HTTP Status 404 -/simple-servlet

type Status report

message /simple-servlet

description The requested resource (/simple-servlet) is not available.

Apache Tomcat / 5.0.30

 

Can anyone please tell me why my servlet is not mapped to the URL properly?

 

Thanks.

 

Darren



Thank you for reply.

2006-01-20 Thread Jack
Paul Singleton wrote:
Unless you specify the key with Connector ... keyAlias=xyz ... / (works 
with 5.5.9 and later, dunno about older versions)
then it seems to pick an arbitrary one (the newest?)

Thank you for your effort to reply me.
I didn't specify the keyAlias. I was using 5.5.12.
I didn't spend time on that. I just delete the newest key.
then everything is fine.

I check its sha1  md5 digest, and I am 100% sure it just picked the newest 
key. I don't know the reason. I don't want to put time on it.
I just want to let other people know it.

[EMAIL PROTECTED]




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



Re: Calling Realm.authenticate() doesn't register Principal in with the Session??

2006-01-20 Thread Mark Thomas
Ken Johanson wrote:
 Mark Thomas wrote:
 Ken Johanson wrote:
 I am able to access the current context's org.apache.catalina.Realm
 object using Yoav Shapira's Tomcat-Realm example; however, when I call
 Realm.authenticate(String user, String pass), the Principal object that
 it returns is not being registered with the session..
snip
 Shouldn't authenticate() register the Principal with the Session
 automatically? Or do I need to call register() in interface
 Authenticator?
You would need to find a way to call register()

 What are you trying to do? From the amount of access you seem to need
 to Tomcat internals, you might be better off just writing a custom
 realm and/or authenticator.

 Mark


 
 Mark,
 
 I'm trying to write a facade API that will call into whatever
 Realm/Authenticator that the user already has configured (though an
 abstract/overridden method)... the idea being that no changes to the
 user's existing auth config or modules are required, nor that the user
 should need to change out any custom realm/authenticator that they may
 have written, for mine. So the solution needs to transparently call into
 some existing method(s) in the 'Base' classes or interface impls..
To do what? What user requirement are you trying to meet? Technically
I understand what you are trying to do but not the fundamental why.
Knowing your ultimate aim may enable people on this list to suggest an
alternative approach.

Mark


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



Re: tomcat realm with digest password configuration help

2006-01-20 Thread Mark Thomas
philguillard wrote:
 Realm className=org.apache.catalina.realm.MemoryRealm debug=2
 digest=MD5/
 
 login-config
  !--auth-methodBASIC/auth-method--
  auth-methodDIGEST/auth-method
  realm-nameProtected area/realm-name
 /login-config

You are using DIGEST authentication AND digested passwords. You need
to generate the digest differently in this case. See
http://tomcat.apache.org/tomcat-5.5-doc/realm-howto.html

Mark


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



ClassLoader/Security Manager Question

2006-01-20 Thread George Sexton
I'm trying to get my app to run under the security manager and I'm hitting
some problems. 

I have class B, derived from class A, in Jar B in the WEB-INF/lib directory

Class A is in Jar A in the shared/lib directory.

I created an entry in the catalina.policy file:

grant codeBase file:${catalina.base}/shared/- {
permission java.lang.RuntimePermission accessClassInPackage.*;
permission java.security.AllPermission;
};

When a method defined in Class A uses reflection to get the constructors for
Class B, the following error message happens:

01/20/2006 13:24:36 java.security.AccessControlException: access denied 
(java.lang.RuntimePermission accessDeclaredMembers)
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java
:264)
at java.security.AccessController.checkPermission(AccessController.java:427)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkMemberAccess(SecurityManager.java:1662)
at java.lang.Class.checkMemberAccess(Class.java:2125)
at java.lang.Class.getDeclaredConstructor(Class.java:1952)

I've done some research and it seems like what I'm trying to do should work
if I specify accessClassInPackage. I've tried explicitly setting the class A
package in the accessClassInPackage statement but I'm not making any
headway.

I would rather not put Jar A in WEB-INF/lib because I have something like
100 contexts that all use that jar and I'm already hitting issues with
PermGenSpace. I also can't put Jar B in shared/lib because of design (or
lack thereof).

Does anyone have any ideas (other than the obvious one of putting Jar A in
WEB-INF/lib)?

George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585
 


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



RE: mod_jk connection problem after couple of days or a week

2006-01-20 Thread Guernsey, Byron \(GE Consumer Industrial\)

Just wanted to point out that on #1 below: many real world environments
have web servers in a DMZ and a firewall between their web servers an
app servers.  The default assumption should be that AJP connections can
and are frequently broken.  Firewalls will do this to you.

I'm curious why tomcat and mod_jk both won't detect properly closed
sockets out of the box?  I can understand why firewall disconnects would
go unnoticed, but if you set cache_timeout, recycle_timeout, or
MaxRequestsPerClient, I'd expect the TCP connection to notify the other
end of the close and for the app server to detect it like any well
behaved TCP-based server. 

There are many ways to detect the properly closed socket- some
event-based ways as well, both in a C and Java.  It seems odd that we'd
need to set a timeout to wake up a server to cleanup properly closed
sockets- that should be inherent to its operation.

Byron
 

-Original Message-
From: Mladen Turk [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 20, 2006 5:19 AM
To: Tomcat Users List
Subject: Re: mod_jk connection problem after couple of days or a week

Jonathon Reeve wrote:
 Well I'm glad someone else is getting this, even if you have no idea 
 either. We wondered if we were missing some configuration from 
 workers.properties, since the quick start section
 (http://tomcat.apache.org/connectors-doc/howto/quick.html) on Tomcat's

 site gives an example minimum workers.properties:
 


Huh, you really tried everything :)

Couple of notes:
1. AJP connection is supposed to last forever.
2. cache_timeout, recycle_timeout, MaxRequestsPerClient
tend to close the socket, so you have half-closed
sockets, and that's why you are leaking resources.
3. Whenever there is a need to recycle one end of the
channel the other end must be recycled too.
This is done by setting connectionTimeout=milliseconds
in server.xml for AJP/1.3 connector.
4. If you need full failover add 'connection_timeout' and
'prepost_timeout' to each worker.
This implicates that CPING/CPONG packets will be send
before each request is forwarded to Tomcat.

Regards,
Mladen.

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



Setting up connection pools on the fly...

2006-01-20 Thread Warrick Wilson
I've got a project where there's a basic interface, with some basic 
database access. However, when someone signs up, then a new MySQL 
database will be allocated for them. There's security associated with 
it, and the user will have to log in to identify himself. 

How can I create a new connection pool for that new database for my 
web app? My current pool is set up in context.xml - do I modify that 
on the fly from my web app?

What I'm doing currently is figuring out who the user is and which 
database he's associated with, and when I do any database work, the 
first statement is USE databasename to get the proper database.

Is there a better approach? More like a proper approach? (Says he who 
isn't sure he fully understands connection pools yet)

-- 
Warrick Wilson
[EMAIL PROTECTED]

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



ClassLoader/Security Manager Question

2006-01-20 Thread George Sexton
I'm trying to get my app to run under the security manager and I'm hitting
some problems. 

I have class B, derived from class A, in Jar B in the WEB-INF/lib directory

Class A is in Jar A in the shared/lib directory.

I created an entry in the catalina.policy file:

grant codeBase file:${catalina.base}/shared/- {
permission java.lang.RuntimePermission accessClassInPackage.*;
permission java.security.AllPermission;
};

When a method defined in Class A uses reflection to get the constructors for
Class B, the following error message happens:

01/20/2006 13:24:36 java.security.AccessControlException: access denied 
(java.lang.RuntimePermission accessDeclaredMembers)
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java
:264)
at java.security.AccessController.checkPermission(AccessController.java:427)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkMemberAccess(SecurityManager.java:1662)
at java.lang.Class.checkMemberAccess(Class.java:2125)
at java.lang.Class.getDeclaredConstructor(Class.java:1952)

I've done some research and it seems like what I'm trying to do should work
if I specify accessClassInPackage. I've tried explicitly setting the class A
package in the accessClassInPackage statement but I'm not making any
headway.

I would rather not put Jar A in WEB-INF/lib because I have something like
100 contexts that all use that jar and I'm already hitting issues with
PermGenSpace. I also can't put Jar B in shared/lib because of design (or
lack thereof).

Does anyone have any ideas (other than the obvious one of putting Jar A in
WEB-INF/lib)?

George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585
 


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



Sending a lot of info the a jsp page

2006-01-20 Thread Dola Woolfe
Hi,

This question will reveal how little I know about
networking or http or something else.

Basically I wrote an applet that sends data to a
servlet. I do it by forming a url with a query string
(GET). But this doesn't work when there's too much
data.

What are my options?
Is it possible to use POST?
Or, better yet, is it possible to send a java object
by creating a socket connection with the servlet?

Very many thanks in advance!

Dola

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



Re: Remote address filter for host Alias

2006-01-20 Thread Patricio Keilty
Pulkit Singhal pulkitsinghal at gmail.com writes:

 
  Using RemoteAddrValve as Host/ subelement won't work, as will
 apply to both, any suggestions?
 
 Why not just do:
 
 Host name=www.mydomain.com  .. 
Context path= docBase= debug=0 . /
 /Host
 Host name=www-i.mydomain.com http://www.mydomain.com/  .. 
Context path= docBase= debug=0 . /
 /Host
 

Pulkit,
that option is not possible since both domains are served by just one instance
of the application, that is one Host, that´s the motivation behind using
Alias/ in first place.

I have managed to create a Tomcat Valve similar to RemoteAddrValve, which
instead of obtaining just remote ip addr, it also gets the server name, making
possible to use this kind of pattern in the valve allow atribute:

   Valve class=.myValve
allow=www-i.mydomain.com/192.168.*.*,www.mydomain.com/10.146.*.* /

--p





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



Re: Sending a lot of info the a jsp page

2006-01-20 Thread Glen Mazza

Dola Woolfe wrote:


Hi,

This question will reveal how little I know about
networking or http or something else.

Basically I wrote an applet that sends data to a
servlet. I do it by forming a url with a query string
(GET). But this doesn't work when there's too much
data.

What are my options?
Is it possible to use POST?


This article: http://www.javaworld.com/javaworld/javatips/jw-javatip34.html
gives a sample applet that uses HTTP POST.

Glen


Or, better yet, is it possible to send a java object
by creating a socket connection with the servlet?

Very many thanks in advance!

Dola




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



Re: Sending a lot of info the a jsp page

2006-01-20 Thread Dola Woolfe


--- Leon Rosenberg [EMAIL PROTECTED]
wrote:

 On 1/20/06, Dola Woolfe [EMAIL PROTECTED] wrote:
  Hi,
 
  This question will reveal how little I know about
  networking or http or something else.
 
  Basically I wrote an applet that sends data to a
  servlet. I do it by forming a url with a query
 string
  (GET). But this doesn't work when there's too much
  data.
 
  What are my options?
  Is it possible to use POST?
  Or, better yet, is it possible to send a java
 object
  by creating a socket connection with the servlet?
 
 Creating a socket is the easiest way for you, the
 only restriction is,
 that you can only connect to the server the applet
 came from (unless
 its signed) and have to bypass proxies etc. by
 yourself. And you need
 of course something listening to the socket on the
 other end...
 
 regards
 Leon
 

Can you point to some documentation or examples?

Will I be able to do this in the context of a servlet
(or a jsp page) or will I have to write an altogether
new beast running alongside tomcat that is listening
to a socket on some other port?

Thanks!

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



RE: Setting up connection pools on the fly...

2006-01-20 Thread Tim Lucia
In a previous life, I worked on a portal-type enterprise application in
which a single deployment supported multiple customers.  For each
deployment, there was a master database, and n customer databases, one per
customer.  The general mechanism we used there was to put the connection
pool connections to the master database (catalog), and then do a
connection.setCatalog() for the customer-specific data.  This of course
means that you have a single DB server which hosts the master + n customer
DBs.

So, that's one approach that works in a production world.

To modify the datasources on the fly would require (I think) your own
context / JNDI provider (rather then Tomcat's) which maintained the list of
available DataSources.

Tim

-Original Message-
From: Warrick Wilson [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 20, 2006 3:52 PM
To: users@tomcat.apache.org
Subject: Setting up connection pools on the fly...

I've got a project where there's a basic interface, with some basic 
database access. However, when someone signs up, then a new MySQL 
database will be allocated for them. There's security associated with 
it, and the user will have to log in to identify himself. 

How can I create a new connection pool for that new database for my 
web app? My current pool is set up in context.xml - do I modify that 
on the fly from my web app?

What I'm doing currently is figuring out who the user is and which 
database he's associated with, and when I do any database work, the 
first statement is USE databasename to get the proper database.

Is there a better approach? More like a proper approach? (Says he who 
isn't sure he fully understands connection pools yet)

-- 
Warrick Wilson
[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: ClassLoader/Security Manager Question

2006-01-20 Thread Larry Isaacs
For reasons that are difficult to predict or calculate,
some other protection domain (i.e. codeBase) for somebody
in the stack may be missing this permission.  I've given
up trying to figure these out after the obvious doesn't
fix it.

Try adding:

 -Djava.security.debug=access,failure

to your Tomcat startup arguments.  Hopefully you can capture
the output around the point of failure.  There will be a lot
of output.

Look for access denied.  That will give you the missing
permission.  Not to far below that you can find the domain
that failed, which will give you the codeBase missing the
permission.  It is not unusual to see something unexpected.
Somewhere below that you can see the permissions that this
domain does currently have.  This is where you might find that
a permission you tried to grant has a typo, so it doesn't serve
its purpose.  Give it a try and see if anything turns up.

Cheers,
Larry

 -Original Message-
 From: George Sexton [mailto:[EMAIL PROTECTED] 
 Sent: Friday, January 20, 2006 3:46 PM
 To: 'Tomcat Users List'
 Subject: ClassLoader/Security Manager Question
 
 I'm trying to get my app to run under the security manager 
 and I'm hitting some problems. 
 
 I have class B, derived from class A, in Jar B in the 
 WEB-INF/lib directory
 
 Class A is in Jar A in the shared/lib directory.
 
 I created an entry in the catalina.policy file:
 
 grant codeBase file:${catalina.base}/shared/- {
 permission java.lang.RuntimePermission 
 accessClassInPackage.*;
 permission java.security.AllPermission; };
 
 When a method defined in Class A uses reflection to get the 
 constructors for Class B, the following error message happens:
 
 01/20/2006 13:24:36 java.security.AccessControlException: 
 access denied (java.lang.RuntimePermission 
 accessDeclaredMembers) at 
 java.security.AccessControlContext.checkPermission(AccessContr
 olContext.java
 :264)
 at 
 java.security.AccessController.checkPermission(AccessControlle
 r.java:427)
 at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
 at 
 java.lang.SecurityManager.checkMemberAccess(SecurityManager.java:1662)
 at java.lang.Class.checkMemberAccess(Class.java:2125)
 at java.lang.Class.getDeclaredConstructor(Class.java:1952)
 
 I've done some research and it seems like what I'm trying to 
 do should work if I specify accessClassInPackage. I've tried 
 explicitly setting the class A package in the 
 accessClassInPackage statement but I'm not making any headway.
 
 I would rather not put Jar A in WEB-INF/lib because I have 
 something like 100 contexts that all use that jar and I'm 
 already hitting issues with PermGenSpace. I also can't put 
 Jar B in shared/lib because of design (or lack thereof).
 
 Does anyone have any ideas (other than the obvious one of 
 putting Jar A in WEB-INF/lib)?
 
 George Sexton
 MH Software, Inc.
 http://www.mhsoftware.com/
 Voice: 303 438 9585
  
 
 
 -
 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: Calling Realm.authenticate() doesn't register Principal in with the Session??

2006-01-20 Thread Ken Johanson

...


I'm trying to write a facade API that will call into whatever
Realm/Authenticator that the user already has configured (though an
abstract/overridden method)... the idea being that no changes to the
user's existing auth config or modules are required, nor that the user
should need to change out any custom realm/authenticator that they may
have written, for mine. So the solution needs to transparently call into
some existing method(s) in the 'Base' classes or interface impls..

To do what? What user requirement are you trying to meet? Technically
I understand what you are trying to do but not the fundamental why.
Knowing your ultimate aim may enable people on this list to suggest an
alternative approach.

Mark



The intent is that a simple library can be deployed into the (at 
server/lib or shared/lib), and from any webapp, calling into that 
wrapper class will allow the app to authenticate and register the user.. 
irregardless of what specific authenticate/realm modules are being used.


A very simple example, is that I would like for users to login on a html 
form, by entering not just their username - but maybe their email 
address (any number of them), or pub key (to be hypothetical)... then 
its it will be up to the webapp to search a database beforehand, to 
lookup the email address or pub key, and get the userid, then pass it to 
the auth module if, say, the account is current, the password age isn't 
expired, etc.


All completely independent of what Realm/Authent. is config'd for any 
webapp. Only the username and password (and which webapp as implied by 
the context path contained in Request).: static boolean 
Tomcat5.authenticate(request, response, user, pass);


Creating and deploying my own version of this class is not feasible, 
because :


-users should have the option to write the account validation logic in JSP

-Users may already have a custom impl, and should not have to extend or 
implement or compile anything in that impl. to support this lib. Be it 
their own impl or their choice-use of tomcat JDBC realm.


Thanks,
Ken



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



Re: Sending a lot of info the a jsp page

2006-01-20 Thread TonyCoco
Hi Dola
  yes you can use  POST for an unlimited amount of data but of course you'll 
need to set your http headers correctly, specifically the Content-Length header.

 -- Original message --
From: Dola Woolfe [EMAIL PROTECTED]
 Hi,
 
 This question will reveal how little I know about
 networking or http or something else.
 
 Basically I wrote an applet that sends data to a
 servlet. I do it by forming a url with a query string
 (GET). But this doesn't work when there's too much
 data.
 
 What are my options?
 Is it possible to use POST?
 Or, better yet, is it possible to send a java object
 by creating a socket connection with the servlet?
 
 Very many thanks in advance!
 
 Dola
 
 __
 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]



increase limit Xmx

2006-01-20 Thread Andri Herumurti
how to increase limit of Xmx?
   
  i use suse linux enterprise server 9, but i need to increase the limit of Xmx 
so it can become more than 1800m?
   
  Thanks
  Andri


-
 
 What are the most popular cars?  Find out at Yahoo! Autos

Re: Connection Pool Woes

2006-01-20 Thread Len Popp
As far as I can tell, the JSTL sql: actions are supposed to close
the connections that they use. I can't say for sure, because *my* way
of dealing with this is to never access the database directly in a
JSP. :-)
--
Len

On 1/20/06, Alex Turner [EMAIL PROTECTED] wrote:
 How do you deal with this when using pure JSTL sql calls using a
 connection?  How does JSTL sql library release the connection at the
 end of a page to ensure that connections don't get leaked?  For the
 case when I'm using a servlet, I have put in an explicit close() call
 on the connection, but some pages are pure JSP.

 Alex.

 On 1/20/06, Caldarale, Charles R [EMAIL PROTECTED] wrote:
 
 
   -Original Message-
   From: Alex Turner [mailto:[EMAIL PROTECTED]
   Subject: Re: Connection Pool Woes
  
   It looks like the connection object was not being garbage collected
   promptly (imagine that), and because it wasn't explicitly closed, it
   was just hanging open until garbage collection happened (I'm more used
   to python's garbage collector that is a bit more prompt).
 
  Garbage collection should have nothing to do with it; don't confuse
  finalizers with finally clauses.  If your application operation is
  dependent on a finalizer, you're in a world of hurt.  There is no
  guarantee that a finalizer will _ever_ be run.
 
   - Chuck
 
 
  THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
  MATERIAL and is thus for use only by the intended recipient. If you
  received this in error, please contact the sender and delete the e-mail
  and its attachments from all computers.
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

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

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



Re: Sending a lot of info the a jsp page

2006-01-20 Thread Bill Barker

Dola Woolfe [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hi,

 This question will reveal how little I know about
 networking or http or something else.

 Basically I wrote an applet that sends data to a
 servlet. I do it by forming a url with a query string
 (GET). But this doesn't work when there's too much
 data.

 What are my options?
 Is it possible to use POST?
 Or, better yet, is it possible to send a java object
 by creating a socket connection with the servlet?


Actually, combining these two is often easiest (of course, your java Object 
must implement Serializable for this to work).  Something like (Applet 
code):

 URL servlet = new URL(getDocumentBase(), /path/to/my/servlet);
 HttpURLConnection conn = (HttpURLConnection)servlet.openConnection();
 conn.setDoInput(true);
 conn.setDoOutput(true);
 conn.setRequestMethod(POST);
 conn.setHeaderField(Content-Type, application/x-java);
 ObjectOutputStream out = new 
ObjectOutputStream(conn.getOutputStream());
 out.writeObject(myObject);
 int status = conn.getResponseCode();
 if(isOK(status)) {
 InputStream in = conn.getInputStream();
// Handle response here.
 }


 Very many thanks in advance!

 Dola

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



RE: ClassLoader/Security Manager Question

2006-01-20 Thread George Sexton
Thanks for your help. With the debugging tip you gave me, I was able to
figure it out.

It turns out that the problem was Class B trying to reference class A?

grant codeBase file:Z:/CDAILY/WEB-INF/classes/- {
permission java.lang.RuntimePermission accessDeclaredMembers;
permission java.lang.RuntimePermission
accessClassInPackage.com.MHSoftware.db.*;
};

Now all I have to figure out is how to handle the grant to the codebase when
I have a hundred jars...

George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585
  

 -Original Message-
 From: Larry Isaacs [mailto:[EMAIL PROTECTED] 
 Sent: Friday, January 20, 2006 4:37 PM
 To: Tomcat Users List
 Subject: RE: ClassLoader/Security Manager Question
 
 For reasons that are difficult to predict or calculate,
 some other protection domain (i.e. codeBase) for somebody
 in the stack may be missing this permission.  I've given
 up trying to figure these out after the obvious doesn't
 fix it.
 
 Try adding:
 
  -Djava.security.debug=access,failure
 
 to your Tomcat startup arguments.  Hopefully you can capture
 the output around the point of failure.  There will be a lot
 of output.
 
 Look for access denied.  That will give you the missing
 permission.  Not to far below that you can find the domain
 that failed, which will give you the codeBase missing the
 permission.  It is not unusual to see something unexpected.
 Somewhere below that you can see the permissions that this
 domain does currently have.  This is where you might find that
 a permission you tried to grant has a typo, so it doesn't serve
 its purpose.  Give it a try and see if anything turns up.
 
 Cheers,
 Larry
 
  -Original Message-
  From: George Sexton [mailto:[EMAIL PROTECTED] 
  Sent: Friday, January 20, 2006 3:46 PM
  To: 'Tomcat Users List'
  Subject: ClassLoader/Security Manager Question
  
  I'm trying to get my app to run under the security manager 
  and I'm hitting some problems. 
  
  I have class B, derived from class A, in Jar B in the 
  WEB-INF/lib directory
  
  Class A is in Jar A in the shared/lib directory.
  
  I created an entry in the catalina.policy file:
  
  grant codeBase file:${catalina.base}/shared/- {
  permission java.lang.RuntimePermission 
  accessClassInPackage.*;
  permission java.security.AllPermission; };
  
  When a method defined in Class A uses reflection to get the 
  constructors for Class B, the following error message happens:
  
  01/20/2006 13:24:36 java.security.AccessControlException: 
  access denied (java.lang.RuntimePermission 
  accessDeclaredMembers) at 
  java.security.AccessControlContext.checkPermission(AccessContr
  olContext.java
  :264)
  at 
  java.security.AccessController.checkPermission(AccessControlle
  r.java:427)
  at 
 java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
  at 
  
 java.lang.SecurityManager.checkMemberAccess(SecurityManager.java:1662)
  at java.lang.Class.checkMemberAccess(Class.java:2125)
  at java.lang.Class.getDeclaredConstructor(Class.java:1952)
  
  I've done some research and it seems like what I'm trying to 
  do should work if I specify accessClassInPackage. I've tried 
  explicitly setting the class A package in the 
  accessClassInPackage statement but I'm not making any headway.
  
  I would rather not put Jar A in WEB-INF/lib because I have 
  something like 100 contexts that all use that jar and I'm 
  already hitting issues with PermGenSpace. I also can't put 
  Jar B in shared/lib because of design (or lack thereof).
  
  Does anyone have any ideas (other than the obvious one of 
  putting Jar A in WEB-INF/lib)?
  
  George Sexton
  MH Software, Inc.
  http://www.mhsoftware.com/
  Voice: 303 438 9585
   
  
  
  
 -
  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]