Re: Control character in cookie value

2009-12-08 Thread itay sahar
Andre,

I'm not sure why you worry about the other cookie value. let me show you an
example
maybe then you may see something that i'm missing.

getCookieMaxAge()  is  31536000
cookiePathis   /jboss-seam-jpa

What can be wrong here ? It works!
Are you worry about special character on cookiePath. I can make sure
in my application this won't happen right ?
If you think something is wrong in the methods below please suggest
solution..

Thanks!



On Mon, Dec 7, 2009 at 10:42 PM, itay sahar itay.sa...@gmail.com wrote:

 sure!
  protected void setCookieValueIfEnabled(String value)
{
   FacesContext ctx = FacesContext.getCurrentInstance();

   if ( isCookieEnabled()  ctx != null)
   {
  HttpServletResponse response = (HttpServletResponse)
 ctx.getExternalContext().getResponse();
  Cookie cookie = new Cookie( getCookieName(), value );
  cookie.setMaxAge( getCookieMaxAge() );
  cookie.setPath(cookiePath);
  response.addCookie(cookie);
   }
}

 On Mon, Dec 7, 2009 at 10:26 PM, André Warnier a...@ice-sa.com wrote:

 itay sahar wrote:

 sure!
 protected void clearCookieValue()
   {
  Cookie cookie = getCookie();
  if ( cookie!=null )
  {
 HttpServletResponse response = (HttpServletResponse)
 FacesContext.getCurrentInstance().getExternalContext().getResponse();

 cookie.setValue(null);
 cookie.setPath(cookiePath);
 cookie.setMaxAge(0);
 response.addCookie(cookie);
  }
   }


 That's not the code setting the cookie, it is code clearing a cookie
 value. But nevertheless..


  But look like problem is fixed. I extended the encodeToken method and
 change
 it to be
 return Base64.encodeBytes(sb.toString().getBytes(),
 Base64.DONT_BREAK_LINES);
 And now it works (like a charm)!


 And may I point you to a remark from quite a few posts ago, which went
 like :
 ...
 --quote--

 Except that some Base64 encoders, in some cases, will wrap the output
 string at 76 bytes, by inserting a CR/LF pair, which are both control
 characters.  (Note that the output string of Base64 is longer than the
 input string, since it encodes 3 consecutive input bytes into 4 output
 bytes.)
 My guess is that this is what happens here, and that could trigger the
 exception above.
 Maybe this Base64.encodeBytes() method has an optional argument which
 would tell it to not wrap the output value ?
 --end of quote--


  but i'm not sure it solve all the
  scenarios/possibilities.

 No, as also already pointed out, considering the code you posted before, a
 control character could also creep into cookiePath or getCookieMaxAge().

 Also read what Mark posted previously, about possible = signs getting
 into the Base64 encoded value (at the end, for padding).


 -

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





Re: Control character in cookie value

2009-12-07 Thread itay sahar
Pid,
I'm not using B as the cookie value.  A  B go to encode and finally you
have *one *value(C). this value
is sent to addCookie.

C is somthing like:
aXRheS5zYWhhckBnbWFpbC5jb206NmRlNWNhNGY6MTI1NGM0NjExMTA6LTdmZWI6OTEzNTQ4NjI0

On Mon, Dec 7, 2009 at 12:16 PM, Pid p...@pidster.com wrote:

 On 06/12/2009 21:51, itay sahar wrote:

 Hi Andre,

 please see below input and output of:
 protected String encodeToken(String username, String value)
{
   StringBuilder sb = new StringBuilder();
   sb.append(username);
   sb.append(:);
   sb.append(value);
   return Base64.encodeBytes(sb.toString().getBytes());
 }

 Input is:

 username= itay.sa...@gmial.com
 value=6de5ca4f:1254c461110:-7feb:9135486247122677484

 Output is (this is what actually addCookie get as parameter):

 6de5ca4f:1254c461110:-7feb:9135486247122677484

 Can you suggest solution ?


 Yep.

 You are claiming that you are supplying A  B to the encodeToken function,
 but then you are using B as the cookie value.

 Try using the value returned from the encodeToken function instead.
 Hint, if it contains a : character, it's not Base64 encoded.



 p


  On Sun, Dec 6, 2009 at 11:28 PM, itay saharitay.sa...@gmail.com  wrote:

  Hi Andre,

 please see below input and output of:
 protected String encodeToken(String username, String value)
{
   StringBuilder sb = new StringBuilder();
   sb.append(username);
   sb.append(:);
   sb.append(value);
   return Base64.encodeBytes(sb.toString().getBytes());
 }

 Input is:

 username= itay.sa...@gmial.com

 value=6de5ca4f:1254c461110:-7feb:9135486247122677484


 Output is:


 aXRheS5zYWhhckBnbWFpbC5jb206NmRlNWNhNGY6MTI1NGM0NjExMTA6LTdmZWI6OTEzNTQ4NjI0



 Can you suggest solution ?

 On Sat, Dec 5, 2009 at 6:20 PM, André Warniera...@ice-sa.com  wrote:

  Mark Thomas wrote:

  itay sahar wrote:

  Caused by: java.lang.IllegalArgumentException: Control character in
 cookie
 value, consider BASE64 encoding your value
at


 org.apache.tomcat.util.http.ServerCookie.maybeQuote2(ServerCookie.java:396)


 To cause this, there must be a character in the value with an ASCII
 code
  of less than 0x20 or greater or equal to 0x7f and is not 0x09.

 You need to fix that first.

 Then you'll need to worry about Base64 using '=' in cookie values. The
 value needs to be quoted for this to work. Tomcat will do this
 automatically if necessary.


  Mark above is talking about the output value of the Base64 encoder
 which
 you are using, and which you then feed to the response.addCookie(cookie)
 method.

 It is not clear (to me) where the used Base64.encodeBytes() method comes
 from.  But wherever it comes from, it should encode any input series of
 bytes according to
 http://tools.ietf.org/html/rfc3548#section-3
 which cannot produce control characters.
 Except that some Base64 encoders, in some cases, will wrap the output
 string at 76 bytes, by inserting a CR/LF pair, which are both control
 characters.  (Note that the output string of Base64 is longer than the
 input string, since it encodes 3 consecutive input bytes into 4 output
 bytes.)
 My guess is that this is what happens here, and that could trigger the
 exception above.
 Maybe this Base64.encodeBytes() method has an optional argument which
 would tell it to not wrap the output value ?

 Note also that with the code you were showing, the control character(s)
 could presumably be also in cookiePath.

 Why do you not log the cookie value, just before you call
 setCookieValueIfEnabled(String value) ?


 -
 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: Control character in cookie value

2009-12-07 Thread itay sahar
Thanks André,
*
*
*I agree with you about the doubt you have about the : being in C (after
encoding).*
 return Base64.encodeBytes(sb.toString().getBytes());
*I guess you suggest to log somthing like *
*(new String(C)).getBytes ? If yes I post it here later. I hope you can then
suggest somthing to sove this.*


On Mon, Dec 7, 2009 at 1:57 PM, André Warnier a...@ice-sa.com wrote:

 itay sahar wrote:

 Pid,
 I'm not using B as the cookie value.  A  B go to encode and finally you
 have *one *value(C). this value
 is sent to addCookie.

 C is somthing like:

 aXRheS5zYWhhckBnbWFpbC5jb206NmRlNWNhNGY6MTI1NGM0NjExMTA6LTdmZWI6OTEzNTQ4NjI0


 Ok, let's take this at face value.

 So yet, you are still getting an exception, which says that there is a
 control character in the value of the cookie which you are trying to add.

 Let's assume for now that the addCookie method itself has no bug, and that
 what it says in the exception is the truth.

 It also does not look (in these email communications), as if your value C
 above has a control character in it.

 (But note : there still could be one, that we do not see here in these
 emails.  For example, if the value C above was in reality ending in a CR/LF
 pair.  Apart from the string C itself above, you should maybe also log its
 length in bytes, so that we can really make sure that this is not the case).

 Then, if I remember well the code which really adds the cookie (and which
 is not the one shown below), independently of the value, there is also in
 these cookies an expiration date, and a path, which you add to the cookie
 string one by one.
 So really, when you do the addCookie, what you do is creating a cookie
 header which looks like :
 Set-Cookie: cookie-name=cookie-value(C);expires=somedate;path=somepath

 Any one of somedate or somepath could (potentially) contain a control
 character, and the exception would only show up when you actually do the
 addCookie() of the whole value (including expiration date and path) at once.






 On Mon, Dec 7, 2009 at 12:16 PM, Pid p...@pidster.com wrote:

  On 06/12/2009 21:51, itay sahar wrote:

  Hi Andre,

 please see below input and output of:
 protected String encodeToken(String username, String value)
   {
  StringBuilder sb = new StringBuilder();
  sb.append(username);
  sb.append(:);
  sb.append(value);
  return Base64.encodeBytes(sb.toString().getBytes());
 }

 Input is:

 username= itay.sa...@gmial.com
 value=6de5ca4f:1254c461110:-7feb:9135486247122677484

 Output is (this is what actually addCookie get as parameter):

 6de5ca4f:1254c461110:-7feb:9135486247122677484

 Can you suggest solution ?

  Yep.

 You are claiming that you are supplying A  B to the encodeToken
 function,
 but then you are using B as the cookie value.

 Try using the value returned from the encodeToken function instead.
 Hint, if it contains a : character, it's not Base64 encoded.



 p


  On Sun, Dec 6, 2009 at 11:28 PM, itay saharitay.sa...@gmail.com
  wrote:

  Hi Andre,

 please see below input and output of:
 protected String encodeToken(String username, String value)
   {
  StringBuilder sb = new StringBuilder();
  sb.append(username);
  sb.append(:);
  sb.append(value);
  return Base64.encodeBytes(sb.toString().getBytes());
 }

 Input is:

 username= itay.sa...@gmial.com

 value=6de5ca4f:1254c461110:-7feb:9135486247122677484


 Output is:



 aXRheS5zYWhhckBnbWFpbC5jb206NmRlNWNhNGY6MTI1NGM0NjExMTA6LTdmZWI6OTEzNTQ4NjI0



 Can you suggest solution ?

 On Sat, Dec 5, 2009 at 6:20 PM, André Warniera...@ice-sa.com  wrote:

  Mark Thomas wrote:

  itay sahar wrote:

  Caused by: java.lang.IllegalArgumentException: Control character in

 cookie
 value, consider BASE64 encoding your value
   at



 org.apache.tomcat.util.http.ServerCookie.maybeQuote2(ServerCookie.java:396)


  To cause this, there must be a character in the value with an ASCII
 code
  of less than 0x20 or greater or equal to 0x7f and is not 0x09.

 You need to fix that first.

 Then you'll need to worry about Base64 using '=' in cookie values.
 The
 value needs to be quoted for this to work. Tomcat will do this
 automatically if necessary.


  Mark above is talking about the output value of the Base64 encoder

 which
 you are using, and which you then feed to the
 response.addCookie(cookie)
 method.

 It is not clear (to me) where the used Base64.encodeBytes() method
 comes
 from.  But wherever it comes from, it should encode any input series
 of
 bytes according to
 http://tools.ietf.org/html/rfc3548#section-3
 which cannot produce control characters.
 Except that some Base64 encoders, in some cases, will wrap the
 output
 string at 76 bytes, by inserting a CR/LF pair, which are both control
 characters.  (Note that the output string of Base64 is longer than
 the
 input string, since it encodes 3 consecutive input bytes into 4 output
 bytes.)
 My guess is that this is what happens here, and that could trigger

Re: Control character in cookie value

2009-12-07 Thread itay sahar
I add log for the following method:

protected String encodeToken(String username, String value)
   {
  StringBuilder sb = new StringBuilder();
  sb.append(username);
  sb.append(:);
  sb.append(value);
  return Base64.encodeBytes(sb.toString().getBytes());
   }
*Before encoding:*
sb.toString().getBytes() =
[105, 116, 97, 121, 46, 115, 97, 104, 97, 114, 64, 103, 109, 97, 105, 108,
46, 99, 111, 109, 58, 45, 51, 51, 99, 100, 102, 98, 54, 102, 58, 49, 50, 53,
54, 97, 57, 48, 99, 57, 97, 99, 58, 45, 56, 48, 48, 48, 58, 51, 54, 55, 56,
53, 55, 52, 53, 54, 55, 52, 56, 55, 53, 56, 54, 57, 51, 56]

*After encoding:*
Base64.encodeBytes(sb.toString().getBytes()) =

aXRheS5zYWhhckBnbWFpbC5jb206LTMzY2RmYjZmOjEyNTZhOTBjOWFjOi04MDAwOjM2Nzg1NzQ1

Base64.encodeBytes(sb.toString().getBytes()).getBytes()
[97, 88, 82, 104, 101, 83, 53, 122, 89, 87, 104, 104, 99, 107, 66, 110, 98,
87, 70, 112, 98, 67, 53, 106, 98, 50, 48, 54, 76, 84, 77, 122, 89, 50, 82,
109, 89, 106, 90, 109, 79, 106, 69, 121, 78, 84, 90, 104, 79, 84, 66, 106,
79, 87, 70, 106, 79, 105, 48, 52, 77, 68, 65, 119, 79, 106, 77, 50, 78, 122,
103, 49, 78, 122, 81, 49, 10, 78, 106, 99, 48, 79, 68, 99, 49, 79, 68, 89,
53, 77, 122, 103, 61]

Please note that any change in the above might affect the decoder.
Thanks!


On Mon, Dec 7, 2009 at 3:04 PM, itay sahar itay.sa...@gmail.com wrote:

 Thanks André,
 *
 *
 *I agree with you about the doubt you have about the : being in C (after
 encoding).*
  return Base64.encodeBytes(sb.toString().getBytes());
 *I guess you suggest to log somthing like *
 *(new String(C)).getBytes ? If yes I post it here later. I hope you can
 then suggest somthing to sove this.*


 On Mon, Dec 7, 2009 at 1:57 PM, André Warnier a...@ice-sa.com wrote:

 itay sahar wrote:

 Pid,
 I'm not using B as the cookie value.  A  B go to encode and finally you
 have *one *value(C). this value
 is sent to addCookie.

 C is somthing like:

 aXRheS5zYWhhckBnbWFpbC5jb206NmRlNWNhNGY6MTI1NGM0NjExMTA6LTdmZWI6OTEzNTQ4NjI0


 Ok, let's take this at face value.

 So yet, you are still getting an exception, which says that there is a
 control character in the value of the cookie which you are trying to add.

 Let's assume for now that the addCookie method itself has no bug, and that
 what it says in the exception is the truth.

 It also does not look (in these email communications), as if your value C
 above has a control character in it.

 (But note : there still could be one, that we do not see here in these
 emails.  For example, if the value C above was in reality ending in a CR/LF
 pair.  Apart from the string C itself above, you should maybe also log its
 length in bytes, so that we can really make sure that this is not the case).

 Then, if I remember well the code which really adds the cookie (and which
 is not the one shown below), independently of the value, there is also in
 these cookies an expiration date, and a path, which you add to the cookie
 string one by one.
 So really, when you do the addCookie, what you do is creating a cookie
 header which looks like :
 Set-Cookie: cookie-name=cookie-value(C);expires=somedate;path=somepath

 Any one of somedate or somepath could (potentially) contain a control
 character, and the exception would only show up when you actually do the
 addCookie() of the whole value (including expiration date and path) at once.






 On Mon, Dec 7, 2009 at 12:16 PM, Pid p...@pidster.com wrote:

  On 06/12/2009 21:51, itay sahar wrote:

  Hi Andre,

 please see below input and output of:
 protected String encodeToken(String username, String value)
   {
  StringBuilder sb = new StringBuilder();
  sb.append(username);
  sb.append(:);
  sb.append(value);
  return Base64.encodeBytes(sb.toString().getBytes());
 }

 Input is:

 username= itay.sa...@gmial.com
 value=6de5ca4f:1254c461110:-7feb:9135486247122677484

 Output is (this is what actually addCookie get as parameter):

 6de5ca4f:1254c461110:-7feb:9135486247122677484

 Can you suggest solution ?

  Yep.

 You are claiming that you are supplying A  B to the encodeToken
 function,
 but then you are using B as the cookie value.

 Try using the value returned from the encodeToken function instead.
 Hint, if it contains a : character, it's not Base64 encoded.



 p


  On Sun, Dec 6, 2009 at 11:28 PM, itay saharitay.sa...@gmail.com
  wrote:

  Hi Andre,

 please see below input and output of:
 protected String encodeToken(String username, String value)
   {
  StringBuilder sb = new StringBuilder();
  sb.append(username);
  sb.append(:);
  sb.append(value);
  return Base64.encodeBytes(sb.toString().getBytes());
 }

 Input is:

 username= itay.sa...@gmial.com

 value=6de5ca4f:1254c461110:-7feb:9135486247122677484


 Output is:



 aXRheS5zYWhhckBnbWFpbC5jb206NmRlNWNhNGY6MTI1NGM0NjExMTA6LTdmZWI6OTEzNTQ4NjI0



 Can you suggest solution ?

 On Sat, Dec 5, 2009 at 6:20 PM, André Warniera...@ice-sa.com  wrote:

  Mark Thomas

Re: Control character in cookie value

2009-12-07 Thread itay sahar
sure!
protected void clearCookieValue()
   {
  Cookie cookie = getCookie();
  if ( cookie!=null )
  {
 HttpServletResponse response = (HttpServletResponse)
FacesContext.getCurrentInstance().getExternalContext().getResponse();

 cookie.setValue(null);
 cookie.setPath(cookiePath);
 cookie.setMaxAge(0);
 response.addCookie(cookie);
  }
   }
But look like problem is fixed. I extended the encodeToken method and change
it to be
return Base64.encodeBytes(sb.toString().getBytes(),
Base64.DONT_BREAK_LINES);
And now it works (like a charm)! but i'm not sure it solve all the
scenarios/possibilities.

On Mon, Dec 7, 2009 at 9:47 PM, Pid Ster p...@pidster.com wrote:

 On 7 Dec 2009, at 19:26, itay sahar itay.sa...@gmail.com wrote:

  I add log for the following method:
 
  protected String encodeToken(String username, String value)
{
   StringBuilder sb = new StringBuilder();
   sb.append(username);
   sb.append(:);
   sb.append(value);
   return Base64.encodeBytes(sb.toString().getBytes());
}
  *Before encoding:*
  sb.toString().getBytes() =
  [105, 116, 97, 121, 46, 115, 97, 104, 97, 114, 64, 103, 109, 97,
  105, 108,
  46, 99, 111, 109, 58, 45, 51, 51, 99, 100, 102, 98, 54, 102, 58, 49,
  50, 53,
  54, 97, 57, 48, 99, 57, 97, 99, 58, 45, 56, 48, 48, 48, 58, 51, 54,
  55, 56,
  53, 55, 52, 53, 54, 55, 52, 56, 55, 53, 56, 54, 57, 51, 56]
 
  *After encoding:*
  Base64.encodeBytes(sb.toString().getBytes()) =
 
 
 aXRheS5zYWhhckBnbWFpbC5jb206LTMzY2RmYjZmOjEyNTZhOTBjOWFjOi04MDAwOjM2Nzg1NzQ1


 
  Base64.encodeBytes(sb.toString().getBytes()).getBytes()
  [97, 88, 82, 104, 101, 83, 53, 122, 89, 87, 104, 104, 99, 107, 66,
  110, 98,
  87, 70, 112, 98, 67, 53, 106, 98, 50, 48, 54, 76, 84, 77, 122, 89,
  50, 82,
  109, 89, 106, 90, 109, 79, 106, 69, 121, 78, 84, 90, 104, 79, 84,
  66, 106,
  79, 87, 70, 106, 79, 105, 48, 52, 77, 68, 65, 119, 79, 106, 77, 50,
  78, 122,
  103, 49, 78, 122, 81, 49, 10, 78, 106, 99, 48, 79, 68, 99, 49, 79,
  68, 89,
  53, 77, 122, 103, 61]
 
  Please note that any change in the above might affect the decoder.
  Thanks!

 This is nice, but what does it prove?

 How about posting the bit of code where you create and set the cookie?

 Then we might see what you're doing wrong.

 p

  On Mon, Dec 7, 2009 at 3:04 PM, itay sahar itay.sa...@gmail.com
  wrote:
 
  Thanks André,
  *
  *
  *I agree with you about the doubt you have about the : being in C
  (after
  encoding).*
  return Base64.encodeBytes(sb.toString().getBytes());
  *I guess you suggest to log somthing like *
  *(new String(C)).getBytes ? If yes I post it here later. I hope you
  can
  then suggest somthing to sove this.*
 
 
  On Mon, Dec 7, 2009 at 1:57 PM, André Warnier a...@ice-sa.com wrote:
 
  itay sahar wrote:
 
  Pid,
  I'm not using B as the cookie value.  A  B go to encode and
  finally you
  have *one *value(C). this value
  is sent to addCookie.
 
  C is somthing like:
 
 
 aXRheS5zYWhhckBnbWFpbC5jb206NmRlNWNhNGY6MTI1NGM0NjExMTA6LTdmZWI6OTEzNTQ4NjI0


 
 
  Ok, let's take this at face value.
 
  So yet, you are still getting an exception, which says that there
  is a
  control character in the value of the cookie which you are
  trying to add.
 
  Let's assume for now that the addCookie method itself has no bug,
  and that
  what it says in the exception is the truth.
 
  It also does not look (in these email communications), as if your
  value C
  above has a control character in it.
 
  (But note : there still could be one, that we do not see here in
  these
  emails.  For example, if the value C above was in reality ending
  in a CR/LF
  pair.  Apart from the string C itself above, you should maybe also
  log its
  length in bytes, so that we can really make sure that this is not
  the case).
 
  Then, if I remember well the code which really adds the cookie
  (and which
  is not the one shown below), independently of the value, there
  is also in
  these cookies an expiration date, and a path, which you add to the
  cookie
  string one by one.
  So really, when you do the addCookie, what you do is creating a
  cookie
  header which looks like :
  Set-Cookie: cookie-name=cookie-value
  (C);expires=somedate;path=somepath
 
  Any one of somedate or somepath could (potentially) contain a
  control
  character, and the exception would only show up when you actually
  do the
  addCookie() of the whole value (including expiration date and
  path) at once.
 
 
 
 
 
 
  On Mon, Dec 7, 2009 at 12:16 PM, Pid p...@pidster.com wrote:
 
  On 06/12/2009 21:51, itay sahar wrote:
 
  Hi Andre,
 
  please see below input and output of:
  protected String encodeToken(String username, String value)
   {
  StringBuilder sb = new StringBuilder();
  sb.append(username);
  sb.append(:);
  sb.append(value);
  return Base64.encodeBytes(sb.toString().getBytes());
  }
 
  Input is:
 
  username= itay.sa...@gmial.com
  value=6de5ca4f

Re: Control character in cookie value

2009-12-07 Thread itay sahar
sure!
 protected void setCookieValueIfEnabled(String value)
   {
  FacesContext ctx = FacesContext.getCurrentInstance();

  if ( isCookieEnabled()  ctx != null)
  {
 HttpServletResponse response = (HttpServletResponse)
ctx.getExternalContext().getResponse();
 Cookie cookie = new Cookie( getCookieName(), value );
 cookie.setMaxAge( getCookieMaxAge() );
 cookie.setPath(cookiePath);
 response.addCookie(cookie);
  }
   }

On Mon, Dec 7, 2009 at 10:26 PM, André Warnier a...@ice-sa.com wrote:

 itay sahar wrote:

 sure!
 protected void clearCookieValue()
   {
  Cookie cookie = getCookie();
  if ( cookie!=null )
  {
 HttpServletResponse response = (HttpServletResponse)
 FacesContext.getCurrentInstance().getExternalContext().getResponse();

 cookie.setValue(null);
 cookie.setPath(cookiePath);
 cookie.setMaxAge(0);
 response.addCookie(cookie);
  }
   }


 That's not the code setting the cookie, it is code clearing a cookie value.
 But nevertheless..


  But look like problem is fixed. I extended the encodeToken method and
 change
 it to be
 return Base64.encodeBytes(sb.toString().getBytes(),
 Base64.DONT_BREAK_LINES);
 And now it works (like a charm)!


 And may I point you to a remark from quite a few posts ago, which went like
 :
 ...
 --quote--

 Except that some Base64 encoders, in some cases, will wrap the output
 string at 76 bytes, by inserting a CR/LF pair, which are both control
 characters.  (Note that the output string of Base64 is longer than the
 input string, since it encodes 3 consecutive input bytes into 4 output
 bytes.)
 My guess is that this is what happens here, and that could trigger the
 exception above.
 Maybe this Base64.encodeBytes() method has an optional argument which would
 tell it to not wrap the output value ?
 --end of quote--


  but i'm not sure it solve all the
  scenarios/possibilities.

 No, as also already pointed out, considering the code you posted before, a
 control character could also creep into cookiePath or getCookieMaxAge().

 Also read what Mark posted previously, about possible = signs getting
 into the Base64 encoded value (at the end, for padding).


 -

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




Re: Control character in cookie value

2009-12-06 Thread itay sahar
Hi Andre,

please see below input and output of:
protected String encodeToken(String username, String value)
   {
  StringBuilder sb = new StringBuilder();
  sb.append(username);
  sb.append(:);
  sb.append(value);
  return Base64.encodeBytes(sb.toString().getBytes());
}

Input is:

username= itay.sa...@gmial.com
value=6de5ca4f:1254c461110:-7feb:9135486247122677484

Output is (this is what actually addCookie get as parameter):

6de5ca4f:1254c461110:-7feb:9135486247122677484

Can you suggest solution ?

On Sun, Dec 6, 2009 at 11:28 PM, itay sahar itay.sa...@gmail.com wrote:

 Hi Andre,

 please see below input and output of:
 protected String encodeToken(String username, String value)
{
   StringBuilder sb = new StringBuilder();
   sb.append(username);
   sb.append(:);
   sb.append(value);
   return Base64.encodeBytes(sb.toString().getBytes());
 }

 Input is:

 username= itay.sa...@gmial.com

 value=6de5ca4f:1254c461110:-7feb:9135486247122677484


 Output is:

 aXRheS5zYWhhckBnbWFpbC5jb206NmRlNWNhNGY6MTI1NGM0NjExMTA6LTdmZWI6OTEzNTQ4NjI0



 Can you suggest solution ?

 On Sat, Dec 5, 2009 at 6:20 PM, André Warnier a...@ice-sa.com wrote:

 Mark Thomas wrote:

 itay sahar wrote:

 Caused by: java.lang.IllegalArgumentException: Control character in
 cookie
 value, consider BASE64 encoding your value
at

 org.apache.tomcat.util.http.ServerCookie.maybeQuote2(ServerCookie.java:396)


 To cause this, there must be a character in the value with an ASCII code
  of less than 0x20 or greater or equal to 0x7f and is not 0x09.

 You need to fix that first.

 Then you'll need to worry about Base64 using '=' in cookie values. The
 value needs to be quoted for this to work. Tomcat will do this
 automatically if necessary.


 Mark above is talking about the output value of the Base64 encoder which
 you are using, and which you then feed to the response.addCookie(cookie)
 method.

 It is not clear (to me) where the used Base64.encodeBytes() method comes
 from.  But wherever it comes from, it should encode any input series of
 bytes according to
 http://tools.ietf.org/html/rfc3548#section-3
 which cannot produce control characters.
 Except that some Base64 encoders, in some cases, will wrap the output
 string at 76 bytes, by inserting a CR/LF pair, which are both control
 characters.  (Note that the output string of Base64 is longer than the
 input string, since it encodes 3 consecutive input bytes into 4 output
 bytes.)
 My guess is that this is what happens here, and that could trigger the
 exception above.
 Maybe this Base64.encodeBytes() method has an optional argument which
 would tell it to not wrap the output value ?

 Note also that with the code you were showing, the control character(s)
 could presumably be also in cookiePath.

 Why do you not log the cookie value, just before you call
 setCookieValueIfEnabled(String value) ?


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





Re: Control character in cookie value

2009-12-05 Thread itay sahar
This is not my code. It is seam code.
see below the encoding section:
protected String encodeToken(String username, String value)
   {
  StringBuilder sb = new StringBuilder();
  sb.append(username);
  sb.append(:);
  sb.append(value);
  return Base64.encodeBytes(sb.toString().getBytes());
   }



On Sat, Dec 5, 2009 at 2:14 PM, André Warnier a...@ice-sa.com wrote:

 itay sahar wrote:

 Hi all,

 I'm using seam on tomcat 6.0.20 and encounter problem in my security
 module.

 Basically, i try to add cookie with base64 encoding of the username which
 is
 email address.


  The encoding works and no exception is thrown. But when seam try adding
 the
 cookie an exception is thrown:

 05/12/2009 02:23:00 com.sun.faces.lifecycle.Phase doPhase
 SEVERE: JSF1054: (Phase ID: INVOKE_APPLICATION 5, View ID: /login.xhtml)
 Exception thrown during phase execution:

 javax.faces.event.phaseevent[source=com.sun.faces.lifecycle.lifecyclei...@7d5
 05/12/2009 02:23:00 org.ajax4jsf.webapp.BaseXMLFilter doXmlFilter
 SEVERE: Exception in the filter chain
 javax.servlet.ServletException: #{identity.login}:
 java.lang.IllegalArgumentException: Control character in cookie value,
 consider BASE64 encoding your value
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)


 Obviously, the value of your cookie is /not/ Base-64 encoded.
 I also cannot see in your code where that encoding should take place.

 And if the value is really an email address, and if you really do encode it
 somewhere else than in the code you show, then what probably happens is that
 your Base-64 encoded string exceeds 80 characters, and is being wrapped with
 a CR/LF somewhere.

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




Re: Control character in cookie value

2009-12-05 Thread itay sahar
Thanks for reply Mark,

So you suggest to change the following method:

protected String encodeToken(String username, String value)
   {
  StringBuilder sb = new StringBuilder();
  sb.append(username);
  sb.append(:);
  sb.append(value);
  return Base64.encodeBytes(sb.toString().getBytes());

Can you suggest a work around for this ?

This code is from seam but i can override a component if not sufficient.
The special characters i have in the specific email address (username  is .
and @
But i really need to support all characters that can be applied in email
address.

Thanks!

On Sat, Dec 5, 2009 at 3:37 PM, Mark Thomas ma...@apache.org wrote:

 itay sahar wrote:
  Caused by: java.lang.IllegalArgumentException: Control character in
 cookie
  value, consider BASE64 encoding your value
  at
 
 org.apache.tomcat.util.http.ServerCookie.maybeQuote2(ServerCookie.java:396)

 To cause this, there must be a character in the value with an ASCII code
  of less than 0x20 or greater or equal to 0x7f and is not 0x09.

 You need to fix that first.

 Then you'll need to worry about Base64 using '=' in cookie values. The
 value needs to be quoted for this to work. Tomcat will do this
 automatically if necessary.

 Mark




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




Control character in cookie value

2009-12-04 Thread itay sahar
Hi all,

I'm using seam on tomcat 6.0.20 and encounter problem in my security module.

Basically, i try to add cookie with base64 encoding of the username which is
email address.
The encoding works and no exception is thrown. But when seam try adding the
cookie an exception is thrown:

05/12/2009 02:23:00 com.sun.faces.lifecycle.Phase doPhase
SEVERE: JSF1054: (Phase ID: INVOKE_APPLICATION 5, View ID: /login.xhtml)
Exception thrown during phase execution:
javax.faces.event.phaseevent[source=com.sun.faces.lifecycle.lifecyclei...@7d5
05/12/2009 02:23:00 org.ajax4jsf.webapp.BaseXMLFilter doXmlFilter
SEVERE: Exception in the filter chain
javax.servlet.ServletException: #{identity.login}:
java.lang.IllegalArgumentException: Control character in cookie value,
consider BASE64 encoding your value
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at
org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at
org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at
org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at
org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
at
org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
at
org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
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:595)
Caused by: javax.faces.FacesException: #{identity.login}:
java.lang.IllegalArgumentException: Control character in cookie value,
consider BASE64 encoding your value
at
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
at javax.faces.component.UICommand.broadcast(UICommand.java:387)
at
org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
at
org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
at
org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
at
org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
at
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
... 30 more
Caused by: javax.faces.el.EvaluationException:
java.lang.IllegalArgumentException: Control character in cookie value,
consider BASE64 encoding your value
at
javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
at
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
... 39 more
Caused by: java.lang.IllegalArgumentException: Control character in cookie
value, 

After deployment to tomcat: entity class not found

2009-05-07 Thread itay sahar
Hello,

I've successfully created all hbm,POJO and DAO files using Hibernate tool
which is great!!!

Once deploy to Tomcat I got the exception:
nested exception is org.hibernate.MappingException: entity class not found:
MyClass

the full stack is:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'sessionFactory' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested
exception is org.hibernate.MappingException: entity class not found: MyClass
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1362)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:540)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:407)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:735)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:251)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:190)
at
org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Caused by: org.hibernate.MappingException: entity class not found: Regional
at
org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.java:99)
at org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactory.java:168)
at
org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:44)
at
org.hibernate.tuple.entity.EntityMetamodel.init(EntityMetamodel.java:123)
at
org.hibernate.persister.entity.AbstractEntityPersister.init(AbstractEntityPersister.java:434)
at
org.hibernate.persister.entity.SingleTableEntityPersister.init(SingleTableEntityPersister.java:109)
at
org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at 

JSF implementation selection

2008-05-09 Thread itay sahar
hi all,
I would like you share with us the best JSF implemetation.
(myfaces,icefaces) and explian
why you prefer one above the other.

Thanks
Itay


Re: hibernate3 / JPA / JBossCache / tomcat

2008-02-01 Thread itay sahar
Tomcat can use JTA. I use it also with Hib3. My sugession to you is to find
the appropriate jar with JBossCache and for tomcat version.

On 2/1/08, David Cassidy [EMAIL PROTECTED] wrote:

 Hey guys

 Having problems getting Hib3/JPA working with JBossCache within tomcat.

 Am I trying for the impossible?
 I could get it working with OSCache but JBossCache likes to have a JTA
 now unless I'm missing something Tomcat doesn't do JTA

 Anyone got the answer as to what my persistence.xml should look like and
 if I need anything else in my server.xml

 Help 

 Thanks guys

 David




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




tiles 2 JSF integration in tomcat 5.5.25

2007-11-15 Thread itay sahar
hi,
i'm trying to forward from index.jsp:
jsp:forward page=main.jsf/

to main.jsp:


%@ taglib uri=http://tiles.apache.org/tags-tiles; prefix=tiles %

tiles:insertDefinition name=.mainLayout

tiles:putAttribute name=title value=Main Page/

tiles:putAttribute name=body value=/tiles/main.jsp/

/tiles:insertDefinition
this is part of tiles.xml:


!DOCTYPE tiles-definitions PUBLIC

-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN

http://tiles.apache.org/dtds/tiles-config_2_0.dtd;

tiles-definitions

definition name=.mainLayout template=/layout.jsp

put-attribute name=header value=/tiles/header.jsp/

part of web.xml:

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

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

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

version=2.4

context-param

param-nameorg.apache.tiles.CONTEXT_FACTORY/param-name

param-valueorg.apache.tiles.context.enhanced.EnhancedContextFactory/
param-value

/context-param



servlet

servlet-nameTiles Servlet/servlet-name

servlet-classorg.apache.tiles.web.startup.TilesServlet/servlet-class

init-param

param-namedefinitions-config/param-name

param-value/WEB-INF/tiles-defs.xml,/org/apache/tiles/classpath-defs.xml/
param-value

/init-param

load-on-startup2/load-on-startup

/servlet

listener

listener-classorg.apache.tiles.web.startup.TilesListener/listener-class

/listener



The excpetion is:

java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo
.init(Ljava/lang/String;ZLjava/lang/String;ZZ)V
at org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute(
TagLibraryInfoImpl.java:581)



jar included:

 aopalliance.jar
 cglib-2.0-rc2.jar
 commons-beanutils.jar
 commons-collections-2.1.jar
 commons-dbcp-1.1.jar
 commons-digester.jar
 commons-fileupload-1.0.jar
 commons-logging.jar
 commons-pool-1.1.jar
 dom4j-1.4.jar
 hibernate2.jar
 jsf-api.jar
 jsf-impl.jar
 jstl-1.1.0.jar
 jta.jar
 log4j.jar
 mysql-connector-java-3.0.9-stable-bin.jar
 odmg-3.0.jar
 spring.jar
 standard.jar
 tiles-api-2.0.5.jar
 tiles-core-2.0.5.jar
 tiles-jsp-2.0.5.jar

this is an advance topic. any idea will be welcome!


Re: tiles 2 JSF integration in tomcat 5.5.25

2007-11-15 Thread itay sahar
i do have, thanks

On 11/16/07, Martin Gainty [EMAIL PROTECTED] wrote:

 make sure you have $CATALINA_HOME/common/lib/jsp-api.jar

 M--
 - Original Message -
 From: itay sahar [EMAIL PROTECTED]
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Thursday, November 15, 2007 7:12 PM
 Subject: tiles 2 JSF integration in tomcat 5.5.25


  hi,
  i'm trying to forward from index.jsp:
  jsp:forward page=main.jsf/
 
  to main.jsp:
 
 
  %@ taglib uri=http://tiles.apache.org/tags-tiles; prefix=tiles %
 
  tiles:insertDefinition name=.mainLayout
 
  tiles:putAttribute name=title value=Main Page/
 
  tiles:putAttribute name=body value=/tiles/main.jsp/
 
  /tiles:insertDefinition
  this is part of tiles.xml:
 
 
  !DOCTYPE tiles-definitions PUBLIC
 
  -//Apache Software Foundation//DTD Tiles Configuration 2.0//EN
 
  http://tiles.apache.org/dtds/tiles-config_2_0.dtd;
 
  tiles-definitions
 
  definition name=.mainLayout template=/layout.jsp
 
  put-attribute name=header value=/tiles/header.jsp/
 
  part of web.xml:
 
  web-app xmlns=http://java.sun.com/xml/ns/j2ee;
 
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 
  xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
  http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
 
  version=2.4
 
  context-param
 
  param-nameorg.apache.tiles.CONTEXT_FACTORY/param-name
 
  param-valueorg.apache.tiles.context.enhanced.EnhancedContextFactory/
  param-value
 
  /context-param
 
 
 
  servlet
 
  servlet-nameTiles Servlet/servlet-name
 
  servlet-classorg.apache.tiles.web.startup.TilesServlet/servlet-class
 
  init-param
 
  param-namedefinitions-config/param-name
 
 
 param-value/WEB-INF/tiles-defs.xml,/org/apache/tiles/classpath-defs.xml
 /
  param-value
 
  /init-param
 
  load-on-startup2/load-on-startup
 
  /servlet
 
  listener
 
 
 listener-classorg.apache.tiles.web.startup.TilesListener
 /listener-class
 
  /listener
 
 
 
  The excpetion is:
 
  java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo
  .init(Ljava/lang/String;ZLjava/lang/String;ZZ)V
  at org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute
 (
  TagLibraryInfoImpl.java:581)
 
 
 
  jar included:
 
   aopalliance.jar
   cglib-2.0-rc2.jar
   commons-beanutils.jar
   commons-collections-2.1.jar
   commons-dbcp-1.1.jar
   commons-digester.jar
   commons-fileupload-1.0.jar
   commons-logging.jar
   commons-pool-1.1.jar
   dom4j-1.4.jar
   hibernate2.jar
   jsf-api.jar
   jsf-impl.jar
   jstl-1.1.0.jar
   jta.jar
   log4j.jar
   mysql-connector-java-3.0.9-stable-bin.jar
   odmg-3.0.jar
   spring.jar
   standard.jar
   tiles-api-2.0.5.jar
   tiles-core-2.0.5.jar
   tiles-jsp-2.0.5.jar
 
  this is an advance topic. any idea will be welcome!
 


 -
 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: jsp:forward in tomcat 5.5.25

2007-11-13 Thread itay sahar
hi david thanks for reply,

my web.xml include the following declaration:

!DOCTYPE web-app PUBLIC
  -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
  http://java.sun.com/dtd/web-app_2_3.dtd;

refer to your advice guess you need to declare the jsp taglib i'm not sure
which declaration is needed if any ?

thanks

On 11/12/07, David Smith [EMAIL PROTECTED] wrote:

 I'm going to venture a guess you need to declare the jsp taglib at the
 top of your jsp file.  Also you don't need all the html to execute a
 forward.  Only the jsp:forward.../ tag is required w/o all the html
 ... /html stuff.  The client won't see the html anyway.

 Lastly, you webapp will continue to use servlet spec 2.3/jsp 1.2 as long
 as your web.xml declares servlet spec 2.3.  Upgrade to the web.xml to
 enable all the servlet spec 2.4/jsp 2.0 features.

 --David

 itay sahar wrote:
  hi all,
 
  The tomcat version is 5.5.25 with the default version (binary).
  contain (jsp-api,jar and servlet-api.jar). Servlet 2.4 support jsp 2.0.
 
  My application worked (before) on tomcat 4.1 with jsp 1.2.
  Now i'm working on tomcat 5.5 as mention.
 
  I'm not sure what i need to change!!!
 
  my index.jsp contain the code below: (that's it)
 
  html
  head
  /head
  body
  jsp:forward page=main.jsf/
  /body
  /html
 
  I get the error:
 
  org.apache.jasper.JasperException: Exception in JSP: /index.jsp:5
 
  2: head
  3: /head
  4: body
  5: jsp:forward page=main.jsf/
  6: /body
  7: /html
 
 
  Stacktrace:
  org.apache.jasper.servlet.JspServletWrapper.handleJspException(
  JspServletWrapper.java:451)
  org.apache.jasper.servlet.JspServletWrapper.service(
 JspServletWrapper.java
  :355)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 
  root cause
 
  javax.servlet.ServletException: java.lang.NoSuchMethodError:
  javax.servlet.jsp.tagext.TagAttributeInfo
  .init(Ljava/lang/String;ZLjava/lang/String;ZZ)V
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:273)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  com.sun.faces.context.ExternalContextImpl.dispatch(
 ExternalContextImpl.java
  :322)
  com.sun.faces.application.ViewHandlerImpl.renderView(
 ViewHandlerImpl.java
  :142)
  com.sun.faces.lifecycle.RenderResponsePhase.execute(
 RenderResponsePhase.java
  :87)
  com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
  com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
  javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
  org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java
  :686)
  org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java
 :656)
  org.apache.jsp.index_jsp._jspService(index_jsp.java:48)
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  org.apache.jasper.servlet.JspServletWrapper.service(
 JspServletWrapper.java
  :331)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  root cause
 
  java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo
  .init(Ljava/lang/String;ZLjava/lang/String;ZZ)V
  org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute(
  TagLibraryInfoImpl.java:581)
  org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(
  TagLibraryInfoImpl.java:402)
  org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(
  TagLibraryInfoImpl.java:249)
  org.apache.jasper.compiler.TagLibraryInfoImpl.init(
 TagLibraryInfoImpl.java
  :180)
  org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:424)
  org.apache.jasper.compiler.Parser.parseDirective(Parser.java:493)
  org.apache.jasper.compiler.Parser.parseElements(Parser.java:1557)
  org.apache.jasper.compiler.Parser.parse(Parser.java:127)
  org.apache.jasper.compiler.ParserController.doParse(
 ParserController.java
  :212)
  org.apache.jasper.compiler.ParserController.parse(ParserController.java
 :101)
  org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
  org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
  org.apache.jasper.JspCompilationContext.compile(
 JspCompilationContext.java
  :564)
  org.apache.jasper.servlet.JspServletWrapper.service(
 JspServletWrapper.java
  :302)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  com.sun.faces.context.ExternalContextImpl.dispatch(
 ExternalContextImpl.java
  :322

Re: jsp:forward in tomcat 5.5.25

2007-11-13 Thread itay sahar
yeh well i already done it before, (jstl 1.1.0 version _ standard.jar)

tomcat 5.5.25  jsp-api.jar is the only jar contain the constractor of the
tag jsp:forward  !!!
my code works fine with servlet.jar (in tomcat 4.1 version).

I think i need other alternative to do the forward. (A new way according
tomcat 5.5.25 spec) do you know the way to do it ?



On 11/14/07, David Smith [EMAIL PROTECTED] wrote:

 Ok... after some research on your issue, what appears to be happening is
 there's a library version conflict somewhere.  It's really hard to tell
 where, but I would start by upgrading your libraries where possible --
 especially any that might have been compiled against an older jsp-api
 like standard.jar and jstl.jar.  The current version 1.1 of standard.jar
 and jstl.jar are built against jsp-api 2.0 (included w/ tomcat 5.5 in
 the common/lib directory).

 Also if you have any .java or .class files in tomcat's work directory,
 delete them and restart tomcat to remove any possible old stuff.

 --David

 itay sahar wrote:
  hi david thanks for reply,
 
  my web.xml include the following declaration:
 
  !DOCTYPE web-app PUBLIC
-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
http://java.sun.com/dtd/web-app_2_3.dtd;
 
  refer to your advice guess you need to declare the jsp taglib i'm not
 sure
  which declaration is needed if any ?
 
  thanks
 
  On 11/12/07, David Smith [EMAIL PROTECTED] wrote:
 
  I'm going to venture a guess you need to declare the jsp taglib at the
  top of your jsp file.  Also you don't need all the html to execute a
  forward.  Only the jsp:forward.../ tag is required w/o all the html
  ... /html stuff.  The client won't see the html anyway.
 
  Lastly, you webapp will continue to use servlet spec 2.3/jsp 1.2 as
 long
  as your web.xml declares servlet spec 2.3.  Upgrade to the web.xml to
  enable all the servlet spec 2.4/jsp 2.0 features.
 
  --David
 
  itay sahar wrote:
 
  hi all,
 
  The tomcat version is 5.5.25 with the default version (binary).
  contain (jsp-api,jar and servlet-api.jar). Servlet 2.4 support jsp 2.0
 .
 
  My application worked (before) on tomcat 4.1 with jsp 1.2.
  Now i'm working on tomcat 5.5 as mention.
 
  I'm not sure what i need to change!!!
 
  my index.jsp contain the code below: (that's it)
 
  html
  head
  /head
  body
  jsp:forward page=main.jsf/
  /body
  /html
 
  I get the error:
 
  org.apache.jasper.JasperException: Exception in JSP: /index.jsp:5
 
  2: head
  3: /head
  4: body
  5: jsp:forward page=main.jsf/
  6: /body
  7: /html
 
 
  Stacktrace:
  org.apache.jasper.servlet.JspServletWrapper.handleJspException(
  JspServletWrapper.java:451)
  org.apache.jasper.servlet.JspServletWrapper.service(
 
  JspServletWrapper.java
 
  :355)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
 :329)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 
  root cause
 
  javax.servlet.ServletException: java.lang.NoSuchMethodError:
  javax.servlet.jsp.tagext.TagAttributeInfo
  .init(Ljava/lang/String;ZLjava/lang/String;ZZ)V
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:273)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  com.sun.faces.context.ExternalContextImpl.dispatch(
 
  ExternalContextImpl.java
 
  :322)
  com.sun.faces.application.ViewHandlerImpl.renderView(
 
  ViewHandlerImpl.java
 
  :142)
  com.sun.faces.lifecycle.RenderResponsePhase.execute(
 
  RenderResponsePhase.java
 
  :87)
  com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
  com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
  javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
  org.apache.jasper.runtime.PageContextImpl.doForward(
 PageContextImpl.java
  :686)
  org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java
 
  :656)
 
  org.apache.jsp.index_jsp._jspService(index_jsp.java:48)
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  org.apache.jasper.servlet.JspServletWrapper.service(
 
  JspServletWrapper.java
 
  :331)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
 :329)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  root cause
 
  java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo
  .init(Ljava/lang/String;ZLjava/lang/String;ZZ)V
  org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute(
  TagLibraryInfoImpl.java:581)
  org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(
  TagLibraryInfoImpl.java:402)
  org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(
  TagLibraryInfoImpl.java:249)
  org.apache.jasper.compiler.TagLibraryInfoImpl.init(
 
  TagLibraryInfoImpl.java
 
  :180)
  org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java

jsp:forward in tomcat 5.5.25

2007-11-10 Thread itay sahar
hi all,

The tomcat version is 5.5.25 with the default version (binary).
contain (jsp-api,jar and servlet-api.jar). Servlet 2.4 support jsp 2.0.

My application worked (before) on tomcat 4.1 with jsp 1.2.
Now i'm working on tomcat 5.5 as mention.

I'm not sure what i need to change!!!

my index.jsp contain the code below: (that's it)

html
head
/head
body
jsp:forward page=main.jsf/
/body
/html

I get the error:

org.apache.jasper.JasperException: Exception in JSP: /index.jsp:5

2: head
3: /head
4: body
5: jsp:forward page=main.jsf/
6: /body
7: /html


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(
JspServletWrapper.java:451)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java
:355)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

javax.servlet.ServletException: java.lang.NoSuchMethodError:
javax.servlet.jsp.tagext.TagAttributeInfo
.init(Ljava/lang/String;ZLjava/lang/String;ZZ)V
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:273)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java
:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java
:142)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java
:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java
:686)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:656)
org.apache.jsp.index_jsp._jspService(index_jsp.java:48)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java
:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause

java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo
.init(Ljava/lang/String;ZLjava/lang/String;ZZ)V
org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute(
TagLibraryInfoImpl.java:581)
org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(
TagLibraryInfoImpl.java:402)
org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(
TagLibraryInfoImpl.java:249)
org.apache.jasper.compiler.TagLibraryInfoImpl.init(TagLibraryInfoImpl.java
:180)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:424)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:493)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1557)
org.apache.jasper.compiler.Parser.parse(Parser.java:127)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java
:212)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java
:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java
:302)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java
:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java
:142)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java
:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java
:686)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:656)
org.apache.jsp.index_jsp._jspService(index_jsp.java:48)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java
:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

Note: The probelm is tomcat doesn't recognize jsp:forward
this works fine on tomcat 4.1.

thanks for your answers...



Re: Tomcat 5.5.23 throw ServletException

2007-11-04 Thread itay sahar
hi,

well the version is 5.5.25. this is the name of the archive dowloaded from
tomcat.org: apache-tomcat-5.5.25.
jsp-api.jar is included.

my application use the following jars:

aopalliance.jar
cglib-2.0-rc2.jar
commons-beanutils.jar
commons-collections-2.1.jar
commons-dbcp-1.1.jar
commons-digester-1.8.jar
commons-logging-api-1.1.jar
dom4j-1.4.jar
hibernate2.jar
jsf-api.jar
jsf-impl.jar
jsp-api.jar
jstl.jar
jta.jar
log4j.jar
mysql-connector-java-3.0.9-stable-bin.jar
odmg-3.0.jar
servlet-api.jar
spring.jar
tiles-api-2.0.5.jar
tiles-core-2.0.5.jar
tiles-jsp-2.0.5.jar

all jar is taken from eclipse. build with no errors. the problem is only on
runtime as mention.

thanks

On 11/4/07, Caldarale, Charles R [EMAIL PROTECTED] wrote:

  From: itay sahar [mailto:[EMAIL PROTECTED]
  Subject: Tomcat 5.5.23 throw ServletException
 
  i think i have  wrong jar files.
 
  org.apache.jasper.JasperException: javax.servlet.ServletException:
  java.lang.NoSuchMethodError:
  javax.servlet.jsp.tagext.TagAttributeInfo.init
  (Ljava/lang/String;ZLjava/lang/String;ZZ)V

 Either that, or you have CLASSPATH set and it's messing things up.  I
 don't have 5.5.23 around any longer, but in 5.5.25 the above class
 containing the designated constructor is inside common/lib/jsp-api.jar.
 To insure things run properly, that should be the only instance of
 jsp-api.jar on your system.  You're not using some lobotomized 3rd-party
 repackaged version of Tomcat, are you?

 - Chuck


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

 -
 To 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.23 throw ServletException

2007-11-04 Thread itay sahar
well, in apache both  jsp-api.jar, servlet-api.jar were removed before
running.
they exist only in  eclipse!!







On 11/4/07, Caldarale, Charles R [EMAIL PROTECTED] wrote:

  From: itay sahar [mailto:[EMAIL PROTECTED]
  Subject: Re: Tomcat 5.5.23 throw ServletException
 
  my application use the following jars:
 
  jsp-api.jar
  servlet-api.jar

 If by uses you mean the above are in the application's WEB-INF/lib
 directory, you must remove them.  Do not include anything in WEB-INF/lib
 that Tomcat provides in common/lib - attempting to do so guarantees
 classloader problems, and possibly the symptom you're seeing.

 - Chuck


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

 -
 To 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.23 throw ServletException

2007-11-04 Thread itay sahar
any ideal anyone?

On 11/4/07, itay sahar [EMAIL PROTECTED] wrote:

 well, in apache both  jsp-api.jar, servlet-api.jar were removed before
 running.
 they exist only in  eclipse!!







 On 11/4/07, Caldarale, Charles R [EMAIL PROTECTED] wrote:
 
   From: itay sahar [mailto:[EMAIL PROTECTED]
   Subject: Re: Tomcat 5.5.23 throw ServletException
  
   my application use the following jars:
  
   jsp-api.jar
   servlet-api.jar
 
  If by uses you mean the above are in the application's WEB-INF/lib
  directory, you must remove them.  Do not include anything in WEB-INF/lib
  that Tomcat provides in common/lib - attempting to do so guarantees
  classloader problems, and possibly the symptom you're seeing.
 
  - Chuck
 
 
  THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
  MATERIAL and is thus for use only by the intended recipient. If you
  received this in error, please contact the sender and delete the e-mail
  and its attachments from all computers.
 
  -
  To start a new topic, e-mail: users@tomcat.apache.org
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



migration from tomcat 4.1 to 5.5

2007-10-30 Thread itay sahar
hi,

i have an application running on tomcat 4.1.
i want to make a huge addings to this application but first i want to work
on tomcat 5.5 version.
is there a way i can do it ? (i know it's not easy).

my project lib include the following jar files:  (works fine on tomcat
4.1)

aopalliance.jar
cglib-2.0-rc2.jar
commons-beanutils.jar
commons-collections-2.1.jar
commons-dbcp-1.1.jar
commons-digester.jar
commons-logging.jar
dom4j-1.4.jar
hibernate2.jar
jsf-api.jar
jsf-impl.jar
jstl.jar (i don't see any use in the application but the jar exist
anyway)
jta.jar
log4j.jar
mysql-connector-java-3.0.9-stable-bin.jar
odmg-3.0.jar
servlet.jar  (probably Servlet 2.3).
spring.jar
struts.jar


i'v tried to remove sevlet.jar and use servlet-api.jar (tomcat 5.5 version
-- Servlet 2.4) but i cannot use:javax.servlet.jsp.tagext.TagSupport
and also javax.servlet.jsp.JspException is not available.

thanks in advance,
itay


Re: migration from tomcat 4.1 to 5.5

2007-10-30 Thread itay sahar
hi thanks for reply,

The DataSource details is in applicationContext.xml (spring).
There is no data moved from context.xml/server.xml from tomcat 4.1 to tomcat
5.5. (i just don't have it...)
succeeded run on the default 4.1 version.

I'm using the default files as they created by tomcat 5.5.
Tomcat ignore servlet.jar so it removed by me from the lib folder.
(in Apache only)

* In eclipse i still need it to compile!! i do want to work with the new jar
(servlet-api.jar)
but when i removed the servlet.jar from the class path i got this error on
one of the classes:

The type javax.servlet.jsp.tagext.TagSupport cannot be resolved. It is
indirectly referenced from required .class files
*The application is up and running but when click on the application from
tomcat manager i got the followiong error:


java.lang.NoSuchMethodError:
javax.servlet.jsp.tagext.TagAttributeInfo.init(Ljava/lang/String;ZLjava/lang/String;ZZ)V

org.apache.jasper.compiler.TagLibraryInfoImpl.createAttribute(TagLibraryInfoImpl.java:581)

org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:402)

org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:249)

org.apache.jasper.compiler.TagLibraryInfoImpl.init(TagLibraryInfoImpl.java:180)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:424)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:493)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1557)
org.apache.jasper.compiler.Parser.parse(Parser.java:127)

org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212)

org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)

org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)

com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:142)

com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)

org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:691)

org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:661)
org.apache.jsp.index_jsp._jspService(index_jsp.java:48)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)




On 10/30/07, Christopher Schultz [EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Itay,

 itay sahar wrote:
  i have an application running on tomcat 4.1.
  i want to make a huge addings to this application but first i want to
 work
  on tomcat 5.5 version.
  is there a way i can do it ? (i know it's not easy).

 I recently upgraded 5 applications from 4.1.36 to 5.5.23 and it was
 relatively smooth. The best advice I can give you is:

 1. Move any Realm and/or DataSource elements from server.xml to
   [yourwebapp]/META-INF/context.xml (yes, that's META-INF, not WEB-INF)

 2. Throw out your old server.xml. Start again with the one that ships
   with Tomcat 5.5 and customize it to meet your needs. You may find
   that, after doing #1 above that you no longer need any customizations
   to the server.xml file.

 3. Throw out servlet-api.jar and servlet.jar from your application.
   Tomcat will ignore them at best (which I think is the case) and fail
   at worst.

  commons-beanutils.jar
  commons-collections-2.1.jar
  commons-dbcp-1.1.jar
  commons-digester.jar
  commons-logging.jar

 You might want to check that you have the most recent (compatible)
 versions of these libraries. I know that some of them have newer
 versions. I wouldn't do this until after you have TC 5.5 working, though.

  mysql

Re: migration from tomcat 4.1 to 5.5

2007-10-30 Thread itay sahar
well i change the classpath to work with the new servlet-api.jar and 
jsp-api.jar (new version from tomcat)
After deploy i removed from the folder the two jar mention above since they
already exist in common/lib.

so now:
1. No errors in eclipse ( after using the new jars).
2. Tomcat is starting with no errors.
3. But i still get the error: java.lang.NoSuchMethodError:
javax.servlet.jsp.tagext.TagAttributeInfo
when tring launch the application.

do you have an idea where is the conflict came from ?


On 10/30/07, Christopher Schultz [EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Itay,

 itay sahar wrote:
  The type javax.servlet.jsp.tagext.TagSupport cannot be resolved. It is
  indirectly referenced from required .class files
  *The application is up and running but when click on the application
 from
  tomcat manager i got the followiong error:

 Hmm.. it's possible that something changed from Servlet 2.3 (Tomcat 4.x)
 to Servlet 2.4 (Tomcat 5.x). Actually, it's probably the difference
 between JSP 1.2 (Tomcat 4.x) and JSP 2.0 (Tomcat 5.5). In either case,
 the API has changed, and you need to change along with it. The error you
 are getting does not point to an API issue, but it's worth a check.

 In your project, replace servlet-api.jar with the one you can find in
 the Tomcat distribution. Re-compile and you'll probably get errors
 (method not found?). Fix those errors and you'll probably be able to
 deploy after that.

 You can completely remove servlet.jar from your project (you do not need
 it even to compile). This may be interfering, since this is the
 implementation JAR. I think Tomcat will veto loading the servlet API
 jar, but it might not detect the other one as a problem.

 Once you do all that, let us know how it goes.

 - -chris

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

 iD8DBQFHJ2w29CaO5/Lv0PARApq+AJ9IYAHhlaYEs6nvo7ZaQjhUgH0u8QCeOd0d
 bENAJ2AAS3p9mW+vMdc/8Lc=
 =i87r
 -END PGP SIGNATURE-

 -
 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: migration from tomcat 4.1 to 5.5

2007-10-30 Thread itay sahar
i'm using the servlet-api.jar that come with tomcat 5.5 installation (
download from tomcat website).
it's should be 2.4. (according the spec).

my code is build in  eclipse with this jar version.
the problem is in runtime...
note: i don't want to get back to 1.4.
maybe i need to change somthing in the code:

this is the code display with the error mention above:

org.apache.jasper.JasperException: Exception in JSP: /index.jsp:5

2:   head
3:   /head
4:   body
5: jsp:forward page=main.jsf/
6:   /body
7: /html




On 10/30/07, Caldarale, Charles R [EMAIL PROTECTED] wrote:

  From: itay sahar [mailto:[EMAIL PROTECTED]
  Subject: Re: migration from tomcat 4.1 to 5.5
 
  3. But i still get the error: java.lang.NoSuchMethodError:
  javax.servlet.jsp.tagext.TagAttributeInfo
  when tring launch the application.

 There are three versions of the TagAttributeInfo constructor,
 differentiated by the arguments, implemented at different versions of
 the JSP spec.  Which one are you trying to use?  Your stack trace should
 tell you.

 - Chuck


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

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




Re: migration from tomcat 4.1 to 5.5

2007-10-30 Thread itay sahar
running Tomcat by itself downloaded from tomcat.apache.org


On 10/30/07, itay sahar [EMAIL PROTECTED] wrote:

 i'm using the servlet-api.jar that come with tomcat 5.5 installation (
 download from tomcat website).
 it's should be 2.4. (according the spec).

 my code is build in  eclipse with this jar version.
 the problem is in runtime...
 note: i don't want to get back to 1.4.
 maybe i need to change somthing in the code:

 this is the code display with the error mention above:

 org.apache.jasper.JasperException: Exception in JSP: /index.jsp:5

 2:   head
 3:   /head
 4:   body
 5: jsp:forward page=main.jsf/
 6:   /body
 7: /html




 On 10/30/07, Caldarale, Charles R [EMAIL PROTECTED] wrote:
 
   From: itay sahar [mailto:[EMAIL PROTECTED]
   Subject: Re: migration from tomcat 4.1 to 5.5
  
   3. But i still get the error: java.lang.NoSuchMethodError:
   javax.servlet.jsp.tagext.TagAttributeInfo
   when tring launch the application.
 
  There are three versions of the TagAttributeInfo constructor,
  differentiated by the arguments, implemented at different versions of
  the JSP spec.  Which one are you trying to use?  Your stack trace should
  tell you.
 
  - Chuck
 
 
  THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 
  MATERIAL and is thus for use only by the intended recipient. If you
  received this in error, please contact the sender and delete the e-mail
  and its attachments from all computers.
 
  -
  To start a new topic, e-mail: users@tomcat.apache.org
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]