Re: [Trinidad] Trinidad and Glassfish: resource servlet does not work

2010-01-12 Thread schneidc

Hi,

I think this is the right place to ask, as I'm also having problems with the
resources.

I'm using Glassfish V2.1, Trinidad 1.2.12, MyFaces 1.2.8 and Facelets. My
pages get displayed but as soon as it gets to showing images or accessing
the stylesheet file these aren't found.

A snippet from my faces-config:


faces

org.apache.myfaces.webapp.MyFacesServlet
1



org.apache.myfaces.webapp.StartupServletContextListener



trinidad

org.apache.myfaces.trinidad.webapp.TrinidadFilter


trinidad


faces


resources

org.apache.myfaces.trinidad.webapp.ResourceServlet


resources
/adf/*



org.apache.myfaces.trinidad.resource.DEBUG
true




org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER

org.apache.myfaces.trinidadinternal.facelets.TrinidadFaceletViewHandler



org.apache.myfaces.trinidad.FACELETS_VIEW_MAPPINGS
.xhtml


trinidad-config:


http://myfaces.apache.org/trinidad/config";>

true
default
vkb


and trinidad-skins:


http://myfaces.apache.org/trinidad/skin";>

vkb.desktop
vkb
org.apache.myfaces.trinidad.desktop
theme/stylesheet.css




I was using exact the same configuration on a Websphere App Server and there
everything worked fine. The only error message I get now when calling a page
is:

SEVERE: Could not load style sheet: theme/stylesheet.css
SEVERE: java.io.FileNotFoundException: Unable to locate style sheet
"theme/stylesheet.css" in local styles directory
(C:\Programme\GlassfishV2\domains\domain1\generated\jsp\j2ee-apps\ZVD_VS_EAR\ZVD_VS_WEB_war\adf\styles),
or on the class path.

I also added the sun-web.xml when I found this thread to tell the Glassfish
that I'm using MyFaces but this didn't change anything.

Anybody an idea why resources aren't working here?


Simon
-- 
View this message in context: 
http://old.nabble.com/-Trinidad--Trinidad-and-Glassfish%3A-resource-servlet-does-not-work-tp26873419p27140871.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.



RE: Spring FilterSecurityInterceptor not been called for myfaces forwards

2010-01-12 Thread Madhav Bhargava
Yes, I am not using facelets.
I had a look at the NavigationHandlerImpl and here is the excerpt from it:

Method: handleNavigation

if (navigationCase != null)
{
if (log.isTraceEnabled())
{
log.trace("handleNavigation fromAction=" + fromAction + " 
outcome=" + outcome +
  " toViewId =" + navigationCase.getToViewId() +
  " redirect=" + navigationCase.isRedirect());
}
if (navigationCase.isRedirect() &&
(!PortletUtil.isPortletRequest(facesContext)))
{ // Spec section 7.4.2 says "redirects not possible" in this case 
for portlets
ExternalContext externalContext = 
facesContext.getExternalContext();
ViewHandler viewHandler = 
facesContext.getApplication().getViewHandler();
String redirectPath = viewHandler.getActionURL(facesContext, 
navigationCase.getToViewId());

try
{

externalContext.redirect(externalContext.encodeActionURL(redirectPath));
}
catch (IOException e)
{
throw new FacesException(e.getMessage(), e);
}
}
else
{
ViewHandler viewHandler = 
facesContext.getApplication().getViewHandler();
//create new view
String newViewId = navigationCase.getToViewId();
UIViewRoot viewRoot = null;
if (isPartialStateSavingOn(facesContext)) {
viewRoot = viewHandler.restoreView(facesContext,newViewId);
} else {
viewRoot = viewHandler.createView(facesContext, newViewId);
}
facesContext.setViewRoot(viewRoot);
facesContext.renderResponse();
}

In the above code, redirect happens properly however for a forward there is no 
RequestDispatcher.forward or ExternalContext.dispatch called. So I do not know 
where a forward happens.

Regards,
Madhav

From: sethfromaust...@gmail.com [mailto:sethfromaust...@gmail.com] On Behalf Of 
Jakob Korherr
>Hi Tomasz,
>
>That's all correct! However, I don't think he is using Facelets, because he
>mentioned JSP-pages...
>
>Regards,
>Jakob
>
>2010/1/12 Tomasz Pasierb 
>
> Hi,
>
> as I understand you use a commandButton and as a result a different page (a
> secured one) is rendered but spring security does not seem to intercept the
> url, is that right?
>
> If so and if the solution used by you uses Facelets then this may be the
> problem.
> When using Facelets as opposed to "pure" (older) jsf+jsp approach there is
> no forward when a new view is rendered that is a result of a navigation case
> forward. I've been investigating this recently. When JSP view handler is
> used it checks which view should be rendered next and does a forward to this
> new view which spring security can intercept. The Facelet view handler
> however seems to load the view (xhtml) and render it without making the
> actual forward. As a result no interception can happen and usually it is
> triggered with the next request.
> You need to either use redirects or make GET requests to logically separate
> views - I know this is not natural with jsf versions prior to 2.0, but this
> new spec seems to change everything :-) - use can easily generate GET
> requests with the new version.
>
> Hope this helps ;)
>
> Regards,
> Tom Pasierb
>
> Madhav Bhargava pisze:
>
>  Hi All,
>>
>> I am using myfaces 1.1, icefaces 1.8.1, spring 2.5.6, spring security
>> -2.0.5, WAS 6.0 (app server)
>>
>> I have configured spring security for my JSF application along with
>> SiteMinder as an external authentication mechanism. It works fine till a
>> forward happens from within myfaces.
>>
>> Here is my spring servlet filter chain declaration:
>> 
>>
>>Spring delegating filter which will
>> initiate the spring
>>security filter chain
>>
>>springSecurityFilterChain
>>springSecurityFilterChain
>>
>>
>>  org.springframework.web.filter.DelegatingFilterProxy
>>
>> 
>>
>> 
>>springSecurityFilterChain
>>/*
>>FORWARD
>>REQUEST
>> 
>>
>> And in my spring application context I have followed the advice from
>> spring forums and done necessary settings:
>> Excerpt is:
>>
>> >
>>  entry-point-ref="preAuthenticatedProcessingFilterEntryPoint"
>> once-per-request="false">
>>> />
>>> />
>>> filters="none"/>
>>> filters="none"/>
>>> filters="none"/>
>>
>>> filters="none"/>
>>> access="ROLE_USER" />
>>> access="ROLE_OPERATIONS"/>
>>> access=

Re: [Trinidad] Trinidad consuming 80-90% CPU

2010-01-12 Thread Richard Yee
http://myfaces.apache.org/trinidad/download.html

trinidad-1.0.11-example.zip

I'm not sure if the 1.0.11 version has any incompatibilities with 1.0.7. If
you can't find one that works with 1.0.7, email me offline and I will mail
the one I have to you.

-Richard



On Tue, Jan 12, 2010 at 2:31 PM, Ravi Kapoor wrote:

> That is an excellent suggestion Richard. Can you point me to the
> application
> you mentioned (I am on trinidad 1.0.7)
>
> Thanks
>
>
> On Tue, Jan 12, 2010 at 4:58 PM, Richard Yee  >wrote:
>
> > One suggestion that I would make is to run the Trinidad example
> application
> > and examine the behavior.
> >
> > -Richard
> >
> >
> >
> > On Tue, Jan 12, 2010 at 11:00 AM, Matthias Wessendorf  > >wrote:
> >
> > > I contacted Ravi already offline
> > >
> > > -M
> > >
> > > On Tue, Jan 12, 2010 at 7:59 PM, Jan-Kees van Andel
> > >   wrote:
> > > > Apache officially doesn't provide support, see:
> > > > http://httpd.apache.org/docs/1.3/misc/FAQ.html#support
> > > > But you can try to contact a commercial company that does provide
> > > support.
> > > >
> > > > It's an issue Apache can't really help you with.
> > > >
> > > > Depending on where you're located, it shouldn't be very hard to find
> > > > Trinidad experience. There are a lot of followers on this list, so
> > > > maybe...?
> > > >
> > > > Regards,
> > > > Jan-Kees
> > > >
> > > >
> > > > 2010/1/12 Ravi Kapoor :
> > > >> I found that link as well 10 seconds ago and was going to email you
> > :).
> > > Yes
> > > >> you are right, I cannot run this app in tomcat, this is enterprise
> app
> > > with
> > > >> tons of dependency on websphere.
> > > >>
> > > >> Anyways, how can I get onsite support? Who provides such support?
> > > Apache?
> > > >> Can you send me contact info or a link?
> > > >>
> > > >> Thanks
> > > >> Ravi
> > > >>
> > > >> On Tue, Jan 12, 2010 at 1:28 PM, Jan-Kees van Andel <
> > > >> jankeesvanan...@gmail.com> wrote:
> > > >>
> > > >>> Hrm, it looks like the IBM JVM doesn't support VisualVM. See:
> > > >>>
> > >
> http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14210263
> > > >>> Sorry. It would be nice if it worked.
> > > >>> You're probably not able to run your app on i.e. Tomcat, JBoss or
> > > >>> Glassfish, just for testing? If you are, things are easier.
> > > >>>
> > > >>> But I'm afraid we're not solving problems here. I think you'd
> better
> > > >>> look for on-site support...
> > > >>>
> > > >>> /JK
> > > >>>
> > > >>>
> > > >>> 2010/1/12 Ravi Kapoor :
> > > >>> > Jan-Kees, thanks for this info. I got the settings in order. But
> I
> > am
> > > >>> having
> > > >>> > another problem.
> > > >>> >
> > > >>> > When I launch the server from within RAD, VisualVM is not able to
> > > detect
> > > >>> the
> > > >>> > process at all. Can you tell me what do I need to do so VisualVM
> > can
> > > >>> detect
> > > >>> > my server so that I can get profiling information for my classes?
> > > >>> >
> > > >>> >
> > > >>> >
> > > >>> > On Tue, Jan 12, 2010 at 10:02 AM, Jan-Kees van Andel <
> > > >>> > jankeesvanan...@gmail.com> wrote:
> > > >>> >
> > > >>> >> Hey Ravi,
> > > >>> >>
> > > >>> >> First you need to connect to your server. If that's done,
> > depending
> > > on
> > > >>> >> the type of connection, profiling becomes possible (AFAIK local
> > > >>> >> applications always work, but JMX based connections don't).
> > > >>> >> If profiling is possible, you should see a Profiler tab. In the
> > > >>> >> Profiler tab, on the right you can see a checkbox called
> > "settings".
> > > >>> >> Check it.
> > > >>> >>
> > > >>> >> In the first textarea, called: "Start profiling from classes",
> > enter
> > > >>> >> the following:
> > > >>> >> javax.faces.**
> > > >>> >> org.apache.myfaces.**
> > > >>> >> com.yourcompany.**
> > > >>> >>
> > > >>> >> The other settings should be ok, or maybe you need to apply some
> > > >>> >> additional filter to prevent OOME's.
> > > >>> >>
> > > >>> >> When done, you can hit the Profile button and start generating
> > load
> > > on
> > > >>> >> your webapp. Note the small button in the Profiler tab to create
> > > >>> >> snapshots. This is a useful one, because you have extra
> profiling
> > > >>> >> features on snapshots that aren't available on the realtime
> data.
> > > >>> >>
> > > >>> >> Note: It might be smart to increase the max heap size in
> > > >>> >> [VISUALVM_HOME]/etc/visualvm.conf. 512MB should be enough (
> > > -J-Xmx512m
> > > >>> >> ).
> > > >>> >>
> > > >>> >> I hope these steps work for you and maybe a different graph
> gives
> > > some
> > > >>> >> more insight...
> > > >>> >>
> > > >>> >> Regards,
> > > >>> >> Jan-Kees
> > > >>> >>
> > > >>> >>
> > > >>> >> 2010/1/12 Ravi Kapoor :
> > > >>> >> > Oh I see what you are saying. We only create and populate the
> > > hashmap
> > > >>> >> once,
> > > >>> >> > we never clear or delete from it. So that endless loop is not
> > the
> > >

Re: Spring FilterSecurityInterceptor not been called for myfaces forwards

2010-01-12 Thread Jakob Korherr
Hi Tomasz,

That's all correct! However, I don't think he is using Facelets, because he
mentioned JSP-pages...

Regards,
Jakob

2010/1/12 Tomasz Pasierb 

> Hi,
>
> as I understand you use a commandButton and as a result a different page (a
> secured one) is rendered but spring security does not seem to intercept the
> url, is that right?
>
> If so and if the solution used by you uses Facelets then this may be the
> problem.
> When using Facelets as opposed to "pure" (older) jsf+jsp approach there is
> no forward when a new view is rendered that is a result of a navigation case
> forward. I've been investigating this recently. When JSP view handler is
> used it checks which view should be rendered next and does a forward to this
> new view which spring security can intercept. The Facelet view handler
> however seems to load the view (xhtml) and render it without making the
> actual forward. As a result no interception can happen and usually it is
> triggered with the next request.
> You need to either use redirects or make GET requests to logically separate
> views - I know this is not natural with jsf versions prior to 2.0, but this
> new spec seems to change everything :-) - use can easily generate GET
> requests with the new version.
>
> Hope this helps ;)
>
> Regards,
> Tom Pasierb
>
> Madhav Bhargava pisze:
>
>  Hi All,
>>
>> I am using myfaces 1.1, icefaces 1.8.1, spring 2.5.6, spring security
>> -2.0.5, WAS 6.0 (app server)
>>
>> I have configured spring security for my JSF application along with
>> SiteMinder as an external authentication mechanism. It works fine till a
>> forward happens from within myfaces.
>>
>> Here is my spring servlet filter chain declaration:
>> 
>>
>>Spring delegating filter which will
>> initiate the spring
>>security filter chain
>>
>>springSecurityFilterChain
>>springSecurityFilterChain
>>
>>
>>  org.springframework.web.filter.DelegatingFilterProxy
>>
>> 
>>
>> 
>>springSecurityFilterChain
>>/*
>>FORWARD
>>REQUEST
>> 
>>
>> And in my spring application context I have followed the advice from
>> spring forums and done necessary settings:
>> Excerpt is:
>>
>> >
>>  entry-point-ref="preAuthenticatedProcessingFilterEntryPoint"
>> once-per-request="false">
>>> />
>>> />
>>> filters="none"/>
>>> filters="none"/>
>>> filters="none"/>
>>
>>> filters="none"/>
>>> access="ROLE_USER" />
>>> access="ROLE_OPERATIONS"/>
>>> access="IS_AUTHENTICATED_ANONYMOUSLY" />
>> 
>>
>> Now when I forward a request from index.jsp to login.jsp then the spring
>> filters are called with the login.jsp URL even though the browser shows the
>> old URL.
>>
>> However when from within an action method a navigation case is handled
>> then it is not intercepted by the spring filters at all. However if I give a
>>  then it is properly intercepted with the correct URL as
>> expected.
>>
>> What can be the reason?
>>
>> Regards,
>> Madhav
>>
>>
>>
>


Re: Spring FilterSecurityInterceptor not been called for myfaces forwards

2010-01-12 Thread Tomasz Pasierb

Hi,

as I understand you use a commandButton and as a result a different page 
(a secured one) is rendered but spring security does not seem to 
intercept the url, is that right?


If so and if the solution used by you uses Facelets then this may be the 
problem.
When using Facelets as opposed to "pure" (older) jsf+jsp approach there 
is no forward when a new view is rendered that is a result of a 
navigation case forward. I've been investigating this recently. When JSP 
view handler is used it checks which view should be rendered next and 
does a forward to this new view which spring security can intercept. The 
Facelet view handler however seems to load the view (xhtml) and render 
it without making the actual forward. As a result no interception can 
happen and usually it is triggered with the next request.
You need to either use redirects or make GET requests to logically 
separate views - I know this is not natural with jsf versions prior to 
2.0, but this new spec seems to change everything :-) - use can easily 
generate GET requests with the new version.


Hope this helps ;)

Regards,
Tom Pasierb

Madhav Bhargava pisze:

Hi All,

I am using myfaces 1.1, icefaces 1.8.1, spring 2.5.6, spring security -2.0.5, 
WAS 6.0 (app server)

I have configured spring security for my JSF application along with SiteMinder 
as an external authentication mechanism. It works fine till a forward happens 
from within myfaces.

Here is my spring servlet filter chain declaration:


Spring delegating filter which will initiate 
the spring
security filter chain

springSecurityFilterChain
springSecurityFilterChain


org.springframework.web.filter.DelegatingFilterProxy




springSecurityFilterChain
/*
FORWARD
REQUEST


And in my spring application context I have followed the advice from spring 
forums and done necessary settings:
Excerpt is:














Now when I forward a request from index.jsp to login.jsp then the spring 
filters are called with the login.jsp URL even though the browser shows the old 
URL.

However when from within an action method a navigation case is handled then it is not 
intercepted by the spring filters at all. However if I give a  then 
it is properly intercepted with the correct URL as expected.

What can be the reason?

Regards,
Madhav

  


Re: [Trinidad] Trinidad consuming 80-90% CPU

2010-01-12 Thread Ravi Kapoor
That is an excellent suggestion Richard. Can you point me to the application
you mentioned (I am on trinidad 1.0.7)

Thanks


On Tue, Jan 12, 2010 at 4:58 PM, Richard Yee wrote:

> One suggestion that I would make is to run the Trinidad example application
> and examine the behavior.
>
> -Richard
>
>
>
> On Tue, Jan 12, 2010 at 11:00 AM, Matthias Wessendorf  >wrote:
>
> > I contacted Ravi already offline
> >
> > -M
> >
> > On Tue, Jan 12, 2010 at 7:59 PM, Jan-Kees van Andel
> >   wrote:
> > > Apache officially doesn't provide support, see:
> > > http://httpd.apache.org/docs/1.3/misc/FAQ.html#support
> > > But you can try to contact a commercial company that does provide
> > support.
> > >
> > > It's an issue Apache can't really help you with.
> > >
> > > Depending on where you're located, it shouldn't be very hard to find
> > > Trinidad experience. There are a lot of followers on this list, so
> > > maybe...?
> > >
> > > Regards,
> > > Jan-Kees
> > >
> > >
> > > 2010/1/12 Ravi Kapoor :
> > >> I found that link as well 10 seconds ago and was going to email you
> :).
> > Yes
> > >> you are right, I cannot run this app in tomcat, this is enterprise app
> > with
> > >> tons of dependency on websphere.
> > >>
> > >> Anyways, how can I get onsite support? Who provides such support?
> > Apache?
> > >> Can you send me contact info or a link?
> > >>
> > >> Thanks
> > >> Ravi
> > >>
> > >> On Tue, Jan 12, 2010 at 1:28 PM, Jan-Kees van Andel <
> > >> jankeesvanan...@gmail.com> wrote:
> > >>
> > >>> Hrm, it looks like the IBM JVM doesn't support VisualVM. See:
> > >>>
> > http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14210263
> > >>> Sorry. It would be nice if it worked.
> > >>> You're probably not able to run your app on i.e. Tomcat, JBoss or
> > >>> Glassfish, just for testing? If you are, things are easier.
> > >>>
> > >>> But I'm afraid we're not solving problems here. I think you'd better
> > >>> look for on-site support...
> > >>>
> > >>> /JK
> > >>>
> > >>>
> > >>> 2010/1/12 Ravi Kapoor :
> > >>> > Jan-Kees, thanks for this info. I got the settings in order. But I
> am
> > >>> having
> > >>> > another problem.
> > >>> >
> > >>> > When I launch the server from within RAD, VisualVM is not able to
> > detect
> > >>> the
> > >>> > process at all. Can you tell me what do I need to do so VisualVM
> can
> > >>> detect
> > >>> > my server so that I can get profiling information for my classes?
> > >>> >
> > >>> >
> > >>> >
> > >>> > On Tue, Jan 12, 2010 at 10:02 AM, Jan-Kees van Andel <
> > >>> > jankeesvanan...@gmail.com> wrote:
> > >>> >
> > >>> >> Hey Ravi,
> > >>> >>
> > >>> >> First you need to connect to your server. If that's done,
> depending
> > on
> > >>> >> the type of connection, profiling becomes possible (AFAIK local
> > >>> >> applications always work, but JMX based connections don't).
> > >>> >> If profiling is possible, you should see a Profiler tab. In the
> > >>> >> Profiler tab, on the right you can see a checkbox called
> "settings".
> > >>> >> Check it.
> > >>> >>
> > >>> >> In the first textarea, called: "Start profiling from classes",
> enter
> > >>> >> the following:
> > >>> >> javax.faces.**
> > >>> >> org.apache.myfaces.**
> > >>> >> com.yourcompany.**
> > >>> >>
> > >>> >> The other settings should be ok, or maybe you need to apply some
> > >>> >> additional filter to prevent OOME's.
> > >>> >>
> > >>> >> When done, you can hit the Profile button and start generating
> load
> > on
> > >>> >> your webapp. Note the small button in the Profiler tab to create
> > >>> >> snapshots. This is a useful one, because you have extra profiling
> > >>> >> features on snapshots that aren't available on the realtime data.
> > >>> >>
> > >>> >> Note: It might be smart to increase the max heap size in
> > >>> >> [VISUALVM_HOME]/etc/visualvm.conf. 512MB should be enough (
> > -J-Xmx512m
> > >>> >> ).
> > >>> >>
> > >>> >> I hope these steps work for you and maybe a different graph gives
> > some
> > >>> >> more insight...
> > >>> >>
> > >>> >> Regards,
> > >>> >> Jan-Kees
> > >>> >>
> > >>> >>
> > >>> >> 2010/1/12 Ravi Kapoor :
> > >>> >> > Oh I see what you are saying. We only create and populate the
> > hashmap
> > >>> >> once,
> > >>> >> > we never clear or delete from it. So that endless loop is not
> the
> > >>> >> problem.
> > >>> >> > Also in that case the CPU wouldnt show up for org.apache.*
> > classes.
> > >>> >> >
> > >>> >> > I guess you are looking for how to specify packages in VisualVM.
> > This
> > >>> >> would
> > >>> >> > give me another point of reference to validate my numbers.
> > >>> >> >
> > >>> >> > - Ravi
> > >>> >> >
> > >>> >> >
> > >>> >> > On Mon, Jan 11, 2010 at 6:00 PM, Jakob Korherr <
> > >>> jakob.korh...@gmail.com
> > >>> >> >wrote:
> > >>> >> >
> > >>> >> >> Ravi,
> > >>> >> >>
> > >>> >> >> To your question: Can you explain little bit how lack of
> > >>> synchronization
> > >>> >> >> can
> > >>> >> >> add to CPU?
> > >>> >> >>
> > >>> >> >> I don't know exac

Re: [Trinidad] Trinidad consuming 80-90% CPU

2010-01-12 Thread Richard Yee
One suggestion that I would make is to run the Trinidad example application
and examine the behavior.

-Richard



On Tue, Jan 12, 2010 at 11:00 AM, Matthias Wessendorf wrote:

> I contacted Ravi already offline
>
> -M
>
> On Tue, Jan 12, 2010 at 7:59 PM, Jan-Kees van Andel
>   wrote:
> > Apache officially doesn't provide support, see:
> > http://httpd.apache.org/docs/1.3/misc/FAQ.html#support
> > But you can try to contact a commercial company that does provide
> support.
> >
> > It's an issue Apache can't really help you with.
> >
> > Depending on where you're located, it shouldn't be very hard to find
> > Trinidad experience. There are a lot of followers on this list, so
> > maybe...?
> >
> > Regards,
> > Jan-Kees
> >
> >
> > 2010/1/12 Ravi Kapoor :
> >> I found that link as well 10 seconds ago and was going to email you :).
> Yes
> >> you are right, I cannot run this app in tomcat, this is enterprise app
> with
> >> tons of dependency on websphere.
> >>
> >> Anyways, how can I get onsite support? Who provides such support?
> Apache?
> >> Can you send me contact info or a link?
> >>
> >> Thanks
> >> Ravi
> >>
> >> On Tue, Jan 12, 2010 at 1:28 PM, Jan-Kees van Andel <
> >> jankeesvanan...@gmail.com> wrote:
> >>
> >>> Hrm, it looks like the IBM JVM doesn't support VisualVM. See:
> >>>
> http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14210263
> >>> Sorry. It would be nice if it worked.
> >>> You're probably not able to run your app on i.e. Tomcat, JBoss or
> >>> Glassfish, just for testing? If you are, things are easier.
> >>>
> >>> But I'm afraid we're not solving problems here. I think you'd better
> >>> look for on-site support...
> >>>
> >>> /JK
> >>>
> >>>
> >>> 2010/1/12 Ravi Kapoor :
> >>> > Jan-Kees, thanks for this info. I got the settings in order. But I am
> >>> having
> >>> > another problem.
> >>> >
> >>> > When I launch the server from within RAD, VisualVM is not able to
> detect
> >>> the
> >>> > process at all. Can you tell me what do I need to do so VisualVM can
> >>> detect
> >>> > my server so that I can get profiling information for my classes?
> >>> >
> >>> >
> >>> >
> >>> > On Tue, Jan 12, 2010 at 10:02 AM, Jan-Kees van Andel <
> >>> > jankeesvanan...@gmail.com> wrote:
> >>> >
> >>> >> Hey Ravi,
> >>> >>
> >>> >> First you need to connect to your server. If that's done, depending
> on
> >>> >> the type of connection, profiling becomes possible (AFAIK local
> >>> >> applications always work, but JMX based connections don't).
> >>> >> If profiling is possible, you should see a Profiler tab. In the
> >>> >> Profiler tab, on the right you can see a checkbox called "settings".
> >>> >> Check it.
> >>> >>
> >>> >> In the first textarea, called: "Start profiling from classes", enter
> >>> >> the following:
> >>> >> javax.faces.**
> >>> >> org.apache.myfaces.**
> >>> >> com.yourcompany.**
> >>> >>
> >>> >> The other settings should be ok, or maybe you need to apply some
> >>> >> additional filter to prevent OOME's.
> >>> >>
> >>> >> When done, you can hit the Profile button and start generating load
> on
> >>> >> your webapp. Note the small button in the Profiler tab to create
> >>> >> snapshots. This is a useful one, because you have extra profiling
> >>> >> features on snapshots that aren't available on the realtime data.
> >>> >>
> >>> >> Note: It might be smart to increase the max heap size in
> >>> >> [VISUALVM_HOME]/etc/visualvm.conf. 512MB should be enough (
> -J-Xmx512m
> >>> >> ).
> >>> >>
> >>> >> I hope these steps work for you and maybe a different graph gives
> some
> >>> >> more insight...
> >>> >>
> >>> >> Regards,
> >>> >> Jan-Kees
> >>> >>
> >>> >>
> >>> >> 2010/1/12 Ravi Kapoor :
> >>> >> > Oh I see what you are saying. We only create and populate the
> hashmap
> >>> >> once,
> >>> >> > we never clear or delete from it. So that endless loop is not the
> >>> >> problem.
> >>> >> > Also in that case the CPU wouldnt show up for org.apache.*
> classes.
> >>> >> >
> >>> >> > I guess you are looking for how to specify packages in VisualVM.
> This
> >>> >> would
> >>> >> > give me another point of reference to validate my numbers.
> >>> >> >
> >>> >> > - Ravi
> >>> >> >
> >>> >> >
> >>> >> > On Mon, Jan 11, 2010 at 6:00 PM, Jakob Korherr <
> >>> jakob.korh...@gmail.com
> >>> >> >wrote:
> >>> >> >
> >>> >> >> Ravi,
> >>> >> >>
> >>> >> >> To your question: Can you explain little bit how lack of
> >>> synchronization
> >>> >> >> can
> >>> >> >> add to CPU?
> >>> >> >>
> >>> >> >> I don't know exactly, but maybe it is possible that the internal
> >>> >> structure
> >>> >> >> of a Map (e.g. HashMap) can be destroyed when there are multiple
> >>> change
> >>> >> >> operations (put, remove, clear) at the same time, because of lack
> of
> >>> >> >> synchronization. But that's really just a guess!
> >>> >> >>
> >>> >> >> Regards,
> >>> >> >> Jakob
> >>> >> >>
> >>> >> >> 2010/1/11 Ravi Kapoor 
> >>> >> >>
> >>> >> >> > Jakob,
> >>> >> >> >
> >>> >> >> > I did install Visual

Re: Spring FilterSecurityInterceptor not been called for myfaces forwards

2010-01-12 Thread Jakob Korherr
One more: Tried MyFilter in a JSF application which first renders index.jsp,
then a commandButton is hit and the action method "forwards" to index2.jsp.

Here is the filter-output of the first request:

Filter1 (forward + request) invoked for path /faces/index.jsp
Filter1 (forward + request) invoked for path /index.jsp

...and for the second request:

Filter1 (forward + request) invoked for path /faces/index.jsp
Filter1 (forward + request) invoked for path /index2.jsp

So here you can see the original faces request (1st lines, including
/faces/) and the rendering forward (2nd lines).

This shows that the filter is invoked properly. so your problem is maybe
related to spring...

2010/1/12 Jakob Korherr 

> I'm really sorry, but there seemed to be some configuration problem with my
> local tomcat. The filter _is_ called twice.
>
> My example:
>
> web.xml (excerpt):
>
> 
> Servlet1
> at.jakobkorherr.servlets.Servlet1
>   
>   
> Servlet2
> at.jakobkorherr.servlets.Servlet2
>   
>   
> Servlet1
> /Servlet1
>   
>   
> Servlet2
> /Servlet2
>   
>   
> MyFilter
> at.jakobkorherr.filter.MyFilter
>   
>   
> MyFilter
>
> /*
> FORWARD
> REQUEST
>   
>
> Servlet1.java (excerpt):
>
> public void service(ServletRequest request, ServletResponse response)
> throws ServletException, IOException
> {
> System.out.println("Servlet1");
> request.getRequestDispatcher("/Servlet2").forward(request,
> response);
> }
>
> Servlet2.java (excerpt):
>
> public void service(ServletRequest request, ServletResponse response)
> throws ServletException, IOException
> {
> System.out.println("Servlet2");
> response.getWriter().println("Servlet2");
> }
>
> MyFilter.java (excerpt):
>
> public void doFilter(ServletRequest request, ServletResponse response,
> FilterChain chain) throws IOException, ServletException
> {
> System.out.println("Filter1 (forward + request) invoked for path "
> + ((HttpServletRequest) request).getServletPath());
> chain.doFilter(request, response);
> }
>
>
> When requesting Servlet1, the following output is generated (on the
> console):
>
> Filter1 (forward + request) invoked for path /Servlet1
> Servlet1
> Filter1 (forward + request) invoked for path /Servlet2
> Servlet2
>
> So this should function properly.
>
>
> 2010/1/12 Jakob Korherr 
>
> "The filter for JSF forwards is not getting invoked at all."
>>
>> That's exactly what I was saying  ...and it does not help you if you
>> set , because the filter is only
>> invoked once anyway.
>>
>> Madhav's problem is that the Filter itself is only invoked once for the
>> request (at the time when the user makes the request), although there is a
>> internal forward with the RequestDispatcher.
>>
>> So the problem is that the same Filter is not invoked twice for one
>> request (at first for REQUEST and then for FORWARD).
>>
>>
>> Regards,
>> Jakob
>>
>>
>> 2010/1/12 Madhav Bhargava 
>>
>>> I had added spring security code in my workspace for debugging reasons
>>> and I suspected that how can a new page be shown when the URL passed to the
>>> filter at the server is old. So I put a dummy filter in front of spring
>>> security just to print out the URL that is getting intercepted by spring
>>> security filter chain.
>>>
>>> So now I find that when a JSF forward happens via NavigationHandler then
>>> there is no URL that is actually intercepted by the spring filter. What I
>>> saw during debugging was not the correct picture.
>>>
>>> SO I am back at the same problem. The filter for JSF forwards is not
>>> getting invoked at all.
>>>
>>> Regards,
>>> Madhav
>>>
>>> From: Madhav Bhargava
>>> >
>>> >Yes, I have made the appropriate configuration for spring security
>>> filters so that specially in the case that >you have described below this
>>> property will make sure that the authentication is done again.
>>> >
>>> >However I do not think that it has anything to do with a stale URL being
>>> passed to the filter at the server >side. I can understand that the browser
>>> will have an old URL but at the server side the URL intercepted by the
>>> >filter should not be stale. Moreover the control is being forwarded to the
>>> correct page and the page is visible >as well so do not know how can a old
>>> ULR be passed at the server side and a new page be displayed at the client
>>> >side.
>>> >
>>> >Thanks,
>>> >Madhav
>>> >
>>> >From: Michael Kurz [mailto:michi.k...@gmx.at]
>>> >
>>> >Hm, I thought the same first but he has attribute once-per-request set
>>> >to false:
>>> >
>>> >
>>> >
>>> >- Michael
>>> >
>>> >Jakob Korherr schrieb:
>>> > Hi Madhav,
>>> >
>>> > I now know what the problem is. I wrote a small test webapp and came to
>>> the
>>> > following conclusion:
>>> >
>>> > JSF uses RequestDispatcher.forward(..) to render the second view. Thus
>>> the
>>> > filter should be invoked for the forward. H

Re: Spring FilterSecurityInterceptor not been called for myfaces forwards

2010-01-12 Thread Jakob Korherr
I'm really sorry, but there seemed to be some configuration problem with my
local tomcat. The filter _is_ called twice.

My example:

web.xml (excerpt):


Servlet1
at.jakobkorherr.servlets.Servlet1
  
  
Servlet2
at.jakobkorherr.servlets.Servlet2
  
  
Servlet1
/Servlet1
  
  
Servlet2
/Servlet2
  
  
MyFilter
at.jakobkorherr.filter.MyFilter
  
  
MyFilter
/*
FORWARD
REQUEST
  

Servlet1.java (excerpt):

public void service(ServletRequest request, ServletResponse response)
throws ServletException, IOException
{
System.out.println("Servlet1");
request.getRequestDispatcher("/Servlet2").forward(request,
response);
}

Servlet2.java (excerpt):

public void service(ServletRequest request, ServletResponse response)
throws ServletException, IOException
{
System.out.println("Servlet2");
response.getWriter().println("Servlet2");
}

MyFilter.java (excerpt):

public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException
{
System.out.println("Filter1 (forward + request) invoked for path " +
((HttpServletRequest) request).getServletPath());
chain.doFilter(request, response);
}


When requesting Servlet1, the following output is generated (on the
console):

Filter1 (forward + request) invoked for path /Servlet1
Servlet1
Filter1 (forward + request) invoked for path /Servlet2
Servlet2

So this should function properly.


2010/1/12 Jakob Korherr 

> "The filter for JSF forwards is not getting invoked at all."
>
> That's exactly what I was saying  ...and it does not help you if you
> set , because the filter is only
> invoked once anyway.
>
> Madhav's problem is that the Filter itself is only invoked once for the
> request (at the time when the user makes the request), although there is a
> internal forward with the RequestDispatcher.
>
> So the problem is that the same Filter is not invoked twice for one request
> (at first for REQUEST and then for FORWARD).
>
>
> Regards,
> Jakob
>
>
> 2010/1/12 Madhav Bhargava 
>
>> I had added spring security code in my workspace for debugging reasons and
>> I suspected that how can a new page be shown when the URL passed to the
>> filter at the server is old. So I put a dummy filter in front of spring
>> security just to print out the URL that is getting intercepted by spring
>> security filter chain.
>>
>> So now I find that when a JSF forward happens via NavigationHandler then
>> there is no URL that is actually intercepted by the spring filter. What I
>> saw during debugging was not the correct picture.
>>
>> SO I am back at the same problem. The filter for JSF forwards is not
>> getting invoked at all.
>>
>> Regards,
>> Madhav
>>
>> From: Madhav Bhargava
>> >
>> >Yes, I have made the appropriate configuration for spring security
>> filters so that specially in the case that >you have described below this
>> property will make sure that the authentication is done again.
>> >
>> >However I do not think that it has anything to do with a stale URL being
>> passed to the filter at the server >side. I can understand that the browser
>> will have an old URL but at the server side the URL intercepted by the
>> >filter should not be stale. Moreover the control is being forwarded to the
>> correct page and the page is visible >as well so do not know how can a old
>> ULR be passed at the server side and a new page be displayed at the client
>> >side.
>> >
>> >Thanks,
>> >Madhav
>> >
>> >From: Michael Kurz [mailto:michi.k...@gmx.at]
>> >
>> >Hm, I thought the same first but he has attribute once-per-request set
>> >to false:
>> >
>> >
>> >
>> >- Michael
>> >
>> >Jakob Korherr schrieb:
>> > Hi Madhav,
>> >
>> > I now know what the problem is. I wrote a small test webapp and came to
>> the
>> > following conclusion:
>> >
>> > JSF uses RequestDispatcher.forward(..) to render the second view. Thus
>> the
>> > filter should be invoked for the forward. However, the filter is/was
>> already
>> > invoked for the first request and it cannot be invoked twice for one
>> > request.
>> >
>> > Only for test reasons, remove REQUEST from your
>> > filter config in the web.xml and the filter will be invoked for
>> > RequestDispatcher.forward(..), because it was not invoked for the
>> original
>> > request.
>> >
>> > I know this does not solve your problem, but I think there is maybe a
>> > workaround for this.. I myself just don't know one..
>> > Maybe define the filter twice would solve the problem, but that's just a
>> > guess.
>> >
>> > Regards,
>> > Jakob
>> >
>> > 2010/1/12 Madhav Bhargava 
>> >
>> >>
>> >> -Original Message-
>> >> From: Michael Kurz [mailto:michi.k...@gmx.at]
>> >>
>> >>> Madhav Bhargava schrieb:
>> >>> To add if you see the spring security application config, I have the
>> >> following set:
>> >>> 
>> >>>   > >> access="ROLE_US

Re: [Trinidad] Trinidad consuming 80-90% CPU

2010-01-12 Thread Matthias Wessendorf
I contacted Ravi already offline

-M

On Tue, Jan 12, 2010 at 7:59 PM, Jan-Kees van Andel
 wrote:
> Apache officially doesn't provide support, see:
> http://httpd.apache.org/docs/1.3/misc/FAQ.html#support
> But you can try to contact a commercial company that does provide support.
>
> It's an issue Apache can't really help you with.
>
> Depending on where you're located, it shouldn't be very hard to find
> Trinidad experience. There are a lot of followers on this list, so
> maybe...?
>
> Regards,
> Jan-Kees
>
>
> 2010/1/12 Ravi Kapoor :
>> I found that link as well 10 seconds ago and was going to email you :). Yes
>> you are right, I cannot run this app in tomcat, this is enterprise app with
>> tons of dependency on websphere.
>>
>> Anyways, how can I get onsite support? Who provides such support? Apache?
>> Can you send me contact info or a link?
>>
>> Thanks
>> Ravi
>>
>> On Tue, Jan 12, 2010 at 1:28 PM, Jan-Kees van Andel <
>> jankeesvanan...@gmail.com> wrote:
>>
>>> Hrm, it looks like the IBM JVM doesn't support VisualVM. See:
>>> http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14210263
>>> Sorry. It would be nice if it worked.
>>> You're probably not able to run your app on i.e. Tomcat, JBoss or
>>> Glassfish, just for testing? If you are, things are easier.
>>>
>>> But I'm afraid we're not solving problems here. I think you'd better
>>> look for on-site support...
>>>
>>> /JK
>>>
>>>
>>> 2010/1/12 Ravi Kapoor :
>>> > Jan-Kees, thanks for this info. I got the settings in order. But I am
>>> having
>>> > another problem.
>>> >
>>> > When I launch the server from within RAD, VisualVM is not able to detect
>>> the
>>> > process at all. Can you tell me what do I need to do so VisualVM can
>>> detect
>>> > my server so that I can get profiling information for my classes?
>>> >
>>> >
>>> >
>>> > On Tue, Jan 12, 2010 at 10:02 AM, Jan-Kees van Andel <
>>> > jankeesvanan...@gmail.com> wrote:
>>> >
>>> >> Hey Ravi,
>>> >>
>>> >> First you need to connect to your server. If that's done, depending on
>>> >> the type of connection, profiling becomes possible (AFAIK local
>>> >> applications always work, but JMX based connections don't).
>>> >> If profiling is possible, you should see a Profiler tab. In the
>>> >> Profiler tab, on the right you can see a checkbox called "settings".
>>> >> Check it.
>>> >>
>>> >> In the first textarea, called: "Start profiling from classes", enter
>>> >> the following:
>>> >> javax.faces.**
>>> >> org.apache.myfaces.**
>>> >> com.yourcompany.**
>>> >>
>>> >> The other settings should be ok, or maybe you need to apply some
>>> >> additional filter to prevent OOME's.
>>> >>
>>> >> When done, you can hit the Profile button and start generating load on
>>> >> your webapp. Note the small button in the Profiler tab to create
>>> >> snapshots. This is a useful one, because you have extra profiling
>>> >> features on snapshots that aren't available on the realtime data.
>>> >>
>>> >> Note: It might be smart to increase the max heap size in
>>> >> [VISUALVM_HOME]/etc/visualvm.conf. 512MB should be enough ( -J-Xmx512m
>>> >> ).
>>> >>
>>> >> I hope these steps work for you and maybe a different graph gives some
>>> >> more insight...
>>> >>
>>> >> Regards,
>>> >> Jan-Kees
>>> >>
>>> >>
>>> >> 2010/1/12 Ravi Kapoor :
>>> >> > Oh I see what you are saying. We only create and populate the hashmap
>>> >> once,
>>> >> > we never clear or delete from it. So that endless loop is not the
>>> >> problem.
>>> >> > Also in that case the CPU wouldnt show up for org.apache.* classes.
>>> >> >
>>> >> > I guess you are looking for how to specify packages in VisualVM. This
>>> >> would
>>> >> > give me another point of reference to validate my numbers.
>>> >> >
>>> >> > - Ravi
>>> >> >
>>> >> >
>>> >> > On Mon, Jan 11, 2010 at 6:00 PM, Jakob Korherr <
>>> jakob.korh...@gmail.com
>>> >> >wrote:
>>> >> >
>>> >> >> Ravi,
>>> >> >>
>>> >> >> To your question: Can you explain little bit how lack of
>>> synchronization
>>> >> >> can
>>> >> >> add to CPU?
>>> >> >>
>>> >> >> I don't know exactly, but maybe it is possible that the internal
>>> >> structure
>>> >> >> of a Map (e.g. HashMap) can be destroyed when there are multiple
>>> change
>>> >> >> operations (put, remove, clear) at the same time, because of lack of
>>> >> >> synchronization. But that's really just a guess!
>>> >> >>
>>> >> >> Regards,
>>> >> >> Jakob
>>> >> >>
>>> >> >> 2010/1/11 Ravi Kapoor 
>>> >> >>
>>> >> >> > Jakob,
>>> >> >> >
>>> >> >> > I did install VisualVM but it is not capturing org.apache.* classes
>>> or
>>> >> >> > com.mycompany.* classes. I did not find a setting on how to enable
>>> >> >> > capturing
>>> >> >> > data for all the classes I want. Can you tell me where to specity
>>> the
>>> >> >> > packages for which I want to capture CPU usage?
>>> >> >> >
>>> >> >> > Vinay
>>> >> >> >
>>> >> >> >
>>> >> >> > On Mon, Jan 11, 2010 at 4:05 PM, Ravi Kapoor <
>>> ravikapoor...@gmail.com
>>> >> >> > >wrote:
>>> >> >> >
>

Re: [Trinidad] Trinidad consuming 80-90% CPU

2010-01-12 Thread Jan-Kees van Andel
Apache officially doesn't provide support, see:
http://httpd.apache.org/docs/1.3/misc/FAQ.html#support
But you can try to contact a commercial company that does provide support.

It's an issue Apache can't really help you with.

Depending on where you're located, it shouldn't be very hard to find
Trinidad experience. There are a lot of followers on this list, so
maybe...?

Regards,
Jan-Kees


2010/1/12 Ravi Kapoor :
> I found that link as well 10 seconds ago and was going to email you :). Yes
> you are right, I cannot run this app in tomcat, this is enterprise app with
> tons of dependency on websphere.
>
> Anyways, how can I get onsite support? Who provides such support? Apache?
> Can you send me contact info or a link?
>
> Thanks
> Ravi
>
> On Tue, Jan 12, 2010 at 1:28 PM, Jan-Kees van Andel <
> jankeesvanan...@gmail.com> wrote:
>
>> Hrm, it looks like the IBM JVM doesn't support VisualVM. See:
>> http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14210263
>> Sorry. It would be nice if it worked.
>> You're probably not able to run your app on i.e. Tomcat, JBoss or
>> Glassfish, just for testing? If you are, things are easier.
>>
>> But I'm afraid we're not solving problems here. I think you'd better
>> look for on-site support...
>>
>> /JK
>>
>>
>> 2010/1/12 Ravi Kapoor :
>> > Jan-Kees, thanks for this info. I got the settings in order. But I am
>> having
>> > another problem.
>> >
>> > When I launch the server from within RAD, VisualVM is not able to detect
>> the
>> > process at all. Can you tell me what do I need to do so VisualVM can
>> detect
>> > my server so that I can get profiling information for my classes?
>> >
>> >
>> >
>> > On Tue, Jan 12, 2010 at 10:02 AM, Jan-Kees van Andel <
>> > jankeesvanan...@gmail.com> wrote:
>> >
>> >> Hey Ravi,
>> >>
>> >> First you need to connect to your server. If that's done, depending on
>> >> the type of connection, profiling becomes possible (AFAIK local
>> >> applications always work, but JMX based connections don't).
>> >> If profiling is possible, you should see a Profiler tab. In the
>> >> Profiler tab, on the right you can see a checkbox called "settings".
>> >> Check it.
>> >>
>> >> In the first textarea, called: "Start profiling from classes", enter
>> >> the following:
>> >> javax.faces.**
>> >> org.apache.myfaces.**
>> >> com.yourcompany.**
>> >>
>> >> The other settings should be ok, or maybe you need to apply some
>> >> additional filter to prevent OOME's.
>> >>
>> >> When done, you can hit the Profile button and start generating load on
>> >> your webapp. Note the small button in the Profiler tab to create
>> >> snapshots. This is a useful one, because you have extra profiling
>> >> features on snapshots that aren't available on the realtime data.
>> >>
>> >> Note: It might be smart to increase the max heap size in
>> >> [VISUALVM_HOME]/etc/visualvm.conf. 512MB should be enough ( -J-Xmx512m
>> >> ).
>> >>
>> >> I hope these steps work for you and maybe a different graph gives some
>> >> more insight...
>> >>
>> >> Regards,
>> >> Jan-Kees
>> >>
>> >>
>> >> 2010/1/12 Ravi Kapoor :
>> >> > Oh I see what you are saying. We only create and populate the hashmap
>> >> once,
>> >> > we never clear or delete from it. So that endless loop is not the
>> >> problem.
>> >> > Also in that case the CPU wouldnt show up for org.apache.* classes.
>> >> >
>> >> > I guess you are looking for how to specify packages in VisualVM. This
>> >> would
>> >> > give me another point of reference to validate my numbers.
>> >> >
>> >> > - Ravi
>> >> >
>> >> >
>> >> > On Mon, Jan 11, 2010 at 6:00 PM, Jakob Korherr <
>> jakob.korh...@gmail.com
>> >> >wrote:
>> >> >
>> >> >> Ravi,
>> >> >>
>> >> >> To your question: Can you explain little bit how lack of
>> synchronization
>> >> >> can
>> >> >> add to CPU?
>> >> >>
>> >> >> I don't know exactly, but maybe it is possible that the internal
>> >> structure
>> >> >> of a Map (e.g. HashMap) can be destroyed when there are multiple
>> change
>> >> >> operations (put, remove, clear) at the same time, because of lack of
>> >> >> synchronization. But that's really just a guess!
>> >> >>
>> >> >> Regards,
>> >> >> Jakob
>> >> >>
>> >> >> 2010/1/11 Ravi Kapoor 
>> >> >>
>> >> >> > Jakob,
>> >> >> >
>> >> >> > I did install VisualVM but it is not capturing org.apache.* classes
>> or
>> >> >> > com.mycompany.* classes. I did not find a setting on how to enable
>> >> >> > capturing
>> >> >> > data for all the classes I want. Can you tell me where to specity
>> the
>> >> >> > packages for which I want to capture CPU usage?
>> >> >> >
>> >> >> > Vinay
>> >> >> >
>> >> >> >
>> >> >> > On Mon, Jan 11, 2010 at 4:05 PM, Ravi Kapoor <
>> ravikapoor...@gmail.com
>> >> >> > >wrote:
>> >> >> >
>> >> >> > > Jakob,
>> >> >> > >
>> >> >> > > The beans are not big. Also these tests have been performed under
>> a
>> >> >> > single
>> >> >> > > user to measure the CPU timing. So I doubt
>> locking/synchronization
>> >> is
>> >> >> an
>> >> >> > > i

Re: [Trinidad] Trinidad consuming 80-90% CPU

2010-01-12 Thread Ravi Kapoor
I found that link as well 10 seconds ago and was going to email you :). Yes
you are right, I cannot run this app in tomcat, this is enterprise app with
tons of dependency on websphere.

Anyways, how can I get onsite support? Who provides such support? Apache?
Can you send me contact info or a link?

Thanks
Ravi

On Tue, Jan 12, 2010 at 1:28 PM, Jan-Kees van Andel <
jankeesvanan...@gmail.com> wrote:

> Hrm, it looks like the IBM JVM doesn't support VisualVM. See:
> http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14210263
> Sorry. It would be nice if it worked.
> You're probably not able to run your app on i.e. Tomcat, JBoss or
> Glassfish, just for testing? If you are, things are easier.
>
> But I'm afraid we're not solving problems here. I think you'd better
> look for on-site support...
>
> /JK
>
>
> 2010/1/12 Ravi Kapoor :
> > Jan-Kees, thanks for this info. I got the settings in order. But I am
> having
> > another problem.
> >
> > When I launch the server from within RAD, VisualVM is not able to detect
> the
> > process at all. Can you tell me what do I need to do so VisualVM can
> detect
> > my server so that I can get profiling information for my classes?
> >
> >
> >
> > On Tue, Jan 12, 2010 at 10:02 AM, Jan-Kees van Andel <
> > jankeesvanan...@gmail.com> wrote:
> >
> >> Hey Ravi,
> >>
> >> First you need to connect to your server. If that's done, depending on
> >> the type of connection, profiling becomes possible (AFAIK local
> >> applications always work, but JMX based connections don't).
> >> If profiling is possible, you should see a Profiler tab. In the
> >> Profiler tab, on the right you can see a checkbox called "settings".
> >> Check it.
> >>
> >> In the first textarea, called: "Start profiling from classes", enter
> >> the following:
> >> javax.faces.**
> >> org.apache.myfaces.**
> >> com.yourcompany.**
> >>
> >> The other settings should be ok, or maybe you need to apply some
> >> additional filter to prevent OOME's.
> >>
> >> When done, you can hit the Profile button and start generating load on
> >> your webapp. Note the small button in the Profiler tab to create
> >> snapshots. This is a useful one, because you have extra profiling
> >> features on snapshots that aren't available on the realtime data.
> >>
> >> Note: It might be smart to increase the max heap size in
> >> [VISUALVM_HOME]/etc/visualvm.conf. 512MB should be enough ( -J-Xmx512m
> >> ).
> >>
> >> I hope these steps work for you and maybe a different graph gives some
> >> more insight...
> >>
> >> Regards,
> >> Jan-Kees
> >>
> >>
> >> 2010/1/12 Ravi Kapoor :
> >> > Oh I see what you are saying. We only create and populate the hashmap
> >> once,
> >> > we never clear or delete from it. So that endless loop is not the
> >> problem.
> >> > Also in that case the CPU wouldnt show up for org.apache.* classes.
> >> >
> >> > I guess you are looking for how to specify packages in VisualVM. This
> >> would
> >> > give me another point of reference to validate my numbers.
> >> >
> >> > - Ravi
> >> >
> >> >
> >> > On Mon, Jan 11, 2010 at 6:00 PM, Jakob Korherr <
> jakob.korh...@gmail.com
> >> >wrote:
> >> >
> >> >> Ravi,
> >> >>
> >> >> To your question: Can you explain little bit how lack of
> synchronization
> >> >> can
> >> >> add to CPU?
> >> >>
> >> >> I don't know exactly, but maybe it is possible that the internal
> >> structure
> >> >> of a Map (e.g. HashMap) can be destroyed when there are multiple
> change
> >> >> operations (put, remove, clear) at the same time, because of lack of
> >> >> synchronization. But that's really just a guess!
> >> >>
> >> >> Regards,
> >> >> Jakob
> >> >>
> >> >> 2010/1/11 Ravi Kapoor 
> >> >>
> >> >> > Jakob,
> >> >> >
> >> >> > I did install VisualVM but it is not capturing org.apache.* classes
> or
> >> >> > com.mycompany.* classes. I did not find a setting on how to enable
> >> >> > capturing
> >> >> > data for all the classes I want. Can you tell me where to specity
> the
> >> >> > packages for which I want to capture CPU usage?
> >> >> >
> >> >> > Vinay
> >> >> >
> >> >> >
> >> >> > On Mon, Jan 11, 2010 at 4:05 PM, Ravi Kapoor <
> ravikapoor...@gmail.com
> >> >> > >wrote:
> >> >> >
> >> >> > > Jakob,
> >> >> > >
> >> >> > > The beans are not big. Also these tests have been performed under
> a
> >> >> > single
> >> >> > > user to measure the CPU timing. So I doubt
> locking/synchronization
> >> is
> >> >> an
> >> >> > > issue.
> >> >> > >
> >> >> > > I would think that if there is synchronization, then the threads
> >> could
> >> >> be
> >> >> > > waiting for long time, but lack of synchronization can only lead
> to
> >> >> > corrupt
> >> >> > > data not to higher CPU. Can you explain little bit how lack of
> >> >> > > synchronization can add to CPU?
> >> >> > >
> >> >> > > I have never used VisualVM, I can try it sometime this week. I am
> >> >> > assuming
> >> >> > > it will work with Websphere 6.1
> >> >> > >
> >> >> > > Regards
> >> >> > > Ravi
> >> >> > >
> >> >> > >
> >> >

Re: [Trinidad] Trinidad consuming 80-90% CPU

2010-01-12 Thread Jan-Kees van Andel
Hrm, it looks like the IBM JVM doesn't support VisualVM. See:
http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14210263
Sorry. It would be nice if it worked.
You're probably not able to run your app on i.e. Tomcat, JBoss or
Glassfish, just for testing? If you are, things are easier.

But I'm afraid we're not solving problems here. I think you'd better
look for on-site support...

/JK


2010/1/12 Ravi Kapoor :
> Jan-Kees, thanks for this info. I got the settings in order. But I am having
> another problem.
>
> When I launch the server from within RAD, VisualVM is not able to detect the
> process at all. Can you tell me what do I need to do so VisualVM can detect
> my server so that I can get profiling information for my classes?
>
>
>
> On Tue, Jan 12, 2010 at 10:02 AM, Jan-Kees van Andel <
> jankeesvanan...@gmail.com> wrote:
>
>> Hey Ravi,
>>
>> First you need to connect to your server. If that's done, depending on
>> the type of connection, profiling becomes possible (AFAIK local
>> applications always work, but JMX based connections don't).
>> If profiling is possible, you should see a Profiler tab. In the
>> Profiler tab, on the right you can see a checkbox called "settings".
>> Check it.
>>
>> In the first textarea, called: "Start profiling from classes", enter
>> the following:
>> javax.faces.**
>> org.apache.myfaces.**
>> com.yourcompany.**
>>
>> The other settings should be ok, or maybe you need to apply some
>> additional filter to prevent OOME's.
>>
>> When done, you can hit the Profile button and start generating load on
>> your webapp. Note the small button in the Profiler tab to create
>> snapshots. This is a useful one, because you have extra profiling
>> features on snapshots that aren't available on the realtime data.
>>
>> Note: It might be smart to increase the max heap size in
>> [VISUALVM_HOME]/etc/visualvm.conf. 512MB should be enough ( -J-Xmx512m
>> ).
>>
>> I hope these steps work for you and maybe a different graph gives some
>> more insight...
>>
>> Regards,
>> Jan-Kees
>>
>>
>> 2010/1/12 Ravi Kapoor :
>> > Oh I see what you are saying. We only create and populate the hashmap
>> once,
>> > we never clear or delete from it. So that endless loop is not the
>> problem.
>> > Also in that case the CPU wouldnt show up for org.apache.* classes.
>> >
>> > I guess you are looking for how to specify packages in VisualVM. This
>> would
>> > give me another point of reference to validate my numbers.
>> >
>> > - Ravi
>> >
>> >
>> > On Mon, Jan 11, 2010 at 6:00 PM, Jakob Korherr > >wrote:
>> >
>> >> Ravi,
>> >>
>> >> To your question: Can you explain little bit how lack of synchronization
>> >> can
>> >> add to CPU?
>> >>
>> >> I don't know exactly, but maybe it is possible that the internal
>> structure
>> >> of a Map (e.g. HashMap) can be destroyed when there are multiple change
>> >> operations (put, remove, clear) at the same time, because of lack of
>> >> synchronization. But that's really just a guess!
>> >>
>> >> Regards,
>> >> Jakob
>> >>
>> >> 2010/1/11 Ravi Kapoor 
>> >>
>> >> > Jakob,
>> >> >
>> >> > I did install VisualVM but it is not capturing org.apache.* classes or
>> >> > com.mycompany.* classes. I did not find a setting on how to enable
>> >> > capturing
>> >> > data for all the classes I want. Can you tell me where to specity the
>> >> > packages for which I want to capture CPU usage?
>> >> >
>> >> > Vinay
>> >> >
>> >> >
>> >> > On Mon, Jan 11, 2010 at 4:05 PM, Ravi Kapoor > >> > >wrote:
>> >> >
>> >> > > Jakob,
>> >> > >
>> >> > > The beans are not big. Also these tests have been performed under a
>> >> > single
>> >> > > user to measure the CPU timing. So I doubt locking/synchronization
>> is
>> >> an
>> >> > > issue.
>> >> > >
>> >> > > I would think that if there is synchronization, then the threads
>> could
>> >> be
>> >> > > waiting for long time, but lack of synchronization can only lead to
>> >> > corrupt
>> >> > > data not to higher CPU. Can you explain little bit how lack of
>> >> > > synchronization can add to CPU?
>> >> > >
>> >> > > I have never used VisualVM, I can try it sometime this week. I am
>> >> > assuming
>> >> > > it will work with Websphere 6.1
>> >> > >
>> >> > > Regards
>> >> > > Ravi
>> >> > >
>> >> > >
>> >> > > On Mon, Jan 11, 2010 at 3:03 PM, Jan-Kees van Andel <
>> >> > > jankeesvanan...@gmail.com> wrote:
>> >> > >
>> >> > >> Hi Ravi,
>> >> > >>
>> >> > >> Just a stupid question. Are your beans extremely big? Since
>> FacesBean
>> >> > >> doesn't do much locking/synchronizing (none if I'm correctly), the
>> >> > >> only reason I can imagine it to eat CPU cycles is because of its
>> >> > >> size...
>> >> > >>
>> >> > >> Also, is it possible for you to do a profiling run using VisualVM?
>> >> > >> I've been profiling Trinidad with VisualVM myself and maybe we can
>> >> > >> compare numbers... Using the same tool might make it easier to
>> >> > >> compare...
>> >> > >>
>> >> > >> /JK
>> >> > >>
>> >> > >>
>> >> > >> 2010/1/11 Ravi Kapo

Re: access MethodExpression from actionListener

2010-01-12 Thread Jakob Korherr
Hi Michael,

Taking a short look at MethodExpressionActionListener, there are no getters
and the instance fields are private.. One way to get the original
MethodExpression is (as you suggested) to patch this class locally..

Another would be (although poor) to use the saveState()-method to get the
ActionListener's state. This is usually an Object array with most of its
instance variables. Then you could extract the MethodExpression from the
Object array.

..or you could use reflection to access the private field, but that's also
not very "beautiful".

Hope this helps!

Regards,
Jakob

2010/1/12 Michael Heinen 

> Hi,
>
> I use a global action-listener defined in faces-config via the
> action-listener tag to log called actions/actionsListeners.
> With JSF 1.1 I used following code:
>
> private void storeCalledAction(ActionEvent actionEvent){
>  ActionSource actionSource = (ActionSource) actionEvent.getComponent();
>  //1. check for action listener
>  MethodBinding methodBinding = actionSource.getActionListener();
>  if (methodBinding == null){
>//2. check for action
>methodBinding = actionSource.getAction();
>  }
>  if (methodBinding != null){
>action = methodBinding.getExpressionString();
>...
>
> MethodBinding is deprecated in JSF1.2 and also null for actionListeners.
> Therefore I changed ActionSource to ActionSource2 and MethodBinding to
> MethodExpression.
>
> private void storeCalledAction(final ActionEvent actionEvent){
>  ActionSource2 actionSource = (ActionSource2) actionEvent.getComponent();
>  MethodExpression methodExpression = actionSource.getActionExpression();
>
>  if (methodExpression==null){
>ActionListener[] actionListeners = actionSource.getActionListeners();
>if (actionListeners!=null && actionListeners.length>0){
>  ActionListener lastActionListener =
> actionListeners[actionListeners.length-1];
>  // And now???
>}
>  }
>
> How can I access the methodExpression of the (now nested) ActionListeners?
> They are of type javax.faces.event.MethodExpressionActionListener but there
> is no getter available.
>
> Do I have to patch MethodExpressionActionListener locally and add a getter
> or is there an official alternative?
>
> Michael
>


Re: Spring FilterSecurityInterceptor not been called for myfaces forwards

2010-01-12 Thread Jakob Korherr
"The filter for JSF forwards is not getting invoked at all."

That's exactly what I was saying  ...and it does not help you if you set
, because the filter is only
invoked once anyway.

Madhav's problem is that the Filter itself is only invoked once for the
request (at the time when the user makes the request), although there is a
internal forward with the RequestDispatcher.

So the problem is that the same Filter is not invoked twice for one request
(at first for REQUEST and then for FORWARD).

Regards,
Jakob


2010/1/12 Madhav Bhargava 

> I had added spring security code in my workspace for debugging reasons and
> I suspected that how can a new page be shown when the URL passed to the
> filter at the server is old. So I put a dummy filter in front of spring
> security just to print out the URL that is getting intercepted by spring
> security filter chain.
>
> So now I find that when a JSF forward happens via NavigationHandler then
> there is no URL that is actually intercepted by the spring filter. What I
> saw during debugging was not the correct picture.
>
> SO I am back at the same problem. The filter for JSF forwards is not
> getting invoked at all.
>
> Regards,
> Madhav
>
> From: Madhav Bhargava
> >
> >Yes, I have made the appropriate configuration for spring security filters
> so that specially in the case that >you have described below this property
> will make sure that the authentication is done again.
> >
> >However I do not think that it has anything to do with a stale URL being
> passed to the filter at the server >side. I can understand that the browser
> will have an old URL but at the server side the URL intercepted by the
> >filter should not be stale. Moreover the control is being forwarded to the
> correct page and the page is visible >as well so do not know how can a old
> ULR be passed at the server side and a new page be displayed at the client
> >side.
> >
> >Thanks,
> >Madhav
> >
> >From: Michael Kurz [mailto:michi.k...@gmx.at]
> >
> >Hm, I thought the same first but he has attribute once-per-request set
> >to false:
> >
> >
> >
> >- Michael
> >
> >Jakob Korherr schrieb:
> > Hi Madhav,
> >
> > I now know what the problem is. I wrote a small test webapp and came to
> the
> > following conclusion:
> >
> > JSF uses RequestDispatcher.forward(..) to render the second view. Thus
> the
> > filter should be invoked for the forward. However, the filter is/was
> already
> > invoked for the first request and it cannot be invoked twice for one
> > request.
> >
> > Only for test reasons, remove REQUEST from your
> > filter config in the web.xml and the filter will be invoked for
> > RequestDispatcher.forward(..), because it was not invoked for the
> original
> > request.
> >
> > I know this does not solve your problem, but I think there is maybe a
> > workaround for this.. I myself just don't know one..
> > Maybe define the filter twice would solve the problem, but that's just a
> > guess.
> >
> > Regards,
> > Jakob
> >
> > 2010/1/12 Madhav Bhargava 
> >
> >>
> >> -Original Message-
> >> From: Michael Kurz [mailto:michi.k...@gmx.at]
> >>
> >>> Madhav Bhargava schrieb:
> >>> To add if you see the spring security application config, I have the
> >> following set:
> >>> 
> >>>>> access="ROLE_USER" />
> >>>>> access="ROLE_OPERATIONS"/>
> >>> 
> >>>
> >>> The URL for the outcome to be forwarded to matches the second
> interceptor
> >> pattern which is "/jsp/operations/user/operationsLanding.iface"
> >>> However what the filter receives is "/jsp/secure/hprelanding.jspx"
> which
> >> is the old URL from where the control is being forwarded. This is not
> how it
> >> happens when using jsp:forward.
> >>
> >>> For clarification: Is the navigation to the new page
> >>> operationsLanding.iface performed (do you actually see it in the
> browser)?
> >>>
> >>> - Michael
> >> Yes,the request is properly forwarded to operationsLanding.jspx and I
> can
> >> view the page. I had put a breakpoint in one of the spring security
> classes
> >> and I could see the old URL which got successfully mapped against
> pattern
> >> /**/secure/** which should not have happened.
> >>
> >> If I have a normal JSP application where there is no JSF then it works
> >> fine. I meant the navigation is not handled by JSF.
> >>
> >> Regards,
> >> Madhav
> >>
> >
>
>
>  CAUTION - Disclaimer *
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended
> solely
> for the use of the addressee(s). If you are not the intended recipient,
> please
> notify the sender by e-mail and delete the original message. Further, you
> are not
> to copy, disclose, or distribute this e-mail or its contents to any other
> person and
> any such actions are unlawful. This e-mail may contain viruses. Infosys has
> taken
> every reasonable precaution to minimize this risk, but is not liable for
> any damage
> you may sustain as a result of any virus in this e-mail. You sho

access MethodExpression from actionListener

2010-01-12 Thread Michael Heinen
Hi,

I use a global action-listener defined in faces-config via the action-listener 
tag to log called actions/actionsListeners.
With JSF 1.1 I used following code:

private void storeCalledAction(ActionEvent actionEvent){
  ActionSource actionSource = (ActionSource) actionEvent.getComponent();
  //1. check for action listener
  MethodBinding methodBinding = actionSource.getActionListener();
  if (methodBinding == null){
//2. check for action
methodBinding = actionSource.getAction();
  }
  if (methodBinding != null){
action = methodBinding.getExpressionString();
...

MethodBinding is deprecated in JSF1.2 and also null for actionListeners.
Therefore I changed ActionSource to ActionSource2 and MethodBinding to 
MethodExpression.

private void storeCalledAction(final ActionEvent actionEvent){
  ActionSource2 actionSource = (ActionSource2) actionEvent.getComponent();
  MethodExpression methodExpression = actionSource.getActionExpression();

  if (methodExpression==null){
ActionListener[] actionListeners = actionSource.getActionListeners();
if (actionListeners!=null && actionListeners.length>0){
  ActionListener lastActionListener = 
actionListeners[actionListeners.length-1];
  // And now???
}
  }

How can I access the methodExpression of the (now nested) ActionListeners?
They are of type javax.faces.event.MethodExpressionActionListener but there is 
no getter available.

Do I have to patch MethodExpressionActionListener locally and add a getter or 
is there an official alternative?

Michael


Re: [Trinidad] Trinidad consuming 80-90% CPU

2010-01-12 Thread Ravi Kapoor
Jan-Kees, thanks for this info. I got the settings in order. But I am having
another problem.

When I launch the server from within RAD, VisualVM is not able to detect the
process at all. Can you tell me what do I need to do so VisualVM can detect
my server so that I can get profiling information for my classes?



On Tue, Jan 12, 2010 at 10:02 AM, Jan-Kees van Andel <
jankeesvanan...@gmail.com> wrote:

> Hey Ravi,
>
> First you need to connect to your server. If that's done, depending on
> the type of connection, profiling becomes possible (AFAIK local
> applications always work, but JMX based connections don't).
> If profiling is possible, you should see a Profiler tab. In the
> Profiler tab, on the right you can see a checkbox called "settings".
> Check it.
>
> In the first textarea, called: "Start profiling from classes", enter
> the following:
> javax.faces.**
> org.apache.myfaces.**
> com.yourcompany.**
>
> The other settings should be ok, or maybe you need to apply some
> additional filter to prevent OOME's.
>
> When done, you can hit the Profile button and start generating load on
> your webapp. Note the small button in the Profiler tab to create
> snapshots. This is a useful one, because you have extra profiling
> features on snapshots that aren't available on the realtime data.
>
> Note: It might be smart to increase the max heap size in
> [VISUALVM_HOME]/etc/visualvm.conf. 512MB should be enough ( -J-Xmx512m
> ).
>
> I hope these steps work for you and maybe a different graph gives some
> more insight...
>
> Regards,
> Jan-Kees
>
>
> 2010/1/12 Ravi Kapoor :
> > Oh I see what you are saying. We only create and populate the hashmap
> once,
> > we never clear or delete from it. So that endless loop is not the
> problem.
> > Also in that case the CPU wouldnt show up for org.apache.* classes.
> >
> > I guess you are looking for how to specify packages in VisualVM. This
> would
> > give me another point of reference to validate my numbers.
> >
> > - Ravi
> >
> >
> > On Mon, Jan 11, 2010 at 6:00 PM, Jakob Korherr  >wrote:
> >
> >> Ravi,
> >>
> >> To your question: Can you explain little bit how lack of synchronization
> >> can
> >> add to CPU?
> >>
> >> I don't know exactly, but maybe it is possible that the internal
> structure
> >> of a Map (e.g. HashMap) can be destroyed when there are multiple change
> >> operations (put, remove, clear) at the same time, because of lack of
> >> synchronization. But that's really just a guess!
> >>
> >> Regards,
> >> Jakob
> >>
> >> 2010/1/11 Ravi Kapoor 
> >>
> >> > Jakob,
> >> >
> >> > I did install VisualVM but it is not capturing org.apache.* classes or
> >> > com.mycompany.* classes. I did not find a setting on how to enable
> >> > capturing
> >> > data for all the classes I want. Can you tell me where to specity the
> >> > packages for which I want to capture CPU usage?
> >> >
> >> > Vinay
> >> >
> >> >
> >> > On Mon, Jan 11, 2010 at 4:05 PM, Ravi Kapoor  >> > >wrote:
> >> >
> >> > > Jakob,
> >> > >
> >> > > The beans are not big. Also these tests have been performed under a
> >> > single
> >> > > user to measure the CPU timing. So I doubt locking/synchronization
> is
> >> an
> >> > > issue.
> >> > >
> >> > > I would think that if there is synchronization, then the threads
> could
> >> be
> >> > > waiting for long time, but lack of synchronization can only lead to
> >> > corrupt
> >> > > data not to higher CPU. Can you explain little bit how lack of
> >> > > synchronization can add to CPU?
> >> > >
> >> > > I have never used VisualVM, I can try it sometime this week. I am
> >> > assuming
> >> > > it will work with Websphere 6.1
> >> > >
> >> > > Regards
> >> > > Ravi
> >> > >
> >> > >
> >> > > On Mon, Jan 11, 2010 at 3:03 PM, Jan-Kees van Andel <
> >> > > jankeesvanan...@gmail.com> wrote:
> >> > >
> >> > >> Hi Ravi,
> >> > >>
> >> > >> Just a stupid question. Are your beans extremely big? Since
> FacesBean
> >> > >> doesn't do much locking/synchronizing (none if I'm correctly), the
> >> > >> only reason I can imagine it to eat CPU cycles is because of its
> >> > >> size...
> >> > >>
> >> > >> Also, is it possible for you to do a profiling run using VisualVM?
> >> > >> I've been profiling Trinidad with VisualVM myself and maybe we can
> >> > >> compare numbers... Using the same tool might make it easier to
> >> > >> compare...
> >> > >>
> >> > >> /JK
> >> > >>
> >> > >>
> >> > >> 2010/1/11 Ravi Kapoor :
> >> > >> > I am thinking if that was the case, I would see high CPU in
> >> > >> > java.util.HashMap instead of org.apache.faces.*
> >> > >> >
> >> > >> > If you disagree, please explain and I can try using HashTable to
> >> store
> >> > >> data
> >> > >> > and get fresh numbers.
> >> > >> >
> >> > >> >
> >> > >> > On Mon, Jan 11, 2010 at 10:00 AM, Jakob Korherr <
> >> > >> jakob.korh...@gmail.com>wrote:
> >> > >> >
> >> > >> >> Maybe it happens when accessing the value from the Map with
> >> > >> >> "#{bean.get['memid']}", because the Map is not properly
> >> 

Re: [Trinidad] Trinidad consuming 80-90% CPU

2010-01-12 Thread Jan-Kees van Andel
Hey Ravi,

First you need to connect to your server. If that's done, depending on
the type of connection, profiling becomes possible (AFAIK local
applications always work, but JMX based connections don't).
If profiling is possible, you should see a Profiler tab. In the
Profiler tab, on the right you can see a checkbox called "settings".
Check it.

In the first textarea, called: "Start profiling from classes", enter
the following:
javax.faces.**
org.apache.myfaces.**
com.yourcompany.**

The other settings should be ok, or maybe you need to apply some
additional filter to prevent OOME's.

When done, you can hit the Profile button and start generating load on
your webapp. Note the small button in the Profiler tab to create
snapshots. This is a useful one, because you have extra profiling
features on snapshots that aren't available on the realtime data.

Note: It might be smart to increase the max heap size in
[VISUALVM_HOME]/etc/visualvm.conf. 512MB should be enough ( -J-Xmx512m
).

I hope these steps work for you and maybe a different graph gives some
more insight...

Regards,
Jan-Kees


2010/1/12 Ravi Kapoor :
> Oh I see what you are saying. We only create and populate the hashmap once,
> we never clear or delete from it. So that endless loop is not the problem.
> Also in that case the CPU wouldnt show up for org.apache.* classes.
>
> I guess you are looking for how to specify packages in VisualVM. This would
> give me another point of reference to validate my numbers.
>
> - Ravi
>
>
> On Mon, Jan 11, 2010 at 6:00 PM, Jakob Korherr wrote:
>
>> Ravi,
>>
>> To your question: Can you explain little bit how lack of synchronization
>> can
>> add to CPU?
>>
>> I don't know exactly, but maybe it is possible that the internal structure
>> of a Map (e.g. HashMap) can be destroyed when there are multiple change
>> operations (put, remove, clear) at the same time, because of lack of
>> synchronization. But that's really just a guess!
>>
>> Regards,
>> Jakob
>>
>> 2010/1/11 Ravi Kapoor 
>>
>> > Jakob,
>> >
>> > I did install VisualVM but it is not capturing org.apache.* classes or
>> > com.mycompany.* classes. I did not find a setting on how to enable
>> > capturing
>> > data for all the classes I want. Can you tell me where to specity the
>> > packages for which I want to capture CPU usage?
>> >
>> > Vinay
>> >
>> >
>> > On Mon, Jan 11, 2010 at 4:05 PM, Ravi Kapoor > > >wrote:
>> >
>> > > Jakob,
>> > >
>> > > The beans are not big. Also these tests have been performed under a
>> > single
>> > > user to measure the CPU timing. So I doubt locking/synchronization is
>> an
>> > > issue.
>> > >
>> > > I would think that if there is synchronization, then the threads could
>> be
>> > > waiting for long time, but lack of synchronization can only lead to
>> > corrupt
>> > > data not to higher CPU. Can you explain little bit how lack of
>> > > synchronization can add to CPU?
>> > >
>> > > I have never used VisualVM, I can try it sometime this week. I am
>> > assuming
>> > > it will work with Websphere 6.1
>> > >
>> > > Regards
>> > > Ravi
>> > >
>> > >
>> > > On Mon, Jan 11, 2010 at 3:03 PM, Jan-Kees van Andel <
>> > > jankeesvanan...@gmail.com> wrote:
>> > >
>> > >> Hi Ravi,
>> > >>
>> > >> Just a stupid question. Are your beans extremely big? Since FacesBean
>> > >> doesn't do much locking/synchronizing (none if I'm correctly), the
>> > >> only reason I can imagine it to eat CPU cycles is because of its
>> > >> size...
>> > >>
>> > >> Also, is it possible for you to do a profiling run using VisualVM?
>> > >> I've been profiling Trinidad with VisualVM myself and maybe we can
>> > >> compare numbers... Using the same tool might make it easier to
>> > >> compare...
>> > >>
>> > >> /JK
>> > >>
>> > >>
>> > >> 2010/1/11 Ravi Kapoor :
>> > >> > I am thinking if that was the case, I would see high CPU in
>> > >> > java.util.HashMap instead of org.apache.faces.*
>> > >> >
>> > >> > If you disagree, please explain and I can try using HashTable to
>> store
>> > >> data
>> > >> > and get fresh numbers.
>> > >> >
>> > >> >
>> > >> > On Mon, Jan 11, 2010 at 10:00 AM, Jakob Korherr <
>> > >> jakob.korh...@gmail.com>wrote:
>> > >> >
>> > >> >> Maybe it happens when accessing the value from the Map with
>> > >> >> "#{bean.get['memid']}", because the Map is not properly
>> synchronized,
>> > >> thus
>> > >> >> its internal structure is broken and thus it is running in infinite
>> > >> loops.
>> > >> >>
>> > >> >> Are your resources properly synchronized?
>> > >> >>
>> > >> >> Just a guess in the blue...
>> > >> >>
>> > >> >> Regards,
>> > >> >> Jakob Korherr
>> > >> >>
>> > >> >> 2010/1/11 Ravi Kapoor 
>> > >> >>
>> > >> >> > Another thing, most of our EL expressions are one of the
>> following
>> > >> types
>> > >> >> >
>> > >> >> > "#{bean.active}"
>> > >> >> > or
>> > >> >> > "#{bean.get['memid']}"
>> > >> >> >
>> > >> >> > Parsing of these expressions probably happens within
>> > >> org.apache.myfaces.*
>> > >> >> > classes. These are fai

RE: Spring FilterSecurityInterceptor not been called for myfaces forwards

2010-01-12 Thread Madhav Bhargava
I had added spring security code in my workspace for debugging reasons and I 
suspected that how can a new page be shown when the URL passed to the filter at 
the server is old. So I put a dummy filter in front of spring security just to 
print out the URL that is getting intercepted by spring security filter chain.

So now I find that when a JSF forward happens via NavigationHandler then there 
is no URL that is actually intercepted by the spring filter. What I saw during 
debugging was not the correct picture.

SO I am back at the same problem. The filter for JSF forwards is not getting 
invoked at all.

Regards,
Madhav

From: Madhav Bhargava 
>
>Yes, I have made the appropriate configuration for spring security filters so 
>that specially in the case that >you have described below this property will 
>make sure that the authentication is done again.
>
>However I do not think that it has anything to do with a stale URL being 
>passed to the filter at the server >side. I can understand that the browser 
>will have an old URL but at the server side the URL intercepted by the >filter 
>should not be stale. Moreover the control is being forwarded to the correct 
>page and the page is visible >as well so do not know how can a old ULR be 
>passed at the server side and a new page be displayed at the client >side.
>
>Thanks,
>Madhav
>
>From: Michael Kurz [mailto:michi.k...@gmx.at] 
>
>Hm, I thought the same first but he has attribute once-per-request set 
>to false:
>
>
>
>- Michael
>
>Jakob Korherr schrieb:
> Hi Madhav,
> 
> I now know what the problem is. I wrote a small test webapp and came to the
> following conclusion:
> 
> JSF uses RequestDispatcher.forward(..) to render the second view. Thus the
> filter should be invoked for the forward. However, the filter is/was already
> invoked for the first request and it cannot be invoked twice for one
> request.
> 
> Only for test reasons, remove REQUEST from your
> filter config in the web.xml and the filter will be invoked for
> RequestDispatcher.forward(..), because it was not invoked for the original
> request.
> 
> I know this does not solve your problem, but I think there is maybe a
> workaround for this.. I myself just don't know one..
> Maybe define the filter twice would solve the problem, but that's just a
> guess.
> 
> Regards,
> Jakob
> 
> 2010/1/12 Madhav Bhargava 
> 
>>
>> -Original Message-
>> From: Michael Kurz [mailto:michi.k...@gmx.at]
>>
>>> Madhav Bhargava schrieb:
>>> To add if you see the spring security application config, I have the
>> following set:
>>> 
>>>   > access="ROLE_USER" />
>>>   > access="ROLE_OPERATIONS"/>
>>> 
>>>
>>> The URL for the outcome to be forwarded to matches the second interceptor
>> pattern which is "/jsp/operations/user/operationsLanding.iface"
>>> However what the filter receives is "/jsp/secure/hprelanding.jspx" which
>> is the old URL from where the control is being forwarded. This is not how it
>> happens when using jsp:forward.
>>
>>> For clarification: Is the navigation to the new page
>>> operationsLanding.iface performed (do you actually see it in the browser)?
>>>
>>> - Michael
>> Yes,the request is properly forwarded to operationsLanding.jspx and I can
>> view the page. I had put a breakpoint in one of the spring security classes
>> and I could see the old URL which got successfully mapped against pattern
>> /**/secure/** which should not have happened.
>>
>> If I have a normal JSP application where there is no JSF then it works
>> fine. I meant the navigation is not handled by JSF.
>>
>> Regards,
>> Madhav
>>
> 


 CAUTION - Disclaimer *
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are 
not 
to copy, disclose, or distribute this e-mail or its contents to any other 
person and 
any such actions are unlawful. This e-mail may contain viruses. Infosys has 
taken 
every reasonable precaution to minimize this risk, but is not liable for any 
damage 
you may sustain as a result of any virus in this e-mail. You should carry out 
your 
own virus checks before opening the e-mail or attachment. Infosys reserves the 
right to monitor and review the content of all messages sent to or from this 
e-mail 
address. Messages sent to or from this e-mail address may be stored on the 
Infosys e-mail system.
***INFOSYS End of Disclaimer INFOSYS***

RE: Spring FilterSecurityInterceptor not been called for myfaces forwards

2010-01-12 Thread Madhav Bhargava
Yes, I have made the appropriate configuration for spring security filters so 
that specially in the case that you have described below this property will 
make sure that the authentication is done again.

However I do not think that it has anything to do with a stale URL being passed 
to the filter at the server side. I can understand that the browser will have 
an old URL but at the server side the URL intercepted by the filter should not 
be stale. Moreover the control is being forwarded to the correct page and the 
page is visible as well so do not know how can a old ULR be passed at the 
server side and a new page be displayed at the client side.

Thanks,
Madhav

From: Michael Kurz [mailto:michi.k...@gmx.at] 
>
>Hm, I thought the same first but he has attribute once-per-request set 
>to false:
>
>
>
>- Michael
>
>Jakob Korherr schrieb:
> Hi Madhav,
> 
> I now know what the problem is. I wrote a small test webapp and came to the
> following conclusion:
> 
> JSF uses RequestDispatcher.forward(..) to render the second view. Thus the
> filter should be invoked for the forward. However, the filter is/was already
> invoked for the first request and it cannot be invoked twice for one
> request.
> 
> Only for test reasons, remove REQUEST from your
> filter config in the web.xml and the filter will be invoked for
> RequestDispatcher.forward(..), because it was not invoked for the original
> request.
> 
> I know this does not solve your problem, but I think there is maybe a
> workaround for this.. I myself just don't know one..
> Maybe define the filter twice would solve the problem, but that's just a
> guess.
> 
> Regards,
> Jakob
> 
> 2010/1/12 Madhav Bhargava 
> 
>>
>> -Original Message-
>> From: Michael Kurz [mailto:michi.k...@gmx.at]
>>
>>> Madhav Bhargava schrieb:
>>> To add if you see the spring security application config, I have the
>> following set:
>>> 
>>>   > access="ROLE_USER" />
>>>   > access="ROLE_OPERATIONS"/>
>>> 
>>>
>>> The URL for the outcome to be forwarded to matches the second interceptor
>> pattern which is "/jsp/operations/user/operationsLanding.iface"
>>> However what the filter receives is "/jsp/secure/hprelanding.jspx" which
>> is the old URL from where the control is being forwarded. This is not how it
>> happens when using jsp:forward.
>>
>>> For clarification: Is the navigation to the new page
>>> operationsLanding.iface performed (do you actually see it in the browser)?
>>>
>>> - Michael
>> Yes,the request is properly forwarded to operationsLanding.jspx and I can
>> view the page. I had put a breakpoint in one of the spring security classes
>> and I could see the old URL which got successfully mapped against pattern
>> /**/secure/** which should not have happened.
>>
>> If I have a normal JSP application where there is no JSF then it works
>> fine. I meant the navigation is not handled by JSF.
>>
>> Regards,
>> Madhav
>>
> 



Re: Spring FilterSecurityInterceptor not been called for myfaces forwards

2010-01-12 Thread Michael Kurz
Hm, I thought the same first but he has attribute once-per-request set 
to false:




- Michael

Jakob Korherr schrieb:

Hi Madhav,

I now know what the problem is. I wrote a small test webapp and came to the
following conclusion:

JSF uses RequestDispatcher.forward(..) to render the second view. Thus the
filter should be invoked for the forward. However, the filter is/was already
invoked for the first request and it cannot be invoked twice for one
request.

Only for test reasons, remove REQUEST from your
filter config in the web.xml and the filter will be invoked for
RequestDispatcher.forward(..), because it was not invoked for the original
request.

I know this does not solve your problem, but I think there is maybe a
workaround for this.. I myself just don't know one..
Maybe define the filter twice would solve the problem, but that's just a
guess.

Regards,
Jakob

2010/1/12 Madhav Bhargava 



-Original Message-
From: Michael Kurz [mailto:michi.k...@gmx.at]


Madhav Bhargava schrieb:
To add if you see the spring security application config, I have the

following set:


  
access="ROLE_USER" />

  
access="ROLE_OPERATIONS"/>



The URL for the outcome to be forwarded to matches the second interceptor

pattern which is "/jsp/operations/user/operationsLanding.iface"

However what the filter receives is "/jsp/secure/hprelanding.jspx" which

is the old URL from where the control is being forwarded. This is not how it
happens when using jsp:forward.


For clarification: Is the navigation to the new page
operationsLanding.iface performed (do you actually see it in the browser)?

- Michael

Yes,the request is properly forwarded to operationsLanding.jspx and I can
view the page. I had put a breakpoint in one of the spring security classes
and I could see the old URL which got successfully mapped against pattern
/**/secure/** which should not have happened.

If I have a normal JSP application where there is no JSF then it works
fine. I meant the navigation is not handled by JSF.

Regards,
Madhav







Re: Spring FilterSecurityInterceptor not been called for myfaces forwards

2010-01-12 Thread Jakob Korherr
Hi Madhav,

I now know what the problem is. I wrote a small test webapp and came to the
following conclusion:

JSF uses RequestDispatcher.forward(..) to render the second view. Thus the
filter should be invoked for the forward. However, the filter is/was already
invoked for the first request and it cannot be invoked twice for one
request.

Only for test reasons, remove REQUEST from your
filter config in the web.xml and the filter will be invoked for
RequestDispatcher.forward(..), because it was not invoked for the original
request.

I know this does not solve your problem, but I think there is maybe a
workaround for this.. I myself just don't know one..
Maybe define the filter twice would solve the problem, but that's just a
guess.

Regards,
Jakob

2010/1/12 Madhav Bhargava 

>
>
> -Original Message-
> From: Michael Kurz [mailto:michi.k...@gmx.at]
>
> >Madhav Bhargava schrieb:
> > To add if you see the spring security application config, I have the
> following set:
> >
> > 
> >access="ROLE_USER" />
> >access="ROLE_OPERATIONS"/>
> > 
> >
> > The URL for the outcome to be forwarded to matches the second interceptor
> pattern which is "/jsp/operations/user/operationsLanding.iface"
> >
> > However what the filter receives is "/jsp/secure/hprelanding.jspx" which
> is the old URL from where the control is being forwarded. This is not how it
> happens when using jsp:forward.
>
> >For clarification: Is the navigation to the new page
> >operationsLanding.iface performed (do you actually see it in the browser)?
> >
> >- Michael
>
> Yes,the request is properly forwarded to operationsLanding.jspx and I can
> view the page. I had put a breakpoint in one of the spring security classes
> and I could see the old URL which got successfully mapped against pattern
> /**/secure/** which should not have happened.
>
> If I have a normal JSP application where there is no JSF then it works
> fine. I meant the navigation is not handled by JSF.
>
> Regards,
> Madhav
>


RE: Spring FilterSecurityInterceptor not been called for myfaces forwards

2010-01-12 Thread Madhav Bhargava


-Original Message-
From: Michael Kurz [mailto:michi.k...@gmx.at] 

>Madhav Bhargava schrieb:
> To add if you see the spring security application config, I have the 
> following set:
> 
> 
>access="ROLE_USER" />
>access="ROLE_OPERATIONS"/>
> 
> 
> The URL for the outcome to be forwarded to matches the second interceptor 
> pattern which is "/jsp/operations/user/operationsLanding.iface"
> 
> However what the filter receives is "/jsp/secure/hprelanding.jspx" which is 
> the old URL from where the control is being forwarded. This is not how it 
> happens when using jsp:forward.

>For clarification: Is the navigation to the new page 
>operationsLanding.iface performed (do you actually see it in the browser)?
>
>- Michael

Yes,the request is properly forwarded to operationsLanding.jspx and I can view 
the page. I had put a breakpoint in one of the spring security classes and I 
could see the old URL which got successfully mapped against pattern 
/**/secure/** which should not have happened.

If I have a normal JSP application where there is no JSF then it works fine. I 
meant the navigation is not handled by JSF.

Regards,
Madhav


Re: Spring FilterSecurityInterceptor not been called for myfaces forwards

2010-01-12 Thread Michael Kurz

Madhav Bhargava schrieb:

To add if you see the spring security application config, I have the following 
set:






The URL for the outcome to be forwarded to matches the second interceptor pattern which 
is "/jsp/operations/user/operationsLanding.iface"

However what the filter receives is "/jsp/secure/hprelanding.jspx" which is the 
old URL from where the control is being forwarded. This is not how it happens when using 
jsp:forward.


For clarification: Is the navigation to the new page 
operationsLanding.iface performed (do you actually see it in the browser)?


- Michael