Re: 1 EAR, 2 WARs causes Spring Context Problem

2009-10-01 Thread shetc

Thanks Martin! That did the trick.

Here's some info for other developers fortunate enough to work with IBM's
WebSphere:

Firstly, IBM's docs claim that, by default, each application server instance
has
a WAR class loader policy in which a different class loader is used for each
WAR file.
This is not true: I checked my local server (installed with Rational
Software Architect),
dev, QA and prod servers. All of them were set to using a single class
loader for all
WARs within an enterprise application. I was not asked how to set this
policy when I
installed RSA on my machine.

Secondly, there seems to be a bug that prevents changing the WAR class
loader policy
when working within RSA. That is, that policy setting was in read only mode
when 
displayed in the WebSphere admin console (aka the Integrated Solutions
Console).
The solution seems to be as follows:

1) In RSA, double click on the WebSphere 6.1 server displayed in the Servers
view;
this opens the Server Overview window.
2) In the Server Overview window, go to the Publishing section and uncheck
the
Minimize application files copied to the server setting.
3) Save the change.
4) Restart the server.
5) Start the admin console.
6) Select an enterprise application,
7) Click Class loading and update detection
8) Set the WAR class loader policy to Class loader for each WAR file in
application
9) Apply and save the change.

-- 
View this message in context: 
http://www.nabble.com/1-EAR%2C-2-WARs-causes-Spring-Context-Problem-tp25684384p25696859.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



1 EAR, 2 WARs causes Spring Context Problem

2009-09-30 Thread Steve Hiller
Hi All,

I'm not sure if this is a Wicket, Spring or WebSphere issue or some combination 
of the 3.

General Setup:
WebSphere 6.1, wicket 1.3.7, Spring 2.5.6

Specific Setup:
1 EAR contains 2 WARs, call them WAR1 and WAR2.
Each WAR uses the Wicket  Spring frameworks.
The EAR is deployed to WebSphere -- each WAR's deployment descriptor
uses the WicketServlet and SpringContextLoaderServlet to control their 
respective frameworks
(see 
http://cwiki.apache.org/WICKET/websphere.html#Websphere-WicketServletratherthanWicketFilter)
Each WAR holds its Spring application configuration file 
(applicationContext.xml) under its WEB-INF directory.
Each applicationContext.xml file wires up a service bean.
The service beans are for two completely different classes, call them Service1 
(in WAR1) and Service2 (in WAR2).

Problem:
If I run the WAR1 web application first, then it successfully uses its Service1 
bean.
But, if I then run the WAR2 web application, it cannot find its Service2 bean.
This also happens in reverse order. That is, if I run the WAR2 web application 
first, then it
successfully uses its Service2 bean, but then running the WAR1 application 
fails to find
its Service1 bean. The failure exception is like:

  java.lang.IllegalStateException: bean of type [war1.Service1] not found
at 
org.apache.wicket.spring.SpringBeanLocator.getBeanNameOfClass(SpringBeanLocator.java:107)
at 
org.apache.wicket.spring.SpringBeanLocator.getBeanName(SpringBeanLocator.java:192)
at 
org.apache.wicket.spring.SpringBeanLocator.isSingletonBean(SpringBeanLocator.java:133)
at 
org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.getFieldValue(AnnotProxyFieldValueFactory.java:90)
at org.apache.wicket.injection.Injector.inject(Injector.java:108)
at 
org.apache.wicket.injection.ConfigurableInjector.inject(ConfigurableInjector.java:39)

Has anyone come across this issue before?

Thanks,
Steve


Re: 1 EAR, 2 WARs causes Spring Context Problem

2009-09-30 Thread Martin Sachs
Hi, you have to user a classloader per Webapp, so the InjectorHolder has
for each webapp the correct Springcontext. (injectorholder uses a static
variable)

martin

Steve Hiller schrieb:
 Hi All,

 I'm not sure if this is a Wicket, Spring or WebSphere issue or some 
 combination of the 3.

 General Setup:
 WebSphere 6.1, wicket 1.3.7, Spring 2.5.6

 Specific Setup:
 1 EAR contains 2 WARs, call them WAR1 and WAR2.
 Each WAR uses the Wicket  Spring frameworks.
 The EAR is deployed to WebSphere -- each WAR's deployment descriptor
 uses the WicketServlet and SpringContextLoaderServlet to control their 
 respective frameworks
 (see 
 http://cwiki.apache.org/WICKET/websphere.html#Websphere-WicketServletratherthanWicketFilter)
 Each WAR holds its Spring application configuration file 
 (applicationContext.xml) under its WEB-INF directory.
 Each applicationContext.xml file wires up a service bean.
 The service beans are for two completely different classes, call them 
 Service1 (in WAR1) and Service2 (in WAR2).

 Problem:
 If I run the WAR1 web application first, then it successfully uses its 
 Service1 bean.
 But, if I then run the WAR2 web application, it cannot find its Service2 bean.
 This also happens in reverse order. That is, if I run the WAR2 web 
 application first, then it
 successfully uses its Service2 bean, but then running the WAR1 application 
 fails to find
 its Service1 bean. The failure exception is like:

   java.lang.IllegalStateException: bean of type [war1.Service1] not found
 at 
 org.apache.wicket.spring.SpringBeanLocator.getBeanNameOfClass(SpringBeanLocator.java:107)
 at 
 org.apache.wicket.spring.SpringBeanLocator.getBeanName(SpringBeanLocator.java:192)
 at 
 org.apache.wicket.spring.SpringBeanLocator.isSingletonBean(SpringBeanLocator.java:133)
 at 
 org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.getFieldValue(AnnotProxyFieldValueFactory.java:90)
 at org.apache.wicket.injection.Injector.inject(Injector.java:108)
 at 
 org.apache.wicket.injection.ConfigurableInjector.inject(ConfigurableInjector.java:39)
 
 Has anyone come across this issue before?

 Thanks,
 Steve

   


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