More exploration into the document maze!
1)
https://cwiki.apache.org/confluence/display/OFBTECH/Apache+OFBiz+Technical+Production+Setup+Guide
says that
the entityengine.xml is found at ${ofbiz install
dir}/framework/entity/config/entityengine.xml
http://ofbiz.apache.org/docs/entityconfig.html says that it is found at
ofbiz/commonapp/etc/entityengine.xml which does not appear to exist
2) http://ofbiz.apache.org/docs/entityconfig.htm has the entitygroupfile
at *|ofbiz/commonapp/entitydef/entitygroup.xml|*. which is not right.
3) I have not found the missing information that is missing from this
section. I assume that there must be someplace where you tell the Entity
Engine which delegator you want to use.
I think that the nesting of "3 To setup the Entity Engine ...." is not
correct "1. If using the default..." looks like a peer to 3 but is
actually a child.
1.
If you decide not to use the embedded Derby database, check/install your
database of choice
2.
If necessary, put the correct JDBC driver in:
1.
${ofbiz install dir}/framework/entity/lib/jdbc
2.
replacing the old or incorrect version of the driver there (ie copy in
with same name to avoid problems with update restoring the old driver later)
3.
To setup the Entity Engine to use a different database from the default
Derby database.
In the: ${ofbiz install dir}/framework/entity/config/entityengine.xml file:
Modify an existing datasource (near the bottom of the file) or create a new one
by copying one of the sample datasources already there and giving it a new
unique name
1.
If using the default OFBiz transaction manager and connection pool, update
the data URI, username and password in the inline-jdbc tag
2.
If you want your OFBiz tables in a special schema first create that schema
in your database, then set the schema-name attribute on the datasource tag
3.
Find the "default" delegator near the top of the file and change the
datasource-name attribute value in the group-map tag under it to the name of the data
source you modified or created.
4)Iit appears the the instructions about changing the database should
also include a note about making a parallel change to the "test delegator"
"4. Find the "test-default" delegator (just after the "default" in entityengine.xml) and
make the same changes as were made to the "default" in step 3.
5) http://ofbiz.apache.org/docs/coreconfig.html also has the wrong
location for the property files *|ofbiz/commonapp/etc/|*. It appears
that they are actually in "${ofbiz install dir}/framework/base/config".
I still have not found the missing step in changing the database from
Derby to something else.
*|
|*On 02/06/2014 3:47 AM, Jacques Le Roux wrote:
Le 02/06/2014 04:13, Ron Wheeler a écrit :
At this point I can only help improve the docs by reporting what I
find when I follow the instructions.
I only know what the docs tell me.
I really only want to find out if I can set up an order with a
backorder and properly account for transactions i 2 currencies.
If I could fix the docs, I would not be reading them so closely!!!
Re: Number 8)
I took a bit of a flyer by actually reading the configuration file
even though I do not have any idea about what the function of the
"delegator" is and why the code requires a "delegator". The wiki's
installation page doesn't actually describe what the relationship is
between each of the elements in the file or even what a "delagator"
is. As far as I know (44 years of writing code) delegator is not a
well defined Computer Science term.
No idea if I should even care about a "test delegator" or how it is
used.
I just read the comment in the XML and noticed that the docs do not
include the warning that the XML file does.
Perhaps this needs to be added to the wiki or deleted from the XML
if it is not required.
This should help http://ofbiz.apache.org/docs/entityconfig.html
Also a larger view: http://ofbiz.apache.org/docs/coreconfig.html
The test delegator is used when you run the Junit tests, using "ant
run-tests"
Re: Number 10)
I did not see anything in the docs about the need to create the
database but I did that anyway since it seems like the normal thing
to do if you are going to write a specification for the MySQL
connector - must have DB and name and password of a user that has
all the "right" privs on the db that you want to use so I did create
it first.
I suspect that I missed a note (perhaps invisible) about how the
delegator knows which type of database definition (group-map) to look
for.
I will investigate that further and see if I missed something or if
the docs are missing the instructions about what else you need to
change to use a db other than Derby. This is edging towards "helping"
me which I will request in the user forum since it is not really a
developer topic unless I find out that it is problem in the wiki not
in my reading (or misreading) of it.
Yes better to use the user ML for such questions indeed
I just hope that my comments are helpful in improving the experience
for the next person.
I hope sO
Jacques
Ron
On 01/06/2014 1:07 PM, Jacques Le Roux wrote:
Le 01/06/2014 07:42, Ron Wheeler a écrit :
I am working my way through this in the hope that I will end up
with a working system.
https://cwiki.apache.org/confluence/display/OFBTECH/Apache+OFBiz+Technical+Production+Setup+Guide
I have found some information that is wrong or missing. I notice
that the page has not been changed since 2012.
1) It says that you need to have ant installed. That is not enough.
You also need to have ant-apache-regexp or you will get
"java.lang.ClassNotFoundException:
org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp"
I have removed the section about ant needed to be installed. You
should better use the embedded ant following the way I documented in
the page above this afternoon (ie use ./ant on *nix systems, always
from OFBiz root on any plaftorm
I which case did you get the Jdk14RegexpRegexp
ClassNotFoundException? Doing what I mean? Could you retry using
./ant ?
2) It says that you should run ant as "ant run-install" but when
you do, the script says that you should have actually run "ant
load-demo".
I will fix that one, the 1st is to be used before R12.04 release
(and branch) the 2nd after
3) There are a lot of warnings about deprecrated methods
You are welcome to help about that
4) Not sure if this matters Warning : Module classpath component
'/usr/java/packages/lib/amd64' is not valid and will be ignored...
You can normally neglect such warning, just an information about
your system
5) A lot of these: "warning: [options] bootstrap class path not
set in conjunction with -source 1.6"
This is because you compile with Java 7. You can use it (and it's
better/faster) but if you want to run tests (ant run-tests) then you
need to use an *Oracle* JDK 6.
6) Warning that "
/usr/share/tomcat7/webapps/accounting/specialpurpose/scrum/src/org/ofbiz/scrum/ScrumServices.java
uses unchecked or unsafe operations."
That's interesting, I will have a look at it
7) When trying to follow this "Find the "default" delegator near
the top of the file and change the datasource-name attribute value
in the group-map tag under it to the name of the data source you
modified or created. ", you find that the default delegator has
several group-names commented out and several not commented out. In
my case, I want to use mySQL which is commented out so I changed
that and commented out every other one. The instructions should be
a bit clearer about what this means and what is the right
configuration of coments and group-maps.
You are welcome to help improving the documentation in the open
wiki. As explained at the top of its pages, you must register in
Confluence and then ask us for a write access.
8) In changing the database, the actual : ${ofbiz install
dir}/framework/entity/config/entityengine.xml file has a note about
making the test delegator match the default. This is missing in the
documentation.
Are you referring to a specific part of the documentation? Again you
are welcome to help improving the documentation in the open wiki,
but if it's in a part (Confluence workspace) you can't have access
then let us know and we will add/amend there.
9) The ant run ends with a wonderful combination of a series of
warnings followed by a null pointer and "BUILD SUCCESSFUL" with no
tables created in the mySQL database.
[java] 2014-06-01 01:30:32,232 (main) [
ModelViewEntity.java:551:WARN ] [ExampleStatusDetail]: Conversion
for complex-alias needs to be implemented for cache and in-memory
eval stuff to work correctly, will not work for alias: statusDelay
[java] 2014-06-01 01:30:32,570 (main) [
ModelReader.java:436:INFO ] FINISHED LOADING ENTITIES - ALL FILES;
#Entities=863 #ViewEntities=300 #Fields=9049 #Relationships=2961
#AutoRelationships=2186
[java] 2014-06-01 01:30:32,679 (main) [
GenericDelegator.java:234:INFO ] Doing entity definition check...
[java] 2014-06-01 01:30:32,694 (main) [
ModelEntityChecker.java:508:INFO ] [initReservedWords] array
length=1023
[java] java.lang.NullPointerException
[java] at
org.ofbiz.entity.GenericDelegator.getEntityFieldType(GenericDelegator.java:541)
[java] at
org.ofbiz.entity.model.ModelEntityChecker.checkEntities(ModelEntityChecker.java:107)
[java] at
org.ofbiz.entity.GenericDelegator.<init>(GenericDelegator.java:235)
[java] at
org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:33)
[java] at
org.ofbiz.entity.DelegatorFactoryImpl.getInstance(DelegatorFactoryImpl.java:25)
[java] at
org.ofbiz.base.util.UtilObject.getObjectFromFactory(UtilObject.java:202)
[java] at
org.ofbiz.entity.DelegatorFactory.getDelegator(DelegatorFactory.java:51)
[java] at
org.ofbiz.entityext.data.EntityDataLoadContainer.loadContainer(EntityDataLoadContainer.java:272)
[java] at
org.ofbiz.entityext.data.EntityDataLoadContainer.start(EntityDataLoadContainer.java:236)
[java] at
org.ofbiz.base.container.ContainerLoader.start(ContainerLoader.java:230)
[java] at
org.ofbiz.base.start.Start.startStartLoaders(Start.java:362)
[java] at org.ofbiz.base.start.Start.start(Start.java:337)
[java] at org.ofbiz.base.start.Start.main(Start.java:139)
[java] 2014-06-01 01:30:33,679 (Thread-0) [
ContainerLoader.java:246:INFO ] Shutting down containers
[java] Java Result: 99
BUILD SUCCESSFUL
Total time: 31 seconds
Only when using the embedded Derby you can expect OFBiz to wipe and
create the DB for you. When using another DBMS you must 1st create
the DB in it.
I hope that these comments help.
Thanks for sharing, yes that helps...
I will try to see what I did to cause the null pointer since the
person writing the code did not think that any error was possible
at that point!
Perhaps I commented out too many group-map entities.
I will take this up on the user forum until the wiki gets fixed.
You must have done something specific, yes
Jacques
Ron.
--
Ron Wheeler
President
Artifact Software Inc
email: [email protected]
skype: ronaldmwheeler
phone: 866-970-2435, ext 102