MultiTenant 0.8 not compiling

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

MultiTenant 0.8 not compiling

Felipe Cypriano
Hello,

After I upgrade the plugin I'm getting these compiler error:

Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, \plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy: 3: unable to resolve class tenant.DomainTenantMap
 @ line 3, column 1.
   import tenant.DomainTenantMap
   ^
\plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy: 39: unable to resolve class tenant.DomainTenantMap
 @ line 39, column 17.
         hosts.put(map.domainName, map.mappedTenantId)
                   ^
\plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy: 39: unable to resolve class tenant.DomainTenantMap
 @ line 39, column 33.
         hosts.put(map.domainName, map.mappedTenantId)


The class tenant.DomainTenantMap was removed from this version and its creation needs to execute a script, but the DomainNameDatabaseTenantResolver always looks for the class. It's necessary to remove the direct reference. What about instead of pointing direct to DomainTenantMap change the lines 37 e 38 of  DomainNameDatabaseTenantResolver.groovy to:

    Collection list = DomainTenantMap.findAll("from tenant.DomainTenantMap");
    list.each {map ->

and let groovy access the method and properties dynamically?

This is what I did:
  1. Upgrade the plugin
  2. Execute grails clean
  3. Run test-app

Regards,
---
Felipe Marin Cypriano
Vitória - ES
Reply | Threaded
Open this post in threaded view
|

Re: MultiTenant 0.8 not compiling

Eric Martineau
Crap!  Must have forgotten to clean before I released... 

While your solution will compile, won't it break at runtime?  The DomainTenantMap class is in the package tenant, so you'll get a missing property exception.  If you try to import, the code won't compile.

Thanks for looking into it, I'll churn on it a bit.

Eric

On Fri, May 22, 2009 at 10:12 AM, Felipe Cypriano <[hidden email]> wrote:
Hello,

After I upgrade the plugin I'm getting these compiler error:

Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, \plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy: 3: unable to resolve class tenant.DomainTenantMap
 @ line 3, column 1.
   import tenant.DomainTenantMap
   ^
\plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy: 39: unable to resolve class tenant.DomainTenantMap
 @ line 39, column 17.
         hosts.put(map.domainName, map.mappedTenantId)
                   ^
\plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy: 39: unable to resolve class tenant.DomainTenantMap
 @ line 39, column 33.
         hosts.put(map.domainName, map.mappedTenantId)


The class tenant.DomainTenantMap was removed from this version and its creation needs to execute a script, but the DomainNameDatabaseTenantResolver always looks for the class. It's necessary to remove the direct reference. What about instead of pointing direct to DomainTenantMap change the lines 37 e 38 of  DomainNameDatabaseTenantResolver.groovy to:

    Collection list = DomainTenantMap.findAll("from tenant.DomainTenantMap");
    list.each {map ->

and let groovy access the method and properties dynamically?

This is what I did:
  1. Upgrade the plugin
  2. Execute grails clean
  3. Run test-app

Regards,
---
Felipe Marin Cypriano
Vitória - ES

Reply | Threaded
Open this post in threaded view
|

Re: MultiTenant 0.8 not compiling

Felipe Cypriano
Oops, my solution wont work either. I was just guessing a solution, my bad.

In the other thread when I said that Acegi plugin creates the domain class using scripts, I think it's possible because the acess to the class is configured in Config.groovy. I can say which is class representes a User and which properties of that class refers to password and etc But I never looked into it to see how it's implemented.

Meanwhile, is it possible to to create that resolver togheter with the script that creates the domain class?

---
Felipe Marin Cypriano
Vitória - ES


On Fri, May 22, 2009 at 2:23 PM, Eric Martineau <[hidden email]> wrote:
Crap!  Must have forgotten to clean before I released... 

While your solution will compile, won't it break at runtime?  The DomainTenantMap class is in the package tenant, so you'll get a missing property exception.  If you try to import, the code won't compile.

Thanks for looking into it, I'll churn on it a bit.

Eric


On Fri, May 22, 2009 at 10:12 AM, Felipe Cypriano <[hidden email]> wrote:
Hello,

After I upgrade the plugin I'm getting these compiler error:

Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, \plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy: 3: unable to resolve class tenant.DomainTenantMap
 @ line 3, column 1.
   import tenant.DomainTenantMap
   ^
\plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy: 39: unable to resolve class tenant.DomainTenantMap
 @ line 39, column 17.
         hosts.put(map.domainName, map.mappedTenantId)
                   ^
\plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy: 39: unable to resolve class tenant.DomainTenantMap
 @ line 39, column 33.
         hosts.put(map.domainName, map.mappedTenantId)


The class tenant.DomainTenantMap was removed from this version and its creation needs to execute a script, but the DomainNameDatabaseTenantResolver always looks for the class. It's necessary to remove the direct reference. What about instead of pointing direct to DomainTenantMap change the lines 37 e 38 of  DomainNameDatabaseTenantResolver.groovy to:

    Collection list = DomainTenantMap.findAll("from tenant.DomainTenantMap");
    list.each {map ->

and let groovy access the method and properties dynamically?

This is what I did:
  1. Upgrade the plugin
  2. Execute grails clean
  3. Run test-app

Regards,
---
Felipe Marin Cypriano
Vitória - ES


Reply | Threaded
Open this post in threaded view
|

Re: MultiTenant 0.8 not compiling

Eric Martineau

Meanwhile, is it possible to to create that resolver togheter with the script that creates the domain class?
I started down that thought path, but then everything that depends on the resolver fails to compile... :)

I think I can solve it through spring, but I'm having issues now with the create-dns-map script.  The script moves a template DomainTenantMap file from the plugin's script folder to the appropriate location "grails-app/domain/tenant" when run.  However, when the script is run on a target grails-app, it can't find the file because it can't locate the multi-tenant plugin directory. 

in CreateDnsMap.groovy:

ant.copy(file: 'scripts/resources/DomainTenantMap.tocopy', tofile: 'grails-app/domain/tenant/DomainTenantMap.groovy')

SHOULD be something like

ant.copy(file: '${pathToMultiTenantPlugin}/scripts/resources/DomainTenantMap.tocopy', tofile: 'grails-app/domain/tenant/DomainTenantMap.groovy')

Can you help? Or is there a better way to accomplish this?

Eric


---
Felipe Marin Cypriano
Vitória - ES


On Fri, May 22, 2009 at 2:23 PM, Eric Martineau <[hidden email]> wrote:
Crap!  Must have forgotten to clean before I released... 

While your solution will compile, won't it break at runtime?  The DomainTenantMap class is in the package tenant, so you'll get a missing property exception.  If you try to import, the code won't compile.

Thanks for looking into it, I'll churn on it a bit.

Eric


On Fri, May 22, 2009 at 10:12 AM, Felipe Cypriano <[hidden email]> wrote:
Hello,

After I upgrade the plugin I'm getting these compiler error:

Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, \plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy: 3: unable to resolve class tenant.DomainTenantMap
 @ line 3, column 1.
   import tenant.DomainTenantMap
   ^
\plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy: 39: unable to resolve class tenant.DomainTenantMap
 @ line 39, column 17.
         hosts.put(map.domainName, map.mappedTenantId)
                   ^
\plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy: 39: unable to resolve class tenant.DomainTenantMap
 @ line 39, column 33.
         hosts.put(map.domainName, map.mappedTenantId)


The class tenant.DomainTenantMap was removed from this version and its creation needs to execute a script, but the DomainNameDatabaseTenantResolver always looks for the class. It's necessary to remove the direct reference. What about instead of pointing direct to DomainTenantMap change the lines 37 e 38 of  DomainNameDatabaseTenantResolver.groovy to:

    Collection list = DomainTenantMap.findAll("from tenant.DomainTenantMap");
    list.each {map ->

and let groovy access the method and properties dynamically?

This is what I did:
  1. Upgrade the plugin
  2. Execute grails clean
  3. Run test-app

Regards,
---
Felipe Marin Cypriano
Vitória - ES



Reply | Threaded
Open this post in threaded view
|

Re: MultiTenant 0.8 not compiling

burtbeckwith
There's an under-documented plugin dir variable that you can use - replace 'pathToMultiTenantPlugin' with 'multiTenantPluginDir' which is the location of the installed plugin. These variables are available for all installed plugins so if you depend on another plugin you can access files in its install directory too.


Burt


On Friday 22 May 2009 2:48:55 pm Eric Martineau wrote:
> > Meanwhile, is it possible to to create that resolver togheter with the
> > script that creates the domain class?
> >
> I started down that thought path, but then everything that depends on the
> resolver fails to compile... :)
>
> I think I can solve it through spring, but I'm having issues now with the
> create-dns-map script. The script moves a template DomainTenantMap file
> from the plugin's script folder to the appropriate location
> "grails-app/domain/tenant" when run. However, when the script is run on a
> target grails-app, it can't find the file because it can't locate the
> multi-tenant plugin directory.
>
> in CreateDnsMap.groovy:
>
> ant.copy(file: 'scripts/resources/DomainTenantMap.tocopy', tofile:
> 'grails-app/domain/tenant/DomainTenantMap.groovy')
>
> SHOULD be something like
>
> ant.copy(file:
> '${pathToMultiTenantPlugin}/scripts/resources/DomainTenantMap.tocopy',
> tofile: 'grails-app/domain/tenant/DomainTenantMap.groovy')
>
> Can you help? Or is there a better way to accomplish this?
>
> Eric
>
> >
> >
> > ---
> > Felipe Marin Cypriano
> > Vitória - ES
> >
> >
> > On Fri, May 22, 2009 at 2:23 PM, Eric Martineau <[hidden email]>wrote:
> >
> >> Crap! Must have forgotten to clean before I released...
> >>
> >> While your solution will compile, won't it break at runtime? The
> >> DomainTenantMap class is in the package tenant, so you'll get a missing
> >> property exception. If you try to import, the code won't compile.
> >>
> >> Thanks for looking into it, I'll churn on it a bit.
> >>
> >> Eric
> >>
> >>
> >> On Fri, May 22, 2009 at 10:12 AM, Felipe Cypriano <[hidden email]>wrote:
> >>
> >>> Hello,
> >>>
> >>> After I upgrade the plugin I'm getting these compiler error:
> >>>
> >>> Caused by:
> >>> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
> >>> failed,
> >>> \plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy:
> >>> 3: unable to resolve class tenant.DomainTenantMap
> >>> @ line 3, column 1.
> >>> import tenant.DomainTenantMap
> >>> ^
> >>> \plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy:
> >>> 39: unable to resolve class tenant.DomainTenantMap
> >>> @ line 39, column 17.
> >>> hosts.put(map.domainName, map.mappedTenantId)
> >>> ^
> >>> \plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy:
> >>> 39: unable to resolve class tenant.DomainTenantMap
> >>> @ line 39, column 33.
> >>> hosts.put(map.domainName, map.mappedTenantId)
> >>>
> >>>
> >>> The class tenant.DomainTenantMap was removed from this version and its
> >>> creation needs to execute a script, but the DomainNameDatabaseTenantResolver
> >>> always looks for the class. It's necessary to remove the direct reference.
> >>> What about instead of pointing direct to DomainTenantMap change the lines 37
> >>> e 38 of DomainNameDatabaseTenantResolver.groovy to:
> >>>
> >>> Collection list = DomainTenantMap.findAll("from
> >>> tenant.DomainTenantMap");
> >>> list.each {map ->
> >>>
> >>> and let groovy access the method and properties dynamically?
> >>>
> >>> This is what I did:
> >>>
> >>> 1. Upgrade the plugin
> >>> 2. Execute grails clean
> >>> 3. Run test-app
> >>>
> >>>
> >>> Regards,
> >>> ---
> >>> Felipe Marin Cypriano
> >>> Vitória - ES
> >>>
> >>
> >>
> >
>


Reply | Threaded
Open this post in threaded view
|

Re: MultiTenant 0.8 not compiling

Eric Martineau
OK, I released a fix in version 0.9

On Fri, May 22, 2009 at 12:05 PM, Burt Beckwith <[hidden email]> wrote:
There's an under-documented plugin dir variable that you can use - replace 'pathToMultiTenantPlugin' with 'multiTenantPluginDir' which is the location of the installed plugin. These variables are available for all installed plugins so if you depend on another plugin you can access files in its install directory too.


Burt


On Friday 22 May 2009 2:48:55 pm Eric Martineau wrote:
> > Meanwhile, is it possible to to create that resolver togheter with the
> > script that creates the domain class?
> >
> I started down that thought path, but then everything that depends on the
> resolver fails to compile... :)
>
> I think I can solve it through spring, but I'm having issues now with the
> create-dns-map script. The script moves a template DomainTenantMap file
> from the plugin's script folder to the appropriate location
> "grails-app/domain/tenant" when run. However, when the script is run on a
> target grails-app, it can't find the file because it can't locate the
> multi-tenant plugin directory.
>
> in CreateDnsMap.groovy:
>
> ant.copy(file: 'scripts/resources/DomainTenantMap.tocopy', tofile:
> 'grails-app/domain/tenant/DomainTenantMap.groovy')
>
> SHOULD be something like
>
> ant.copy(file:
> '${pathToMultiTenantPlugin}/scripts/resources/DomainTenantMap.tocopy',
> tofile: 'grails-app/domain/tenant/DomainTenantMap.groovy')
>
> Can you help? Or is there a better way to accomplish this?
>
> Eric
>
> >
> >
> > ---
> > Felipe Marin Cypriano
> > Vitória - ES
> >
> >
> > On Fri, May 22, 2009 at 2:23 PM, Eric Martineau <[hidden email]>wrote:
> >
> >> Crap! Must have forgotten to clean before I released...
> >>
> >> While your solution will compile, won't it break at runtime? The
> >> DomainTenantMap class is in the package tenant, so you'll get a missing
> >> property exception. If you try to import, the code won't compile.
> >>
> >> Thanks for looking into it, I'll churn on it a bit.
> >>
> >> Eric
> >>
> >>
> >> On Fri, May 22, 2009 at 10:12 AM, Felipe Cypriano <[hidden email]>wrote:
> >>
> >>> Hello,
> >>>
> >>> After I upgrade the plugin I'm getting these compiler error:
> >>>
> >>> Caused by:
> >>> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
> >>> failed,
> >>> \plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy:
> >>> 3: unable to resolve class tenant.DomainTenantMap
> >>> @ line 3, column 1.
> >>> import tenant.DomainTenantMap
> >>> ^
> >>> \plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy:
> >>> 39: unable to resolve class tenant.DomainTenantMap
> >>> @ line 39, column 17.
> >>> hosts.put(map.domainName, map.mappedTenantId)
> >>> ^
> >>> \plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy:
> >>> 39: unable to resolve class tenant.DomainTenantMap
> >>> @ line 39, column 33.
> >>> hosts.put(map.domainName, map.mappedTenantId)
> >>>
> >>>
> >>> The class tenant.DomainTenantMap was removed from this version and its
> >>> creation needs to execute a script, but the DomainNameDatabaseTenantResolver
> >>> always looks for the class. It's necessary to remove the direct reference.
> >>> What about instead of pointing direct to DomainTenantMap change the lines 37
> >>> e 38 of DomainNameDatabaseTenantResolver.groovy to:
> >>>
> >>> Collection list = DomainTenantMap.findAll("from
> >>> tenant.DomainTenantMap");
> >>> list.each {map ->
> >>>
> >>> and let groovy access the method and properties dynamically?
> >>>
> >>> This is what I did:
> >>>
> >>> 1. Upgrade the plugin
> >>> 2. Execute grails clean
> >>> 3. Run test-app

> >>>
> >>>
> >>> Regards,
> >>> ---
> >>> Felipe Marin Cypriano
> >>> Vitória - ES
> >>>
> >>
> >>
> >
>



Reply | Threaded
Open this post in threaded view
|

Re: MultiTenant 0.8 not compiling

Felipe Cypriano
Hi Eric,

Version 0.9 fixed the problem.

Regards,
---
Felipe Marin Cypriano
Vitória - ES


On Fri, May 22, 2009 at 5:16 PM, Eric Martineau <[hidden email]> wrote:
OK, I released a fix in version 0.9


On Fri, May 22, 2009 at 12:05 PM, Burt Beckwith <[hidden email]> wrote:
There's an under-documented plugin dir variable that you can use - replace 'pathToMultiTenantPlugin' with 'multiTenantPluginDir' which is the location of the installed plugin. These variables are available for all installed plugins so if you depend on another plugin you can access files in its install directory too.


Burt


On Friday 22 May 2009 2:48:55 pm Eric Martineau wrote:
> > Meanwhile, is it possible to to create that resolver togheter with the
> > script that creates the domain class?
> >
> I started down that thought path, but then everything that depends on the
> resolver fails to compile... :)
>
> I think I can solve it through spring, but I'm having issues now with the
> create-dns-map script. The script moves a template DomainTenantMap file
> from the plugin's script folder to the appropriate location
> "grails-app/domain/tenant" when run. However, when the script is run on a
> target grails-app, it can't find the file because it can't locate the
> multi-tenant plugin directory.
>
> in CreateDnsMap.groovy:
>
> ant.copy(file: 'scripts/resources/DomainTenantMap.tocopy', tofile:
> 'grails-app/domain/tenant/DomainTenantMap.groovy')
>
> SHOULD be something like
>
> ant.copy(file:
> '${pathToMultiTenantPlugin}/scripts/resources/DomainTenantMap.tocopy',
> tofile: 'grails-app/domain/tenant/DomainTenantMap.groovy')
>
> Can you help? Or is there a better way to accomplish this?
>
> Eric
>
> >
> >
> > ---
> > Felipe Marin Cypriano
> > Vitória - ES
> >
> >
> > On Fri, May 22, 2009 at 2:23 PM, Eric Martineau <[hidden email]>wrote:
> >
> >> Crap! Must have forgotten to clean before I released...
> >>
> >> While your solution will compile, won't it break at runtime? The
> >> DomainTenantMap class is in the package tenant, so you'll get a missing
> >> property exception. If you try to import, the code won't compile.
> >>
> >> Thanks for looking into it, I'll churn on it a bit.
> >>
> >> Eric
> >>
> >>
> >> On Fri, May 22, 2009 at 10:12 AM, Felipe Cypriano <[hidden email]>wrote:
> >>
> >>> Hello,
> >>>
> >>> After I upgrade the plugin I'm getting these compiler error:
> >>>
> >>> Caused by:
> >>> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
> >>> failed,
> >>> \plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy:
> >>> 3: unable to resolve class tenant.DomainTenantMap
> >>> @ line 3, column 1.
> >>> import tenant.DomainTenantMap
> >>> ^
> >>> \plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy:
> >>> 39: unable to resolve class tenant.DomainTenantMap
> >>> @ line 39, column 17.
> >>> hosts.put(map.domainName, map.mappedTenantId)
> >>> ^
> >>> \plugins\multi-tenant-0.8\src\groovy\com\infusion\tenant\DomainNameDatabaseTenantResolver.groovy:
> >>> 39: unable to resolve class tenant.DomainTenantMap
> >>> @ line 39, column 33.
> >>> hosts.put(map.domainName, map.mappedTenantId)
> >>>
> >>>
> >>> The class tenant.DomainTenantMap was removed from this version and its
> >>> creation needs to execute a script, but the DomainNameDatabaseTenantResolver
> >>> always looks for the class. It's necessary to remove the direct reference.
> >>> What about instead of pointing direct to DomainTenantMap change the lines 37
> >>> e 38 of DomainNameDatabaseTenantResolver.groovy to:
> >>>
> >>> Collection list = DomainTenantMap.findAll("from
> >>> tenant.DomainTenantMap");
> >>> list.each {map ->
> >>>
> >>> and let groovy access the method and properties dynamically?
> >>>
> >>> This is what I did:
> >>>
> >>> 1. Upgrade the plugin
> >>> 2. Execute grails clean
> >>> 3. Run test-app

> >>>
> >>>
> >>> Regards,
> >>> ---
> >>> Felipe Marin Cypriano
> >>> Vitória - ES
> >>>
> >>
> >>
> >
>