Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Closing Spring root WebApplicationContext - Oracle11g - Spring 3.0.2

698116Nov 23 2010 — edited Aug 29 2013
Hi,

I have recently upgraded my server to 11G from 8.1. I know it's a big upgrade.
Also updated the Spring to 3.0.2 Version.

Application (war) get's deployed and spring container is initialized from web.xml alright.
Using ContextLoaderListener --
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

However on the first access of Login.jsp the Spring restarts...

<Nov 23, 2010 4:59:21 PM EST> <Info> <ServletContext-/weboms> <BEA-000000> <Closing Spring root WebApplicationContext>
Nov-23-2010 21:59:21 INFO (AbstractApplicationContext.java:823) - Closing org.springframework.web.context.support.XmlWebApplicationContext@194af77: d
isplay name [Root WebApplicationContext]; startup date [Tue Nov 23 21:58:19 GMT 2010]; root of context hierarchy

And then again Initializies

<Nov 23, 2010 4:59:58 PM EST> <Info> <ServletContext-/weboms> <BEA-000000> <Initializing Spring root WebApplicationContext>
Nov-23-2010 21:59:58 INFO (ContextLoader.java:189) - Root WebApplicationContext: initialization started
Nov-23-2010 21:59:58 INFO (AbstractApplicationContext.java:400) - Refreshing org.springframework.web.context.support.XmlWebApplicationContext@19132a0
: display name [Root WebApplicationContext]; startup date [Tue Nov 23 21:59:58 GMT 2010]; root of context hierarchy
Nov-23-2010 21:59:59 INFO (XmlBeanDefinitionReader.java:308) - Loading XML bean definitions from URL [file:/C:/weblogic/user_projects/domains/ccfs/ap
pconfig/ccfs-webcontext.xml]

This is strange and really don't know why it's happening..
I have tried to start the server with Spring DEBUG and Weblogic DEBUG options turned on, but gives me no clue. I only see -- Closing Spring root WebApplicationContext.

Will appreciate any expert guidence on this problem if you have had the same situation.

Thanks
Amit

Comments

843804
Not sure what a JPane() is, but if it's derived from a JInternalFrame you may need to setSelected() first. Check this out:

http://forum.java.sun.com/thread.jspa?forumID=57&threadID=507860

Maybe it will help.
800382
you call setFocusable(true) on the panel first?
camickr
You can't set the focus on any component unless its visible.
843804
I have just read in the documentation that requestFocusInWindow() will only give focus to the component when the frame containing the frame is displayed, this is what actually is happening with my application, if I use the window manager to hide/unhide my window the component get the focus. Apparently requestFocusInWindow() just set a kind of default focussed component for when the window containing the component gets activated.
Am I correct, that if you want to force the focus on one component is to use the FocusTraversable policy and focusNextComponent(), focusPreviousComponent(), downFocusCycle() or upFocusCycle() (if at least you want to avoid to activate/deactivate your window. I hope there is a easier way to set the focus on one of the components in a frame.

Marc
843804
Also check if you added the keyListener to the component - and if component extends KeyAdapter or implements KeyListener, add:

addKeyListener(this);

(it seems focus can't be gained if there is no KeyListener in the component)
843805
I see the same problem.
Is it necessary to add a KeyListener ?
It sounds very strange.
Anyway hiding/unhiding the window will show the correct focus location.
I tested also using requestFocus but the behaviour is the same.
Could someone help?
Tks
Tullio
794342
try putting the request in a swingUtilities
SwingUtilities.invokeLater(new Runnable(){
  public void run(){
    [component].requestFocusInWindow();
  }
});
843805
I already tried butnothing changed.
Tks
Tullio
843805
requestFocusInWindow() is crap and just doesn't work consistently. Use requestFocus() instead. I know that's not what the documentation reads, but it works.
843806
This works:

addComponentListener(new ComponentAdapter() {
public void componentShown(ComponentEvent ce) {
securePanel.tfUsername.requestFocusInWindow();
}
});

- Chris Murphy (www.strandz.org)
843806
I had the same problem with the request. This works too:

public void windowOpened(WindowEvent e){ component.requestFocus(); }
1 - 11
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 26 2013
Added on Nov 23 2010
2 comments
6,388 views