[ 
http://jira.amdatu.org/jira/browse/AMDATU-238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10594#comment-10594
 ] 

Ivo Ladage - van Doorn commented on AMDATU-238:
-----------------------------------------------

Hhmm, apparently this doesn't work;

tenantA.getProperties().put(HOSTNAME, "localhost")

but this does;

tenantA.putProperty(HOSTNAME, "localhost")

Since getProperties() will in fact return a copy of the hasmap and so setting 
properties onto it won't effect the entity. Confusing...

> Updating tenants does not work
> ------------------------------
>
>                 Key: AMDATU-238
>                 URL: http://jira.amdatu.org/jira/browse/AMDATU-238
>             Project: Amdatu
>          Issue Type: Bug
>          Components: Amdatu Core
>    Affects Versions: 0.1.0
>            Reporter: Ivo Ladage - van Doorn
>            Assignee: Angelo van der Sijpt
>             Fix For: 0.1.0
>
>
> When I add this code snippet to my service to create and later on update a 
> tenant, I get a NullPointerException when the tenant already exists:
> TenantEntity tenantA = m_tenantManagementService.getTenantById("tenant_a");
> if (tenantA == null) {
>   tenantA = m_tenantManagementService.createTenant("tenant_a", "Tenant A");
> }
> tenantA.getProperties().put(HOSTNAME, "localhost");
> m_tenantManagementService.updateTenant(tenantA);
> The error I get:
> WARNING: Invocation of 'start' failed. [org.amdatu.core.tenant]
> null
> java.lang.NullPointerException
>         at 
> org.amdatu.core.tenant.service.TenantManagementServiceImpl.updateTenantService(TenantManagementServiceImpl.java:117)
>         at 
> org.amdatu.core.tenant.service.TenantManagementServiceImpl.updateTenant(TenantManagementServiceImpl.java:93)
>         at 
> org.amdatu.core.tenant.service.TenantContextProviderImpl.start(TenantContextProviderImpl.java:74)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to