GWT 1.6 + Spring Security issue

164 views
Skip to first unread message

tim.clymer

unread,
May 12, 2009, 8:43:10 AM5/12/09
to Google Web Toolkit
I've been seeing a strange issue when attempting to use GWT with
Spring Security as described here:
http://code.google.com/p/gwt-incubator-lib/

I can deploy the application as a war and run it just fine in Tomcat,
however when I try to run it in hosted mode with jetty I get the
following error:

org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for
XML schema namespace [http://www.springframework.org/schema/security]
Offending resource: ServletContext resource [/WEB-INF/aop-
applicationContext.xml]

I've posted this to the Spring forums and they mention it's a
classpath issue, that there may be more than one instance of the
Spring Security jars on my classpath. I've double-checked my jars and
this doesn't seem to be an issue (especially since I package them with
my app and it works fine). I'm wondering if somehow jetty or GWT is
using a class that might be interfering with the resolution of the
namespace. Prior to incorporating security in my app it was running
fine in hosted mode, even with other Spring beans, so this makes me
think it's related to Spring Security (and not just Spring itself)
somehow.

Any ideas?

Arthur Kalmenson

unread,
May 13, 2009, 9:38:47 AM5/13/09
to Google-We...@googlegroups.com
It could very well be. When running a more complex server side (i.e.
with Spring Security, etc), it's usually recommended that you use
-noserver. In GWT 1.5 with the Google Code gwt-maven plugin, you could
set it up to automatically copy configurations over to the embedded
Tomcat. I'm not sure how it works in 1.6.

--
Arthur Kalmenson

tim.clymer

unread,
May 14, 2009, 8:49:06 AM5/14/09
to Google Web Toolkit
Thanks for the tip. I think I may try that just to avoid having to
redeploy every time I want to test.

Can anyone who's familiar with the inner workings of GWT speak as to
why this may be happening?

Tim

On May 13, 8:38 am, Arthur Kalmenson <arthur.k...@gmail.com> wrote:
> It could very well be. When running a more complex server side (i.e.
> withSpringSecurity, etc), it's usually recommended that you use
> -noserver. InGWT1.5 with the Google Codegwt-maven plugin, you could
> set it up to automatically copy configurations over to the embedded
> Tomcat. I'm not sure how it works in 1.6.
>
> --
> Arthur Kalmenson
>
> On Tue, May 12, 2009 at 8:43 AM, tim.clymer <tim.cly...@gmail.com> wrote:
>
> > I've been seeing a strange issue when attempting to useGWTwith
> >SpringSecurity as described here:
> >http://code.google.com/p/gwt-incubator-lib/
>
> > I can deploy the application as a war and run it just fine in Tomcat,
> > however when I try to run it in hosted mode with jetty I get the
> > following error:
>
> > org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
> > Configuration problem: Unable to locateSpringNamespaceHandler for
> > XML schema namespace [http://www.springframework.org/schema/security]
> > Offending resource: ServletContext resource [/WEB-INF/aop-
> > applicationContext.xml]
>
> > I've posted this to theSpringforums and they mention it's a
> > classpath issue, that there may be more than one instance of the
> >SpringSecurity jars on my classpath.  I've double-checked my jars and
> > this doesn't seem to be an issue (especially since I package them with
> > my app and it works fine).  I'm wondering if somehow jetty orGWTis
> > using a class that might be interfering with the resolution of the
> > namespace.  Prior to incorporating security in my app it was running
> > fine in hosted mode, even with otherSpringbeans, so this makes me

Salvador Diaz

unread,
May 14, 2009, 10:08:13 AM5/14/09
to Google Web Toolkit
Could you share more information with us ? It'll be difficult to help
without knowing your project structure, the tools you're using
(eclipse ? maven ? GEP ? ant ? netbeans), and how you're launching/
debugging your project.

Cheers,

Salvador

tim.clymer

unread,
May 14, 2009, 3:36:44 PM5/14/09
to Google Web Toolkit
Sure. I'm using Maven2 for my dependency management and project
structure, though I do have my spring config files and web.xml in the
GWT /war directory to simplify hosted mode. I use Eclipse 3.4.2 as my
development IDE. I'm using the latest GWT 1.6 release and these are
my spring dependencies:

<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core-tiger</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>net.entropysoft.transmorph</groupId>
<artifactId>transmorph</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.5.3</version>
</dependency>

Basically, I'm trying to use the latest of everything. Hope this
helps, and thanks for your help.

Tim

tim.clymer

unread,
Jun 2, 2009, 9:58:26 AM6/2/09
to Google Web Toolkit
As a follow up, I switched to -noserver mode and it works just fine
now. Must've been a conflict with running it in the bundled jetty.
Thanks for the tips!

On May 14, 2:36 pm, "tim.clymer" <tim.cly...@gmail.com> wrote:
> Sure.  I'm using Maven2 for my dependency management and project
> structure, though I do have myspringconfig files and web.xml in the
> > > > > namespace.  Prior to incorporatingsecurityin my app it was running

olivier nouguier

unread,
Sep 30, 2009, 8:20:20 AM9/30/09
to Google-We...@googlegroups.com
hi
I add the same issues with all namespace handler (aop, sec etc).
As a workaround I found the copy the spring jar (spring-aop, ...) solved the problem for the hosted mode.
HTH
--
A coward is incapable of exhibiting love; it is the prerogative of the brave.
--
Mohandas Gandhi

olivier nouguier

unread,
Sep 30, 2009, 8:21:36 AM9/30/09
to Google-We...@googlegroups.com
Sorry send to fast ...


hi
I add the same issues with all namespace handler (aop, sec etc).
As a workaround I found that copying the spring jar (spring-aop, ...) in the war/WEB-INF/lib solved the problem for the hosted mode.
HTH

Michał Sędzielewski

unread,
Oct 11, 2009, 6:08:57 AM10/11/09
to Google Web Toolkit
Any other workaround for this? I want to keep my source tree clean and
followed http://blog.salvadordiaz.fr/2009/04/29/keep-your-source-tree-clean-gwt/
but I every time I lunch hm I get

Configuration problem: Unable to locate Spring NamespaceHandler for
Offending resource: class path resource [applicationContext-
security.xml]

On 30 Wrz, 14:21, olivier nouguier <olivier.nougu...@gmail.com> wrote:
> Sorry send to fast ...
>
> hi
> I add the same issues with all namespace handler (aop, sec etc).
> As a workaround I found that copying the spring jar (spring-aop, ...) in the
> war/WEB-INF/lib solved the problem for the hosted mode.
> HTH
>
> On Wed, Sep 30, 2009 at 2:20 PM, olivier nouguier <
>
>
>
>
>
> olivier.nougu...@gmail.com> wrote:
> > hi
> > I add the same issues with all namespace handler (aop, sec etc).
> > As a workaround I found the copy the spring jar (spring-aop, ...) solved
> > the problem for the hosted mode.
> > HTH
>
Reply all
Reply to author
Forward
0 new messages