On 11/02/2011 11:40, "Grégory Joseph" <[email protected]>
wrote:
>
>
>On 11 Feb 2011, at 17:18, Rakesh Vidyadharan wrote:
>
>> I was trying to move some of our Groovy classes into the scripts area
>>using the groovy module. Some classes were created fine, but some
>>others fail with weird error messages (groovyc successfully compiles all
>>the classes of course). Here are a couple of issues I ran into:
>>
>> package ucp.importer
>>
>> class AwardsConnection extends DatabaseConnection
>> {
>> AwardsConnection()
>> {
>> // code snipped
>> }
>> }
>>
>> I attempted to create the above under the /ucp/importer folder as
>>AwardsConnection. I keep getting an error
>>"ucp.importer.AwardsConnection should declare at least one class
>>AwardsConnection". I obviously have one in the file. Same error for a
>>few other groovy classes I attempted to place under this folder.
>
>Have you tried making the class public ? It should not be mandatory, but
>eh, that might be a bug.
No effect. As I mentioned in my follow up message, the only way to get it
to compile is to remove the extends DatabaseConnection declaration.
>
>> Another issue:
>>
>> I have a few classes under ucp.scripts.blog package that I was trying
>>to load into the repository. I created the directory structure, but
>>have been unable to import any classes into this folder. Example
>>
>> package ucp.scripts.blog
>>
>> import ucp.blog.bean.Statistics
>> import ucp.blog.books.importer.BlogConnection
>> import ucp.blog.books.press.PressBlogImporter
>> import ucp.scripts.RepositoryConfiguration
>>
>> class ImportPress extends RepositoryConfiguration
>> {
>> static void main( String[] args )
>> {
>> ImportPress importer = new ImportPress()
>> importer.run new Statistics()
>> }
>> }
>>
>> The error message I get is "ImportPress compilation failed: class
>>package 'ucp.scripts.' does not match parent node '/ucp/books/blog' path
>>in the repository. Once again, the package declaration has the full
>>ucp.scripts.blog,
>
>But where is the corresponding node in your tree ? The error message
>seems to indicate it's under /ucp/books/blog, where it should be matching
>the package name, i.e /ucp/scripts/blog
The node path was /ucp/scripts/blog. I am not sure where the
/ucp/books/blog part came from. Funnily enough, this issue went away
after I went back to packing all the groovy classes into our module jar
file.
>
>> but the magnolia groovy class loader seems to have issues with reading
>>the full line.
>>
>> Any ideas on what the core issue may be? I could not find any other
>>log messages, stacktraces or other information.
>>
>> Also, I am bit unclear from the documentation on the script dialog.
>>Will these over-ride compiled groovy class files in our jar files? To
>>be safe, I removed these from our jar file, but wanted to know whether
>>the class loader will use the newer versions from the repository rather
>>than from the jar file.
>
>Yeah, the classes found in the repo will be used, unless you uncheck the
>"enabled" checkbox.
That is what I was hoping for. Is the GroovyClassLoader activated for all
requests? Currently I have all our commands (almost exclusively run as
cron jobs) and their support classes as Groovy classes. I was hoping to
move all these classes into the scripts area, so we can manage these
without requiring a server restart.
>
>>
>> Thanks
>> Rakesh
>>
>>
>> ----------------------------------------------------------------
>> For list details see
>> http://www.magnolia-cms.com/home/community/mailing-lists.html
>> To unsubscribe, E-mail to: <[email protected]>
>> ----------------------------------------------------------------
>
>
>
>----------------------------------------------------------------
>For list details see
>http://www.magnolia-cms.com/home/community/mailing-lists.html
>To unsubscribe, E-mail to: <[email protected]>
>----------------------------------------------------------------
>
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------