Installing/Uninstalling spring-security-eventlog-0.3 - grails

I am having some trouble setting up spring security in my application so I tried to install spring-security-eventlog-0.3 in order to see the logs and understand what the hell is going on :))))
I added this line in BuildConfig.groovy
compile ":spring-security-eventlog:0.3"
When I hit run-app I get this very beautiful message
SpringSecurityEventlogGrailsPlugin.groovy: 3: unable to resolve class org.codehaus.groovy.grails.plugins.springsecurity.SpringSecurityUtils
# line 3, column 1.
import org.codehaus.groovy.grails.plugins.springsecurity.SpringSecurityUtils
^
SpringSecurityEventlogGrailsPlugin.groovy: 2: unable to resolve class org.codehaus.groovy.grails.plugins.springsecurity.SecurityEventListener
# line 2, column 1.
import org.codehaus.groovy.grails.plugins.springsecurity.SecurityEventListener
The run failed. I decided to remove it because I didn't feel like spending hours for that. The thing is that even though I removed the line from BuildConfig, it tries to install it every single time! I even went in my hard disk's path and removed the folder. Even though it installs it every time and fails of course.
Could you please suggest me a solution on this? I would prefer to keep the plugin and be able to have the spring security logs. If it is not possible for some reason, I would like to be able to remove it.

As mentioned in the comments, that plugin depends on version 1.2.x of the core plugin, so you either need to downgrade to 1.2.7.3, or wait until the eventlog plugin is updated to use the 2.0 plugin.
I updated the plugin and sent a pull request, and hopefully the author will release an updated version soon. Feel free to bug him about this if he doesn't :)

Related

Need to restart Grails after controller changes [duplicate]

It looks like IntelliJ's (Ultimate EAP 15) support for Grails 3 is in the early stages yet. If I do Run -> Debug 'Grails:My App', I'm able to launch an app from inside IntelliJ, I can set breakpoints and it works as expected.
If I make changes however, I see in the console that the file is recompiled, but when I hit reload in the browser, I don't see the changes reflected there. I have to stop and restart the app in IntelliJ before I see them. Anyone know how I can get the auto-reloading working?
After chasing this for a week, this post finally provided an explanation.
It's actually a Grails issue, not a problem with IntelliJ's Grails integration: spaces in a file's path will break automatic reloading. Renaming my project from Grails Demo to GrailsDemo got everything straighted out. (Storing a project in a folder like My Documents will also cause trouble.) The post's author indicates that this started with version 2.4.4 and it's still happening for me in 3.0.4.

neo4j-APOC plugin stopped working

Plugin APOC was working for me for a long time which means I have it copied at right place and I have edited config file correctly. But today I needed to create same graph on different data set so I stopped neo4j service, removed database directy, restarted it, changed password then copied plugins directory in neo4j directory(as I'm not using shell) and again restarted neo4j serivice. Then tried to execute the same query again and got error messgae.
There is no procedure with the name apoc.create.relationship registered for this database instance. and the query I'm using is as following
CALL apoc.create.relationship(n, network.connection, {}, m) yield rel
I have made following change based on a stackoverflow post,
uncommented following line
#dbms.directories.plugins=plugins
and added plugin directory path, restarted service even restarted system but still not working. I have done this(removing neo4j directory...) in past multiple times but this has never happened to me. Even I have tried replacing old apoc.jar with newly downloaded one before. I have neo4j3.3.0 with apoc3.3.0.1jar with windows10. Can anybody tell me what have I done wrong this time? Thanks in advance.
EDIT 1: when I uncomment above line in config file my other plugins also stop working but after commenting it other plugins like graph algorithms are working but not APOC
Since you are using APOC procedures and graph algorithms, I think you have configured your config file this way:
dbms.security.procedures.unrestricted=algo.*
dbms.security.procedures.unrestricted=apoc.*
If it is the case, change these lines to:
dbms.security.procedures.unrestricted=algo.*,apoc.*
I really don't know what the problem was, I uninstalled it with logs and config files, downloaded latest version which didn't pose any headaches of editing config file for csv files and for plugins and it worked.
If someone is reading this question and has done everything correctly. Set the correct permissions on the plugins directory, uncommented the whitelisted and unrestricted sections of the /etc/neo4j.conf, checked if the version of the Apoc jar you're loading is the same version as neo4j, etc. and can't make it work.
Try to restart your PC, that was what did it for me, for some weird reason.

Web app reload issue in Groovy/Grails Tool Suite

I have ggts-bundle bundle 3.6.1 64 bit with JDK 7 (jdk1.7.0_67) on Win7 64bit.
I have grails home setup as GRAILS_HOME and grails version grails-2.4.3.
When i create a new action/method in the controller class in the tool suite and hit save and refresh the browser, it doesn't reload the changes in the application.
I even modified BuildConfig.groovy and added the following
grails.reload.enabled = true
I also tried with grails -reloading run-app
Nothing seem to reload the changes, I have to stop the server and restart it and then
it reflects the changes.
I am sure there's something i can do to have it reload the app.
I read online and tried other suggestion in questions on stackoverflow before i posted this.
Any suggestions.
Did you end up getting a solution to this?
I've just tried this out in GGTS and it looks like there is no problem.
Version: 3.6.3.RELEASE
Build Id: 201411281415
Platform: Eclipse Luna SR1 (4.4.1)
OS: Win7 64bit
I'm working on a plain vanilla (unmodified) install with default settings.
Using a simple Grails project, with a simple HelloController.groovy and a couple of GSPs... corresponding to two methods inside the controller. Launch the server...
Tried out two scenarios to see what happened, back in the IDE...
modify some simple output text in one of the GSPs, save, refresh the browser... yep, no problem, the change shows up
modify the HelloController.groovy to tell one of the methods to use a different GSP, save, refresh the browser... again, no problems, the change is reflected.
Note. I did have to wait a few seconds in scenario 2 for the IDE to notice the change and to recompile
Perhaps try updating your instance of GGTS to the latest release to see if that makes a difference?
Hope this helps.

Spring Roo RooEntity and RooJpaActiveRecord

I am a novice with Spring.
I am looking to resolve conflicts between #RooEntity and #RooJpaActiveRecord. I have used the typicalsecurity addon to an existing project which used more recent versions of Roo (#RooJpaActiveRecord). I was wondering if there's a workaround or a specific way to address this issue. I am not able to run the project on the internal web browser. I receive the HTTP Status 404 error.
Any help or suggestions would be greatly appreciated!
#RooEntity is no longer the annotation that you have to use.
Replace it with #RooJpaActiveRecord and run the Roo shell again.
Regarding the web project, the annotations belongs to the spring-roo-annotations.jar (or something like that) that maven puts in your WEB-INF/lib folder when deploying the war application.
You need to have the appropriate jar dependency (I mean, the correct version) depending on the annotation that you have in your code.
In order to see more explanation, maybe you can provide your server stack trace.

Grails: refresh dependencies

I am using STS and sometimes when I stop my app on a crash it opens up to a hundred different class files that seem to be deep deep inner working stuff. HTTPBuilder just stopped working, and I suspect its because I accidentally typed in one of these files and absent mindedly saved it. If I somehow destroyed a local file involved in HTTPBuilder, how would I refresh my dependencies? (have done install-plugin rest and also uncommented everything in BuildConfig.groovy repositories)
My specific problem and error is here:
Grails: HTTPBuilder stopped working suddenly
UPDATE: As much as I would love to blame STS, as you can see from my answer to my own other question, I was purely thwarted by my own carelessness.
We had an issue today that we suspect was due to the Artifactory Migration. Your problem may be similar. The first thing we did to diagnose the issue was to turn up the debug logging in BuildConfig.groovy (change log "warn" to log "debug"). Once we did that, it was evident that the Grails repos in Artifactory appear to be responding differently to queries made to calculate dependencies. To workaround these issues, we:
Removed grailsCentral, grailsHome, and grailsPlugins from BuildConfig
Added grailsRepo "http://grails.org/plugins" to BuildConfig
Changed one of our dependencies so that its transitive dependencies used specific versions instead of version ranges.
For 3, our specific example was to change:
runtime 'com.amazonaws:aws-java-sdk:1.3.4'
to
runtime 'com.amazonaws:aws-java-sdk:1.3.4', {
excludes "commons-logging",
"httpclient", "jackson-core-asl", "jackson-mapper-asl"
}
runtime 'org.codehaus.jackson:jackson-core-asl:1.7.9' {
configurationmapping "*->*,!sources,!javadoc"
}
runtime 'org.codehaus.jackson:jackson-mapper-asl:1.7.9' {
configurationmapping "*->*,!sources,!javadoc"
}
I'm not sure whether all of these steps were necessary, but they allowed us to move forward.

Resources