Re: How to disable JSR 250 annotations processor ?

2011-02-27 Thread Stevo Slavić
If I understood spec (servlet-3_0-final-spec.pdf) well, this service
is required only for servlets, filters, and listeners (Table 15-1
Components and Interfaces supporting Annotations and Dependency
Injection, chapter 15, page 179 of specification, page 201 of pdf).
Yevgen, on which beans did you experience this extra behavior from
Tomcat 7? Were they servlets/filters/listeners or some other spring
managed beans?

Also, shouldn't it be possible for one to turn off this behavior by
specifying metadata-complete=true, in case one doesn't make use of web
fragments and Java EE specified annotation and dependency injection?

Regards,
Stevo.

On Fri, Feb 25, 2011 at 10:12 PM, Mark Thomas  wrote:
> On 25/02/2011 21:03, Yevgen Krapiva wrote:
>> Hi.
>>
>> I have a problem deploying Spring based application to Tomcat 6.0.26 /
>> 7.0.0.
>> Some of my beans have @PostConstruct annotated methods.
>> Like:
>>
>> @PostConstruct
>> public void init() { ... }
>>
>> The problem is that these methods called twice - first time by Tomcat
>> annotation processor,
>> second time - by Spring.
>> Is it possible to turn off this behavior in Tomcat as I do not really want
>> to rewrite the application
>> to use xml configuration metadata.
>
> Sorry, Tomcat provides no such mechanism. The behaviour is required by
> the servlet specification.
>
> Mark
>
>
>
> -
> 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: AccessLogValve pattern (timestamp, bytes sent and time taken)

2011-02-27 Thread Konstantin Kolinko
2011/2/21 Antonios Kogias :
> Thank you very much for the detailed answer. Now there's just one more thing
> to ask.
> If we use tomcat 7.0.8, the "timing for the whole request processing cycle"
> will incorporate transmit time?
> e.g. if using HTTP/1.0, will it represent the total time until the teardown
> of the connection? Or will it be the net processing time /before/
> transmission starts (i.e. time to prepare the http response and push it to
> the network layer)?

In TC 7.0.8 and later:

The start time:
= when org.apache.coyote.Request#setStartTime() is called

That is done by processors. Some initial processing is already done at
that point (e.g. reading the request line).

The end time:
= when org.apache.catalina.connector.CoyoteAdapter#service() calls logAccess(..)

That is done when service() completes processing the request. At that
point the content is already generated and response.finishResponse()
is already called (which closes output buffer and writes remaining
data to the socket).

After that Tomcat performs cleaning of its internal state and is ready
to process next request.

I am not sure what you mean by "teardown".


A correction: I wrote:

> In latest versions of TC7 (7.0.8 and later) (...)
> That version prints timestamp when request was received

That is not true. With %t the AccessLogValve still prints the current
time when logging is performed, not when processing was started.
(There was a patch discussed on dev@ to change the behaviour, but it
has not been applied yet).


BTW, if you want to debug Tomcat,
http://wiki.apache.org/tomcat/FAQ/Developing

Best regards,
Konstantin Kolinko

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



Re: Where are my compiled jsp's?

2011-02-27 Thread Konstantin Kolinko
2011/2/25  :
> Hi,
>
> I have an expanded webapp moved into a directory out of tomcats webapps-dir.
> I have changed the docbase in server.xml (I know, bad practice). But now the
> compiled jsp's are no longer in tomcats work directory. Where are they now?
>

Try ServletContext.getAttribute("javax.servlet.context.tempdir") --
see chapter SRV.4.7.1 in the Servlet Spec. They should be there.

(That is, if your app was deployed successfully and if you have
requested at least one JSP).

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



Re: [OT] Memory Leak in Tomcat

2011-02-27 Thread הילה
Original:
Does this happen all the time? Under what conditions? Are you able to
build a patched version of Tomcat in a test environment to test a fix I
have? What version of Java and Tomcat are you running?

Hey
I'm not sure if you refer the question to me, since the whole topic shifted
to an off topic :]
But yes, it happens all the time. what do you mean "under what conditions?"
As I specified in my first mail, it happens when I implement windows
authentication on tomcat
I use tomcat 6.0.29 , on OS win server 2008 R2 standard, JDK 1.6 Build 23

If you have a fix, I'll happy to try it on our test environment.

Thanks
Hila


2011/2/25 Christopher Schultz 

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> André,
>
> On 2/25/2011 10:47 AM, André Warnier wrote:
> > [Thread hijacking] is more annoying, because quite a few people have
> their client set
> > to display messages "by thread" (a hierarchical display where messages
> > neatly appear under the ones they respond to, instead of just
> > chronologically).  The client classifies new messages as being "part of
> > a thread" using information contained in other headers within the
> > message (kind of a "refers to" thing).  These headers are automatically
> > added by the list server.
> > So when you respond to an existing message and change the subject, for
> > these people an unrelated message suddenly appears inside a discussion
> > "tree" where your new message does not belong.
>
> Worse are mail clients who think that "subject" and "thread" are
> interchangeable: the thread-id in the SMTP headers is ignored and
> instead the subject is used to thread things. That way, two things happen:
>
> 1. People who hijack threads can't tell and get all angry when we tell
> them they hijacked the thread
>
> 2. Legitimate thread-subject-changes (such as adding [OT] or whatever)
> end up showing-up in what looks like a separate thread.
>
> > Please do [chip in].  That's the point of this list.
> > Specially interventions like yours, which is civil, well-written and
> > brings valuable information and insights.
>
> Mostly everyone here will ignore most of the list-etiquette rules and
> remain civil if you have something worthwhile to say. Top-posting is
> only irritating when it looks like this:
>
> Reply:
>
> Yes, no, and maybe. There are other times this happens. 1.6. 5.something.
>
> Original:
> Does this happen all the time? Under what conditions? Are you able to
> build a patched version of Tomcat in a test environment to test a fix I
> have? What version of Java and Tomcat are you running?
>
> Since Chris's post had actual content and didn't really have a
> point-counterpoint feel to it, top-posting can be forgiven :)
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk1n8uwACgkQ9CaO5/Lv0PDHNQCfXscF1JWtPIXeu3DMzLgFbg/A
> CmYAnA/117/lOPYzoKPvU9DOX29BeEFS
> =Xzcc
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: request.getParameter() not working in Tomcat 7.0.8

2011-02-27 Thread Mark Thomas
On 27/02/2011 07:11, Michael McCutcheon wrote:
> I've got a simple problem where:
> 
> request.getQueryString() returns this:
> 
> "title%3Dtesttitle%26categoryAccessLabel%3Dtestcategoryaccesslabel%26valueAccessLabel%3DtestvalueAccessLabel"
> 
> 
> but request.getParameter("title") returns null.
> 
> Am I missing something obvious?
> 
> Shouldn't it be returning 'testtitle'?

Nope, because you encoded the = and & characters. What you have is a
single query parameter with a name of
"title%3Dtesttitle%26categoryAccessLabel%3Dtestcategoryaccesslabel%26valueAccessLabel%3DtestvalueAccessLabel"
and a value of null.

For those that want the details, take a look at the source for
org.apache.tomcat.util.http.Parameters.

Mark

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



Re: request.getParameter() not working in Tomcat 7.0.8

2011-02-27 Thread Konstantin Kolinko
2011/2/27 Mark Thomas :
> On 27/02/2011 16:14, André Warnier wrote:
>> ma...@apache.org wrote:
>> ...
>>
>>>
>>> What you are missing is that query parameters and values are parsed
>>> before %nn decoding so the names and values can contain reserved
>>> characters.
>>>
>> Mark,
>> are you sure ?
>

Sure. Otherwise how are you going to pass "=" in a value?

That is about parameters and the query string. The %nn sequences in
path are decoded elsewhere (in a different step).

> I may be talking nonsense - it was early when I typed that. Lets
> continue this in the non-hijacked thread.

Best regards,
Konstantin Kolinko

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



Re: request.getParameter() not working in Tomcat 7.0.8

2011-02-27 Thread Mark Thomas
On 27/02/2011 16:14, André Warnier wrote:
> ma...@apache.org wrote:
> ...
> 
>>
>> What you are missing is that query parameters and values are parsed
>> before %nn decoding so the names and values can contain reserved
>> characters.
>>
> Mark,
> are you sure ?

I may be talking nonsense - it was early when I typed that. Lets
continue this in the non-hijacked thread.

Mark

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



Re: request.getParameter() not working in Tomcat 7.0.8

2011-02-27 Thread André Warnier

ma...@apache.org wrote:
...



What you are missing is that query parameters and values are parsed before %nn 
decoding so the names and values can contain reserved characters.


Mark,
are you sure ?

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



Re: datasource & persistenceUnit configuration

2011-02-27 Thread Martin Mucha
Christopher,

I'm sorry. I do read too much of walkthroughs and tutorials messing
with tomcat configuration which ended badly, that I got myself into
some mindless frenzy mode. I check everything once again in setup with
resource-local transaction and found out, that I've overlooked
misconfigured oracle dialect.

I'm really sorry that I did waste your time in vain. Thank you for
your effort in helping me, everything is ok now.
martin.

2011/2/22 Christopher Schultz :
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Martin,
>
> On 2/20/2011 1:51 PM, Martin Mucha wrote:
>> Yes, I know I cannot use container managed EntityManager. Tomcat does
>> not support JTA, ok. But I should be able, also the article points it
>> out, to use application managed EntityManager with RESOURCE_LOCAL
>> transaction type. Just like in SE java.
>>
>> In SE java everything works just fine for me.
>
> Good to know.
>
>> Actually the code looks just as in that article:
>>
>> EntityManagerFactory emf =
>> Persistence.createEntityManagerFactory("insolvencePU");
>> EntityManager em = emf.createEntityManager();
>> em.getTransaction().begin();
>>
>> //and the rest of transaction.
>>
>> my persistence.xml looks like:
>
> So, this persistence.xml file works fine in a standalone Java SE
> program? You should be able to get it to work under Tomcat then. Where
> is your persistence.xml file when you run your standalone Java SE test
> program, and what is the effective CLASSPATH?
>
> Where is your persistence.xml file when you deploy it along with your
> webapp? I would expect that it should be in WEB-INF/classes (or at the
> root of a JAR file found in WEB-INF/lib).
>
>> Line
>> EntityManagerFactory emf =
>> Persistence.createEntityManagerFactory("insolvencePU");
>> fires an Exception complaining about unability to build
>> EntityManagerFactory. That leads me to suspicion that either the
>> persistence.xml, the data source or "something-else" is wrong. But I'm
>> quite to unable to find out what.
>
> I'm guessing that the Persistence framework just can't find your
> configuration file.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk1kFHoACgkQ9CaO5/Lv0PBbBACgi5UegxQ/aplal11hRHnGI2z0
> BjYAnRCl4gFqH8H1DqmwXlB1mwzUO5YJ
> =6EHI
> -END PGP SIGNATURE-
>
> -
> 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: Login page not showing up with configured realm.

2011-02-27 Thread Konstantin Kolinko
2011/2/27 Josh Gooding :
> My Main.jsp is in the root directory of the webapps/[my proj] folder and the
> Login.jsp is in /webapps/[my proj]/private.  So now for the issues.  When I
> login with j_security_check, I get no errors, so as much as I hate making
> assumptions, I'm going to assume that nothing is wrong with the realm.
> However what's happening is that when I login, it's just reverting back to
> the login page.  I checked the catalina.out and localhost.[current day] logs
> and I'm not getting an errors.  Any ideas on what could cause this?  It's
> been forever and a day since I set up my last realm.
>

How are you are triggering your login?

Usually that is
1. GET some protected resource
2. Tomcat returns the login form instead of the resource
3. User fills the form and POSTs it to j_security_check
4. The resource requested in (1) is displayed.

I do not remember whether the resource is displayed as response for
(3) or whether a redirect to the original URL is being sent to the
browser. It does not matter.

The essence is that in (4) you are seeing what you were requesting in
(1). So, if you requested your Login.jsp, you will see your Login.jsp
after successfully typing in the password.

BTW, if you want to run Tomcat with a debugger,
http://wiki.apache.org/tomcat/FAQ/Developing


Best regards,
Konstantin Kolinko

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



Login page not showing up with configured realm.

2011-02-27 Thread Josh Gooding
ok, I swore I wasn't going to bother you guys again on the weekend, but I am
running into a little quirk here.  I'm running 6.0.29.  Here is my webapp's
context.xml:


WEB-INF/web.xml




My Database credentials are fine.  When I do a select * from users where
user_name="JGooding" I get the proper things back

Here is my web.xml file:



  MMO
  MMO Testing

  
 javax.sql.DataSource
 jdbc/RealmDB
 Container
  

  
 403
 /error/403.jsp
  
  
 404
 /error/404.jsp
  

  
 480
  

  
 Main.jsp
  

  


MMO
/admin/*
DELETE
GET
POST
PUT


admin

   

   

MMO
/private/*
DELETE
GET
POST
PUT









MMO
/Main.jsp
DELETE
GET
POST
PUT


admin
player



  
 FORM
 MMO
 
/private/Login.jsp
/private/Login.jsp
 
  


My Main.jsp is in the root directory of the webapps/[my proj] folder and the
Login.jsp is in /webapps/[my proj]/private.  So now for the issues.  When I
login with j_security_check, I get no errors, so as much as I hate making
assumptions, I'm going to assume that nothing is wrong with the realm.
However what's happening is that when I login, it's just reverting back to
the login page.  I checked the catalina.out and localhost.[current day] logs
and I'm not getting an errors.  Any ideas on what could cause this?  It's
been forever and a day since I set up my last realm.

Warmest regards,

- Josh


Re: request.getParameter() not working in Tomcat 7.0.8

2011-02-27 Thread
Michael McCutcheon  wrote:

>I've got a simple problem where:
>
>request.getQueryString() returns this:
>
>"title%3Dtesttitle%26categoryAccessLabel%3Dtestcategoryaccesslabel%26valueAccessLabel%3DtestvalueAccessLabel"
>
>but request.getParameter("title") returns null.
>
>Am I missing something obvious?
>
>Shouldn't it be returning 'testtitle'?
>
>thanks,
>Mike
>
>
>-
>To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>For additional commands, e-mail: users-h...@tomcat.apache.org

What you are missing is that query parameters and values are parsed before %nn 
decoding so the names and values can contain reserved characters.

Mark



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