Multitenant configuration problems

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

Multitenant configuration problems

iwolf
Hello,

I would like to set up a multi-tenant environment for development (not Demo) and followed the instructions on https://cwiki.apache.org/confluence/display/OFBIZ/Multitenancy+support.

Unfortunately is end up with "Could not find the serviceengine.xml file"

All I did was (clean 13.07 environment, mysql):

1.) entityengine.xml
<delegator name="default" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main" distributed-cache-clear-enabled="false">
    <group-map group-name="org.ofbiz.tenant" datasource-name="wolfixtenant"/> 
</delegator>

- same for name="default-no-eca"  and name="default-no-eca"
- create <datasource name="wolfixtenant" ...

2.) TenantData.xml
<Tenant tenantId="customer1" tenantName="Customer 1"/>   
<TenantDataSource tenantId="customer1" entityGroupName="org.ofbiz"
    jdbcUri="jdbc:mysql://127.0.0.1/ofbizcustomer1" jdbcUsername="ofbiz" jdbcPassword="ofbiz"/>       
<TenantDataSource tenantId="customer1" entityGroupName="org.ofbiz"
    jdbcUri="jdbc:mysql://127.0.0.1/ofbizcustomer1" jdbcUsername="ofbiz" jdbcPassword="ofbiz"/>

3.) ofbiz-component
<entity-resource type="data" reader-name=<b>"ext" loader="main" location="data/TenantData.xml"/>

My next step is to call:
java \-Xmx512m \-XX:MaxPermSize=128m \-jar ofbiz.jar \install \-readers=seed \-delegator=default

Thats what I got:

java.lang.NullPointerException
        at org.ofbiz.entity.GenericDelegator.getEntityFieldType(GenericDelegator.java:540)
        at org.ofbiz.entity.model.ModelEntityChecker.checkEntities(ModelEntityChecker.java:106)
        at org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:239)
        at org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:33)
        at org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:25)
        at org.ofbiz.base.util.UtilObject.getObjectFromFactory(UtilObject.java:200)
        at org.ofbiz.entity.DelegatorFactory.getDelegator(DelegatorFactory.java:51)
        at org.ofbiz.entityext.data.EntityDataLoadContainer.loadContainer(EntityDataLoadContainer.java:274)
        at org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:238)
        at org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:238)
        at org.ofbiz.base.start.Start.startStartLoaders(Start.java:340)
        at org.ofbiz.base.start.Start.start(Start.java:382)
        at org.ofbiz.base.start.Start.main(Start.java:122)
2014-07-03 13:37:31,949 (Thread-0) [    ContainerLoader.java:255:INFO ] Shutting down containers
2014-07-03 13:37:31,950 (Thread-0) [    ContainerLoader.java:262:INFO ] Stopping container dataload-container
2014-07-03 13:37:31,950 (Thread-0) [    ContainerLoader.java:268:INFO ] Stopped container dataload-container
2014-07-03 13:37:31,951 (Thread-0) [    ContainerLoader.java:262:INFO ] Stopping container service-container
2014-07-03 13:37:32,010 (Thread-0) [          JobPoller.java:69 :ERROR]
---- exception report ----------------------------------------------------------
Exception thrown while getting <thread-pool> model, using default <thread-pool> values:
Exception: org.ofbiz.base.config.GenericConfigException
Message: Could not find the serviceengine.xml file
---- stack trace ---------------------------------------------------------------
org.ofbiz.base.config.GenericConfigException: Could not find the serviceengine.xml file
org.ofbiz.service.config.ServiceConfigUtil.getXmlDocument(ServiceConfigUtil.java:115)
org.ofbiz.service.config.ServiceConfigUtil.getServiceConfig(ServiceConfigUtil.java:79)
org.ofbiz.service.config.ServiceConfigUtil.getServiceEngine(ServiceConfigUtil.java:109)
org.ofbiz.service.job.JobPoller.createThreadPoolExecutor(JobPoller.java:65)
org.ofbiz.service.job.JobPoller.<clinit>(JobPoller.java:53)
org.ofbiz.service.job.JobManager.shutDown(JobManager.java:109)
org.ofbiz.service.ServiceContainer.stop(ServiceContainer.java:68)
org.ofbiz.base.container.ContainerLoader.unload(ContainerLoader.java:264)
org.ofbiz.base.start.Start.shutdownServer(Start.java:316)
org.ofbiz.base.start.Start.access$000(Start.java:41)
org.ofbiz.base.start.Start$1.run(Start.java:220)
--------------------------------------------------------------------------------

I would appreacitate any hint on what I am doing wrong. Thanks!

Ingo
Reply | Threaded
Open this post in threaded view
|

Re: Multitenant configuration problems

Pierre Smits
H Ingo,

We at ORRTIZ.COM do not follow the steps outlined in the document you
referenced.

The process we followed to get multi-tenancy going with a rdbms other than
derby is

   1. setup OFBiz to connect to the rdbms of choice (mySQL, Oracle,
   PostgreSQL) in entityengine.xml
   2. setup OFBiz for multi-tenancy in general.properties
   3. create base databases (ofbiz, ofbiz_olap, ofbiz_tenant) in your rdbms
   4. ensure that rights on rdbms and databases is correct
   5. test by starting up OFBiz with loading data in the databases of the
   rdbms of choice
   6. use ./ant create-tenant to create the first tenant and the tenant
   admin (to login with and load appropriate datasets via webtools/import
   functionality.

Regards,

Pierre Smits

*ORRTIZ.COM <http://www.orrtiz.com>*
Services & Solutions for Cloud-
Based Manufacturing, Professional
Services and Retail & Trade
http://www.orrtiz.com
Reply | Threaded
Open this post in threaded view
|

Re: Multitenant configuration problems

Pierre Smits
In reply to this post by iwolf
Ingo,

Can you elaborate on how you are intending multi-tenancy with respect to
development?
This will help the community to understand what you are trying to achieve
and create to opportunity to get more appropriate involvement.

Regards,

Pierre Smits

*ORRTIZ.COM <http://www.orrtiz.com>*
Services & Solutions for Cloud-
Based Manufacturing, Professional
Services and Retail & Trade
http://www.orrtiz.com


On Thu, Jul 3, 2014 at 1:56 PM, iwolf <[hidden email]> wrote:

> Hello,
>
> I would like to set up a multi-tenant environment for development (not
> Demo)
> and followed the instructions on
> https://cwiki.apache.org/confluence/display/OFBIZ/Multitenancy+support.
>
> Unfortunately is end up with "/Could not find the serviceengine.xml file/"
>
> All I did was (clean 13.07 environment, mysql):
>
> 1.) entityengine.xml
> <delegator name="default" entity-model-reader="main"
> entity-group-reader="main" entity-eca-reader="main"
> distributed-cache-clear-enabled="false">
>     <group-map group-name="org.ofbiz.tenant"
> datasource-name="wolfixtenant"/>
> </delegator>
>
> - same for name="default-no-eca"  and name="default-no-eca"
> - create <datasource name="wolfixtenant" ...
>
> 2.) TenantData.xml
> <Tenant tenantId="customer1" tenantName="Customer 1"/>
> <TenantDataSource tenantId="customer1" entityGroupName="org.ofbiz"
>     jdbcUri="jdbc:mysql://127.0.0.1/ofbizcustomer1" jdbcUsername="ofbiz"
> jdbcPassword="ofbiz"/>
> <TenantDataSource tenantId="customer1" entityGroupName="org.ofbiz"
>     jdbcUri="jdbc:mysql://127.0.0.1/ofbizcustomer1" jdbcUsername="ofbiz"
> jdbcPassword="ofbiz"/>
>
> 3.) ofbiz-component
> <entity-resource type=&quot;data&quot; reader-name=&lt;b>"ext"*
> loader="main" location="data/TenantData.xml"/>
>
> My next step is to call:
> java \-Xmx512m \-XX:MaxPermSize=128m \-jar ofbiz.jar \install
> \-readers=seed
> \-delegator=default
>
> Thats what I got:
>
> java.lang.NullPointerException
>         at
>
> org.ofbiz.entity.GenericDelegator.getEntityFieldType(GenericDelegator.java:540)
>         at
>
> org.ofbiz.entity.model.ModelEntityChecker.checkEntities(ModelEntityChecker.java:106)
>         at
> org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:239)
>         at
>
> org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:33)
>         at
>
> org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:25)
>         at
> org.ofbiz.base.util.UtilObject.getObjectFromFactory(UtilObject.java:200)
>         at
> org.ofbiz.entity.DelegatorFactory.getDelegator(DelegatorFactory.java:51)
>         at
>
> org.ofbiz.entityext.data.EntityDataLoadContainer.loadContainer(EntityDataLoadContainer.java:274)
>         at
>
> org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:238)
>         at
> org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:238)
>         at org.ofbiz.base.start.Start.startStartLoaders(Start.java:340)
>         at org.ofbiz.base.start.Start.start(Start.java:382)
>         at org.ofbiz.base.start.Start.main(Start.java:122)
> 2014-07-03 13:37:31,949 (Thread-0) [    ContainerLoader.java:255:INFO ]
> Shutting down containers
> 2014-07-03 13:37:31,950 (Thread-0) [    ContainerLoader.java:262:INFO ]
> Stopping container dataload-container
> 2014-07-03 13:37:31,950 (Thread-0) [    ContainerLoader.java:268:INFO ]
> Stopped container dataload-container
> 2014-07-03 13:37:31,951 (Thread-0) [    ContainerLoader.java:262:INFO ]
> Stopping container service-container
> 2014-07-03 13:37:32,010 (Thread-0) [          JobPoller.java:69 :ERROR]
> ---- exception report
> ----------------------------------------------------------
> Exception thrown while getting <thread-pool> model, using default
> <thread-pool> values:
> Exception: org.ofbiz.base.config.GenericConfigException
> Message: Could not find the serviceengine.xml file
> ---- stack trace
> ---------------------------------------------------------------
> org.ofbiz.base.config.GenericConfigException: Could not find the
> serviceengine.xml file
>
> org.ofbiz.service.config.ServiceConfigUtil.getXmlDocument(ServiceConfigUtil.java:115)
>
> org.ofbiz.service.config.ServiceConfigUtil.getServiceConfig(ServiceConfigUtil.java:79)
>
> org.ofbiz.service.config.ServiceConfigUtil.getServiceEngine(ServiceConfigUtil.java:109)
> org.ofbiz.service.job.JobPoller.createThreadPoolExecutor(JobPoller.java:65)
> org.ofbiz.service.job.JobPoller.<clinit>(JobPoller.java:53)
> org.ofbiz.service.job.JobManager.shutDown(JobManager.java:109)
> org.ofbiz.service.ServiceContainer.stop(ServiceContainer.java:68)
> org.ofbiz.base.container.ContainerLoader.unload(ContainerLoader.java:264)
> org.ofbiz.base.start.Start.shutdownServer(Start.java:316)
> org.ofbiz.base.start.Start.access$000(Start.java:41)
> org.ofbiz.base.start.Start$1.run(Start.java:220)
>
> --------------------------------------------------------------------------------
>
> I would appreacitate any hint on what I am doing wrong. Thanks!
>
> Ingo
>
>
>
> --
> View this message in context:
> http://ofbiz.135035.n4.nabble.com/Multitenant-configuration-problems-tp4652188.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Multitenant configuration problems

iwolf
Pierre,

thanks for the infos ... I will try.

Development in terms of developing the following:

I am setting up an environment for a logistic centre to provide their customers with the following:

- logistics
- B2B & B2C Webshop
- accounting (invoice, ...)
- order management
- accounting
...

The idea is to have one environment for multiple customers. The customers are small to medium sized companies.

Every custumer will use the standard backend with customized B2B & B2C webshops (cloning E-Commerce).

Kind Regards,
Ingo
Reply | Threaded
Open this post in threaded view
|

Re: Multitenant configuration problems

Pierre Smits
Hi Ingo,

Thanks for the swift reply.

So, if I understand you correctly you will some per client customizations
on one or more components/apps. For development of that you don't need
multi-tenancy in your development environment. But for testing and
production you would.

You could use the ./ant create-tenant-component and ./ant
create-tenant-ecommerce as a starting point for your initial component
generation with specific permissions and data-sets.

Regards,

Pierre



Pierre Smits

*ORRTIZ.COM <http://www.orrtiz.com>*
Services & Solutions for Cloud-
Based Manufacturing, Professional
Services and Retail & Trade
http://www.orrtiz.com


On Thu, Jul 3, 2014 at 4:34 PM, iwolf <[hidden email]> wrote:

> Pierre,
>
> thanks for the infos ... I will try.
>
> Development in terms of developing the following:
>
> I am setting up an environment for a logistic centre to provide their
> customers with the following:
>
> - logistics
> - B2B & B2C Webshop
> - accounting (invoice, ...)
> - order management
> - accounting
> ...
>
> The idea is to have one environment for multiple customers. The customers
> are small to medium sized companies.
>
> Every custumer will use the standard backend with customized B2B & B2C
> webshops (cloning E-Commerce).
>
> Kind Regards,
> Ingo
>
>
>
> --
> View this message in context:
> http://ofbiz.135035.n4.nabble.com/Multitenant-configuration-problems-tp4652188p4652192.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Multitenant configuration problems

iwolf
Hi Pierre,

yes thats correct. Right now I have the Demo Tenant running and want to setup a clean Tenant to check out how everything works together to create my own custom import-xml files according to my requirements.

Thanks for all your input ... that brought me light-years ahead. It's running now.

Thanks!!!

Regards,
Ingo

Reply | Threaded
Open this post in threaded view
|

Re: Multitenant configuration problems

Pierre Smits
Ingo,

You're welcome.

Remember, ./ant -p give you a lot of actions that you can use for
operations.

Regards,

Pierre

Pierre Smits

*ORRTIZ.COM <http://www.orrtiz.com>*
Services & Solutions for Cloud-
Based Manufacturing, Professional
Services and Retail & Trade
http://www.orrtiz.com