Esbach, Brandon wrote:
First thing to check: Are you logged in as admin or a standard user? And do you definitely have programming rights if you're a standard user?
Checked! I have been running the scripts as an admin user.
Second thing to check: Could be an older version of Groovy in xwiki than what you're testing with in your scripts. I know this sort of scripting worked fine back with the Beta v1.0 of xwiki (haven't had the need for such scripts since), as I had to make use of it. I am using XWiki 1.2-milestone-1.5235. I've tried to substitute groovy-all-1.0-jsr-06.jar by the groovy-all-1.0.jar embeddable jar coming with the binary distribution I'm installed here but it seems that it won't be that easy. I get the same results: no row is printed for iterations.
Any idea? As far as I've understood Harikrishnan has succeed at accessing MySQL databases others than XWiki one. Please, could you get the following script working? <% import groovy.sql.Sql; println "This is a sample to access epec in *mire*" def sendSQL = Sql.newInstance("jdbc:mysql://mire.environmentalchange.net/epec", "epec_ReadOnly", "epec_ReadOnly", "com.mysql.jdbc.Driver") sendSQL.eachRow("SELECT * FROM epec.spot s") {row ->println "${row.code}"} %> Here the output I get in XWiki: This is a sample to access epec in mire Here the output I get in Groovy Console: This is a sample to access epec in *mire* AGÑ BAG BLA BDX BPA BUI CAD CDL CPD LUZ MII MIM PDC PNV PVO PZC QXI SUA ACB SVT I get an error while trying the access XWiki.org Sandbox to test the code... javax.servlet.ServletException: com.xpn.xwiki.XWikiException: Error number 3202 in 3: Exception while reading document XWiki.XWikiPreferences Any new idea will be welcome!!! Thanks! -- Ricardo Rodríguez Your XEN ICT Team