Re: Universal connection pooling Type Casting problem

2010-04-19 Thread Harry Metske
2010/4/19 SivaKumarl sivakum...@naradaproducts.com


 Hi Friends,
  I am using universal connection pooling for connecting database ,
 while configuring manually i able to connect to database,but while
 configuring in server.xml i am unable to cast the datasource i am getting
 the class cast exception, please find the below configuration and error
 details , correct me if i configured wrong .I am using Tomcat 6.0

 server.xml configurartion

  Context docBase=UCP path=/UCP reloadable=true
 source=org.eclipse.jst.jee.server:UCP
  Resource auth=Container description=DataSource Reference
 driverClassName=oracle.jdbc.OracleDriver
maxActive=4 maxIdle=2 maxWait=5000
 name=jdbc/oracleds factory=oracle.jdbc.pool.OracleDataSource


shouldn't that be something like
factory=oracle.jdbc.pool.OracleDataSourceFactory
or  factory=oracle.jdbc.connector.OracleManagedConnectionFactory


   username=branch password=branch
 type=oracle.ucp.jdbc.PoolDataSourceImpl
url=jdbc:oracle:thin:@//192.168.203.12:1521/ycs
 validationQuery=select 1 from dual/
  /Context

 Error Details
 javax.naming.NamingException: Could not create resource factory instance
 [Root exception is java.lang.ClassCastException:
 oracle.jdbc.pool.OracleDataSource cannot be cast to
 javax.naming.spi.ObjectFactory]
at

 org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:102)
at
 javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at TestServlet.doGet(TestServlet.java:37)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at

 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at

 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at

 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at

 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at

 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at

 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at

 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at

 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at
 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
 Caused by: java.lang.ClassCastException: oracle.jdbc.pool.OracleDataSource
 cannot be cast to javax.naming.spi.ObjectFactory
at

 org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:98)
... 20 more


 Java code for retrieving connection

 Context initContext;
try {
initContext = new InitialContext();

Context envContext  =
 (Context)initContext.lookup(java:/comp/env);
DataSource ds =
 (DataSource)envContext.lookup(jdbc/oracleds);
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}



 Thanks in Advance
 Siva kumar

 --
 View this message in context:
 http://old.nabble.com/Universal-connection-pooling-Type-Casting-problem-tp28287054p28287054.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Oracle Universal connection pooling type cast problem while configuring in server.xml

2010-04-19 Thread Harry Metske
this is an exact cut/paste from an earlier post, it won't help you repeating
the same questions.

regards,
Harry


2010/4/19 Thangavelu.V thangavel...@yalamanchili.co.in

 Hi Friends,
  I am using universal connection pooling for connecting database ,
 while configuring manually i able to connect to database,but while
 configuring in server.xml i am unable to cast the datasource i am getting
 the class cast exception, please find the below configuration and error
 details , correct me if i configured wrong , I am  using Tomcat 6.0

 server.xml configurartion

  Context docBase=UCP path=/UCP reloadable=true
 source=org.eclipse.jst.jee.server:UCP
  Resource auth=Container description=DataSource Reference
 driverClassName=oracle.jdbc.OracleDriver
maxActive=4 maxIdle=2 maxWait=5000
 name=jdbc/oracleds factory=oracle.jdbc.pool.OracleDataSource
username=branch password=branch
 type=oracle.ucp.jdbc.PoolDataSourceImpl
url=jdbc:oracle:thin:@//192.168.203.12:1521/ycs
 validationQuery=select 1 from dual/
  /Context

 Error Details
 javax.naming.NamingException: Could not create resource factory instance
 [Root exception is java.lang.ClassCastException:
 oracle.jdbc.pool.OracleDataSource cannot be cast to
 javax.naming.spi.ObjectFactory]
at

 org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.
 java:102)
at
 javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at TestServlet.doGet(TestServlet.java:37)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at

 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
 FilterChain.java:290)
at

 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
 ain.java:206)
at

 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
 va:233)
at

 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
 va:191)
at

 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128
 )
at

 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102
 )
at

 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
 :109)
at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at

 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http
 11Protocol.java:583)
at
 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
 Caused by: java.lang.ClassCastException: oracle.jdbc.pool.OracleDataSource
 cannot be cast to javax.naming.spi.ObjectFactory
at

 org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.
 java:98)
... 20 more


 Java code for retrieving connection

 Context initContext;
try {
initContext = new InitialContext();

Context envContext  =
 (Context)initContext.lookup(java:/comp/env);
DataSource ds =
 (DataSource)envContext.lookup(jdbc/oracleds);
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}






 Thanks and Regards,

 V.Thangavelu

 Software Engineer

 This e-mail message may contain confidential, proprietary or legally
 privileged information. It should not be used by anyone who is not the
 original intended recipient. If you have erroneously received this message,
 please delete it immediately and notify the sender. The recipient
 acknowledges that YALAMANCHILI or its subsidiaries and associated
 companies,
 are unable to exercise control or ensure or guarantee the integrity of/over
 the contents of the information contained in e-mail transmissions and
 further acknowledges that any views expressed in this message are those of
 the individual sender and no binding nature of the message shall be implied
 or assumed unless the sender does so expressly with due authority of
 YALAMANCHILI Group.  Before opening any attachments please check them for
 viruses and defects.






Single Sign On Valve

2010-04-19 Thread Arnab Ghosh
Hello Friends,

I want to know about the Single Sign On Valve. Why/when should we use this
valve??

I have already studied the documentation about this. But I haven't got a
clear idea about it. Is there any relation of Single-Sign-On with session
management??

Please help me on this.

Thanks,
Arnab Ghosh


Re: Single Sign On Valve

2010-04-19 Thread Pid
On 19/04/2010 08:05, Arnab Ghosh wrote:
 Hello Friends,
 
 I want to know about the Single Sign On Valve. Why/when should we use this
 valve??
 
 I have already studied the documentation about this. But I haven't got a
 clear idea about it. Is there any relation of Single-Sign-On with session
 management??

When a user logs onto one webapp, they are also authenticated to other
webapps with the same authentication method when the SSO valve is
configured on a Host.


p



signature.asc
Description: OpenPGP digital signature


Re: Universal connection pooling Type Casting problem

2010-04-19 Thread Pid
On 19/04/2010 07:56, Harry Metske wrote:
 2010/4/19 SivaKumarl sivakum...@naradaproducts.com
 

 Hi Friends,
  I am using universal connection pooling for connecting database ,
 while configuring manually i able to connect to database,but while
 configuring in server.xml i am unable to cast the datasource i am getting
 the class cast exception, please find the below configuration and error
 details , correct me if i configured wrong .I am using Tomcat 6.0

 server.xml configurartion

  Context docBase=UCP path=/UCP reloadable=true
 source=org.eclipse.jst.jee.server:UCP
  Resource auth=Container description=DataSource Reference
 driverClassName=oracle.jdbc.OracleDriver
maxActive=4 maxIdle=2 maxWait=5000
 name=jdbc/oracleds factory=oracle.jdbc.pool.OracleDataSource


 shouldn't that be something like
 factory=oracle.jdbc.pool.OracleDataSourceFactory
 or  factory=oracle.jdbc.connector.OracleManagedConnectionFactory


You'll also need a:

 type=javax.sql.DataSource


p


username=branch password=branch
 type=oracle.ucp.jdbc.PoolDataSourceImpl
url=jdbc:oracle:thin:@//192.168.203.12:1521/ycs
 validationQuery=select 1 from dual/
  /Context

 Error Details
 javax.naming.NamingException: Could not create resource factory instance
 [Root exception is java.lang.ClassCastException:
 oracle.jdbc.pool.OracleDataSource cannot be cast to
 javax.naming.spi.ObjectFactory]
at

 org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:102)
at
 javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at TestServlet.doGet(TestServlet.java:37)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at

 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at

 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at

 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at

 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at

 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at

 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at

 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at

 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at
 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
 Caused by: java.lang.ClassCastException: oracle.jdbc.pool.OracleDataSource
 cannot be cast to javax.naming.spi.ObjectFactory
at

 org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:98)
... 20 more


 Java code for retrieving connection

 Context initContext;
try {
initContext = new InitialContext();

Context envContext  =
 (Context)initContext.lookup(java:/comp/env);
DataSource ds =
 (DataSource)envContext.lookup(jdbc/oracleds);
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}



 Thanks in Advance
 Siva kumar

 --
 View this message in context:
 http://old.nabble.com/Universal-connection-pooling-Type-Casting-problem-tp28287054p28287054.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


 




signature.asc
Description: OpenPGP digital signature


memory problems / time outs

2010-04-19 Thread Woude, Alexander van der
Hello All

For a client I developed a few Data webservices. In total there are 7 services.
All are CXF based webservices that use hibernate.

I keep having memory problems, so I increased both JAVA_OPTS as CATALINA_OPTS.
Now I get timed out errors and tomcat blocks completely, I only can resolve 
things by restarting the tomcat server.

I did profile my services and I did profile my hibernate DAO's and it seems 
fine.
I have no clue where to look anymore for a solution, any idea is welcome.

I use tomcat-6.0.18 on RedHat enterprise linux 5 , 64 bit version. With a 
OpenJDK java6 64 JVM.

Thanks 
Alex






This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is 
intended only for the person to whom it is addressed. If you are not the 
intended recipient, you are not authorized to 
read, print, retain, copy, disseminate, distribute, or use this message or any 
part thereof. If you receive this message 
in error, please notify the sender immediately and delete all copies of this 
message.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



set time out based on userInRole

2010-04-19 Thread Søren Blidorf
Is it possible to set time out time on the server base don how is logged
id

 

Soren, DK

 



Re: set time out based on userInRole

2010-04-19 Thread Pid
On 19/04/2010 12:51, Søren Blidorf wrote:
 Is it possible to set time out time on the server base don how is logged
 id

Any chance you can rephrase the question?


p




signature.asc
Description: OpenPGP digital signature


RE: memory problems / time outs

2010-04-19 Thread Woude, Alexander van der
Sorry a small correction. The client times out, because the tomcat gives a Heap 
Space memory error.

config in startup.sh :

export JAVA_OPTS=-Xms128m -Xmx512m
export CATALINA_OPTS=-Xms512m -XX:MaxPermSize=512m

My apps are 7 war, that  each contain its own deps. Size of 1 war is 14 MB

How do I check the memory the tomcat uses?

Greetings
Alex



Van: Woude, Alexander van der [alexander.vander.wo...@capgemini.com]
Verzonden: maandag 19 april 2010 13:49
Aan: users@tomcat.apache.org
Onderwerp: memory problems / time outs

Hello All

For a client I developed a few Data webservices. In total there are 7 services.
All are CXF based webservices that use hibernate.

I keep having memory problems, so I increased both JAVA_OPTS as CATALINA_OPTS.
Now I get timed out errors and tomcat blocks completely, I only can resolve 
things by restarting the tomcat server.

I did profile my services and I did profile my hibernate DAO's and it seems 
fine.
I have no clue where to look anymore for a solution, any idea is welcome.

I use tomcat-6.0.18 on RedHat enterprise linux 5 , 64 bit version. With a 
OpenJDK java6 64 JVM.

Thanks
Alex






This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is
intended only for the person to whom it is addressed. If you are not the 
intended recipient, you are not authorized to
read, print, retain, copy, disseminate, distribute, or use this message or any 
part thereof. If you receive this message
in error, please notify the sender immediately and delete all copies of this 
message.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org







This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is 
intended only for the person to whom it is addressed. If you are not the 
intended recipient, you are not authorized to 
read, print, retain, copy, disseminate, distribute, or use this message or any 
part thereof. If you receive this message 
in error, please notify the sender immediately and delete all copies of this 
message.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: memory problems / time outs

2010-04-19 Thread Pid
On 19/04/2010 12:49, Woude, Alexander van der wrote:
 Hello All
 
 For a client I developed a few Data webservices. In total there are 7 
 services.
 All are CXF based webservices that use hibernate.
 
 I keep having memory problems, so I increased both JAVA_OPTS as CATALINA_OPTS.
 Now I get timed out errors and tomcat blocks completely, I only can resolve 
 things by restarting the tomcat server.
 
 I did profile my services and I did profile my hibernate DAO's and it seems 
 fine.
 I have no clue where to look anymore for a solution, any idea is welcome.

Take a series of thread dumps after the server starts to manifest
problems.  Look for differences between each dump and see if you can
work out what's wrong.  E.g. Lots of threads which are blocked.

I think the jstack tool is available in OpenJDK.


p

 I use tomcat-6.0.18 on RedHat enterprise linux 5 , 64 bit version. With a 
 OpenJDK java6 64 JVM.
 
 Thanks 
 Alex
 
 
 
 
 
 
 This message contains information that may be privileged or confidential and 
 is the property of the Capgemini Group. It is 
 intended only for the person to whom it is addressed. If you are not the 
 intended recipient, you are not authorized to 
 read, print, retain, copy, disseminate, distribute, or use this message or 
 any part thereof. If you receive this message 
 in error, please notify the sender immediately and delete all copies of this 
 message.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 




signature.asc
Description: OpenPGP digital signature


SV: set time out based on userInRole

2010-04-19 Thread Søren Blidorf
Sure.

Fx if you are admin no connectionTimeout and if you are user
connectionTimeout 20 min

Soren

-Oprindelig meddelelse-
Fra: Pid [mailto:p...@pidster.com] 
Sendt: 19. april 2010 13:55
Til: Tomcat Users List
Emne: Re: set time out based on userInRole

On 19/04/2010 12:51, Søren Blidorf wrote:
 Is it possible to set time out time on the server base don how is logged
 id

Any chance you can rephrase the question?


p




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Client cert authentication

2010-04-19 Thread acastanheira2001

Hi,

I have an apache server in front of Tomcat/Jboss, the former receives the
client cert and does revocation list and trust validation.

I need to pass the client cert to Tomcat only to check the SubjectAltNames.

As far as trust accreditation is done by apache, does Tomcat need to have a
keystore and https set?

Thanks, 
André
-- 
View this message in context: 
http://old.nabble.com/Client-cert-authentication-tp28287654p28287654.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Client cert authentication

2010-04-19 Thread Mark Thomas
On 19/04/2010 13:05, acastanheira2001 wrote:
 
 Hi,
 
 I have an apache server in front of Tomcat/Jboss, the former receives the
 client cert and does revocation list and trust validation.
 
 I need to pass the client cert to Tomcat only to check the SubjectAltNames.
 
 As far as trust accreditation is done by apache, does Tomcat need to have a
 keystore and https set?

No.

Mark



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: memory problems / time outs

2010-04-19 Thread Pid
On 19/04/2010 12:54, Woude, Alexander van der wrote:
 Sorry a small correction. The client times out, because the tomcat gives a 
 Heap Space memory error.
 
 config in startup.sh :
 
 export JAVA_OPTS=-Xms128m -Xmx512m
 export CATALINA_OPTS=-Xms512m -XX:MaxPermSize=512m

You're setting -Xms twice there.  Why?

Why are you setting the memory in two different environment variables?

 My apps are 7 war, that  each contain its own deps. Size of 1 war is 14 MB
 
 How do I check the memory the tomcat uses?

 jmap -heap pid

You could post the result of that here.


p


 Greetings
 Alex
 
 
 
 Van: Woude, Alexander van der [alexander.vander.wo...@capgemini.com]
 Verzonden: maandag 19 april 2010 13:49
 Aan: users@tomcat.apache.org
 Onderwerp: memory problems / time outs
 
 Hello All
 
 For a client I developed a few Data webservices. In total there are 7 
 services.
 All are CXF based webservices that use hibernate.
 
 I keep having memory problems, so I increased both JAVA_OPTS as CATALINA_OPTS.
 Now I get timed out errors and tomcat blocks completely, I only can resolve 
 things by restarting the tomcat server.
 
 I did profile my services and I did profile my hibernate DAO's and it seems 
 fine.
 I have no clue where to look anymore for a solution, any idea is welcome.
 
 I use tomcat-6.0.18 on RedHat enterprise linux 5 , 64 bit version. With a 
 OpenJDK java6 64 JVM.
 
 Thanks
 Alex
 
 
 
 
 
 
 This message contains information that may be privileged or confidential and 
 is the property of the Capgemini Group. It is
 intended only for the person to whom it is addressed. If you are not the 
 intended recipient, you are not authorized to
 read, print, retain, copy, disseminate, distribute, or use this message or 
 any part thereof. If you receive this message
 in error, please notify the sender immediately and delete all copies of this 
 message.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 
 
 
 
 This message contains information that may be privileged or confidential and 
 is the property of the Capgemini Group. It is 
 intended only for the person to whom it is addressed. If you are not the 
 intended recipient, you are not authorized to 
 read, print, retain, copy, disseminate, distribute, or use this message or 
 any part thereof. If you receive this message 
 in error, please notify the sender immediately and delete all copies of this 
 message.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 




signature.asc
Description: OpenPGP digital signature


Re: memory problems / time outs

2010-04-19 Thread Harry Metske
2010/4/19 Woude, Alexander van der alexander.vander.wo...@capgemini.com

 Sorry a small correction. The client times out, because the tomcat gives a
 Heap Space memory error.

 config in startup.sh :

 export JAVA_OPTS=-Xms128m -Xmx512m
 export CATALINA_OPTS=-Xms512m -XX:MaxPermSize=512m

 My apps are 7 war, that  each contain its own deps. Size of 1 war is 14 MB

 How do I check the memory the tomcat uses?


you can also enable JMX, see
http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html#Enabling
JMX Remote and use jconsole to monitor real time memory usage.



 Greetings
 Alex


 
 Van: Woude, Alexander van der [alexander.vander.wo...@capgemini.com]
 Verzonden: maandag 19 april 2010 13:49
 Aan: users@tomcat.apache.org
 Onderwerp: memory problems / time outs

 Hello All

 For a client I developed a few Data webservices. In total there are 7
 services.
 All are CXF based webservices that use hibernate.

 I keep having memory problems, so I increased both JAVA_OPTS as
 CATALINA_OPTS.
 Now I get timed out errors and tomcat blocks completely, I only can resolve
 things by restarting the tomcat server.

 I did profile my services and I did profile my hibernate DAO's and it seems
 fine.
 I have no clue where to look anymore for a solution, any idea is welcome.

 I use tomcat-6.0.18 on RedHat enterprise linux 5 , 64 bit version. With a
 OpenJDK java6 64 JVM.

 Thanks
 Alex






 This message contains information that may be privileged or confidential
 and is the property of the Capgemini Group. It is
 intended only for the person to whom it is addressed. If you are not the
 intended recipient, you are not authorized to
 read, print, retain, copy, disseminate, distribute, or use this message or
 any part thereof. If you receive this message
 in error, please notify the sender immediately and delete all copies of
 this message.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org







 This message contains information that may be privileged or confidential
 and is the property of the Capgemini Group. It is
 intended only for the person to whom it is addressed. If you are not the
 intended recipient, you are not authorized to
 read, print, retain, copy, disseminate, distribute, or use this message or
 any part thereof. If you receive this message
 in error, please notify the sender immediately and delete all copies of
 this message.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




RE: memory problems / time outs

2010-04-19 Thread Woude, Alexander van der
Thanks for the suggestions this far. 
I had an oversight with the tomcat monitoring, didnt notice it on the site.

I will try that just as the suggestions about JStack etc.

why 2 Xms settings?
I thought to have understood that catalina en java opts were 2 seperate things 
but I was wrong?

Thanks
Alex

Van: Harry Metske [harry.met...@gmail.com]
Verzonden: maandag 19 april 2010 14:16
Aan: Tomcat Users List
Onderwerp: Re: memory problems / time outs

2010/4/19 Woude, Alexander van der alexander.vander.wo...@capgemini.com

 Sorry a small correction. The client times out, because the tomcat gives a
 Heap Space memory error.

 config in startup.sh :

 export JAVA_OPTS=-Xms128m -Xmx512m
 export CATALINA_OPTS=-Xms512m -XX:MaxPermSize=512m

 My apps are 7 war, that  each contain its own deps. Size of 1 war is 14 MB

 How do I check the memory the tomcat uses?


you can also enable JMX, see
http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html#Enabling
JMX Remote and use jconsole to monitor real time memory usage.



 Greetings
 Alex


 
 Van: Woude, Alexander van der [alexander.vander.wo...@capgemini.com]
 Verzonden: maandag 19 april 2010 13:49
 Aan: users@tomcat.apache.org
 Onderwerp: memory problems / time outs

 Hello All

 For a client I developed a few Data webservices. In total there are 7
 services.
 All are CXF based webservices that use hibernate.

 I keep having memory problems, so I increased both JAVA_OPTS as
 CATALINA_OPTS.
 Now I get timed out errors and tomcat blocks completely, I only can resolve
 things by restarting the tomcat server.

 I did profile my services and I did profile my hibernate DAO's and it seems
 fine.
 I have no clue where to look anymore for a solution, any idea is welcome.

 I use tomcat-6.0.18 on RedHat enterprise linux 5 , 64 bit version. With a
 OpenJDK java6 64 JVM.

 Thanks
 Alex






 This message contains information that may be privileged or confidential
 and is the property of the Capgemini Group. It is
 intended only for the person to whom it is addressed. If you are not the
 intended recipient, you are not authorized to
 read, print, retain, copy, disseminate, distribute, or use this message or
 any part thereof. If you receive this message
 in error, please notify the sender immediately and delete all copies of
 this message.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org







 This message contains information that may be privileged or confidential
 and is the property of the Capgemini Group. It is
 intended only for the person to whom it is addressed. If you are not the
 intended recipient, you are not authorized to
 read, print, retain, copy, disseminate, distribute, or use this message or
 any part thereof. If you receive this message
 in error, please notify the sender immediately and delete all copies of
 this message.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org








This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is 
intended only for the person to whom it is addressed. If you are not the 
intended recipient, you are not authorized to 
read, print, retain, copy, disseminate, distribute, or use this message or any 
part thereof. If you receive this message 
in error, please notify the sender immediately and delete all copies of this 
message.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: memory problems / time outs

2010-04-19 Thread Harry Metske
if you specify java options in JAVA_OPTS it is both valid for startup and
shutdown, if you specify java options in CATALINA_OPTS it is only valid for
startup.
So my guess is that CATALINA_OPTS is the right place in your situation.

regards,
Harry

2010/4/19 Woude, Alexander van der alexander.vander.wo...@capgemini.com

 Thanks for the suggestions this far.
 I had an oversight with the tomcat monitoring, didnt notice it on the site.

 I will try that just as the suggestions about JStack etc.

 why 2 Xms settings?
 I thought to have understood that catalina en java opts were 2 seperate
 things but I was wrong?

 Thanks
 Alex
 
 Van: Harry Metske [harry.met...@gmail.com]
 Verzonden: maandag 19 april 2010 14:16
 Aan: Tomcat Users List
 Onderwerp: Re: memory problems / time outs

 2010/4/19 Woude, Alexander van der alexander.vander.wo...@capgemini.com

  Sorry a small correction. The client times out, because the tomcat gives
 a
  Heap Space memory error.
 
  config in startup.sh :
 
  export JAVA_OPTS=-Xms128m -Xmx512m
  export CATALINA_OPTS=-Xms512m -XX:MaxPermSize=512m
 
  My apps are 7 war, that  each contain its own deps. Size of 1 war is 14
 MB
 
  How do I check the memory the tomcat uses?
 

 you can also enable JMX, see
 http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html#Enabling
 JMX Remote and use jconsole to monitor real time memory usage.



  Greetings
  Alex
 
 
  
  Van: Woude, Alexander van der [alexander.vander.wo...@capgemini.com]
  Verzonden: maandag 19 april 2010 13:49
  Aan: users@tomcat.apache.org
  Onderwerp: memory problems / time outs
 
  Hello All
 
  For a client I developed a few Data webservices. In total there are 7
  services.
  All are CXF based webservices that use hibernate.
 
  I keep having memory problems, so I increased both JAVA_OPTS as
  CATALINA_OPTS.
  Now I get timed out errors and tomcat blocks completely, I only can
 resolve
  things by restarting the tomcat server.
 
  I did profile my services and I did profile my hibernate DAO's and it
 seems
  fine.
  I have no clue where to look anymore for a solution, any idea is welcome.
 
  I use tomcat-6.0.18 on RedHat enterprise linux 5 , 64 bit version. With a
  OpenJDK java6 64 JVM.
 
  Thanks
  Alex
 
 
 
 
 
 
  This message contains information that may be privileged or confidential
  and is the property of the Capgemini Group. It is
  intended only for the person to whom it is addressed. If you are not the
  intended recipient, you are not authorized to
  read, print, retain, copy, disseminate, distribute, or use this message
 or
  any part thereof. If you receive this message
  in error, please notify the sender immediately and delete all copies of
  this message.
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 
 
 
 
  This message contains information that may be privileged or confidential
  and is the property of the Capgemini Group. It is
  intended only for the person to whom it is addressed. If you are not the
  intended recipient, you are not authorized to
  read, print, retain, copy, disseminate, distribute, or use this message
 or
  any part thereof. If you receive this message
  in error, please notify the sender immediately and delete all copies of
  this message.
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 






 This message contains information that may be privileged or confidential
 and is the property of the Capgemini Group. It is
 intended only for the person to whom it is addressed. If you are not the
 intended recipient, you are not authorized to
 read, print, retain, copy, disseminate, distribute, or use this message or
 any part thereof. If you receive this message
 in error, please notify the sender immediately and delete all copies of
 this message.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: memory problems / time outs

2010-04-19 Thread Pid
On 19/04/2010 13:24, Woude, Alexander van der wrote:
 Thanks for the suggestions this far. 
 I had an oversight with the tomcat monitoring, didnt notice it on the site.
 
 I will try that just as the suggestions about JStack etc.
 
 why 2 Xms settings?
 I thought to have understood that catalina en java opts were 2 seperate 
 things but I was wrong?

They are different.  I'm asking why you have set them, what are you
trying to achieve?


p

 Thanks
 Alex
 
 Van: Harry Metske [harry.met...@gmail.com]
 Verzonden: maandag 19 april 2010 14:16
 Aan: Tomcat Users List
 Onderwerp: Re: memory problems / time outs
 
 2010/4/19 Woude, Alexander van der alexander.vander.wo...@capgemini.com
 
 Sorry a small correction. The client times out, because the tomcat gives a
 Heap Space memory error.

 config in startup.sh :

 export JAVA_OPTS=-Xms128m -Xmx512m
 export CATALINA_OPTS=-Xms512m -XX:MaxPermSize=512m

 My apps are 7 war, that  each contain its own deps. Size of 1 war is 14 MB

 How do I check the memory the tomcat uses?

 
 you can also enable JMX, see
 http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html#Enabling
 JMX Remote and use jconsole to monitor real time memory usage.
 
 
 
 Greetings
 Alex


 
 Van: Woude, Alexander van der [alexander.vander.wo...@capgemini.com]
 Verzonden: maandag 19 april 2010 13:49
 Aan: users@tomcat.apache.org
 Onderwerp: memory problems / time outs

 Hello All

 For a client I developed a few Data webservices. In total there are 7
 services.
 All are CXF based webservices that use hibernate.

 I keep having memory problems, so I increased both JAVA_OPTS as
 CATALINA_OPTS.
 Now I get timed out errors and tomcat blocks completely, I only can resolve
 things by restarting the tomcat server.

 I did profile my services and I did profile my hibernate DAO's and it seems
 fine.
 I have no clue where to look anymore for a solution, any idea is welcome.

 I use tomcat-6.0.18 on RedHat enterprise linux 5 , 64 bit version. With a
 OpenJDK java6 64 JVM.

 Thanks
 Alex






 This message contains information that may be privileged or confidential
 and is the property of the Capgemini Group. It is
 intended only for the person to whom it is addressed. If you are not the
 intended recipient, you are not authorized to
 read, print, retain, copy, disseminate, distribute, or use this message or
 any part thereof. If you receive this message
 in error, please notify the sender immediately and delete all copies of
 this message.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org







 This message contains information that may be privileged or confidential
 and is the property of the Capgemini Group. It is
 intended only for the person to whom it is addressed. If you are not the
 intended recipient, you are not authorized to
 read, print, retain, copy, disseminate, distribute, or use this message or
 any part thereof. If you receive this message
 in error, please notify the sender immediately and delete all copies of
 this message.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


 
 
 
 
 
 
 This message contains information that may be privileged or confidential and 
 is the property of the Capgemini Group. It is 
 intended only for the person to whom it is addressed. If you are not the 
 intended recipient, you are not authorized to 
 read, print, retain, copy, disseminate, distribute, or use this message or 
 any part thereof. If you receive this message 
 in error, please notify the sender immediately and delete all copies of this 
 message.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 




signature.asc
Description: OpenPGP digital signature


RE: memory problems / time outs

2010-04-19 Thread Woude, Alexander van der
Wel actually when memeory problems appeared I started with the CATALINA_OPTS to 
increase memeory.
When after a while problems appeared again, I thought to understand that I had 
to increase the heap size op the JVM memory.

In the end I wanted more memeory allocated for the tomcat.
SO please tell me what is the best one for me, if u can.
And I am doubting now if it is in the right file, the startup.sh Can u confirm 
if that is okay?

Greetings Alexander


Van: Pid [...@pidster.com]
Verzonden: maandag 19 april 2010 14:50
Aan: Tomcat Users List
Onderwerp: Re: memory problems / time outs

On 19/04/2010 13:24, Woude, Alexander van der wrote:
 Thanks for the suggestions this far.
 I had an oversight with the tomcat monitoring, didnt notice it on the site.

 I will try that just as the suggestions about JStack etc.

 why 2 Xms settings?
 I thought to have understood that catalina en java opts were 2 seperate 
 things but I was wrong?

They are different.  I'm asking why you have set them, what are you
trying to achieve?


p

 Thanks
 Alex
 
 Van: Harry Metske [harry.met...@gmail.com]
 Verzonden: maandag 19 april 2010 14:16
 Aan: Tomcat Users List
 Onderwerp: Re: memory problems / time outs

 2010/4/19 Woude, Alexander van der alexander.vander.wo...@capgemini.com

 Sorry a small correction. The client times out, because the tomcat gives a
 Heap Space memory error.

 config in startup.sh :

 export JAVA_OPTS=-Xms128m -Xmx512m
 export CATALINA_OPTS=-Xms512m -XX:MaxPermSize=512m

 My apps are 7 war, that  each contain its own deps. Size of 1 war is 14 MB

 How do I check the memory the tomcat uses?


 you can also enable JMX, see
 http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html#Enabling
 JMX Remote and use jconsole to monitor real time memory usage.



 Greetings
 Alex


 
 Van: Woude, Alexander van der [alexander.vander.wo...@capgemini.com]
 Verzonden: maandag 19 april 2010 13:49
 Aan: users@tomcat.apache.org
 Onderwerp: memory problems / time outs

 Hello All

 For a client I developed a few Data webservices. In total there are 7
 services.
 All are CXF based webservices that use hibernate.

 I keep having memory problems, so I increased both JAVA_OPTS as
 CATALINA_OPTS.
 Now I get timed out errors and tomcat blocks completely, I only can resolve
 things by restarting the tomcat server.

 I did profile my services and I did profile my hibernate DAO's and it seems
 fine.
 I have no clue where to look anymore for a solution, any idea is welcome.

 I use tomcat-6.0.18 on RedHat enterprise linux 5 , 64 bit version. With a
 OpenJDK java6 64 JVM.

 Thanks
 Alex






 This message contains information that may be privileged or confidential
 and is the property of the Capgemini Group. It is
 intended only for the person to whom it is addressed. If you are not the
 intended recipient, you are not authorized to
 read, print, retain, copy, disseminate, distribute, or use this message or
 any part thereof. If you receive this message
 in error, please notify the sender immediately and delete all copies of
 this message.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org







 This message contains information that may be privileged or confidential
 and is the property of the Capgemini Group. It is
 intended only for the person to whom it is addressed. If you are not the
 intended recipient, you are not authorized to
 read, print, retain, copy, disseminate, distribute, or use this message or
 any part thereof. If you receive this message
 in error, please notify the sender immediately and delete all copies of
 this message.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org








 This message contains information that may be privileged or confidential and 
 is the property of the Capgemini Group. It is
 intended only for the person to whom it is addressed. If you are not the 
 intended recipient, you are not authorized to
 read, print, retain, copy, disseminate, distribute, or use this message or 
 any part thereof. If you receive this message
 in error, please notify the sender immediately and delete all copies of this 
 message.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org









This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is 
intended only for the person to whom it is addressed. If you are not the 
intended recipient, you are not authorized to 
read, print, retain, copy, 

Re: memory problems / time outs

2010-04-19 Thread Pid
On 19/04/2010 14:39, Woude, Alexander van der wrote:
 Pid, considering I put the _OPTS in my startup.sh file, can it be they are 
 not used?

It was probably used, but the settings you specified overlap with each
other, so the -Xms in JAVA_ is replaced by the second setting in CATALINA_

 What is the quickest way to find out?

 jmap -heap pid


p

 
 Van: Pid [...@pidster.com]
 Verzonden: maandag 19 april 2010 15:33
 Aan: Woude, Alexander van der
 Onderwerp: Re: memory problems / time outs
 
 On 19/04/2010 14:05, Woude, Alexander van der wrote:
 Wel actually when memeory problems appeared I started with the CATALINA_OPTS 
 to increase memeory.

 When after a while problems appeared again, I thought to understand that I 
 had to increase the heap size op the JVM memory.
 
 That's what you were doing.
 
 In the end I wanted more memeory allocated for the tomcat.
 SO please tell me what is the best one for me, if u can.
 
 JAVA_OPTS and CATALINA_OPTS are both used when the starting Tomcat,
 JAVA_OPTS is also used when stopping Tomcat.
 
 Environment variables don't apply separately to the JVM, Tomcat or
 applications, it's all set per JVM.
 
 All of the settings should be in CATALINA_OPTS in your case.
 
 And I am doubting now if it is in the right file, the startup.sh Can u 
 confirm if that is okay?
 
 Environment settings can be placed in bin/setenv.sh, create the file if
 it doesn't exist.
 
 
 p
 
 
 Greetings Alexander

 
 Van: Pid [...@pidster.com]
 Verzonden: maandag 19 april 2010 14:50
 Aan: Tomcat Users List
 Onderwerp: Re: memory problems / time outs

 On 19/04/2010 13:24, Woude, Alexander van der wrote:
 Thanks for the suggestions this far.
 I had an oversight with the tomcat monitoring, didnt notice it on the site.

 I will try that just as the suggestions about JStack etc.

 why 2 Xms settings?
 I thought to have understood that catalina en java opts were 2 seperate 
 things but I was wrong?

 They are different.  I'm asking why you have set them, what are you
 trying to achieve?


 p

 Thanks
 Alex
 
 Van: Harry Metske [harry.met...@gmail.com]
 Verzonden: maandag 19 april 2010 14:16
 Aan: Tomcat Users List
 Onderwerp: Re: memory problems / time outs

 2010/4/19 Woude, Alexander van der alexander.vander.wo...@capgemini.com

 Sorry a small correction. The client times out, because the tomcat gives a
 Heap Space memory error.

 config in startup.sh :

 export JAVA_OPTS=-Xms128m -Xmx512m
 export CATALINA_OPTS=-Xms512m -XX:MaxPermSize=512m

 My apps are 7 war, that  each contain its own deps. Size of 1 war is 14 MB

 How do I check the memory the tomcat uses?


 you can also enable JMX, see
 http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html#Enabling
 JMX Remote and use jconsole to monitor real time memory usage.



 Greetings
 Alex


 
 Van: Woude, Alexander van der [alexander.vander.wo...@capgemini.com]
 Verzonden: maandag 19 april 2010 13:49
 Aan: users@tomcat.apache.org
 Onderwerp: memory problems / time outs

 Hello All

 For a client I developed a few Data webservices. In total there are 7
 services.
 All are CXF based webservices that use hibernate.

 I keep having memory problems, so I increased both JAVA_OPTS as
 CATALINA_OPTS.
 Now I get timed out errors and tomcat blocks completely, I only can resolve
 things by restarting the tomcat server.

 I did profile my services and I did profile my hibernate DAO's and it seems
 fine.
 I have no clue where to look anymore for a solution, any idea is welcome.

 I use tomcat-6.0.18 on RedHat enterprise linux 5 , 64 bit version. With a
 OpenJDK java6 64 JVM.

 Thanks
 Alex






 This message contains information that may be privileged or confidential
 and is the property of the Capgemini Group. It is
 intended only for the person to whom it is addressed. If you are not the
 intended recipient, you are not authorized to
 read, print, retain, copy, disseminate, distribute, or use this message or
 any part thereof. If you receive this message
 in error, please notify the sender immediately and delete all copies of
 this message.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org







 This message contains information that may be privileged or confidential
 and is the property of the Capgemini Group. It is
 intended only for the person to whom it is addressed. If you are not the
 intended recipient, you are not authorized to
 read, print, retain, copy, disseminate, distribute, or use this message or
 any part thereof. If you receive this message
 in error, please notify the sender immediately and delete all copies of
 this message.


 -
 To unsubscribe, e-mail: 

Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-19 Thread laredotornado

Hi,

I'm using Tomcat 6.0.26 on Mac 10.6.3.  Currently, in my $CATALINA_HOME/logs
directory, Tomcat produces a localhost*log file with the date in the file
name for each day, for example -- localhost.2010-04-19.  Is there a way to
get Tomcat to generate simply localhost.log for whatever day today is?  If
not, does anyone know a shell short cut where I can just type in something
like vim ~/localhost.log and see the most current log without having to
specify today's date?

Thanks, - Dave
-- 
View this message in context: 
http://old.nabble.com/Way-to-generate-a-%22localhost.log%22-instead-of-%22localhost-4-20-2010.log%22--tp28287685p28287685.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-19 Thread Peter Crowther
Hmm.  As the log files will alpha-sort by date, something like vim `ls
~/localhost.log* | tail -1` might do it.  Beware - my shell script is rusty
at best.

- Peter

On 19 April 2010 15:29, laredotornado laredotorn...@gmail.com wrote:


 Hi,

 I'm using Tomcat 6.0.26 on Mac 10.6.3.  Currently, in my
 $CATALINA_HOME/logs
 directory, Tomcat produces a localhost*log file with the date in the file
 name for each day, for example -- localhost.2010-04-19.  Is there a way to
 get Tomcat to generate simply localhost.log for whatever day today is?
  If
 not, does anyone know a shell short cut where I can just type in something
 like vim ~/localhost.log and see the most current log without having to
 specify today's date?

 Thanks, - Dave
 --
 View this message in context:
 http://old.nabble.com/Way-to-generate-a-%22localhost.log%22-instead-of-%22localhost-4-20-2010.log%22--tp28287685p28287685.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




RE: Hung threads

2010-04-19 Thread Jeffrey Janner
Konstantin -

I assume that the APR code is responsible for issuing that call?

The reason I'm asking is that I moved the customer to a new server over
the weekend and they showed no sign of the problem on the new setup
(Windows 2008R2*, Sun JDK 1.6.0_20 x64, Tomcat 5.5.27, native lib
1.1.16). That setup was chosen because it closely matches another server
that was not displaying the problem (diffs: non-R2 2008, JDK 1.6.0_13).
Over last night, a normal Monday in SE ASIA, they only generated 14
worker threads.  I'll continue monitoring throughout the week to see if
this holds.

Since I still have the box, and have another similar setup I can use for
testing, I'll see if I can duplicate the issues, at least the creeping
thread leak, on those.  But for now, I've got my production setup back
stable.

I'm not completely ruling out a box/OS issue on the old hardware, but it
had been running fine for at least a year.  The box had started having
some odd behavior (appear to hang until you hit a key on the keyboard,
then blue screen - out of non-paged memory), that I traced down to a
recurring WinMgmt .NET performance counter error that had started
showing up in the Application Event logs every couple of minutes.  I
removed those counters from the performance monitoring and the system
appeared to stabilize.  Later, I had rasctrs error messages appear
every few seconds. Applying OS updates fixed that.  In both cases, the
error message text could not be determined from the dlls that should
have had them. (It had also halted 3 times since November with a CPU
error - only logged by the Dell server mgmt, not Windows - so we had
made the decision to replace the box.)

I had updated the JDK  native lib after the fixing the WinMgmt problem,
and that's when I started see the thread leak.  I backed out the JDK
upgrade, but still saw the leak.  I backed out the JDK, but never got a
night's production out of it before new server arrived.

Jeff

-Original Message-
From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] 
Sent: Friday, April 16, 2010 4:10 PM
To: Tomcat Users List
Subject: Re: Hung threads

2010/4/16 Jeffrey Janner jeffrey.jan...@polydyne.com
 Well, it's definitely deadlocking once it hits the maxThreads limit.

The worker is returned to the workers pool by an
AprEndpoint.recycleWorkerThread(..) call. If that call is skipped, the
workers will leak. That is theoretically. I do not remember any
reports on such an issue.

Do you have any error messages in your logs,  or in the catalina.out
file (aka the file that catches your stderr stream)?

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



***  NOTICE  *
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Problem moving from file upload servlet to JSP

2010-04-19 Thread Ken Bowen
Using Tomcat 6.0.18 (to be 6.0.26) and Google App Engine, for parallel  
development (different db tech)


Short form:  I need to accept a file upload in a servlet, do some  
computations on the upload, and then transition to a JSP with some  
data resulting from the computations. I'm having some trouble with the  
transition at the end.  I need either to make the current code work or  
find an

alternate way to achieve the goal.

Long form.  Here's the html for file upload (vanilla):

form name=csvUploadForm action=csvfileupload method=post  
enctype=multipart/form-data

File:input type=file name=csvfile2uploadbr/br
	input type=submit name=Submit value=Upload CSV File  
onclick=uploadCSVFile();return false;

/form

Here's the servlet mapping for the receiving/processing servlet:

servlet-mapping
servlet-nameCSVFileUpload/servlet-name
url-pattern/csvfileupload/*/url-pattern
/servlet-mapping

The CSVFileUpload servlet doPost method uses
org.apache.commons.fileupload.servlet.ServletFileUpload;
to accept and process the upload, and puts the resulting data into the  
db.  If I don't care about duplicates or partial matches,

this works fine; at the end of the servlet processing, I execute
response.sendRedirect(/myStartPage.jsp);
-- where response is the doPost's HttpServletResponse.

Now I need to deal with partial matches between incoming data from the  
upload, and information already in the db. Specifically,
I need to interact with the user to determine how to resolve the  
ambiguities.  I /thought/ I could create a bean with the necessary  
computed
info, use setAttribute to attach the bean to request (the doPost's  
HttpServletRequest), and then forward to a JSP with code like this:


String nextJSP = /nextPage.jsp;
	RequestDispatcher dispatcher =  
getServletContext().getRequestDispatcher(nextJSP);

dispatcher.forward(request, response);

Unfortunately, I'm running into the following errors showing in the log:

WARNING: Nested in javax.servlet.ServletException:  
org.apache.commons.fileupload.FileUploadBase 
$InvalidContentTypeException: the request doesn't contain a multipart/ 
form-data or multipart/mixed stream, content type header is null:
org.apache.commons.fileupload.FileUploadBase 
$InvalidContentTypeException: the request doesn't contain a multipart/ 
form-data or multipart/mixed stream, content type header is null
at org.apache.commons.fileupload.FileUploadBase 
$FileItemIteratorImpl.init(FileUploadBase.java:885)
at  
org 
.apache 
.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java: 
331)
at  
org 
.apache 
.commons 
.fileupload 
.servlet.ServletFileUpload.getItemIterator(ServletFileUpload.java:148)
at  
com 
.formrunner 
.servlets.CSVFileUploadServlet.doPost(CSVFileUploadServlet.java:53)
at  
com 
.formrunner 
.servlets.CSVFileUploadServlet.doGet(CSVFileUploadServlet.java:29)

.

The browser actually displays the nextPage.jsp page.  However, if one  
then clicks any navigation button, you get a version of the warning  
above showing in the browser.


I'm assuming that the CSVFileUpload servlet processing of the upload  
has stripped the request; hence the errors.


My goal is to get from the CSVFileUpload servlet to the nextPage.jsp  
with the partialMatch data in hand.  In the normal use case, this
will only be a couple of text lines.  However, at the extreme it could  
be hundreds of lines of mismatches.  I really don't care how I
accomplish the transition to nextPage.jsp, so if there's a better way  
than what I'm attempting here, please let me know.
{Anything written on the web would be great.}  [I assume that I could  
store the partialMatch data in the db under some appropriate key,  
get to nextPage using response.sendRedirect, and then retrieve the  
info, but that seems like more of a hack than ought to be necessary  
here.]


Thanks in advance,
Ken





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Oracle Universal connection pooling type cast problem while configuring in server.xml

2010-04-19 Thread Propes, Barry L
V.Thangavelu,

I ran into a similar error as what you state below a month or so ago.

Chuck Caldarale had made the suggestion, and it turned out to be the elixir for 
me, was to make ABSOLUTELY sure you had NO other classes (or jar files) of the 
same name, i.e. tomcat-dbcp.jar, floating around elsewhere in the directory 
anywhere.
It not only can, but will wreak havoc on this DBCP connection.

Double check that, clean it out if you find extras, kill of the context.xml 
file created from META-INF/ in the conf directory.

And try again.

That worked wonders for me.

Barry

-Original Message-
From: Harry Metske [mailto:harry.met...@gmail.com] 
Sent: Monday, April 19, 2010 2:04 AM
To: Tomcat Users List
Subject: Re: Oracle Universal connection pooling type cast problem while 
configuring in server.xml

this is an exact cut/paste from an earlier post, it won't help you repeating 
the same questions.

regards,
Harry


2010/4/19 Thangavelu.V thangavel...@yalamanchili.co.in



 server.xml configurartion

  Context docBase=UCP path=/UCP reloadable=true
 source=org.eclipse.jst.jee.server:UCP
  Resource auth=Container description=DataSource Reference
 driverClassName=oracle.jdbc.OracleDriver
maxActive=4 maxIdle=2 maxWait=5000
 name=jdbc/oracleds factory=oracle.jdbc.pool.OracleDataSource
username=branch password=branch
 type=oracle.ucp.jdbc.PoolDataSourceImpl
url=jdbc:oracle:thin:@//192.168.203.12:1521/ycs
 validationQuery=select 1 from dual/
  /Context

 Error Details
 javax.naming.NamingException: Could not create resource factory 
 instance [Root exception is java.lang.ClassCastException:
 oracle.jdbc.pool.OracleDataSource cannot be cast to 
 javax.naming.spi.ObjectFactory]
at

 org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.
 java:102)
at
 javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at org.apache.naming.NamingContext.lookup(NamingContext.java:793)



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Buen producto!!

2010-04-19 Thread Bocalinda
Estimado amigo,
?Cómo está usted recientemente? decirte una gran sorpresa!
Ktpshop compa?ía es una empresa de comercio electrónico de productos
que ha clasificado superior Asia --- (www.ktpshop.info) y cuenta con
la cooperación con Nokia, Sony, HP, etc durante muchos a?os, la
calidad del producto es muy bueno.
Ellos tienen una buena reputación, buena reacción muchas, y la entrega rápida.
Ahora, la empresa (ktpshop.com) amplía su alcance. Gracias por los
nuevos y antiguos clientes de apoyo, estos productos se venden a un
descuento.,
un montón de amigos ya han comprado los productos de la empresa,
y se elogió a los bienes,
He ordenado una computadoras portátiles de Apple,
Espero que no te lo pierdas.
saludos!

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat6 can't see tcnative-1.dll on win7-64 bit

2010-04-19 Thread Ake Tangkananond
Hello,

I have been struggling with the APR Tomcat 6 on my Windows 7 64-bit for few
hours. I can't make the native lib loaded. Can I have advise where I could
start investigating the problem ?

Here is the info
#1
I use
- Tomcat 6.0.26
- Tomcat Native 1.1.20


#2
C:\Program Files\Apache Software Foundation\Tomcat 6.0\binjava -version
java version 1.6.0_17
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01, mixed mode)

#3
C:\Program Files\Apache Software Foundation\Tomcat 6.0\bindir

 Directory of C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin

04/20/2010  01:42 AMDIR  .
04/20/2010  01:42 AMDIR  ..
03/10/2010  12:06 AM22,110 bootstrap.jar
04/20/2010  12:14 AM 2,969,600 openssl.exe
04/20/2010  01:30 AM74 setenv.bat
04/20/2010  01:16 AM   868,352 tcnative-1.dll
03/10/2010  12:06 AM26,484 tomcat-juli.jar
03/10/2010  12:06 AM78,336 tomcat6.exe
03/10/2010  12:06 AM98,304 tomcat6w.exe
   7 File(s)  4,063,260 bytes
   2 Dir(s)  48,143,810,560 bytes free

C:\Program Files\Apache Software Foundation\Tomcat 6.0\bintomcat6.exe
Apr 20, 2010 1:46:02 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path: C:\Program Files\Apache Software Foundation\Tomcat
6.0\bin;.;C:\Windows
\Sun\Java\bin;C:\Windows\system32;C:\Windows;%CommonProgramFiles%\Microsoft
Shared\Windows
Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\Syst
em32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\T
oshiba\Bluetooth Toshiba Stack\sys\;C:\Program Files (x86)\Toshiba\Bluetooth
Toshiba Stack\sys\x64\;c:\Program Files (x86)\Microsoft SQL
Server\90\Tools\binn\;C:\Program Files (x86)\VanDyke
Software\Clients\;C:\Program F
iles\TortoiseSVN\bin;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program
Files (x86)\VisualSVN Server\bin;C:\Program Files\MySQL\MySQL Server
5.1\bin;C:\PROGRA~1\DISKEE~1\DISKEE~1\;C:\Program Files\Common Files\Microso
ft Shared\Windows Live;C:\Program Files (x86)\IDM Computer
Solutions\UltraEdit\
Apr 20, 2010 1:46:02 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Apr 20, 2010 1:46:02 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1040 ms
...

Thank you so much in advance.


Regards,
Ake


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: SV: set time out based on userInRole

2010-04-19 Thread Bob Hall
Soren,

--- On Mon, 4/19/10 at 5:01 AM, Søren Blidorf so...@nolas.dk wrote:
 Fx if you are admin no connectionTimeout and if you are
 user
 connectionTimeout 20 min
 

session.setMaxInactiveInterval()

- Bob




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



how to link from a jsf to a jsf to form a new request?

2010-04-19 Thread Yucca Nel
my jsf is not getting rendered on a request from a linkable image using both 
graphicimage and outputlink. I suspect that outputlink does not start a new 
request and this is the cause? Should I be using command link because this is 
not a formand only a image banner with some image links.

Re: Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-19 Thread Pid
On 19/04/2010 15:29, laredotornado wrote:
 
 Hi,
 
 I'm using Tomcat 6.0.26 on Mac 10.6.3.  Currently, in my $CATALINA_HOME/logs
 directory, Tomcat produces a localhost*log file with the date in the file
 name for each day, for example -- localhost.2010-04-19.  Is there a way to
 get Tomcat to generate simply localhost.log for whatever day today is?  If
 not, does anyone know a shell short cut where I can just type in something
 like vim ~/localhost.log and see the most current log without having to
 specify today's date?

You know about using the tab key in shell?
Not being bothered to fill in the right filename seems a bit lame.


p




signature.asc
Description: OpenPGP digital signature


Re: Problem moving from file upload servlet to JSP

2010-04-19 Thread Pid
On 19/04/2010 17:06, Ken Bowen wrote:
 Using Tomcat 6.0.18 (to be 6.0.26) and Google App Engine, for parallel
 development (different db tech)
 
 Short form:  I need to accept a file upload in a servlet, do some
 computations on the upload, and then transition to a JSP with some data
 resulting from the computations. I'm having some trouble with the
 transition at the end.  I need either to make the current code work or
 find an
 alternate way to achieve the goal.
 
 Long form.  Here's the html for file upload (vanilla):
 
 form name=csvUploadForm action=csvfileupload method=post
 enctype=multipart/form-data
 File:input type=file name=csvfile2uploadbr/br
 input type=submit name=Submit value=Upload CSV File
 onclick=uploadCSVFile();return false;
 /form
 
 Here's the servlet mapping for the receiving/processing servlet:
 
 servlet-mapping
 servlet-nameCSVFileUpload/servlet-name
 url-pattern/csvfileupload/*/url-pattern
 /servlet-mapping

Why use a wildcard instead of an absolute/explicit path, in both the
action attribute and in the url-pattern?

 The CSVFileUpload servlet doPost method uses
 org.apache.commons.fileupload.servlet.ServletFileUpload;
 to accept and process the upload, and puts the resulting data into the
 db.  If I don't care about duplicates or partial matches,
 this works fine; at the end of the servlet processing, I execute
 response.sendRedirect(/myStartPage.jsp);
 -- where response is the doPost's HttpServletResponse.
 
 Now I need to deal with partial matches between incoming data from the
 upload, and information already in the db. Specifically,
 I need to interact with the user to determine how to resolve the
 ambiguities.  I /thought/ I could create a bean with the necessary computed
 info, use setAttribute to attach the bean to request (the doPost's
 HttpServletRequest), and then forward to a JSP with code like this:

 String nextJSP = /nextPage.jsp;
 RequestDispatcher dispatcher =
 getServletContext().getRequestDispatcher(nextJSP);
 dispatcher.forward(request, response);

/myStartPage.jsp or /nextPage.jsp?

When does the redirect occur and when does the forward occur, it's not
entirely clear.

 Unfortunately, I'm running into the following errors showing in the log:
 
 WARNING: Nested in javax.servlet.ServletException:
 org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the
 request doesn't contain a multipart/form-data or multipart/mixed stream,
 content type header is null:
 org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the
 request doesn't contain a multipart/form-data or multipart/mixed stream,
 content type header is null
 at
 org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.init(FileUploadBase.java:885)
 
 at
 org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:331)
 
 at
 org.apache.commons.fileupload.servlet.ServletFileUpload.getItemIterator(ServletFileUpload.java:148)
 
 at
 com.formrunner.servlets.CSVFileUploadServlet.doPost(CSVFileUploadServlet.java:53)
 
 at
 com.formrunner.servlets.CSVFileUploadServlet.doGet(CSVFileUploadServlet.java:29)

What's at CSVFileUploadServlet.java:53?

 The browser actually displays the nextPage.jsp page.  However, if one
 then clicks any navigation button, you get a version of the warning
 above showing in the browser.

So you're catching the exception before executing the forward?

 I'm assuming that the CSVFileUpload servlet processing of the upload has
 stripped the request; hence the errors.

I'm not sure I concur, it seems a little unclear as to what is really
happening at this point.


p


 My goal is to get from the CSVFileUpload servlet to the nextPage.jsp
 with the partialMatch data in hand.  In the normal use case, this
 will only be a couple of text lines.  However, at the extreme it could
 be hundreds of lines of mismatches.  I really don't care how I
 accomplish the transition to nextPage.jsp, so if there's a better way
 than what I'm attempting here, please let me know.
 {Anything written on the web would be great.}  [I assume that I could
 store the partialMatch data in the db under some appropriate key, get
 to nextPage using response.sendRedirect, and then retrieve the info, but
 that seems like more of a hack than ought to be necessary here.]
 
 Thanks in advance,
 Ken
 
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 




signature.asc
Description: OpenPGP digital signature


Re: how to link from a jsf to a jsf to form a new request?

2010-04-19 Thread Pid
On 20/04/2010 21:13, Yucca Nel wrote:
 my jsf is not getting rendered on a request from a linkable image using both 
 graphicimage and outputlink. I suspect that outputlink does not start a new 
 request and this is the cause? Should I be using command link because this is 
 not a formand only a image banner with some image links.

maybe



signature.asc
Description: OpenPGP digital signature


Re: [OT] Hung threads

2010-04-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jeffrey,

On 4/17/2010 2:15 PM, Jeffrey Janner wrote:
 And the solution to the attachment issue is removing the PGP signing
 stuff from your message in my reply.

Gotcha. Unfortunately, I have to use inline PGP because some email
clients are retarded when it comes to PGP-MIME and they don't display
anything at all. :(

Sorry for the way Outlook handles replies to PGP-signed messages. I
guess it's just another Microsoft product that doesn't play well with
others.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvMxf4ACgkQ9CaO5/Lv0PD4LwCfTWlYHimytAsKBHjSXJrd1OZf
lY0AoLZr+H5WKNHMPe5HDWET+J79TLTD
=Rsg8
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Problem moving from file upload servlet to JSP

2010-04-19 Thread André Warnier

Ken Bowen wrote:
...



Long form.  Here's the html for file upload (vanilla):

form name=csvUploadForm action=csvfileupload method=post 
enctype=multipart/form-data

File:input type=file name=csvfile2uploadbr/br
input type=submit name=Submit value=Upload CSV File 
onclick=uploadCSVFile();return false;

/form

Without and before getting to the Java stuff, I do not really understand 
why above you have a button of type submit, but with an onClick 
event triggering a javascript function.
Either the button should be of type button and have an onClick event 
handler, or it should be of type submit and not have an event handler.
I suspect that by specifying both, you may be generating 2 actions and 
confusing the browser and/or the receiving end.




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Problem moving from file upload servlet to JSP

2010-04-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ken,

On 4/19/2010 12:06 PM, Ken Bowen wrote:
 form name=csvUploadForm action=csvfileupload method=post 
 enctype=multipart/form-data File:input type=file
 name=csvfile2uploadbr/br input type=submit name=Submit
 value=Upload CSV File onclick=uploadCSVFile();return false; 
 /form

Looks good, except for that uploadCSVFile javascript trigger. Why not
just do a regular file upload? Is this some kinda AJAX thing?

 The CSVFileUpload servlet doPost method uses 
 org.apache.commons.fileupload.servlet.ServletFileUpload; to accept
 and process the upload, and puts the resulting data into the db.  If
 I don't care about duplicates or partial matches, this works fine; at
 the end of the servlet processing, I execute 
 response.sendRedirect(/myStartPage.jsp); -- where response is the
 doPost's HttpServletResponse.

That seems fine (ignoring the mismatch between myStartPage.jsp and
nextPage.jsp).

 String nextJSP = /nextPage.jsp; RequestDispatcher dispatcher = 
 getServletContext().getRequestDispatcher(nextJSP); 
 dispatcher.forward(request, response);

That's the correct way to do a forward.

 Unfortunately, I'm running into the following errors showing in the
 log:
 
 WARNING: Nested in javax.servlet.ServletException: 
 org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException:
 the request doesn't contain a multipart/form-data or multipart/mixed
 stream, content type header is null: 
 org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException:
 the request doesn't contain a multipart/form-data or multipart/mixed
 stream, content type header is null at 
 org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.init(FileUploadBase.java:885)

  at 
 org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:331)

  at 
 org.apache.commons.fileupload.servlet.ServletFileUpload.getItemIterator(ServletFileUpload.java:148)

  at 
 com.formrunner.servlets.CSVFileUploadServlet.doPost(CSVFileUploadServlet.java:53)

  at 
 com.formrunner.servlets.CSVFileUploadServlet.doGet(CSVFileUploadServlet.java:29)

From
 
the information you've given, it looks like the
CSVFileUploadServlet is being invoked on a request that doesn't have the
proper formatting. You might want to change your CSVFileUploadServlet to
check the Content-Type of the request before invoking the
commons-file-upload stuff so you can give a better error message to your
users.

This could be happening due to a couple of reasons:

1. Your URL mapping is too wide-reaching and the CVS upload servlet is
handling the request to /nextPage.jsp, which would be weird.
2. Your are seeing an error for a request other than the one you think
you are.

I recommend checking for the Content-Type and then dumping a bunch of
information about the request if it's not multipart/form-data: things
like the URL, method and maybe the parameters, too.

 The browser actually displays the nextPage.jsp page.  However, if
 one then clicks any navigation button, you get a version of the
 warning above showing in the browser.

Do you have a link like a href= that could be going to the wrong
place? Presumably, navigation links shouldn't take you to the
CSVFileUploadServlet... only form POSTs.

 My goal is to get from the CSVFileUpload servlet to the nextPage.jsp 
 with the partialMatch data in hand.

...whatever that is.

 In the normal use case, this will only be a couple of text lines.
 However, at the extreme it could be hundreds of lines of mismatches.
 I really don't care how I accomplish the transition to nextPage.jsp,
 so if there's a better way than what I'm attempting here, please let
 me know. {Anything written on the web would be great.}  [I assume
 that I could store the partialMatch data in the db under some
 appropriate key, get to nextPage using response.sendRedirect, and
 then retrieve the info, but that seems like more of a hack than ought
 to be necessary here.]

Keeping state in the request is always risky, because after it's over,
the user has to re-submit everything in order to basically see the same
result. It's idempotent, but not particularly elegant.

Keeping state in the session is always risky because the session can
expire /and/ you can also bust your heap if it's a lot of data. If
session timeouts are a concern, you have to encode a bunch of
information in the request to recover the session in those cases.

Putting the data into the database is not particularly convenient, but
it will save you from worries about memory exhaustion as well as having
to repeatedly shuttle lots of data from the client to the server and
back. Think: do you want your users to have to re-upload files after the
mismatches have been identified and resolved? Or, do you just want to
apply whatever mitigation steps have been chosen by the user on the data
already on the server?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - 

Re: Problem moving from file upload servlet to JSP

2010-04-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

On 4/19/2010 5:19 PM, André Warnier wrote:
 Ken Bowen wrote:
 ...
 

 Long form.  Here's the html for file upload (vanilla):

 form name=csvUploadForm action=csvfileupload method=post
 enctype=multipart/form-data
 File:input type=file name=csvfile2uploadbr/br
 input type=submit name=Submit value=Upload CSV File
 onclick=uploadCSVFile();return false;
 /form

 Without and before getting to the Java stuff, I do not really understand
 why above you have a button of type submit, but with an onClick
 event triggering a javascript function.
 Either the button should be of type button and have an onClick event
 handler, or it should be of type submit and not have an event handler.

An exception is the case where you want a page that works both with and
without Javascript enabled: the input type=submit allows the form to
submit in the standard way when no Javascript is present, but allows the
(presumably mind-blowingly fantastic) Javascript alternative to run when
appropriate.

You can't get this behavior from type=button.

 I suspect that by specifying both, you may be generating 2 actions and
 confusing the browser and/or the receiving end.

The return false; at the end of the trigger indicates that the event
handler will (duh) return false. When that happens, the browser is
supposed to basically drop the event and not send it to the default
handler, which would result in the form being submitted in the
traditional way. This is actually a pretty standard Javascript
implementation.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvMyiUACgkQ9CaO5/Lv0PBb9wCeJZcEXufKdj7RG6MhAz8eIG0p
o3gAoMCjAaMOmzhjs2q8mzlZiwSs7Yx/
=1Z8E
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: SV: set time out based on userInRole

2010-04-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Bob,

On 4/19/2010 3:20 PM, Bob Hall wrote:
 Soren,
 
 --- On Mon, 4/19/10 at 5:01 AM, Søren Blidorf so...@nolas.dk wrote:
 Fx if you are admin no connectionTimeout and if you are
 user
 connectionTimeout 20 min

 
 session.setMaxInactiveInterval()

+1

Use with a javax.servlet.Filter that you write yourself.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvMylgACgkQ9CaO5/Lv0PCETwCgk+ae6jLHILmlGg5wXGgALUy/
zPsAmwWlv4Emgrndlmz4iQpA8txBPo1y
=u0bG
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-19 Thread Jon Brisbin

On Apr 19, 2010, at 3:42 PM, Pid wrote:

 On 19/04/2010 15:29, laredotornado wrote:
 
 Hi,
 
 I'm using Tomcat 6.0.26 on Mac 10.6.3.  Currently, in my $CATALINA_HOME/logs
 directory, Tomcat produces a localhost*log file with the date in the file
 name for each day, for example -- localhost.2010-04-19.  Is there a way to
 get Tomcat to generate simply localhost.log for whatever day today is?  If
 not, does anyone know a shell short cut where I can just type in something
 like vim ~/localhost.log and see the most current log without having to
 specify today's date?
 
 You know about using the tab key in shell?
 Not being bothered to fill in the right filename seems a bit lame.
 

I'm often frustrated by this convention as well. I end up having to hit tab 
multiple times because there are several months and many days of log files in 
these directories. Those keystrokes add up and it's often no faster to use tab 
than it is to just type the full filename. If, on the other hand, one could 
type less loTAB/loTAB, I could work faster and more efficiently.

I don't find this question insignificant at all. I'd like to know the answer 
myself.

Jon Brisbin
Portal Webmaster
NPC International, Inc.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: loading properties file from WEB-INF instead of WEB-INF/classes

2010-04-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

David,

On 4/18/2010 2:27 PM, David Smith wrote:
 ServletContext.getResource( path ) takes path as relative to the current
 webapp and returns a URL for opening the resource or null if the
 resource was not found.
 
 also there is --
 
 ServletContext.getResourceAsStream( path ) takes a path as relative to
 the current webapp and returns an i/o stream for reading the file.

Yes, please use ServletContext.getResourceAsStream.

 both of these are well documented in the servlet spec.

And in the Servlet API itself if you don't want to dig into the spec
just to read the javadoc.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvMyzoACgkQ9CaO5/Lv0PAG5QCgmmoU7Blc/z1Gzkl3uwOvEUmu
K7wAoJwSb/lD3sVxaYpcg0gq/323BMH3
=N2lO
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-19 Thread André Warnier

Pid wrote:

On 19/04/2010 15:29, laredotornado wrote:

Hi,

I'm using Tomcat 6.0.26 on Mac 10.6.3.  Currently, in my $CATALINA_HOME/logs
directory, Tomcat produces a localhost*log file with the date in the file
name for each day, for example -- localhost.2010-04-19.  Is there a way to
get Tomcat to generate simply localhost.log for whatever day today is?  If
not, does anyone know a shell short cut where I can just type in something
like vim ~/localhost.log and see the most current log without having to
specify today's date?


You know about using the tab key in shell?
Not being bothered to fill in the right filename seems a bit lame.


I disagree.
The point raised by the OP above is one that bothers a lot of people.
The lame bit is the way in which standard out-of-the-box Tomcat 
generates its logfiles, and their rotation, inflexibly.
And yes, I know one can implement log4j and do whatever one wants, but 
for a large number of Tomcat occasional users and admins, that's too 
much to ask.
I am not trying to start a flame, and I like Tomcat in general, and I 
try to contribute to the limits of my limited abilities.  I am just 
pointing out one area in which, in my view, Tomcat is a bit deficient 
for people who cannot spent much of their time on one particular 
server-type software.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: [OT] Hung threads

2010-04-19 Thread Jeffrey Janner
And I'll try to remember to remove the sig from now on before I reply.

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Monday, April 19, 2010 4:07 PM
To: Tomcat Users List
Subject: Re: [OT] Hung threads


Jeffrey,

On 4/17/2010 2:15 PM, Jeffrey Janner wrote:
 And the solution to the attachment issue is removing the PGP signing
 stuff from your message in my reply.

Gotcha. Unfortunately, I have to use inline PGP because some email
clients are retarded when it comes to PGP-MIME and they don't display
anything at all. :(

Sorry for the way Outlook handles replies to PGP-signed messages. I
guess it's just another Microsoft product that doesn't play well with
others.

- -chris


***  NOTICE  *
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.


RE: Problem moving from file upload servlet to JSP

2010-04-19 Thread Propes, Barry L
You sure about that? I've got mine that way (button of type submit, but with 
an onClick 
event triggering a javascript function.) and it works fine. 


 André Warnier wrote:
...

 
 Long form.  Here's the html for file upload (vanilla):
  
   form name=csvUploadForm action=csvfileupload method=post 
  enctype=multipart/form-data
 File:input type=file name=csvfile2uploadbr/br
   input type=submit name=Submit value=Upload CSV File 
   onclick=uploadCSVFile();return false; /form
 
Without and before getting to the Java stuff, I do not really understand why 
above you have a button of type submit, but with an onClick 
event triggering a javascript function.
Either the button should be of type button and have an onClick event handler, 
or it should be of type submit and not have an event handler.
I suspect that by specifying both, you may be generating 2 actions and 
confusing the browser and/or the receiving end.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Binding Tomcat Apps to Specific CPUs in Windows

2010-04-19 Thread Marsh, Geoffrey (NIH/CIT) [E]
Good evening. I would like to bind a specific application within Tomcat to a 
specific CPU or pair of CPUs on a Windows Server.

I'm having no luck finding documentation or list threads about this. Anybody 
done this? Any guidance or pointers would be greatly appreciated.

If it helps, software and hardware specs for the box in question are below.

Thank you in advance for your help.

Specs:
OS: Windows Server 2003 R2 SP2 64-bit
Processor: Quad-core with 8 virtual processors
Tomcat 5.5.27
Sun JVM 1.5.0_20-b02

Geoff



Re: Binding Tomcat Apps to Specific CPUs in Windows

2010-04-19 Thread André Warnier

Marsh, Geoffrey (NIH/CIT) [E] wrote:

Good evening. I would like to bind a specific application within Tomcat to a 
specific CPU or pair of CPUs on a Windows Server.


I don't think you can.
An application within Tomcat is not a separate process.  Even Tomcat is 
not a process, from the OS's point of view. The JVM (Java Virtual 
Machine) running Tomcat is the process.
So you would have to run a separate JVM, with a separate Tomcat, running 
that webapp only, to do what you want to do.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Binding Tomcat Apps to Specific CPUs in Windows

2010-04-19 Thread Marsh, Geoffrey (NIH/CIT) [E]
Thanks Andre. That makes sense. I appreciate the quick reply.

-Original Message-
From: André Warnier [mailto:a...@ice-sa.com] 
Sent: Monday, April 19, 2010 5:48 PM
To: Tomcat Users List
Subject: Re: Binding Tomcat Apps to Specific CPUs in Windows

Marsh, Geoffrey (NIH/CIT) [E] wrote:
 Good evening. I would like to bind a specific application within Tomcat to a 
 specific CPU or pair of CPUs on a Windows Server.
 
I don't think you can.
An application within Tomcat is not a separate process.  Even Tomcat is 
not a process, from the OS's point of view. The JVM (Java Virtual 
Machine) running Tomcat is the process.
So you would have to run a separate JVM, with a separate Tomcat, running 
that webapp only, to do what you want to do.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Problem moving from file upload servlet to JSP

2010-04-19 Thread André Warnier

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

On 4/19/2010 5:19 PM, André Warnier wrote:

Ken Bowen wrote:
...


Long form.  Here's the html for file upload (vanilla):

form name=csvUploadForm action=csvfileupload method=post
enctype=multipart/form-data
File:input type=file name=csvfile2uploadbr/br
input type=submit name=Submit value=Upload CSV File
onclick=uploadCSVFile();return false;
/form


Without and before getting to the Java stuff, I do not really understand
why above you have a button of type submit, but with an onClick
event triggering a javascript function.
Either the button should be of type button and have an onClick event
handler, or it should be of type submit and not have an event handler.


An exception is the case where you want a page that works both with and
without Javascript enabled: the input type=submit allows the form to
submit in the standard way when no Javascript is present, but allows the
(presumably mind-blowingly fantastic) Javascript alternative to run when
appropriate.

You can't get this behavior from type=button.


I suspect that by specifying both, you may be generating 2 actions and
confusing the browser and/or the receiving end.


The return false; at the end of the trigger indicates that the event
handler will (duh) return false. When that happens, the browser is
supposed to basically drop the event and not send it to the default
handler, which would result in the form being submitted in the
traditional way. This is actually a pretty standard Javascript
implementation.


Ok, I'll accept that explanation.
Which still leaves us in the dark concerning the content of that 
javascript uploadCSVFile() function which is probably the one used in 
this case then to post the form content to the server.
I must admit I still don't see the need of it in this case, since the 
form as it is without the onClick would submit the file just as well.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-19 Thread Mark Thomas
On 19/04/2010 22:32, André Warnier wrote:
 I disagree.
 The point raised by the OP above is one that bothers a lot of people.
 The lame bit is the way in which standard out-of-the-box Tomcat
 generates its logfiles, and their rotation, inflexibly.
 And yes, I know one can implement log4j and do whatever one wants, but
 for a large number of Tomcat occasional users and admins, that's too
 much to ask.
 I am not trying to start a flame, and I like Tomcat in general, and I
 try to contribute to the limits of my limited abilities.  I am just
 pointing out one area in which, in my view, Tomcat is a bit deficient
 for people who cannot spent much of their time on one particular
 server-type software.

So I can expect to see an enhancement request with some clear
requirements that go beyond the current implementation is lame in
bugzilla some time soon?

Mark



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Problem moving from file upload servlet to JSP

2010-04-19 Thread Propes, Barry L
 My guess is that he may have other various pieces of validation tied to it, 
client side.

And he might even have some client-side validation intertwined for the type of 
file in an array, - i.e. .xls, .doc., .txt etc. as an acceptable file type to 
upload, though, like you, I have no idea not having seen all of his form and 
code accompanying it.

-Original Message-
From: André Warnier  wrote:

 The return false; at the end of the trigger indicates that the event 
 handler will (duh) return false. When that happens, the browser is 
 supposed to basically drop the event and not send it to the default
 handler, which would result in the form being submitted in the 
 traditional way. This is actually a pretty standard Javascript 
 implementation.
 
Ok, I'll accept that explanation.
Which still leaves us in the dark concerning the content of that javascript 
uploadCSVFile() function which is probably the one used in this case then to 
post the form content to the server.
I must admit I still don't see the need of it in this case, since the form as 
it is without the onClick would submit the file just as well.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-19 Thread André Warnier

Mark Thomas wrote:

On 19/04/2010 22:32, André Warnier wrote:

I disagree.
The point raised by the OP above is one that bothers a lot of people.
The lame bit is the way in which standard out-of-the-box Tomcat
generates its logfiles, and their rotation, inflexibly.
And yes, I know one can implement log4j and do whatever one wants, but
for a large number of Tomcat occasional users and admins, that's too
much to ask.
I am not trying to start a flame, and I like Tomcat in general, and I
try to contribute to the limits of my limited abilities.  I am just
pointing out one area in which, in my view, Tomcat is a bit deficient
for people who cannot spent much of their time on one particular
server-type software.


So I can expect to see an enhancement request with some clear
requirements that go beyond the current implementation is lame in
bugzilla some time soon?


Allright.
How about collecting some suggestions before on this list ?

I suggest a simple way whereby to tell Tomcat (optionally) just /not/ to 
rotate its logfiles itself, and to always write to a fixed filename.

(an additional property in logging.properties ?)
There exists under Linux the logrotate utility, which is perfect for 
that kind of thing.  And with Apache (Unix and Windows) is supplied the 
rotatelogs utility, which can be used with a pipe to much the same effect.
Not much to do at the Tomcat level, and much simplification at the 
sysadmin level.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Problem moving from file upload servlet to JSP

2010-04-19 Thread Ken Bowen
Just aritfacts of step by step changes (as I come to understand  
various thingies):  should be type button, but gives no evidence of  
two events.


On Apr 19, 2010, at 5:19 PM, André Warnier wrote:


Ken Bowen wrote:
...


Long form.  Here's the html for file upload (vanilla):
form name=csvUploadForm action=csvfileupload method=post  
enctype=multipart/form-data

   File:input type=file name=csvfile2uploadbr/br
   input type=submit name=Submit value=Upload CSV File  
onclick=uploadCSVFile();return false;

/form
Without and before getting to the Java stuff, I do not really  
understand why above you have a button of type submit, but with an  
onClick event triggering a javascript function.
Either the button should be of type button and have an onClick  
event handler, or it should be of type submit and not have an  
event handler.
I suspect that by specifying both, you may be generating 2 actions  
and confusing the browser and/or the receiving end.




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



FollowUP: Problem moving from file upload servlet to JSP

2010-04-19 Thread Ken Bowen

Thanks for all the responses.
1.  After posting the original, I thought about it all at lunch, and  
was leaning towards the db solution, and Chris firmly pushed me over  
on that.  Now I just convert the byte stream to a (sometimes big)  
string, and stuff it in a temporary db place using the user's login  
and the current-time-in-millis as a combined key.  The I sendRedirect  
to nextPage.jsp?t=current-time-in-millis and do all the work at that  
page.


2.  Barry basically has it right as far as my using the call to  
javascript:  there is some validation and housekeeping concerning the  
file and user/organization logins going on before the actual upload.


thanks  cheers,
Ken

On Apr 19, 2010, at 5:59 PM, Propes, Barry L wrote:

My guess is that he may have other various pieces of validation tied  
to it, client side.


And he might even have some client-side validation intertwined for  
the type of file in an array, - i.e. .xls, .doc., .txt etc. as an  
acceptable file type to upload, though, like you, I have no idea not  
having seen all of his form and code accompanying it.


-Original Message-
From: André Warnier  wrote:

The return false; at the end of the trigger indicates that the  
event

handler will (duh) return false. When that happens, the browser is
supposed to basically drop the event and not send it to the default
handler, which would result in the form being submitted in the
traditional way. This is actually a pretty standard Javascript
implementation.


Ok, I'll accept that explanation.
Which still leaves us in the dark concerning the content of that  
javascript uploadCSVFile() function which is probably the one used  
in this case then to post the form content to the server.
I must admit I still don't see the need of it in this case, since  
the form as it is without the onClick would submit the file just as  
well.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-19 Thread Pid
On 19/04/2010 23:11, André Warnier wrote:
 Mark Thomas wrote:
 On 19/04/2010 22:32, André Warnier wrote:
 I disagree.

Fair enough.

 The point raised by the OP above is one that bothers a lot of people.

I don't like juli logging at all, but hitting tab  a couple of keys
isn't that traumatic.  Really.

 The lame bit is the way in which standard out-of-the-box Tomcat
 generates its logfiles, and their rotation, inflexibly.

Patching the FileHandler doesn't look so tricky, so if you can generate
some consensus, or ideas about whether you just want to turn it off or
configure rotatable pattern characteristics, I'll take a crack at it.


p

 And yes, I know one can implement log4j and do whatever one wants, but
 for a large number of Tomcat occasional users and admins, that's too
 much to ask.
 I am not trying to start a flame, and I like Tomcat in general, and I
 try to contribute to the limits of my limited abilities.  I am just
 pointing out one area in which, in my view, Tomcat is a bit deficient
 for people who cannot spent much of their time on one particular
 server-type software.

 So I can expect to see an enhancement request with some clear
 requirements that go beyond the current implementation is lame in
 bugzilla some time soon?

 Allright.
 How about collecting some suggestions before on this list ?
 
 I suggest a simple way whereby to tell Tomcat (optionally) just /not/ to
 rotate its logfiles itself, and to always write to a fixed filename.
 (an additional property in logging.properties ?)
 There exists under Linux the logrotate utility, which is perfect for
 that kind of thing.  And with Apache (Unix and Windows) is supplied the
 rotatelogs utility, which can be used with a pipe to much the same effect.
 Not much to do at the Tomcat level, and much simplification at the
 sysadmin level.
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 




signature.asc
Description: OpenPGP digital signature


Re: Problem moving from file upload servlet to JSP

2010-04-19 Thread Pid
On 19/04/2010 22:21, Christopher Schultz wrote:
 Ken,
 
 On 4/19/2010 12:06 PM, Ken Bowen wrote:
 form name=csvUploadForm action=csvfileupload method=post 
 enctype=multipart/form-data File:input type=file
 name=csvfile2uploadbr/br input type=submit name=Submit
 value=Upload CSV File onclick=uploadCSVFile();return false; 
 /form
 
 Looks good, except for that uploadCSVFile javascript trigger. Why not
 just do a regular file upload? Is this some kinda AJAX thing?
 
 The CSVFileUpload servlet doPost method uses 
 org.apache.commons.fileupload.servlet.ServletFileUpload; to accept
 and process the upload, and puts the resulting data into the db.  If
 I don't care about duplicates or partial matches, this works fine; at
 the end of the servlet processing, I execute 
 response.sendRedirect(/myStartPage.jsp); -- where response is the
 doPost's HttpServletResponse.
 
 That seems fine (ignoring the mismatch between myStartPage.jsp and
 nextPage.jsp).

... and that one is a redirect  one is a forward?


p (confused)


 String nextJSP = /nextPage.jsp; RequestDispatcher dispatcher = 
 getServletContext().getRequestDispatcher(nextJSP); 
 dispatcher.forward(request, response);
 
 That's the correct way to do a forward.
 
 Unfortunately, I'm running into the following errors showing in the
 log:
 
 WARNING: Nested in javax.servlet.ServletException: 
 org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException:
 the request doesn't contain a multipart/form-data or multipart/mixed
 stream, content type header is null: 
 org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException:
 the request doesn't contain a multipart/form-data or multipart/mixed
 stream, content type header is null at 
 org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.init(FileUploadBase.java:885)
 
  at 
 org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:331)
 
  at 
 org.apache.commons.fileupload.servlet.ServletFileUpload.getItemIterator(ServletFileUpload.java:148)
 
  at 
 com.formrunner.servlets.CSVFileUploadServlet.doPost(CSVFileUploadServlet.java:53)
 
  at 
 com.formrunner.servlets.CSVFileUploadServlet.doGet(CSVFileUploadServlet.java:29)
 
 From
 
 the information you've given, it looks like the
 CSVFileUploadServlet is being invoked on a request that doesn't have the
 proper formatting. You might want to change your CSVFileUploadServlet to
 check the Content-Type of the request before invoking the
 commons-file-upload stuff so you can give a better error message to your
 users.
 
 This could be happening due to a couple of reasons:
 
 1. Your URL mapping is too wide-reaching and the CVS upload servlet is
 handling the request to /nextPage.jsp, which would be weird.
 2. Your are seeing an error for a request other than the one you think
 you are.
 
 I recommend checking for the Content-Type and then dumping a bunch of
 information about the request if it's not multipart/form-data: things
 like the URL, method and maybe the parameters, too.
 
 The browser actually displays the nextPage.jsp page.  However, if
 one then clicks any navigation button, you get a version of the
 warning above showing in the browser.
 
 Do you have a link like a href= that could be going to the wrong
 place? Presumably, navigation links shouldn't take you to the
 CSVFileUploadServlet... only form POSTs.
 
 My goal is to get from the CSVFileUpload servlet to the nextPage.jsp 
 with the partialMatch data in hand.
 
 ...whatever that is.
 
 In the normal use case, this will only be a couple of text lines.
 However, at the extreme it could be hundreds of lines of mismatches.
 I really don't care how I accomplish the transition to nextPage.jsp,
 so if there's a better way than what I'm attempting here, please let
 me know. {Anything written on the web would be great.}  [I assume
 that I could store the partialMatch data in the db under some
 appropriate key, get to nextPage using response.sendRedirect, and
 then retrieve the info, but that seems like more of a hack than ought
 to be necessary here.]
 
 Keeping state in the request is always risky, because after it's over,
 the user has to re-submit everything in order to basically see the same
 result. It's idempotent, but not particularly elegant.
 
 Keeping state in the session is always risky because the session can
 expire /and/ you can also bust your heap if it's a lot of data. If
 session timeouts are a concern, you have to encode a bunch of
 information in the request to recover the session in those cases.
 
 Putting the data into the database is not particularly convenient, but
 it will save you from worries about memory exhaustion as well as having
 to repeatedly shuttle lots of data from the client to the server and
 back. Think: do you want your users to have to re-upload files after the
 mismatches have been identified and resolved? Or, do you just want to
 apply whatever mitigation steps have been chosen by the user on the data
 already on 

Re: Problem moving from file upload servlet to JSP

2010-04-19 Thread Ken Bowen
The confusion results from the fact that I initially used the redirect  
in the simple case.
Then I tried to switch to the forward in the more complicated case,  
and got in a mess.
But now I've simply stored everything in the db right away, and used a  
redirect

to get to the jsp where I do all the work.

On Apr 19, 2010, at 7:29 PM, Pid wrote:


On 19/04/2010 22:21, Christopher Schultz wrote:

Ken,

On 4/19/2010 12:06 PM, Ken Bowen wrote:

form name=csvUploadForm action=csvfileupload method=post
enctype=multipart/form-data File:input type=file
name=csvfile2uploadbr/br input type=submit name=Submit
value=Upload CSV File onclick=uploadCSVFile();return false;
/form


Looks good, except for that uploadCSVFile javascript trigger. Why  
not

just do a regular file upload? Is this some kinda AJAX thing?


The CSVFileUpload servlet doPost method uses
org.apache.commons.fileupload.servlet.ServletFileUpload; to accept
and process the upload, and puts the resulting data into the db.  If
I don't care about duplicates or partial matches, this works fine;  
at

the end of the servlet processing, I execute
response.sendRedirect(/myStartPage.jsp); -- where response is the
doPost's HttpServletResponse.


That seems fine (ignoring the mismatch between myStartPage.jsp and
nextPage.jsp).


... and that one is a redirect  one is a forward?


p (confused)



String nextJSP = /nextPage.jsp; RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher(nextJSP);
dispatcher.forward(request, response);


That's the correct way to do a forward.


Unfortunately, I'm running into the following errors showing in the
log:



WARNING: Nested in javax.servlet.ServletException:
org.apache.commons.fileupload.FileUploadBase 
$InvalidContentTypeException:

the request doesn't contain a multipart/form-data or multipart/mixed
stream, content type header is null:
org.apache.commons.fileupload.FileUploadBase 
$InvalidContentTypeException:

the request doesn't contain a multipart/form-data or multipart/mixed
stream, content type header is null at
org.apache.commons.fileupload.FileUploadBase 
$FileItemIteratorImpl.init(FileUploadBase.java:885)



at
org 
.apache 
.commons 
.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:331)



at
org 
.apache 
.commons 
.fileupload 
.servlet.ServletFileUpload.getItemIterator(ServletFileUpload.java: 
148)



at
com 
.formrunner 
.servlets.CSVFileUploadServlet.doPost(CSVFileUploadServlet.java:53)



at
com 
.formrunner 
.servlets.CSVFileUploadServlet.doGet(CSVFileUploadServlet.java:29)


From

the information you've given, it looks like the
CSVFileUploadServlet is being invoked on a request that doesn't  
have the
proper formatting. You might want to change your  
CSVFileUploadServlet to

check the Content-Type of the request before invoking the
commons-file-upload stuff so you can give a better error message to  
your

users.

This could be happening due to a couple of reasons:

1. Your URL mapping is too wide-reaching and the CVS upload servlet  
is

handling the request to /nextPage.jsp, which would be weird.
2. Your are seeing an error for a request other than the one you  
think

you are.

I recommend checking for the Content-Type and then dumping a bunch of
information about the request if it's not multipart/form-data: things
like the URL, method and maybe the parameters, too.


The browser actually displays the nextPage.jsp page.  However, if
one then clicks any navigation button, you get a version of the
warning above showing in the browser.


Do you have a link like a href= that could be going to the wrong
place? Presumably, navigation links shouldn't take you to the
CSVFileUploadServlet... only form POSTs.


My goal is to get from the CSVFileUpload servlet to the nextPage.jsp
with the partialMatch data in hand.


...whatever that is.


In the normal use case, this will only be a couple of text lines.
However, at the extreme it could be hundreds of lines of mismatches.
I really don't care how I accomplish the transition to nextPage.jsp,
so if there's a better way than what I'm attempting here, please let
me know. {Anything written on the web would be great.}  [I assume
that I could store the partialMatch data in the db under some
appropriate key, get to nextPage using response.sendRedirect, and
then retrieve the info, but that seems like more of a hack than  
ought

to be necessary here.]


Keeping state in the request is always risky, because after it's  
over,
the user has to re-submit everything in order to basically see the  
same

result. It's idempotent, but not particularly elegant.

Keeping state in the session is always risky because the session can
expire /and/ you can also bust your heap if it's a lot of data. If
session timeouts are a concern, you have to encode a bunch of
information in the request to recover the session in those cases.

Putting the data into the database is not particularly convenient,  
but
it will save you from worries about memory exhaustion as 

Re: FollowUP: Problem moving from file upload servlet to JSP

2010-04-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ken,

On 4/19/2010 6:43 PM, Ken Bowen wrote:
 Thanks for all the responses.
 1.  After posting the original, I thought about it all at lunch, and was
 leaning towards the db solution, and Chris firmly pushed me over on
 that.  Now I just convert the byte stream to a (sometimes big) string

Just remember to properly handle the character encoding. Good luck with
that.

 and stuff it in a temporary db place using the user's login and the
 current-time-in-millis as a combined key.  The I sendRedirect to
 nextPage.jsp?t=current-time-in-millis and do all the work at that page.

I would send the id of the CLOB in the database to that page rather then
the time in millis just in case more than one file was uploaded at the
same instant.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvM7x4ACgkQ9CaO5/Lv0PDDoQCePd6ZNcbALIREAviEdRgAdL7l
kKsAmQEY0b6bVybi2p8rIrC97AlbfDvE
=pH3f
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-19 Thread Konstantin Kolinko
2010/4/20 André Warnier a...@ice-sa.com:

 I suggest a simple way whereby to tell Tomcat (optionally) just /not/ to
 rotate its logfiles itself, and to always write to a fixed filename.
 (an additional property in logging.properties ?)
 There exists under Linux the logrotate utility, which is perfect for that
 kind of thing.  And with Apache (Unix and Windows) is supplied the
 rotatelogs utility, which can be used with a pipe to much the same effect.
 Not much to do at the Tomcat level, and much simplification at the sysadmin
 level.


If you do not want the rotation, that is already available.

Just use a
http://java.sun.com/javase/6/docs/api/java/util/logging/FileHandler.html


Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Universal connection pooling Type Casting problem

2010-04-19 Thread Auser99

Does anyone have a solution for this. Thanks.

au

http:/www.xprad.org/



SivaKumarl wrote:
 
 Hi Friends, 
   I am using universal connection pooling for connecting database
 , while configuring manually i able to connect to database,but while
 configuring in server.xml i am unable to cast the datasource i am getting
 the class cast exception, please find the below configuration and error
 details , correct me if i configured wrong .I am using Tomcat 6.0
 
 server.xml configurartion
 
  Context docBase=UCP path=/UCP reloadable=true
 source=org.eclipse.jst.jee.server:UCP 
   Resource auth=Container description=DataSource Reference
 driverClassName=oracle.jdbc.OracleDriver 
 maxActive=4 maxIdle=2 maxWait=5000
 name=jdbc/oracleds factory=oracle.jdbc.pool.OracleDataSource 
 username=branch password=branch
 type=oracle.ucp.jdbc.PoolDataSourceImpl 
 url=jdbc:oracle:thin:@//192.168.203.12:1521/ycs  
 validationQuery=select 1 from dual/ 
   /Context 
 
 Error Details
 javax.naming.NamingException: Could not create resource factory instance
 [Root exception is java.lang.ClassCastException:
 oracle.jdbc.pool.OracleDataSource cannot be cast to
 javax.naming.spi.ObjectFactory] 
 at
 org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:102)
  
 at
 javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304) 
 at org.apache.naming.NamingContext.lookup(NamingContext.java:793) 
 at org.apache.naming.NamingContext.lookup(NamingContext.java:140) 
 at org.apache.naming.NamingContext.lookup(NamingContext.java:781) 
 at org.apache.naming.NamingContext.lookup(NamingContext.java:153) 
 at TestServlet.doGet(TestServlet.java:37) 
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) 
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 
 at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
  
 at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  
 at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  
 at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  
 at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) 
 at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 
 at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  
 at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) 
 at
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) 
 at
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
  
 at
 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) 
 at java.lang.Thread.run(Thread.java:619) 
 Caused by: java.lang.ClassCastException: oracle.jdbc.pool.OracleDataSource
 cannot be cast to javax.naming.spi.ObjectFactory 
 at
 org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:98)
  
 ... 20 more 
 
 
 Java code for retrieving connection
 
 Context initContext; 
 try { 
 initContext = new InitialContext(); 
 
 Context envContext  =
 (Context)initContext.lookup(java:/comp/env); 
 DataSource ds =
 (DataSource)envContext.lookup(jdbc/oracleds); 
 } catch (NamingException e) { 
 // TODO Auto-generated catch block 
 e.printStackTrace(); 
 } 
 
 
 
 Thanks in Advance 
 Siva kumar
 
 

-- 
View this message in context: 
http://old.nabble.com/Universal-connection-pooling-Type-Casting-problem-tp28287054p28287790.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Way to generate a localhost.log instead of localhost-4-20-2010.log?

2010-04-19 Thread Terence M. Bandoian

Here's a Linux script to remove log files older than seven days:

   find /var/tomcat5/logs -daystart -mtime +7 -type f -exec rm '{}' \;

Just in case anyone might find it useful.

-Terence Bandoian

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



mod_jk reply_timeout and error state

2010-04-19 Thread Sean GAO
Hi,

We are running apache 2.2.4 and tomcat 5.5.28 with mod_jk 1.2.28. 3
tomcat instances.

Referring to http://tomcat.apache.org/connectors-doc/reference/workers.html
, we came up with a workers.properties file like this:

worker.list=balancer
worker.maintain=30
#tomcat01
worker.tomcat01.port=18009
worker.tomcat01.host=localhost
worker.tomcat01.type=ajp13
worker.tomcat01.lbfactor=120
worker.tomcat01.retries=2
worker.tomcat01.socket_timeout=30
worker.tomcat01.reply_timeout=3
worker.tomcat01.recover_time=300
#tomcat02
worker.tomcat02.port=28009
worker.tomcat02.host=localhost
worker.tomcat02.type=ajp13
worker.tomcat02.lbfactor=100
worker.tomcat02.retries=2
worker.tomcat02.socket_timeout=30
worker.tomcat02.reply_timeout=3
worker.tomcat02.recover_time=300
#tomcat03
worker.tomcat03.port=38009
worker.tomcat03.host=localhost
worker.tomcat03.type=ajp13
worker.tomcat03.lbfactor=0
worker.tomcat03.retries=2
#loadbalancer
worker.retries=2
worker.balancer.type=lb
worker.balancer.sticky_session=False
worker.balancer.method=Busyness
worker.balancer.balance_workers=tomcat01,tomcat02,tomcat03

So basically tomcat01 and tomcat02 are the main request handlers, with
tomcat03 acting as a backup server which is accessed only when both
tomcat01 and tomcat02 are in error state (30 seconds without response,
not necessarily mean offline). If something bad happens, e.g.
excessively long GC, or redeployment, we assume each failed tomcat
instance to get back to business in about 5 minutes.

This meets our needs to a certain degree. However, there's one thing
that bugs me:
If we set the reply_timeout too high, we miss the whole point of
fail-over. If we set the value too low, it's likely we are going to
kill a lot of legitimate/would-otherwise-success request, which is not
what we wanted either.

Instead of breaking the long request (say, 30 seconds) and put the
worker into error state, is there anyway, anyway at all, we can tell
mod_jk to mark a worker busy, so that future requests are routed to
alternative workers? mok_jk can still check every 30 (or the default
60) seconds whether it is able to resume one of the busy-marked
workers, just like it does with the ones in error state.


Regards,
Sean

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org