OT: jaxb and xml parsing

2011-09-23 Thread alexis
Hello, sorry to post OT, im facing an issue to handle some xml using jaxb and i 
would like to know if somebody can help on this.

Again, sorry to bother on this, but is important.

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



Re: Unable to compile class for JSP

2011-09-23 Thread Konstantin Kolinko
2011/9/24 R4IDER :
>
> Hi,
>
> Does anyone know how to go about fixing the error below; I have spent a good
> 12 hours trying to work it out.
>
>
> HTTP Status 500 -
>
> type Exception report
>
> message
>
> description The server encountered an internal error () that prevented it
> from fulfilling this request.
>
> exception
>
> org.apache.jasper.JasperException: Unable to compile class for JSP:
>
>
> An error occurred at line: 18 in the generated java file
> The return type is incompatible with JspSourceDependent.getDependants()
>
(...)

1. If you are using precompiled jsp or tag files, you should compile
them with exact the same x.y.z version of Tomcat where you deploy
them.

2. Stop Tomcat and clear everything from the /work subdirectory of
CATALINA_BASE. That is, there might be *.class files compiled with
some other version of Tomcat.

Best regards,
Konstantin Kolinko

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



Unable to compile class for JSP

2011-09-23 Thread R4IDER

Hi,

Does anyone know how to go about fixing the error below; I have spent a good
12 hours trying to work it out.


HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP: 


An error occurred at line: 18 in the generated java file
The return type is incompatible with JspSourceDependent.getDependants()

Stacktrace:

org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93)

org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)

org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:319)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)

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:321)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:257)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

com.jenkov.servlet.multipart.MultipartFilter.doFilter(MultipartFilter.java:93)

note The full stack trace of the root cause is available in the Apache
Tomcat/6.0.33 logs.
Apache Tomcat/6.0.33
-- 
View this message in context: 
http://old.nabble.com/Unable-to-compile-class-for-JSP-tp32503887p32503887.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



RE: Session management issue with Tomcat

2011-09-23 Thread Martin O'Shea
I should have mentioned that as only one user can be logged into a browser
session at any one time, they do have to log out for another user to log on.
But the logging out process does not do any cookie handling or
server-session invalidation.

This last step maybe the missing link.

-Original Message-
From: Martin O'Shea [mailto:app...@dsl.pipex.com] 
Sent: 22 Sep 2011 19 49
To: 'Tomcat Users List'
Subject: RE: Session management issue with Tomcat

To answer your questions:

Is there a reason this data is in a custom cookie, rather than the session,
via setAttribute()?

The cookie is dedicated and meant to be persistent. The idea is that a user
is recognised by the system upon returning to the website after having been
away for some time. Hence, the userid is stored in the cookie, so that when
the user returns to the homepage, the homepage can read the cookie, and
present that user's recent list on the page.

What is the expiry time of the custom cookie?

The cookie is set for a year.

How exactly are you invalidating this other cookie, when you invalidate the
session?

I assume you mean Tomcat's session and not the browser's sessions. The
Tomcat sessions are not being invalidated at the moment. 

The underlying principle here is that if multiple users use the same PC, and
maybe even the same session in a browser, a single cookie is used to store a
userid. Various system pages have a login facility and if invoked, the
cookie is rewritten with the current user's id. But this is where the Back
button issue occurs so it may be that session invalidation  solve my
problem.



-
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: Trying to get 2 instances of Tomcat 6.0.x (Red Hat) to work (each having their own lib directories)...

2011-09-23 Thread Mark Eggers
- Original Message -

> From: Casey Burk 
> To: users@tomcat.apache.org
> Cc: 
> Sent: Thursday, September 22, 2011 12:33 PM
> Subject: Trying to get 2 instances of Tomcat 6.0.x (Red Hat) to work (each 
> having their own lib directories)...
> 
> Hello all!
> 
> First and foremost, forgive me if my method of delivery hasn't followed the
> normal protocol (this is my first time doing this).
> 
> Secondly, the server I'll be deploying my web apps to is a Red Hat box with
> 2 instances of a single Tomcat 6 installation on it. These instances provide
> our team with the capabilities they need to move along the migration
> sequence during testing, but the problem is that each instance directory
> (i.e. - "/usr/tomcat/test1" and "/usr/tomcat/test2") lack 
> working "lib"
> directories with which to load jar files from. We need this.
> 
> Is this type of capability or "segregation of class loading" managed 
> through
> the use of that CATALINA.PROPERTIES file? If so, does this imply that each
> instance directory must have one placed within their "conf" 
> directories? If
> so, what directives must be used in each?
> 
> Here's the basic structure of our setup as it stands:
> 
> *PRIMARY / GLOBAL OUT-OF-THE-BOX TOMCAT FILES -*
> /usr/tomcat
> /usr/tomcat/conf+lib
> /usr/tomcat/conf/catalina.
> properties
> (The lib directory at this level *IS* working.)
> 
> *DEMARCATION 1 / TEST1-SPECIFIC FILES -*
> /usr/tomcat/test1
> /usr/tomcat/test1/lib+conf+webapps+...
> (We need the lib directory to work.)
> 
> *DEMARCATION 2 / TEST2-SPECIFIC FILES -*
> /usr/tomcat/test2
> /usr/tomcat/test2/lib+conf+webapps+...
> (We need the lib directory to work.)
> 
> The *only* truly active catalina.properties file we have right now in
> working order (at the time of this posting) is in / on the primary level
> inside the conf directory and it has the following uncommented lines:
> 
> package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans.
> package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
> 
> common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar
> server.loader=
> shared.loader=
> tomcat.util.buf.StringCache.byte.enabled=true
> 
> Do any of you have any idea how to make this work?
> 
> 
> Regards,
> 
> Casey J. Burk
> www.caseyburk.com
>

I'll take a stab at your question. However a few caveats are in order.

1. I run Fedora, not RedHat
2. I use Tomcat downloaded from Apache, not the distribution's version

That being said, there's a short explanation on how to do this in RUNNING.txt. 
Look under the heading:

Advanced Configuration - Multiple Tomcat Instances

Normally this document is in $CATALINA_HOME. However the packaged version may 
have put the document under /usr/share/doc/tomcat6 or something similar.

In general, the steps are as follows.

1. Create a copy of the original Tomcat directory structure (in $CATALINA_HOME) 
for each
   desired Tomcat.

2. Copy tomcat-juli.jar from $CATALINA_HOME/bin to each new directory 
structure's bin
   directory ($CATALINA_BASE/bin)

3. Copy all of $CATALINA_HOME/conf to $CATALINA_BASE/conf

4. Copy $CATALINA_HOME/webapps/manager to $CATALINA_BASE/webapps/manager if the 
manager
   application is desired

5. Make all of your configuration edits to files in $CATALINA_BASE/conf

Make any modifications to the lib directory (for example, adding JDBC drivers) 
to $CATALINA_BASE/lib. Tomcat will load jars and classes from 
$CATALINA_BASE/lib first, then $CATALINA_HOME/lib.

To start the new Tomcats, set $CATALINA_HOME to your default Tomcat 
installation, $CATALINA_BASE to your copy as set up above, and then run 
$CATALINA_HOME/bin/startup.sh (the file in the original installation). Since 
you've set $CATALINA_BASE, paths will be set accordingly.

Here are some more notes concerning how to do this.

1. Create the copy

When you're done, the directory structure should look like this:

/usr/tomcat/test1 ($CATALINA_BASE)
                bin
                conf
                    Catalina
                        localhost
                lib
                logs
                temp
                webapps
                work

(similarly for test2)

2. Copy tomcat-juli.jar to $CATALINA_BASE/bin

You may want to create a setenv.sh in $CATALINA_BASE/bin. This should contain 
all interesting options such as JAVA_OPTS, CATALINA_OPTS, any environment 
variables, and JMX setup. Do not modify $CATALINA_HOME/bin/catalina.sh or 
$CATALINA_HOME/bin/startup.sh.

3. Copy all of the $CATALINA_HOME/conf files to $CATALINA_BASE/conf

You will need to edit the $CATALINA_BASE/conf files. Minimally you will need to 
do the following:

a. Ensure that the Server shutdown port in server.xml is unique
b. Ensure that all Connector ports in server.xml are unique

You'll probably want to enable the manager application, so make sure to edit
tomcat-use

RE: Tomcat 7.0.21: BufferOverflowException in AjpAprProcessor.output()

2011-09-23 Thread Konstantin Preißer
Hi Chris,

> -Original Message-
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: Friday, September 16, 2011 10:56 PM
> To: Tomcat Users List
> Subject: Re: Tomcat 7.0.21: BufferOverflowException in
> AjpAprProcessor.output()
> 
> Does that mean that the client never sees an error? That would be
> good, as it makes the problem slightly less urgent :)

Yes, it seems that the error only occurred when the client aborted the 
connection.

 
> I can't think of what the problem may be, but it sounds like either
> some rare edge case or a regression. There has been a lot of work on
> merging code between all the various connectors wherever possible, and
> maybe some particular case wasn't merged properly.
> 
> Would you be able to test with either/or the NIO or BIO AJP
> connector(s) and see if the same behavior occurs? Do you have a way to
> force the exception to occur? I wonder if it could be scripted.

Unfortunately, the time when I wrote my initial mail was the only time I ever 
saw that Exception. I also can't reproduce it any more (I can force the 
connection to be terminated with 995 error in the ISAPI log on the server side, 
but I can't get Tomcat to throw the exception again). :(
I might try it with the other connectors (nio/bio), but I'm not sure when I 
have time for it.

But thanks for your suggestions.


Regards,

Konstantin Preißer


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



Re: Different response with jsessionid in the request url between tomcat 6.0.32 and tomcat 6.0.33 for my project

2011-09-23 Thread 陈俊宇
The issue what you have mentioned may be the key point to resolve the
problem.
I'll look into it and try what you have asked. Thanks.

2011/9/23 Konstantin Kolinko 

> 2011/9/23 陈俊宇 :
> > Hi,
> > I have been puzzling about this question for two days. There is
> little
> > relative information can be found with Google.
> > Looking forward for help.  Any thought will be appreciated. Thanks a
> > lot. Here is the detail.
> > The request like this
> > "
> >
> http://www.local.com/pao/PixelTracking.ds;jsessionid=E6CFA65884A52297BC7A3BDDC4E6602.tomcat1?fn=home
> > "
> > will go to different results between tomcat 6.0.32 and 6.0.33 with my
> > project.
> >
> >  For the tomcat 6.0.32 : it got a jpg file , that is what I want
> >
> >  For the tomcat 6.0.33  : it got a 404 error. But When I remove the
> > ".tomcat1" in the url , the url will look like this :
> >   "
> >
> http://www.local.com/pao/PixelTracking.ds;jsessionid=E6CFA65884A52297BC7A3BDDC4E6602?fn=home
> > "
> >It will get the jpg file .
> >
>
>
> 6.0.33 and 7.0 are more closely following the Servlet specification
> and the jsessionid path parameter is exposed by some API where it was
> not exposed previously. It is mentioned in
> https://issues.apache.org/bugzilla/show_bug.cgi?id=51833
>
> It might be that whatever framework you are using to serve those *.ds
> requests has support for removing jsessionid path parameter, but e.g.
> does not expect "." in its value.
>
>
> If you are requesting a file directly (with a *.jsp URL) do you
> observe any problems?
>
> > (configuration details skipped)
>
> Best regards,
> Konstantin Kolinko
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Different response with jsessionid in the request url between tomcat 6.0.32 and tomcat 6.0.33 for my project

2011-09-23 Thread Konstantin Kolinko
2011/9/23 陈俊宇 :
> Hi,
>     I have been puzzling about this question for two days. There is little
> relative information can be found with Google.
>     Looking forward for help.  Any thought will be appreciated. Thanks a
> lot. Here is the detail.
>     The request like this
>     "
> http://www.local.com/pao/PixelTracking.ds;jsessionid=E6CFA65884A52297BC7A3BDDC4E6602.tomcat1?fn=home
> "
>     will go to different results between tomcat 6.0.32 and 6.0.33 with my
> project.
>
>      For the tomcat 6.0.32 : it got a jpg file , that is what I want
>
>      For the tomcat 6.0.33  : it got a 404 error. But When I remove the
> ".tomcat1" in the url , the url will look like this :
>       "
> http://www.local.com/pao/PixelTracking.ds;jsessionid=E6CFA65884A52297BC7A3BDDC4E6602?fn=home
> "
>        It will get the jpg file .
>


6.0.33 and 7.0 are more closely following the Servlet specification
and the jsessionid path parameter is exposed by some API where it was
not exposed previously. It is mentioned in
https://issues.apache.org/bugzilla/show_bug.cgi?id=51833

It might be that whatever framework you are using to serve those *.ds
requests has support for removing jsessionid path parameter, but e.g.
does not expect "." in its value.


If you are requesting a file directly (with a *.jsp URL) do you
observe any problems?

> (configuration details skipped)

Best regards,
Konstantin Kolinko

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



Re: Availability of Tomcat 5.5.34

2011-09-23 Thread Jim Jagielski
Tomcat 5.5.34 was released and announced yesterday...

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



Re: Limiting access to resources, based on username, not on the user role

2011-09-23 Thread Chema
>
> In your code, you would examine the Principal & see if it had permission
> to proceed.  Then return the resource or an error, accordingly.
>

On my way , I would put "your code that  examine the Principal & see
if it had permission " into a custom realm class.
This custom realm can check only user authorization , no role

This way, you avoid to have to implement a redirection manually

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



Re: Limiting access to resources, based on username, not on the user role

2011-09-23 Thread Omar Belkhodja
Thanks. It's clear now :)

2011/9/23 Pid 

> On 22/09/2011 23:23, Omar Belkhodja wrote:
> > Thanks Pid. What do you mean by "a mapping" ? Is it some kind of servlet
> > that would read the file, and create the HTTP answer after having checked
> > the login ?
>
> An arbitrary URL structure:
>
>  /images/{user}/{imageid}
>
> If /images/* was secured, then any user would be authenticated before
> your Servlet or Servlet Filter was executed.
>
> In your code, you would examine the Principal & see if it had permission
> to proceed.  Then return the resource or an error, accordingly.
>
> Your code could request.forward() to another Servlet which actually
> returned the image, or could read the image from where it was stored &
> serve it directly into the outputstream.
>
> Up to you, where & how you store the image.
>
>
> p
>
>


Different response with jsessionid in the request url between tomcat 6.0.32 and tomcat 6.0.33 for my project

2011-09-23 Thread 陈俊宇
Hi,
 I have been puzzling about this question for two days. There is little
relative information can be found with Google.
 Looking forward for help.  Any thought will be appreciated. Thanks a
lot. Here is the detail.
 The request like this
 "
http://www.local.com/pao/PixelTracking.ds;jsessionid=E6CFA65884A52297BC7A3BDDC4E6602.tomcat1?fn=home
"
 will go to different results between tomcat 6.0.32 and 6.0.33 with my
project.

  For the tomcat 6.0.32 : it got a jpg file , that is what I want

  For the tomcat 6.0.33  : it got a 404 error. But When I remove the
".tomcat1" in the url , the url will look like this :
   "
http://www.local.com/pao/PixelTracking.ds;jsessionid=E6CFA65884A52297BC7A3BDDC4E6602?fn=home
"
It will get the jpg file .

  I test this with the following version of tomcat: 5.5.34 , 6.0.32 ,
6.0.33 , 7.0.20 , 7.0.21.
  The result is :  tomcat 5.5.34 behave the same like tomcat 6.0.32 .
tomcat 7.0.20 and tomcat 7.0.21 behave the same
like tomcat 6.0.33

  Setup :
  1. Windows 7 or  CentOS 5.1
  2. Apache 2.2.21. Use mod_proxy for load balance. The following is
the config file:


 

  ProxyPreserveHost On
  SSLProxyEngine On
  
BalancerMember http://127.0.0.1:8080 loadfactor=1
route=tomcat1
BalancerMember http://127.0.0.1:8090 loadfactor=1
route=tomcat2
ProxySet lbmethod=bybusyness
ProxySet stickysession=JSESSIONID|jsessionid
ProxySet scolonpathdelim=On
  
  ProxyPass /pao/ balancer://mycluster/pao/
  ProxyPassReverse /pao/ balancer://mycluster/pao/
  
ServerAdmin honglan...@gmail.com
ServerName www.local.com
DocumentRoot D:/amoy/wwwroot
UseCanonicalName Off
ErrorDocument 404 /404.html
ErrorLog "|/usr/sbin/cronolog
/var/log/httpd/%Y%m%d_httpd_error_log"
CustomLog "|/usr/sbin/cronolog
/var/log/httpd/%Y%m%d_httpd_access_log" combined

   RequestHeader set X-Forwarded-Proto "http"
   Header edit Set-Cookie "^JSESSIONID=(.*); Secure$"
JSESSIONID=$1
   

 
***
 3. tomcat1 : CATALINA_BASE=D:\tomcat1, below is a fragment of
server.xml  for tomcat1
 **
   
  
   
   
   
.
   
 
 tomcat2 : CATANLIA_BASE=D:\tomcat2, below is a fragment of
server.xml for tomcat2
   **
   
  
   
   
   
.
   
 
   CATALINA_HOME:   D:\tomcat6.0.32or   D:\tomcat6.0.33


Re: Session management issue with Tomcat

2011-09-23 Thread Pid
On 22/09/2011 19:49, Martin O'Shea wrote:
> To answer your questions:
> 
> Is there a reason this data is in a custom cookie, rather than the
> session, via setAttribute()?
> 
> The cookie is dedicated and meant to be persistent. The idea is that a user
> is recognised by the system upon returning to the website after having been
> away for some time. Hence, the userid is stored in the cookie, so that when
> the user returns to the homepage, the homepage can read the cookie, and
> present that user's recent list on the page.
> 
> What is the expiry time of the custom cookie?
> 
> The cookie is set for a year.
> 
> How exactly are you invalidating this other cookie, when you
> invalidate the session?
> 
> I assume you mean Tomcat's session and not the browser's sessions. The
> Tomcat sessions are not being invalidated at the moment. 
> 
> The underlying principle here is that if multiple users use the same PC, and
> maybe even the same session in a browser, a single cookie is used to store a
> userid. Various system pages have a login facility and if invoked, the
> cookie is rewritten with the current user's id. But this is where the Back
> button issue occurs so it may be that session invalidation  solve my
> problem.

I don't understand...

How can a new user log in, if you're not logging out?

If you're using FORM auth, then you need a logout mechanism to do that,
and a logout mechanism requires you to invalidate the http session in
Tomcat.


p






signature.asc
Description: OpenPGP digital signature


Re: Limiting access to resources, based on username, not on the user role

2011-09-23 Thread Pid
On 22/09/2011 23:23, Omar Belkhodja wrote:
> Thanks Pid. What do you mean by "a mapping" ? Is it some kind of servlet
> that would read the file, and create the HTTP answer after having checked
> the login ?

An arbitrary URL structure:

 /images/{user}/{imageid}

If /images/* was secured, then any user would be authenticated before
your Servlet or Servlet Filter was executed.

In your code, you would examine the Principal & see if it had permission
to proceed.  Then return the resource or an error, accordingly.

Your code could request.forward() to another Servlet which actually
returned the image, or could read the image from where it was stored &
serve it directly into the outputstream.

Up to you, where & how you store the image.


p



signature.asc
Description: OpenPGP digital signature