ClassNotFound with Spring Security Plugin

View: New views
8 Messages — Rating Filter:   Alert me  

ClassNotFound with Spring Security Plugin

by Dirty Henry :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi everyone,

I'm getting an error when trying to launch a grails app with the Spring Security Plugin :

java.lang.ClassNotFoundException: DefaultSecurityConfig
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at AcegiGrailsPlugin$_closure17.doCall(AcegiGrailsPlugin.groovy:808)
        at _GrailsPackage_groovy$_run_closure5_closure17.doCall(_GrailsPackage_groovy:193)
        at _GrailsPackage_groovy$_run_closure5_closure17.doCall(_GrailsPackage_groovy)
        at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:274)
        at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
        at _GrailsPackage_groovy$_run_closure5.doCall(_GrailsPackage_groovy:191)
        at _GrailsPackage_groovy$_run_closure2.doCall(_GrailsPackage_groovy:129)
        at RunApp$_run_closure1.doCall(RunApp.groovy:28)
        at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324)
        at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334)
        at gant.Gant$_dispatch_closure6.doCall(Gant.groovy)
        at gant.Gant.withBuildListeners(Gant.groovy:344)
        at gant.Gant.this$2$withBuildListeners(Gant.groovy)
        at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
        at gant.Gant.dispatch(Gant.groovy:334)
        at gant.Gant.this$2$dispatch(Gant.groovy)
        at gant.Gant.invokeMethod(Gant.groovy)
        at gant.Gant.processTargets(Gant.groovy:495)
        at gant.Gant.processTargets(Gant.groovy:480)
Error generating web.xml file: DefaultSecurityConfig

But when I access ...\Documents and Settings\{myname}\.grails\1.1.1\projects\{my-project}\classes, I DO get DefaultSecurityConfig.class.

I've just set the files as the plugin documentation says it :
- DefaultSecurityConfig.groovy into /plugins/acegi-0.5.2/grails-app/conf/
- SecurityConfig.groovy into /grails-app/conf/

Thanks for your help !

Re: ClassNotFound with Spring Security Plugin

by Burt Beckwith :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm not sure what you mean by this:

>I've just set the files as the plugin documentation says it :
>- DefaultSecurityConfig.groovy into /plugins/acegi-0.5.2/grails-app/conf/
>- SecurityConfig.groovy into /grails-app/conf/

Are you saying that you copied the files to those locations? That's where they should already have been. DefaultSecurityConfig.groovy is in the plugin's conf directory after installing the plugin, and SecurityConfig.groovy gets created in your project's conf folder after you run "grails create-auth-domains User Role Requestmap" after installing the plugin.

Burt

>
> Hi everyone,
>
> I'm getting an error when trying to launch a grails app with the Spring
> Security Plugin :
>
> java.lang.ClassNotFoundException: DefaultSecurityConfig
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>         at AcegiGrailsPlugin$_closure17.doCall(AcegiGrailsPlugin.groovy:808)
>         at
> _GrailsPackage_groovy$_run_closure5_closure17.doCall(_GrailsPackage_groovy:193)
>         at
> _GrailsPackage_groovy$_run_closure5_closure17.doCall(_GrailsPackage_groovy)
>         at
> _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:274)
>         at
> _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
>         at
> _GrailsPackage_groovy$_run_closure5.doCall(_GrailsPackage_groovy:191)
>         at
> _GrailsPackage_groovy$_run_closure2.doCall(_GrailsPackage_groovy:129)
>         at RunApp$_run_closure1.doCall(RunApp.groovy:28)
>         at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324)
>         at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334)
>         at gant.Gant$_dispatch_closure6.doCall(Gant.groovy)
>         at gant.Gant.withBuildListeners(Gant.groovy:344)
>         at gant.Gant.this$2$withBuildListeners(Gant.groovy)
>         at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
>         at gant.Gant.dispatch(Gant.groovy:334)
>         at gant.Gant.this$2$dispatch(Gant.groovy)
>         at gant.Gant.invokeMethod(Gant.groovy)
>         at gant.Gant.processTargets(Gant.groovy:495)
>         at gant.Gant.processTargets(Gant.groovy:480)
> Error generating web.xml file: DefaultSecurityConfig
>
> But when I access ...\Documents and
> Settings\{myname}\.grails\1.1.1\projects\{my-project}\classes, I DO get
> DefaultSecurityConfig.class.
>
> I've just set the files as the plugin documentation says it :
> - DefaultSecurityConfig.groovy into /plugins/acegi-0.5.2/grails-app/conf/
> - SecurityConfig.groovy into /grails-app/conf/
>
> Thanks for your help !
>


signature.asc (204 bytes) Download Attachment

Re: ClassNotFound with Spring Security Plugin

by Dirty Henry :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

up...

Re: ClassNotFound with Spring Security Plugin

by Müller, Wolfgang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Do you do run-app or run-war? I once ran into a class loader problem with grails that got solved by doing run-war.
Cheers,
Wolfgang

On Tue, Nov 3, 2009 at 2:35 PM, Dirty Henry <dirtyhenry@...> wrote:

up...
--
View this message in context: http://old.nabble.com/ClassNotFound-with-Spring-Security-Plugin-tp26157724p26160119.html
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




Re: ClassNotFound with Spring Security Plugin

by Dirty Henry :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Müller, Wolfgang wrote:
Do you do run-app or run-war? I once ran into a class loader problem with
grails that got solved by doing run-war.
I did both... But I had the same issue both times.

Burt Beckwith wrote:
I'm not sure what you mean by this:

>I've just set the files as the plugin documentation says it :
>- DefaultSecurityConfig.groovy into /plugins/acegi-0.5.2/grails-app/conf/
>- SecurityConfig.groovy into /grails-app/conf/

Are you saying that you copied the files to those locations?
No, what I meant was that I left these files where they were supposed to be by default.

Re: ClassNotFound with Spring Security Plugin

by Mihai Cazacu-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Attach a sample project to your message.

Re: ClassNotFound with Spring Security Plugin

by caman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Getting the same issue. Upgraded 1.1 project to 1.1.2. Everything compiles ok but run-app/run-war throw this error.

Any solution so far? Don't see an attachment from OP, so assume that it's unresolved.

thanks

Mihai Cazacu-2 wrote:
Attach a sample project to your message.

Re: ClassNotFound with Spring Security Plugin

by caman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Finally figured.
Hope this helps someone. I had this class 'org.grails.plugins.springsecurity.service.AuthenticateService' in another jar file in my classpath. Most likely a class file conflict.
Removed the jar file and problem went away. Will report if anything.




Thanks