I really don't know much about the multi tenant functionality, it's new and
I haven't used it. But yeah you do need that tenant group mapped to a
datasource, it contains a set of tables that are needed in addition to the
separate tenant databases (I think).
Regards
Scott
On 21/10/2010, at 11:57 PM, Carsten Schinzer wrote:
Well, so possibly a mistake in the documents as the multitenant
datasources
would be defined in the config file placed on data/... (as mentioned
above).
Using your aproach, I would be using the entityengine.xml to define any
datasource required?
Then for data loading: How do I address a certain datasource?
I had the idea to use defined readers like e.g.
<entity-data-reader name="ext-tenant1"/>
and define those readers only for the respective data sources.
Does that make sense?
Thanks for the tip!
I'll play around a little with this idea.
Just one last question: What is the dedicated TenantDatasources.xml file
then used for at all? To map the datasource to the respective tenant
logins?
Because irritatingly, this file also references jdbcUri, jdbcUsername and
jdbcPassword. But all that I would have specified in entityengine.xml as
well.
Well, it looks like I'd update some documents once I found my way through
this. Stay tuned :)
Regards
Carsten
2010/10/21 Scott Gray<[email protected]>
OOTB in 10.04 the delegator definition looks like this:
<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" datasource-name="localderby"/>
<group-map group-name="org.ofbiz.olap"
datasource-name="localderbyolap"/>
<group-map group-name="org.ofbiz.tenant"
datasource-name="localderbytenant"/>
</delegator>
Your one appears to be missing the last group-map for org.ofbiz.tenant
and
I'm guessing that is the problem. I have no idea why you and BJ were
missing that entry though, it was there before 10.04 existed.
Regards
Scott
HotWax Media
http://www.hotwaxmedia.com
On 21/10/2010, at 9:42 PM, Carsten Schinzer wrote:
Hi Scott,
well, I digged out this old thread as the very same seemed happening to
BJ
as well. Here's a little context:
I am aiming at multitenant along with PostGreSQL database, i.e. I have
created the DB for each tenant.
I changed entityengine.xml to use the localpostnew DataSource in the
default
delegator:
<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"
datasource-name="localpostnew"/>
<group-map group-name="org.ofbiz.olap"
datasource-name="localderbyolap"/>
</delegator>
of course localpostnew is updated with connection string info as usual
and
the respective postgres drivers are placed in
{ofbiz-home}\framework\entity\lib\jdbc
Now the multitenant info, i.e. the datasource setup for each Tenant's
database, went to the xml file in
{ofbiz-home}\framework\entity\data\TenantDataSources.xml
(the filename is different and is updated accordingly in
{ofbiz-home}\framework\entity\ofbiz-component.xml
If I choose the localderby datasource, everything goes just nice and
the
databases are generated, data loaded etc.
If I change to the above configuration, i.e. using localpostnew, ofbiz
throws an exception as follows
*
COMMAND ISSUED:*
D:\__eclipse\ofbiz-multitenant>java -Xmx512m -XX:MaxPermSize=128m -jar
ofbiz.jar -install -readers=seed-initial -delegator=default
*CONSOLE OUTPUT:*
Set OFBIZ_HOME to - D:/__eclipse/ofbiz-multitenant
(...)
2010-10-20 18:28:34,283 (main) [ ModelReader.java:389:INFO ]
FINISHED
LOADING ENTITIES - ALL FILES; #Entities=849 #ViewEntities=267
#Fields=8870
#Relationships=2925 #AutoRelationships=2157
2010-10-20 18:28:34,392 (main) [ GenericDelegator.java:244:INFO ]
Doing
entity definition check...
2010-10-20 18:28:34,408 (main) [ ModelEntityChecker.java:502:INFO ]
[initReservedWords] array length=1023
Exception in thread "main" java.lang.NullPointerException
at
org.ofbiz.entity.GenericDelegator.getEntityFieldType(GenericDelegator.java:555)
at
org.ofbiz.entity.model.ModelEntityChecker.checkEntities(ModelEntityChecker.java:101)
at
org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:245)
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:202)
at
org.ofbiz.entity.DelegatorFactory.getDelegator(DelegatorFactory.java:47)
at
org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:230)
at
org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:100)
at org.ofbiz.base.start.Start.startStartLoaders(Start.java:272)
at org.ofbiz.base.start.Start.startServer(Start.java:322)
at org.ofbiz.base.start.Start.start(Start.java:326)
at org.ofbiz.base.start.Start.main(Start.java:411)
2010-10-20 18:28:34,627 (OFBiz_Shutdown_Hook) [
ContainerLoader.java:113:INFO ] Shutting down containers
I would like to understand the following:
- what is going wrong? OFBIZ seems to have issues with the
entityfieldtypes for postnew. This is not observed for single tenant
OFBIZ
setups -- or no-one out there is using single instances on postgres
with
release 10.04 or later.
- how can I dig deeper into the issue? Reviewing the classes I do see
sporadic log statement which I do not find back on the console, hence:
where
can I switch log levels for a component or the entire ofbiz instance?
Hint for any of these two are much appreciated.
And thanks for focussing back on the topic :-)
Regards
Carsten
2010/10/21 Scott Gray<[email protected]>
Sorry my bad.
Could you explain what changes you've made to the entityengine.xml
that
got
you to the point of something not working?
Thanks
Scott
HotWax Media
http://www.hotwaxmedia.com
On 21/10/2010, at 6:04 PM, Carsten Schinzer wrote:
Hmmm. Again this has gone off towards debugging/logging (just like
the
older
thread from June).
Anyone with proposals on how to include the Tenant datasources into
entityengine.xml as BJ indicated he had found a workaround for this
issue
that involves this? BJ?
Thanks
Carsten
2010/10/21 David E Jones<[email protected]>
On Oct 20, 2010, at 4:39 PM, Scott Gray wrote:
On 21/10/2010, at 10:39 AM, James McGill wrote:
On Mon, Jun 14, 2010 at 11:08 AM, BJ Freeman<[email protected]
wrote:
Not sure why it worked in derby mode but not in postgresql.
but it hung up on the tenant entity.
but adding the tenant stuff into the entityengine.xml it no
longer
errors.
I am such a slouch I used one line of debug.loginfo to find the
problem.
someday I will put energy into the remote debugging.
:D
I find remote debugging is extremely easy, using Eclipse. If only
there
was
a way to step into minilang services -- they make remote debugging
pretty
frustrating, especially if you want to breakpoint an ECA.
You can cheat a little sometimes with that. I regularly drop in
this:
<log level="always" message="${someVar}"/>
<transaction-rollback/>
Obviously not as good as breakpoints but you can move it around and
just
keep refreshing the browser to continually execute the method and
never
commit the changes.
Actually, IMO, when you don't have to worry about compile/run cycles
I
like
logging better than break points and variable inspection. It
requires
a
little more typing, but a LOT less clicking and watching and
browsing
through data. In fact, IMO logging is faster when you don't have to
worry
about compilation making things intolerably slow. It's kind of like
command-line versus a purely graphical way of doing things.
Of course, to each their own... most programmers can't seem to
handle
something that they aren't used and/or wasn't their idea... ;)
-David
--
Best
Carsten Schinzer
Waisenhausstr. 53a
80637 München
Germany
--
Best
Carsten Schinzer
Waisenhausstr. 53a
80637 München
Germany
--
Best
Carsten Schinzer
Waisenhausstr. 53a
80637 München
Germany