Tomcat 4.1 Admin Context Error.

2006-08-22 Thread Foo Shyn
Hi guys,

I'm using Tomcat 4.1 currently. I'm facing problem to create a datasource for a 
context that is created by uploading a .war file. It prints out the following 
error:

javax.servlet.ServletException: Exception retrieving attribute 
'driverClassName'I think this should be fixed in Tomcat 5, but unfortunately 
upgrading Tomcat is not an option for me now. Any workarounds that i can 
use?Many ThanxThanx.
Regards,
FooShyn

Different results for the same application in different directories

2006-08-22 Thread [EMAIL PROTECTED]

Hi,

I have a JSF/IceFaces powered application running on Tomcat 5.5.17 in
Windows 2003 server SP1. When deploying my webapp to a .war file and copying
it to the webapps directory of Tomcat the method
FacesContext.getCurrentInstance ().getViewRoot().getViewId() returns
different results with every deployment. It looks very random.

For example, I deploy the webapp to myapp1.war and copy that file 3 times:
myapp1.war, myapp2.war, myapp3.war, myapp4.war .

I copy all 4 to the webapps dir of Tomcat and let them deploy themselves.

When requesting the index.iface url, I get 2 different results
eg:
http://localhost/myapp1/index.iface -- viewId = index.iface (correct)
http://localhost/myapp2/index.iface -- viewId = index.jsp (incorrect)
http://localhost/myapp3/index.iface -- viewId = index.jsp (incorrect)
http://localhost/myapp4/index.iface -- viewId = index.iface (correct)

I also tested this on a Windows XP Pro and I tried with different Tomcat
version (5.0.28, 5.5.16).

So my question is, how is it possible that one method returns different
values just by having a different contextpath (and ofcourse, how to solve
it).

Thank you


Re: one application on different port

2006-08-22 Thread Mikolaj Rydzewski

Ben Stringer wrote:

On Mon, 2006-08-21 at 07:20 -0700, tamri wrote:
  

I have  one application and use tomcat 5.0.
I want to run this application on different port , on 8080 and  8082
independently each other.
I configure in tomcat this two connector with ports 8080 and 8082.
how can I configure tomcat  to run one application on different ports
indepedently.



One way to do this is to modify server.xml so there are two services
running in the one server. This then allows you to define independent
Connector settings for each service, and each service can also
have independent webapps areas. Make sure each service uses different
ports to the other (eg. 8080 vs. 18080, 8009 vs 18009, 8443 vs 18443).
  
I'm not sure, but tamri wanted to make _one_ application available on 
two different ports. Your solution implies the same app deployed twice, 
thus giving two applications.


--
Mikolaj Rydzewski [EMAIL PROTECTED]



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Problem with Emailappender of Log4j

2006-08-22 Thread Mario Bittermann
Here are the codes:

Javacode:
Logger logger = Logger.getLogger(CreditLimitEditActionFromList.class.getName());
try {
// some code where exceptions can occur
} catch (Exception e) {
   logger.error(unhandled exception: ,e);
}

Log4j-config:

log4j.rootLogger=ERROR, email
log4j.appender.email = org.apache.log4j.net.SMTPAppender
log4j.appender.email.BufferSize = 512
log4j.appender.email.From = server
log4j.appender.email.SMTPHost = localhost
log4j.appender.email.Subject = CreditLimitRequest Error Report
log4j.appender.email.To = [EMAIL PROTECTED]
log4j.appender.email.layout = org.apache.log4j.PatternLayout
log4j.appender.email.layout.conversionPattern = %d %-5p [%-10t] %c{2} - %m%n

Normally we get emails with mailbody like:

2006-08-22 09:22:33,667 61214430 [http-8090-Processor13] ERROR 
com.omv.creditlimit.action.CreditLimitEditActionFromList.execute(CreditLimitEditActionFromList.java:295)-
 unhandled exception: 
java.lang.NullPointerException
at 
com.omv.creditlimit.business.RulesEngineImpl.setDocumentID(RulesEngineImpl.java:366)
at 
com.omv.creditlimit.action.CreditLimitEditActionFromList.execute(CreditLimitEditActionFromList.java:121)
at 
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at 
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)


Mario
 Original-Nachricht 
Datum: Mon, 21 Aug 2006 12:40:12 -0400
Von: Martin Gainty [EMAIL PROTECTED]
An: Tomcat Users List users@tomcat.apache.org
Betreff: Re: Problem with Emailappender of Log4j

 Mario-
 
 can we see the exception handler and how you are capturing stackTrace?
 
 M-
 *
 This email message and any files transmitted with it contain confidential
 information intended only for the person(s) to whom this email message is
 addressed.  If you have received this email message in error, please
 notify
 the sender immediately by telephone or email and destroy the original
 message without making a copy.  Thank you.
 
 
 
 - Original Message - 
 From: Mario Bittermann [EMAIL PROTECTED]
 To: users@tomcat.apache.org
 Sent: Monday, August 21, 2006 12:01 PM
 Subject: Problem with Emailappender of Log4j
 
 
  Hi,
  
  we have a problem with our emailappender of Log4j.
  We are using Log4js emailappender to be informed when an unhandled
 exception is thrown in an application.
  If an exception is thrown we get an email with a exceptionstacktrace as
 mailbody. This works fine with Tomcat 4.
  
  Since we are using Tomcat 5.5.12 with Sun jdk 1.5_07 no stacktrace is
 sent! We get a mail with empty body.
  I did some test with jdk 1.5 and Log4j and emailnotification works fine.
 But on Tomcat 5.5 we get empty email.
  
  Who can help? Any ideas?
  
  Thanks
  Mario
  -- 
  
  
  Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
  Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
  
  -
  To start a new topic, e-mail: users@tomcat.apache.org
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
 

-- 


Feel free – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail


Re: How to get tomcat configuration inside a servlet

2006-08-22 Thread Miguel Alcalde

Mikolaj Rydzewski escribió:
You don't have to worry about it. Read about redirectPort attribute at 
http://tomcat.apache.org/tomcat-5.5-doc/config/http.html

Thanks, mate.
It solves 90% of our problems.

But we still need to get tomcat ssl configuration inside a servlet.  
The reason: In our strange architecture (struts-flavour) a servlet is a 
wrapper for actions with states. Only some of these states have to be 
secured.   


Have anybody an idea how to get that information?
Thank in advanced


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Parsing keyvalue pairs in POST data

2006-08-22 Thread Santosh Puranshettiwar
The J2ME application that sends the data to my server is built on the 
MIDP 2.0 profile. And MIDP 2.0 does support Unicode.


Moreover, could it really be a problem related to encoding? I unable to 
correlate it with the peculiar behavior I am observing whereby the 
server fails to parse the parameters in the message body, if its length 
is greater than 2016 characters. What's it got to do with 2016?


On the other hand, it might as well be a problem with encoding (or bug) 
in J2ME. Because, the same data when sent from a browser does not cause 
any problems.


One more query. Will digging the source code help? If so what should I 
specifically look for?


Thanks alot.
Santosh.
Martin Gainty wrote:

I know the initial versions of J2ME did not have UNICODE (either UTF-8 or 
UTF-16) support.

I would search the lists located here
https://subscriptions.sun.com/subscription_center/ecomm.jsp
2 years ago I met a fellow who coded a UTF-8 MIDP device for collecting Patient 
info (with the conclusion that UNICODE enabled handhelds are possible)

You will probably wind up hand coding the UTF-8 encoding logic...
provided your displays will have to be UNICODE display enabled display
and your input devices will need to be IME enabled..

Martin --
*
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



- Original Message - 
From: Santosh Puranshettiwar [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Monday, August 21, 2006 12:49 AM
Subject: Re: Parsing keyvalue pairs in POST data


  

Thanks alot for your reply Martin.
Its just a simple setup. I am using Tomcat 4.1 listening on port 80 (OS: 
Windows - if that matters). Its not coupled with Apache.


Why would the same data when sent from a browser would parse well while 
not from a J2ME application? I'm baffled.


Santosh.

Martin Gainty wrote:


I assume you are front-ending with Apache..?

I would use HTTP 1.1 instead of (HTTP 1.0 where length must be specified 
beforehand)

Here are some keyword values in httpd.conf that will help you overcome your 
current limitations

You can adjust the limit on the size of any field via
LimitRequestFieldSize

You can adjust the limit on the size of the request line via 
LimitRequestLine


You can adjust the limit on the size of the HTTP body sent via text/xml
LimitXMLRequestBody 


documenation available at
http://httpd.apache.org/docs/2.0/mod/core.html

Martin --
*
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



- Original Message - 
From: Santosh Puranshettiwar [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Saturday, August 19, 2006 8:03 AM
Subject: Re: Parsing keyvalue pairs in POST data


  
  

Well, there's another problem.
HttpServletRequest.getParameter() is unable to parse the key-value pairs 
in the http message body if the the total content-length is greater that 
2016.


Any ideas? Please.
Santosh.

Santosh Puranshettiwar wrote:



Managed to digg it.
Had to set Content-Type=application/x-www-form-urlencoded

Santosh Puranshettiwar wrote:
  
  

Hello,

How does tomcat parse the key-value pairs sent in a Http Request as 
POST data? I am unable to read the parameters using the 
HttpServletRequest.getParameter() method. Parameters are being sent 
by a J2ME application.


Tell me if more details are required.

Thanks alot.
Santosh.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  
  

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, 

Re: How to get tomcat configuration inside a servlet

2006-08-22 Thread Mikolaj Rydzewski

Miguel Alcalde wrote:

Mikolaj Rydzewski escribió:
You don't have to worry about it. Read about redirectPort attribute 
at http://tomcat.apache.org/tomcat-5.5-doc/config/http.html

Thanks, mate.
It solves 90% of our problems.

But we still need to get tomcat ssl configuration inside a servlet.  
The reason: In our strange architecture (struts-flavour) a servlet is 
a wrapper for actions with states. Only some of these states have to 
be secured.  
Have anybody an idea how to get that information?
You can run an apache server in the front. And then use mod_rewrite (for 
specific URLs) to redirect users to secure pages. The application (and 
Tomcat) doesn't need to know anything about security in this scenario.


--
Mikolaj Rydzewski [EMAIL PROTECTED]



smime.p7s
Description: S/MIME Cryptographic Signature


Re: How to get tomcat configuration inside a servlet

2006-08-22 Thread Mikolaj Rydzewski

Mikolaj Rydzewski wrote:
But we still need to get tomcat ssl configuration inside a servlet.  
The reason: In our strange architecture (struts-flavour) a servlet is 
a wrapper for actions with states. Only some of these states have to 
be secured.  Have anybody an idea how to get that information?
You can run an apache server in the front. And then use mod_rewrite 
(for specific URLs) to redirect users to secure pages. The application 
(and Tomcat) doesn't need to know anything about security in this 
scenario.
Oh, I read your original posting again and it now the solution with 
apache in the front is not the best one.


I'd try to use MBeans and JMX infrastructure to find out tomcat 
configuration. http://tomcat.apache.org/tomcat-5.5-doc/monitoring.html

The admin webapp depends on MBeans to 'talk' to tomcat. So try this way.

--
Mikolaj Rydzewski [EMAIL PROTECTED]



smime.p7s
Description: S/MIME Cryptographic Signature


Restriciting maximum post size in Tomcat

2006-08-22 Thread Krish B

I set the maxPostSize=1000 in the server.xml and started the server.
If i post  1000 i dont get a error.
(
   Connector port=8080 maxPostSize=1000 maxHttpHeaderSize=8192
  maxThreads=150 minSpareThreads=25 maxSpareThreads=75
  enableLookups=false redirectPort=8443 acceptCount=100
  connectionTimeout=2 disableUploadTimeout=true/
)

How to get this feature to work. I have searched all over the place
and dont have answers.

I have tried 5.5.17  15 tomcat.

I use a FORM to POST a file of large size.

Thanks for any help

Rgds
Krish

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Solved Problem with Emailappender of Log4j

2006-08-22 Thread Mario Bittermann

Problem is solved. We used wrong Mail API. With 1.4 everything works fine.

Mario
 Original-Nachricht 
Datum: Tue, 22 Aug 2006 09:27:22 +0200
Von: Mario Bittermann [EMAIL PROTECTED]
An: Tomcat Users List users@tomcat.apache.org
Betreff: Re: Problem with Emailappender of Log4j

 Here are the codes:
 
 Javacode:
 Logger logger =
 Logger.getLogger(CreditLimitEditActionFromList.class.getName());
 try {
 // some code where exceptions can occur
 } catch (Exception e) {
logger.error(unhandled exception: ,e);
 }
 
 Log4j-config:
 
 log4j.rootLogger=ERROR, email
 log4j.appender.email = org.apache.log4j.net.SMTPAppender
 log4j.appender.email.BufferSize = 512
 log4j.appender.email.From = server
 log4j.appender.email.SMTPHost = localhost
 log4j.appender.email.Subject = CreditLimitRequest Error Report
 log4j.appender.email.To = [EMAIL PROTECTED]
 log4j.appender.email.layout = org.apache.log4j.PatternLayout
 log4j.appender.email.layout.conversionPattern = %d %-5p [%-10t] %c{2} -
 %m%n
 
 Normally we get emails with mailbody like:
 
 2006-08-22 09:22:33,667 61214430 [http-8090-Processor13] ERROR
 com.omv.creditlimit.action.CreditLimitEditActionFromList.execute(CreditLimitEditActionFromList.java:295)-
 unhandled exception: 
 java.lang.NullPointerException
   at
 com.omv.creditlimit.business.RulesEngineImpl.setDocumentID(RulesEngineImpl.java:366)
   at
 com.omv.creditlimit.action.CreditLimitEditActionFromList.execute(CreditLimitEditActionFromList.java:121)
   at
 org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
   at
 org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
   at
 org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
   at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
   at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
   at
 org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
   at
 org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at
 org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
   at
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
   at java.lang.Thread.run(Thread.java:595)
 
 
 Mario
  Original-Nachricht 
 Datum: Mon, 21 Aug 2006 12:40:12 -0400
 Von: Martin Gainty [EMAIL PROTECTED]
 An: Tomcat Users List users@tomcat.apache.org
 Betreff: Re: Problem with Emailappender of Log4j
 
  Mario-
  
  can we see the exception handler and how you are capturing stackTrace?
  
  M-
  *
  This email message and any files transmitted with it contain
 confidential
  information intended only for the person(s) to whom this email message
 is
  addressed.  If you have received this email message in error, please
  notify
  the sender immediately by telephone or email and destroy the original
  message without making a copy.  Thank you.
  
  
  
  - Original Message - 
  From: Mario Bittermann [EMAIL PROTECTED]
  To: users@tomcat.apache.org
  Sent: Monday, August 21, 2006 12:01 PM
  Subject: Problem with Emailappender of Log4j
  
  
   Hi,
   
   we have a problem with our emailappender of Log4j.
   We are using Log4js emailappender to be informed when an unhandled
  exception is thrown in an application.
   If an exception is thrown we get an email with a exceptionstacktrace
 as
  mailbody. This works fine with Tomcat 4.
   
   Since we are using Tomcat 5.5.12 with Sun jdk 1.5_07 no stacktrace is
  sent! We get a mail with empty body.
   I did some test with jdk 1.5 and Log4j and emailnotification works
 fine.
  But on Tomcat 5.5 we get empty email.
   
   Who can help? Any ideas?
   
   Thanks
   Mario
   -- 
   
   
   Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
   Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
   
   

Re: Parsing keyvalue pairs in POST data

2006-08-22 Thread Santosh Puranshettiwar

Looking into the code finally helped.
The problem is like this.

Before the first call to getParameter(), the parameters map is built by 
parsing the message body in POST request. Parsing happends only when 
Content-Type: application/x-www-form-urlencoded and Content-Length is sent.


The J2ME application for some reason still unknown does fails to set the 
Content-Length for requests with content above 2016 characters.


Therefore, when the data is below 2016 characters, things work. And when 
its greater than that, they fail.


Thanks alot for all your help.
Santosh.

Santosh Puranshettiwar wrote:
The J2ME application that sends the data to my server is built on the 
MIDP 2.0 profile. And MIDP 2.0 does support Unicode.


Moreover, could it really be a problem related to encoding? I unable 
to correlate it with the peculiar behavior I am observing whereby the 
server fails to parse the parameters in the message body, if its 
length is greater than 2016 characters. What's it got to do with 2016?


On the other hand, it might as well be a problem with encoding (or 
bug) in J2ME. Because, the same data when sent from a browser does not 
cause any problems.


One more query. Will digging the source code help? If so what should I 
specifically look for?


Thanks alot.
Santosh.
Martin Gainty wrote:
I know the initial versions of J2ME did not have UNICODE (either 
UTF-8 or UTF-16) support.


I would search the lists located here
https://subscriptions.sun.com/subscription_center/ecomm.jsp
2 years ago I met a fellow who coded a UTF-8 MIDP device for 
collecting Patient info (with the conclusion that UNICODE enabled 
handhelds are possible)


You will probably wind up hand coding the UTF-8 encoding logic...
provided your displays will have to be UNICODE display enabled display
and your input devices will need to be IME enabled..

Martin --
*
This email message and any files transmitted with it contain 
confidential
information intended only for the person(s) to whom this email 
message is
addressed.  If you have received this email message in error, please 
notify

the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



- Original Message - From: Santosh Puranshettiwar 
[EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Monday, August 21, 2006 12:49 AM
Subject: Re: Parsing keyvalue pairs in POST data


 

Thanks alot for your reply Martin.
Its just a simple setup. I am using Tomcat 4.1 listening on port 80 
(OS: Windows - if that matters). Its not coupled with Apache.


Why would the same data when sent from a browser would parse well 
while not from a J2ME application? I'm baffled.


Santosh.

Martin Gainty wrote:
   

I assume you are front-ending with Apache..?

I would use HTTP 1.1 instead of (HTTP 1.0 where length must be 
specified beforehand)


Here are some keyword values in httpd.conf that will help you 
overcome your current limitations


You can adjust the limit on the size of any field via
LimitRequestFieldSize

You can adjust the limit on the size of the request line via 
LimitRequestLine


You can adjust the limit on the size of the HTTP body sent via 
text/xml

LimitXMLRequestBody
documenation available at
http://httpd.apache.org/docs/2.0/mod/core.html

Martin --
*
This email message and any files transmitted with it contain 
confidential
information intended only for the person(s) to whom this email 
message is
addressed.  If you have received this email message in error, 
please notify

the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



- Original Message - From: Santosh Puranshettiwar 
[EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Saturday, August 19, 2006 8:03 AM
Subject: Re: Parsing keyvalue pairs in POST data


   

Well, there's another problem.
HttpServletRequest.getParameter() is unable to parse the key-value 
pairs in the http message body if the the total content-length is 
greater that 2016.


Any ideas? Please.
Santosh.

Santosh Puranshettiwar wrote:
   

Managed to digg it.
Had to set Content-Type=application/x-www-form-urlencoded

Santosh Puranshettiwar wrote:
   

Hello,

How does tomcat parse the key-value pairs sent in a Http Request 
as POST data? I am unable to read the parameters using the 
HttpServletRequest.getParameter() method. Parameters are being 
sent by a J2ME application.


Tell me if more details are required.

Thanks alot.
Santosh.

- 


To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Restriciting maximum post size in Tomcat

2006-08-22 Thread Krish B

hi ,

this works. I had set wrong encoding in the FORM. It should be
application/x-www-form-urlencoded

Tx,
Krishnakumar


On 8/22/06, Krish B [EMAIL PROTECTED] wrote:


I set the maxPostSize=1000 in the server.xml and started the server.
If i post  1000 i dont get a error.
(
   Connector port=8080 maxPostSize=1000 maxHttpHeaderSize=8192
  maxThreads=150 minSpareThreads=25 maxSpareThreads=75
  enableLookups=false redirectPort=8443 acceptCount=100
  connectionTimeout=2 disableUploadTimeout=true/
)

How to get this feature to work. I have searched all over the place
and dont have answers.

I have tried 5.5.17  15 tomcat.

I use a FORM to POST a file of large size.

Thanks for any help

Rgds
Krish



Re: Tomcat BUILD FAILED, error=2

2006-08-22 Thread Martin Gainty
agreed..assuming they are not blocking ICMP
ping the repository host to verify reachability-

M-
*
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.




 Yan Bai wrote:
 Could this be a svn problem? when i tried svn checkout
 http://svn.apache.org/repos/asf/tomcat/current/tc5.5.x 
 
 I got the following msg:
 svn: PROPFIND request failed on '/repos/asf/tomcat/current/tc5.5.x'
 svn: PROPFIND of '/repos/asf/tomcat/current/tc5.5.x': could not connect
 to serve
 r (http://svn.apache.org)
 ---end of 'svn checkout'
 
 This works for me. Might you be behind some form of firewall that
 prevents you from doing this?
 
 Mark
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


Import user defined class not working

2006-08-22 Thread Level, Haroldo (Jr)


Hello all,

Im trying to import a class into a JSP file.

At the beginning I got the an error saying Generated servlet error:
Only a type can be imported. SDTDeal resolves to a package

After a lot of googling I found  I wasn't placing my class files in the
WEB-INF\classes\ directory and my classes weren't public. But after I
fixed all of that I got the following error:

An error occurred at line: 113 in the jsp file: /SD Tool/CheckNew.jsp
Generated servlet error:
SDTDeal cannot be resolved

I heven't find a way to solve this issue since the error message is too
general. Can somebody please give me some help at least to get me going
on to how to solve this problems.

P.S. Here is the JSP code:

 %@ page import=java.sql.* %
 %@ page import=java.io.* %
 %@ page import=SDT.SDTDeal %


 

%String connectionURL =
jdbc:microsoft:sqlserver://HLEVEL1:1433;databasename=sdt;
Connection connection = null;
Statement statement = null;
PreparedStatement insert= null;
ResultSet rs = null;

Class.forName(com.microsoft.jdbc.sqlserver.SQLServerDriver).newInstanc
e();
connection = DriverManager.getConnection( connectionURL, harol3,
toto2409); statement = connection.createStatement();

  
String user = request.getParameter(user); String password =
request.getParameter(password); String
name=request.getParameter(name);
String company=request.getParameter(company);
int day=Integer.parseInt(request.getParameter(day));
int month=Integer.parseInt(request.getParameter(month));
int year=Integer.parseInt(request.getParameter(year));
String checkbox=request.getParameter(checkbox);
boolean fail=false;

if(name.trim().equals())
{
fail=true;
%
/p
pspan class=style7Fill in the name of the Deal /span/p
p
%
}

else
{
rs = statement.executeQuery(SELECT name FROM deals WHERE name
LIKE '+name.trim()+');

if(rs.next())
{
fail=true;
%
/p
pspan class=style7This name is being used by
another deal /span/p
p
 %
}
}

if(company.trim().equals())
{
fail=true;
%
/p
pspan class=style7Fill in the Company Name/span/p p
  %
}

if(checkbox==null)
{
if((month==4||month==6||month==9||month==11)day==31)
{
fail=true;
%
/p
pspan class=style7The selected month does not have
31 days/span/p
p
  %
}

if(month==2day28)
{
fail=true;
%
/p
pspan class=style7The selected month have less
than 29 days/span/p
p
  %
}

}

if(fail)
{
%
/p
form action=New.jsp method=post name=form1
target=rightFrame class=style4 id=form1
div align=left
  input type=hidden value = %= user%name=username /
  input type=hidden value = %= password%name=password /
  input type=submit name=Submit value=Back /
/form
p
%
}

else
{
SDTDeal deal = new SDTDeal(day,month,year,company,name);

try
{
ObjectOutputStream dout= new ObjectOutputStream(new
FileOutputStream(new File(name+.deal)));
dout.writeObtect(SDTDeal);

insert = connection.prepareStatement(INSERT INTO deals
VALUES ('+name+','+company+','IP','+user+'));
insert.executeUpdate();
%
/p
pspan class=style7New deal created
Successfully/span/p
p
/p
form action=Work.jsp method=post name=form1
target=rightFrame class=style4 id=form1
div align=left
  input type=hidden value = %= user%name=user
/
  input type=hidden value = %=
password%name=password /
  input type=hidden value = %= name%name=name
/
  input type=hidden value = %=
company%name=company /
  input type=submit name=Submit value=Go to first
evaluation /
/form
p
%
}

catch(Exception e)
{
e.printStackTrace();
}
}
%

Regards and your help is very welcome,
Haroldo Level Jr


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Import user defined class not working

2006-08-22 Thread Markus Schönhaber
Level, Haroldo (Jr) wrote:
 Im trying to import a class into a JSP file.

 At the beginning I got the an error saying Generated servlet error:
 Only a type can be imported. SDTDeal resolves to a package

 After a lot of googling I found  I wasn't placing my class files in the
 WEB-INF\classes\ directory and my classes weren't public. But after I
 fixed all of that I got the following error:

 An error occurred at line: 113 in the jsp file: /SD Tool/CheckNew.jsp
 Generated servlet error:
 SDTDeal cannot be resolved
[...]
  %@ page import=SDT.SDTDeal %

You should have
WEB-INF\classes\SDT\SDTDeal.class
Is that so?
BTW: case matters.

Regards
  mks

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Log4j and Tomcat problem

2006-08-22 Thread pompiuses

I'm using Tomcat 5.0.30 running on Ubuntu Linux (6.06).

I've made a small webapp which runs fine under Tomcat on Windows, but on
Linux I've got a problem with log4j.

I've put commons-logging-1.1.jar and log4j-1.2.13.jar in the webapp libs
directory ($CATALINA_HOME/webapps/ROOT/WEB-INF/lib). In the webapp classes
directory I've put log4j.properties.

The problem is that the webapp won't even run as long as
commons-logging-1.1.jar is in the class path. If I remove it, the webapp
will run but there's no logging.

Then I tried putting log4j.properties in $CATALINA_HOME/shared/classes and
$CATALINA_HOME/common/classes, but it still wouldn't log anything.

No error messages is written to system.out (/var/log/tomcat5/catalina.out)
or any of the Tomcat log files.

My log4j.properties look like this (just prints to the console):

# The log4j configuration file.
log4j.rootLogger=debug, R
log4j.appender.R=org.apache.log4j.ConsoleAppender
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%-5p %-30.30c{1} %x - %m%n


How can I test if log4j.properties really is in the classpath? Perhaps it's
missing from the classpath?

Perhaps using the ROOT directory for my webapp is a bad idea?

Any comments and suggestions are welcome :-)

-- 
View this message in context: 
http://www.nabble.com/Log4j-and-Tomcat-problem-tf2146529.html#a5926291
Sent from the Tomcat - User forum at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Import user defined class not working

2006-08-22 Thread Lou Caudell

Markus Schönhaber wrote:

Level, Haroldo (Jr) wrote:
  

Im trying to import a class into a JSP file.

At the beginning I got the an error saying Generated servlet error:
Only a type can be imported. SDTDeal resolves to a package

After a lot of googling I found  I wasn't placing my class files in the
WEB-INF\classes\ directory and my classes weren't public. But after I
fixed all of that I got the following error:

An error occurred at line: 113 in the jsp file: /SD Tool/CheckNew.jsp
Generated servlet error:
SDTDeal cannot be resolved


[...]
  

 %@ page import=SDT.SDTDeal %



You should have
WEB-INF\classes\SDT\SDTDeal.class
Is that so?
BTW: case matters.

Regards
  mks

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  
Looks like you're developing without using a good IDE. Not using one is 
actually more time consuming and difficult than using one for java web 
development. Besides you will pickup the structure more easily, and it 
will be in a portable .war file. I suggest Netbeans. It's free.
Also, look into MVC2 architecture, so you won't need to expose your db 
password. After all a jsp is a text file.


- Lou Caudell

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Log4j and Tomcat problem

2006-08-22 Thread Boris Unckel

 Original-Nachricht 
Datum: Tue, 22 Aug 2006 07:09:58 -0700 (PDT)
Von: pompiuses [EMAIL PROTECTED]
An: users@tomcat.apache.org
Betreff: Log4j and Tomcat problem

 
 I'm using Tomcat 5.0.30 running on Ubuntu Linux (6.06).
 
 I've made a small webapp which runs fine under Tomcat on Windows, but on
 Linux I've got a problem with log4j.
 
 I've put commons-logging-1.1.jar and log4j-1.2.13.jar in the webapp
 libs
 directory ($CATALINA_HOME/webapps/ROOT/WEB-INF/lib). In the webapp classes
 directory I've put log4j.properties.
That is the best way to avoid problems, so further tries should rely on that.
Maybe Tomcat 5.0.30 delivers an old commons-logging-api.jar. Have a look at
http://jakarta.apache.org/commons/logging/commons-logging-1.1/guide.html#Jars_Included_in_the_Standard_Distribution
and try to find the correct combination of
a) replacing the old version with the current commons-logging inside tomcat
b) replace WEB-INF/lib/commons-logging-1.1.jar with commons-logging-adapters.jar

Force commons-logging 1.1 with JVM parameter
-Dorg.apache.commons.logging.diagnostics.dest=STDOUT
to give you a trace of what it does. If you still have errors - please post 
this trace.

Please send back your solution to the list...

Regards
Boris

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Import user defined class not working

2006-08-22 Thread Level, Haroldo (Jr)
Hello all,

The issue was solved. The error was not related to tomcat but to an error in 
the code that I missed, thanks Hassan for your help. And thanks everybody else 
for your sugestions I will look into them

Regards,
Haroldo Level

-Original Message-
From: Lou Caudell [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 22, 2006 10:25 AM
To: Tomcat Users List
Subject: Re: Import user defined class not working

Markus Schönhaber wrote:
 Level, Haroldo (Jr) wrote:
   
 Im trying to import a class into a JSP file.

 At the beginning I got the an error saying Generated servlet error:
 Only a type can be imported. SDTDeal resolves to a package

 After a lot of googling I found  I wasn't placing my class files in 
 the WEB-INF\classes\ directory and my classes weren't public. But 
 after I fixed all of that I got the following error:

 An error occurred at line: 113 in the jsp file: /SD 
 Tool/CheckNew.jsp Generated servlet error:
 SDTDeal cannot be resolved
 
 [...]
   
  %@ page import=SDT.SDTDeal %
 

 You should have
 WEB-INF\classes\SDT\SDTDeal.class
 Is that so?
 BTW: case matters.

 Regards
   mks

 -
 To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, 
 e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


   
Looks like you're developing without using a good IDE. Not using one is 
actually more time consuming and difficult than using one for java web 
development. Besides you will pickup the structure more easily, and it will be 
in a portable .war file. I suggest Netbeans. It's free.
Also, look into MVC2 architecture, so you won't need to expose your db 
password. After all a jsp is a text file.

- Lou Caudell

-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: 
[EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JK 1.2.18 win32 dll not working

2006-08-22 Thread Jessica

Hi Julie,
I`m facing exactly the same problem as you described.
Have you found any solution yet?

Has anyone else succeded in getting jk-1.2.18 to run under IIS? 
An answer would help in isolating the problem to IIS or JK.
When googling for IIS isapi filters I came across this link:
http://blogs.msdn.com/david.wang/archive/2005/06/21/HOWTO_Diagnose_and_Fix_Common_ISAPI_Filter_Installation_Failures.aspx

which basicly tell us that the error code means that the ISAPI Filter
specified an ISAPI Filter DLL that does not exist.
But if for any reason GetFilterVersion(), HttpFilterProc() or
GetFilterVersion() returns FALSE when IIS tries loadLibrary, then you will
get the same error with WHATEVER value GetLastError() returns.

Any help preciated!
/* Jessica



Julie Szmyd wrote:
 
 Hi,
 
 I tried to upgrade an older version of the win32 JK isapi_redirect.dll 
 to the jk-1.2.18 version that I downloaded from 
 http://mirrors.ibiblio.org/pub/mirrors/apache/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.18.
  
 For some reason, IIS is not able to load the ISAPI filter.  It errors 
 out with the following message when I start IIS:
 
 -
 
 The HTTP Filter DLL C:\java\Tomcat\Jakarta Isapi 
 Redirector\bin\isapi_redirect.dll failed to load.  The data is the error.
 
 data in bytes: : 02 00 00 00   
 
 -
 
 I was able to successfully upgrade to the jk-1.2.15 version, which makes 
 me think my setup is correct, and there could be  a problem with the 
 binary for jk-1.2.18.  Has anyone else gotten the 1.2.18 version working 
 on Windows XP IIS version 5.1?  Are there any differences in 
 configuration from 1.2.15 to 1.2.18?
 
 Thanks,
 Julie Szmyd
 
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/JK-1.2.18-win32-dll-not-working-tf2069405.html#a5931115
Sent from the Tomcat - User forum at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



IIS 5.0 - Jboss with Tomcat 5.5 - JK 1.2.15 - NTLM

2006-08-22 Thread Scott Shaver

Okay I have Jboss set up on my machine with a simple one page web app
that has an Active Directory security realm set up.  I have another
machine running IIS 5 with the isapi_redirect.dll installed as an ISAPI
filter to redirect the requests to Tomcat on my machine.  I can access
the web app via IIS, get prompted for a user name and password, the app
server validates me in the AD domain controller and send me the page; As
long as

1 the auth-method in the web.xml is BASIC
2 the IIS web server has Anonymous Access turned on
3 Integrated Windows Security Authentication turned off

To see what the configuration step are for this go to:
http://www.scottshaver2000.com/forum/viewtopic.php?p=601#601

I now want to do the same thing but not have the user get prompted to
login by having the app server use the NTLM headers that IE sends with
the requests.  So I thought I could do this:

1 turn Integrated Windows Authentication on for the IIS web site.
2 set the auth-method to CLIENT-CERT in the web.xml
3 set tomcatAuthentication=false in the tomcat server.xml file

However this doesn't work, does anyone have a clue what I should do
next?

Scott A. Shaver


SPECIAL NOTICE

All information transmitted hereby is intended only for the use of the
addressee(s) named above and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or distribution
of confidential and privileged information is prohibited. If the reader
of this message is not the intended recipient(s) or the employee or agent
responsible for delivering the message to the intended recipient, you are
hereby notified that you must not read this transmission and that disclosure,
copying, printing, distribution or use of any of the information contained
in or attached to this transmission is STRICTLY PROHIBITED.

Anyone who receives confidential and privileged information in error should
notify us immediately by telephone and mail the original message to us at
the above address and destroy all copies.  To the extent any portion of this
communication contains public information, no such restrictions apply to that
information. (gate01)

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



one docbase, many paths

2006-08-22 Thread Kallin Nagelberg

What is the best way to setup multiple paths all pointing to the same
docbase?

IE, I want 'www.mysite.com', 'www.mysite.com/brand1', 'www.mysite.com/brand2'
etc., to all point to the same folder (say tomcat5.5/webapps/myapp).

I have been able to do this by placing multiple context tags within the host
tag of server.xml, but then I require a restart for them to takeeffect.
I also have been able to do this by placing brand1.xml, brand2.xml etc.
files in the catalinahome/engine/host folder, but then i need 1 file per
context. This is dynamic, but if I have many paths there will be many files.


Is there a way to combine the power of having multiple contexts within 1
file in the first method, with the power of hot-deploy in the second?


Re: one docbase, many paths

2006-08-22 Thread Hassan Schroeder

On 8/22/06, Kallin Nagelberg [EMAIL PROTECTED] wrote:

What is the best way to setup multiple paths all pointing to the same
docbase?


Have only one Context and use a Filter to forward from the fake paths? :-)

--
Hassan Schroeder  [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat 5.5 class loader question.

2006-08-22 Thread Mark Thomas
Borut Hadžialić wrote:
 However, when we move those Jira dependencies from
 $CATALINA_HOME/common/lib/ to $CATALINA_BASE/shared/lib/
 Jira starup fails - it throws several ClassDefNotFoundException
 (for org.postgresql.Driver and other classes)
 
 Does anyone know why is this happening?

Probably because the Catalina classloader also needs to be able to see
those classes. If they are in shared, they are not visible to the core
Tomcat code.

Mark

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Different request.getLocalName() values

2006-08-22 Thread Mohsen Saboorian

Hi,
I tested request.getLocalName() on two different WinXP machines, one
returning 127.0.0.1 and the other localhost.
What is the problem?

Thanks in advance.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]