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