You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Kapil garg <ga...@hotmail.com> on 2010/10/29 21:09:39 UTC

Issues Creating Entities in Ofbiz from existing Schema

I am trying to create a entities within OFbiz out of an existing schema in production. Not sure if this is the best way to create entties out of an existing schema. Suggestions are welcomed!!

I tried to add a datasource tag in default delegator in entity-engine.xml
Followed the instructions on
https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
Would like to know where I am going wrong. On restart, I realised that ofbiz does not finish to the point that I can get webtools or even login for ecommerce. IT has just stuck at soem point saying  ServiceDispatcher.java 584 INFO Sync service..
There is no exception or anything but OFbiz does not go further with complete laoding. Anything I am doing wrong?
Being a default delegaotr, there was no special entity-group.xml file in the ofbiz 9_04 code base. Hence I did not bother to create an entity-group.xml file
My schema name is lronline, following are the entries I had in entity-engine.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" datasource-name="localderby"/>
        <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>
        <group-map group-name="org.ofbiz" datasource-name="mysql"/>
    </delegator>

<datasource name="mysql"
            helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
            field-type-name="mysql"
            check-on-start="true"
            add-missing-on-start="true"
            check-pks-on-start="false"
            use-foreign-keys="true"
            join-style="ansi-no-parenthesis"
            alias-view-columns="false"
            drop-fk-use-foreign-key-keyword="true"
            table-type="InnoDB"
            character-set="latin1"
            collate="latin1_general_cs">
        <read-data reader-name="seed"/>
        <read-data reader-name="seed-initial"/>
        <read-data reader-name="demo"/>
        <read-data reader-name="ext"/>
        <inline-jdbc
                jdbc-driver="com.mysql.jdbc.Driver"
                jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
                jdbc-username="root"
                jdbc-password=""
                isolation-level="ReadCommitted"
                pool-minsize="2"
                pool-maxsize="250"/>
        <!-- <jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/> -->
    </datasource>
    


Kapil Garg
 


 		 	   		  

Re: Issues Creating Entities in Ofbiz from existing Schema

Posted by BJ Freeman <bj...@free-man.net>.
the drivers for the version of mysql you use.

=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man


Kapil garg sent the following on 10/30/2010 7:54 AM:
>
> Ofcourse we need to add mysql drivers. My question was is it a special one for ofbiz?
>
>
> Kapil Garg
>
>
>
>
>
>> Date: Sat, 30 Oct 2010 07:52:55 -0700
>> From: bjfree@free-man.net
>> To: user@ofbiz.apache.org
>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>
>> sorry yes you need to load the mysql drivers into the
>> framework/entity\lib\jdbc
>>
>> =========================
>> BJ Freeman
>> Strategic Power Office with Supplier Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>> Specialtymarket.com<http://www.specialtymarket.com/>
>> Systems Integrator-- Glad to Assist
>>
>> Chat  Y! messenger: bjfr33man
>>
>>
>> BJ Freeman sent the following on 10/30/2010 7:47 AM:
>>> OTTB means you have not modified anything on which ever version you use.
>>> by default the DB that will be created is derby.
>>> for your experimentation, for inducing the entities this sufficient and
>>> less confusing.
>>>
>>> once you have done the
>>> ./ant run-install
>>> then will have demo data in the derby DB and will not get any start up
>>> errors.
>>>
>>> add your data source you created "mysql".
>>> then go to the induce link and it should work, using
>>> mysql as the data source
>>>
>>> =========================
>>> BJ Freeman
>>> Strategic Power Office with Supplier Automation
>>> <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>> Systems Integrator-- Glad to Assist
>>>
>>> Chat Y! messenger: bjfr33man
>>>
>>>
>>> Kapil garg sent the following on 10/30/2010 7:32 AM:
>>>>
>>>> When your say OTTB ( as in Out of the box) are you referring to any
>>>> trunk version number for ofbiz?
>>>> Also in your instruction below are you saying to add the datasource
>>>> after running ant run-install? I believe that run-install would run
>>>> DBUtil code so wont be need to declare datasources before running ant
>>>> run-install?
>>>>
>>>> Regardless I am not able to connect to the DB. IS there a special jar
>>>> file for mysql driver for ofbiz?
>>>>
>>>>
>>>> Kapil Garg
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> Date: Sat, 30 Oct 2010 07:27:57 -0700
>>>>> From: bjfree@free-man.net
>>>>> To: user@ofbiz.apache.org
>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>
>>>>> all my instructions are based on
>>>>> 1) OTTB ofbiz
>>>>> 2) ./ant run-install was completed successfully
>>>>>
>>>>> then you add your datasource.
>>>>>
>>>>> =========================
>>>>> BJ Freeman
>>>>> Strategic Power Office with Supplier
>>>>> Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>
>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>> Systems Integrator-- Glad to Assist
>>>>>
>>>>> Chat Y! messenger: bjfr33man
>>>>>
>>>>>
>>>>> Kapil garg sent the following on 10/30/2010 6:56 AM:
>>>>>>
>>>>>> I already tried that it gives Null pointer exception. I created an
>>>>>> empty database Ofbiz with ofbiz/ofbiz as credentials and used the
>>>>>> normal localmysql that came in original file, it still gives
>>>>>> NullPointer Exception. For some reason at startup the DBUTIL is not
>>>>>> getting the connnectionURL paparmeter read from the
>>>>>> entity-engine-xml file and hence it gives NullPounter on this paramter.
>>>>>>
>>>>>> Is this somehting that is fixed in other release. I tried this on
>>>>>> 10.4 as well and got same NullpointerException and in debug the
>>>>>> connection URL is not getting read from the xml file. What else
>>>>>> could be wrong? Any other suggestions. I am willing to try
>>>>>> everything to get this working. Worst Case I would be hardcoding but
>>>>>> then it would create problem with localderby as it needs to be read.
>>>>>> Can localderby be copied to mysql?
>>>>>>
>>>>>>
>>>>>> Kapil Garg
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Date: Sat, 30 Oct 2010 06:27:18 -0700
>>>>>>> From: bjfree@free-man.net
>>>>>>> To: user@ofbiz.apache.org
>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>>>
>>>>>>> I would suggest you return the entityengine.xml back to its original
>>>>>>> configuration, add your mysql datasource as the only modification
>>>>>>> to the
>>>>>>> file and try it again.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> =========================
>>>>>>> BJ Freeman
>>>>>>> Strategic Power Office with Supplier
>>>>>>> Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>>
>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>
>>>>>>> Chat Y! messenger: bjfr33man
>>>>>>> Kapil garg sent the following on 10/30/2010 4:30 AM:
>>>>>>>
>>>>>>>>
>>>>>>>> Hello Santosh
>>>>>>>> The IllegalArgument exception went away after I put in a tenatant
>>>>>>>> group name for localderby as show below. However Now I am getting
>>>>>>>> Null Pointer Exception
>>>>>>>> GenericDAO.induceModelFromDB() calls
>>>>>>>> DatabaseUtil.induceModelFromDB(). In
>>>>>>>> DatabaseUtil.induceModelFromDB() method, there is a line of code
>>>>>>>> this.getTableNames() which is comming out tobe null? ANy idea
>>>>>>>> why?Also the DBUTIL class is getting NULL value for connectionURL
>>>>>>>> paramter and the dirveName parameter is also coming out to be null.
>>>>>>>> Why is that? Hence th Nullpointer. I would imagine that this is
>>>>>>>> read from the helperName=localMysql which is howing correctly in
>>>>>>>> debug variable list. AM I missing anything here?
>>>>>>>>
>>>>>>>> Coudl you advise further as you seem to know about this?
>>>>>>>>
>>>>>>>>
>>>>>>>> Kapil Garg
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> Date: Sat, 30 Oct 2010 09:51:54 +0530
>>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>>>>> From: santoshs.indore@gmail.com
>>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>>
>>>>>>>>> *Hello Kapil,
>>>>>>>>> *Update your code, you are having two entries of same name it
>>>>>>>>> must look like
>>>>>>>>> <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="mysql"/>
>>>>>>>>> <group-map group-name="org.ofbiz.olap"
>>>>>>>>> datasource-name="localderbyolap"/>
>>>>>>>>> <group-map group-name="org.ofbiz.tenant"
>>>>>>>>> datasource-name="ocalderbytenant"/>
>>>>>>>>> </delegator>
>>>>>>>>> now create database and execute commands for "clean-all" and
>>>>>>>>> "run-install"
>>>>>>>>> Its done now.
>>>>>>>>> *
>>>>>>>>> Yours,
>>>>>>>>>
>>>>>>>>> Santosh Singh.*
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Sat, Oct 30, 2010 at 1:52 AM, BJ Freeman<bj...@free-man.net>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> just declare the datasource for you db.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> =========================
>>>>>>>>>> BJ Freeman
>>>>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>>>>
>>>>>>>>>> Chat Y! messenger: bjfr33man
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Kapil garg sent the following on 10/29/2010 1:01 PM:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> Does that mean that I dont need to associate a datsource I
>>>>>>>>>>> create with a
>>>>>>>>>>> delagator ? As in the datasource entry need not have a group
>>>>>>>>>>> associated
>>>>>>>>>>> with it? or a delagator associated with it?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Kapil Garg
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Date: Fri, 29 Oct 2010 12:54:13 -0700
>>>>>>>>>>>> From: bjfree@free-man.net
>>>>>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing
>>>>>>>>>>>> Schema
>>>>>>>>>>>>
>>>>>>>>>>>> you did add more than the datasource
>>>>>>>>>>>> you make it default delegator.
>>>>>>>>>>>> this will cause the database to be updated with ofbiz schema
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> =========================
>>>>>>>>>>>>
>>>>>>>>>>>> BJ Freeman
>>>>>>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>>>>>>
>>>>>>>>>>>> Chat Y! messenger: bjfr33man
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Kapil garg sent the following on 10/29/2010 12:45 PM:
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Yes I created only the datasource by putting an entry in the
>>>>>>>>>>>>> entity-engine.xml file. I did not create anything else and
>>>>>>>>>>>>> intentionally put
>>>>>>>>>>>>> it in default delegator. Still I am not ale to Induce. IT
>>>>>>>>>>>>> says unrecognised
>>>>>>>>>>>>> datasource. I also get Null Pointer exception for localmysql
>>>>>>>>>>>>> datasource
>>>>>>>>>>>>> whose entry is already in there. DO I need to do anything else?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Do I need to do ant run-install, restart before hitting induce?
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Kapil Garg
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Date: Fri, 29 Oct 2010 12:41:59 -0700
>>>>>>>>>>>>>> From: bjfree@free-man.net
>>>>>>>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing
>>>>>>>>>>>>>> Schema
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> only create a datasource. nothing else
>>>>>>>>>>>>>> the mysql one you created you use the name.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> =========================
>>>>>>>>>>>>>> BJ Freeman
>>>>>>>>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>>>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Chat Y! messenger: bjfr33man
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Kapil garg sent the following on 10/29/2010 12:29 PM:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I actually did use mysql as the datasource and tried using
>>>>>>>>>>>>>>> the link
>>>>>>>>>>>>>>> below by putting in the datasource name in the text box and
>>>>>>>>>>>>>>> clicking on
>>>>>>>>>>>>>>> Induce. For existing datasources name such as localmysql or
>>>>>>>>>>>>>>> localderby, I
>>>>>>>>>>>>>>> got a NullPointer Exception.
>>>>>>>>>>>>>>> For the one that I had an new entry witin the default
>>>>>>>>>>>>>>> delegator, I got
>>>>>>>>>>>>>>> " unrecognized datasource" name sort of message. Do I need
>>>>>>>>>>>>>>> to create a new
>>>>>>>>>>>>>>> entity-group.xml file for the datasource mysql I created
>>>>>>>>>>>>>>> below even if I am
>>>>>>>>>>>>>>> using a default delagator similar to the data-source
>>>>>>>>>>>>>>> localmysql? Does it
>>>>>>>>>>>>>>> need to be having group name org.ofbiz or something else
>>>>>>>>>>>>>>> within the
>>>>>>>>>>>>>>> delegator tag?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Date: Fri, 29 Oct 2010 12:23:37 -0700
>>>>>>>>>>>>>>>> From: bjfree@free-man.net
>>>>>>>>>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from
>>>>>>>>>>>>>>>> existing Schema
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> use mysql as the datasource
>>>>>>>>>>>>>>>> https://localhost:8443/webtools/control/view/ModelInduceFromDb
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> =========================
>>>>>>>>>>>>>>>> BJ Freeman
>>>>>>>>>>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>>>>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>>>>>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Chat Y! messenger: bjfr33man
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Kapil garg sent the following on 10/29/2010 12:09 PM:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> I am trying to create a entities within OFbiz out of an
>>>>>>>>>>>>>>>>> existing
>>>>>>>>>>>>>>>>> schema in production. Not sure if this is the best way to
>>>>>>>>>>>>>>>>> create entties out
>>>>>>>>>>>>>>>>> of an existing schema. Suggestions are welcomed!!
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> I tried to add a datasource tag in default delegator in
>>>>>>>>>>>>>>>>> entity-engine.xml
>>>>>>>>>>>>>>>>> Followed the instructions on
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Would like to know where I am going wrong. On restart, I
>>>>>>>>>>>>>>>>> realised
>>>>>>>>>>>>>>>>> that ofbiz does not finish to the point that I can get
>>>>>>>>>>>>>>>>> webtools or even
>>>>>>>>>>>>>>>>> login for ecommerce. IT has just stuck at soem point saying
>>>>>>>>>>>>>>>>> ServiceDispatcher.java 584 INFO Sync service..
>>>>>>>>>>>>>>>>> There is no exception or anything but OFbiz does not go
>>>>>>>>>>>>>>>>> further with
>>>>>>>>>>>>>>>>> complete laoding. Anything I am doing wrong?
>>>>>>>>>>>>>>>>> Being a default delegaotr, there was no special
>>>>>>>>>>>>>>>>> entity-group.xml
>>>>>>>>>>>>>>>>> file in the ofbiz 9_04 code base. Hence I did not bother
>>>>>>>>>>>>>>>>> to create an
>>>>>>>>>>>>>>>>> entity-group.xml file
>>>>>>>>>>>>>>>>> My schema name is lronline, following are the entries I
>>>>>>>>>>>>>>>>> had in
>>>>>>>>>>>>>>>>> entity-engine.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"
>>>>>>>>>>>>>>>>> datasource-name="localderby"/>
>>>>>>>>>>>>>>>>> <group-map group-name="org.ofbiz.olap"
>>>>>>>>>>>>>>>>> datasource-name="localderbyolap"/>
>>>>>>>>>>>>>>>>> <group-map group-name="org.ofbiz"
>>>>>>>>>>>>>>>>> datasource-name="mysql"/>
>>>>>>>>>>>>>>>>> </delegator>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> <datasource name="mysql"
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>>>>>>>>>>>>>>>> field-type-name="mysql"
>>>>>>>>>>>>>>>>> check-on-start="true"
>>>>>>>>>>>>>>>>> add-missing-on-start="true"
>>>>>>>>>>>>>>>>> check-pks-on-start="false"
>>>>>>>>>>>>>>>>> use-foreign-keys="true"
>>>>>>>>>>>>>>>>> join-style="ansi-no-parenthesis"
>>>>>>>>>>>>>>>>> alias-view-columns="false"
>>>>>>>>>>>>>>>>> drop-fk-use-foreign-key-keyword="true"
>>>>>>>>>>>>>>>>> table-type="InnoDB"
>>>>>>>>>>>>>>>>> character-set="latin1"
>>>>>>>>>>>>>>>>> collate="latin1_general_cs">
>>>>>>>>>>>>>>>>> <read-data reader-name="seed"/>
>>>>>>>>>>>>>>>>> <read-data reader-name="seed-initial"/>
>>>>>>>>>>>>>>>>> <read-data reader-name="demo"/>
>>>>>>>>>>>>>>>>> <read-data reader-name="ext"/>
>>>>>>>>>>>>>>>>> <inline-jdbc
>>>>>>>>>>>>>>>>> jdbc-driver="com.mysql.jdbc.Driver"
>>>>>>>>>>>>>>>>> jdbc-uri="jdbc:mysql://
>>>>>>>>>>>>>>>>> 127.0.0.1/lronlineonedb?autoReconnect=true"
>>>>>>>>>>>>>>>>> jdbc-username="root"
>>>>>>>>>>>>>>>>> jdbc-password=""
>>>>>>>>>>>>>>>>> isolation-level="ReadCommitted"
>>>>>>>>>>>>>>>>> pool-minsize="2"
>>>>>>>>>>>>>>>>> pool-maxsize="250"/>
>>>>>>>>>>>>>>>>> <!--<jndi-jdbc jndi-server-name="localjndi"
>>>>>>>>>>>>>>>>> jndi-name="java:/MySqlDataSource"
>>>>>>>>>>>>>>>>> isolation-level="Serializable"/>  -->
>>>>>>>>>>>>>>>>> </datasource>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Kapil Garg
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>>
>>
>   		 	   		


RE: Issues Creating Entities in Ofbiz from existing Schema

Posted by Kapil garg <ga...@hotmail.com>.
Ofcourse we need to add mysql drivers. My question was is it a special one for ofbiz?


Kapil Garg
 




> Date: Sat, 30 Oct 2010 07:52:55 -0700
> From: bjfree@free-man.net
> To: user@ofbiz.apache.org
> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> 
> sorry yes you need to load the mysql drivers into the
> framework/entity\lib\jdbc
> 
> =========================
> BJ Freeman
> Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> Specialtymarket.com  <http://www.specialtymarket.com/>
> Systems Integrator-- Glad to Assist
> 
> Chat  Y! messenger: bjfr33man
> 
> 
> BJ Freeman sent the following on 10/30/2010 7:47 AM:
> > OTTB means you have not modified anything on which ever version you use.
> > by default the DB that will be created is derby.
> > for your experimentation, for inducing the entities this sufficient and
> > less confusing.
> >
> > once you have done the
> > ./ant run-install
> > then will have demo data in the derby DB and will not get any start up
> > errors.
> >
> > add your data source you created "mysql".
> > then go to the induce link and it should work, using
> > mysql as the data source
> >
> > =========================
> > BJ Freeman
> > Strategic Power Office with Supplier Automation
> > <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> > Specialtymarket.com <http://www.specialtymarket.com/>
> > Systems Integrator-- Glad to Assist
> >
> > Chat Y! messenger: bjfr33man
> >
> >
> > Kapil garg sent the following on 10/30/2010 7:32 AM:
> >>
> >> When your say OTTB ( as in Out of the box) are you referring to any
> >> trunk version number for ofbiz?
> >> Also in your instruction below are you saying to add the datasource
> >> after running ant run-install? I believe that run-install would run
> >> DBUtil code so wont be need to declare datasources before running ant
> >> run-install?
> >>
> >> Regardless I am not able to connect to the DB. IS there a special jar
> >> file for mysql driver for ofbiz?
> >>
> >>
> >> Kapil Garg
> >>
> >>
> >>
> >>
> >>
> >>> Date: Sat, 30 Oct 2010 07:27:57 -0700
> >>> From: bjfree@free-man.net
> >>> To: user@ofbiz.apache.org
> >>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>
> >>> all my instructions are based on
> >>> 1) OTTB ofbiz
> >>> 2) ./ant run-install was completed successfully
> >>>
> >>> then you add your datasource.
> >>>
> >>> =========================
> >>> BJ Freeman
> >>> Strategic Power Office with Supplier
> >>> Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>
> >>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>> Systems Integrator-- Glad to Assist
> >>>
> >>> Chat Y! messenger: bjfr33man
> >>>
> >>>
> >>> Kapil garg sent the following on 10/30/2010 6:56 AM:
> >>>>
> >>>> I already tried that it gives Null pointer exception. I created an
> >>>> empty database Ofbiz with ofbiz/ofbiz as credentials and used the
> >>>> normal localmysql that came in original file, it still gives
> >>>> NullPointer Exception. For some reason at startup the DBUTIL is not
> >>>> getting the connnectionURL paparmeter read from the
> >>>> entity-engine-xml file and hence it gives NullPounter on this paramter.
> >>>>
> >>>> Is this somehting that is fixed in other release. I tried this on
> >>>> 10.4 as well and got same NullpointerException and in debug the
> >>>> connection URL is not getting read from the xml file. What else
> >>>> could be wrong? Any other suggestions. I am willing to try
> >>>> everything to get this working. Worst Case I would be hardcoding but
> >>>> then it would create problem with localderby as it needs to be read.
> >>>> Can localderby be copied to mysql?
> >>>>
> >>>>
> >>>> Kapil Garg
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>> Date: Sat, 30 Oct 2010 06:27:18 -0700
> >>>>> From: bjfree@free-man.net
> >>>>> To: user@ofbiz.apache.org
> >>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>>>
> >>>>> I would suggest you return the entityengine.xml back to its original
> >>>>> configuration, add your mysql datasource as the only modification
> >>>>> to the
> >>>>> file and try it again.
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> =========================
> >>>>> BJ Freeman
> >>>>> Strategic Power Office with Supplier
> >>>>> Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>>>
> >>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>>> Systems Integrator-- Glad to Assist
> >>>>>
> >>>>> Chat Y! messenger: bjfr33man
> >>>>> Kapil garg sent the following on 10/30/2010 4:30 AM:
> >>>>>
> >>>>>>
> >>>>>> Hello Santosh
> >>>>>> The IllegalArgument exception went away after I put in a tenatant
> >>>>>> group name for localderby as show below. However Now I am getting
> >>>>>> Null Pointer Exception
> >>>>>> GenericDAO.induceModelFromDB() calls
> >>>>>> DatabaseUtil.induceModelFromDB(). In
> >>>>>> DatabaseUtil.induceModelFromDB() method, there is a line of code
> >>>>>> this.getTableNames() which is comming out tobe null? ANy idea
> >>>>>> why?Also the DBUTIL class is getting NULL value for connectionURL
> >>>>>> paramter and the dirveName parameter is also coming out to be null.
> >>>>>> Why is that? Hence th Nullpointer. I would imagine that this is
> >>>>>> read from the helperName=localMysql which is howing correctly in
> >>>>>> debug variable list. AM I missing anything here?
> >>>>>>
> >>>>>> Coudl you advise further as you seem to know about this?
> >>>>>>
> >>>>>>
> >>>>>> Kapil Garg
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>> Date: Sat, 30 Oct 2010 09:51:54 +0530
> >>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>>>>> From: santoshs.indore@gmail.com
> >>>>>>> To: user@ofbiz.apache.org
> >>>>>>>
> >>>>>>> *Hello Kapil,
> >>>>>>> *Update your code, you are having two entries of same name it
> >>>>>>> must look like
> >>>>>>> <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="mysql"/>
> >>>>>>> <group-map group-name="org.ofbiz.olap"
> >>>>>>> datasource-name="localderbyolap"/>
> >>>>>>> <group-map group-name="org.ofbiz.tenant"
> >>>>>>> datasource-name="ocalderbytenant"/>
> >>>>>>> </delegator>
> >>>>>>> now create database and execute commands for "clean-all" and
> >>>>>>> "run-install"
> >>>>>>> Its done now.
> >>>>>>> *
> >>>>>>> Yours,
> >>>>>>>
> >>>>>>> Santosh Singh.*
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> On Sat, Oct 30, 2010 at 1:52 AM, BJ Freeman<bj...@free-man.net>
> >>>>>>> wrote:
> >>>>>>>
> >>>>>>>> just declare the datasource for you db.
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> =========================
> >>>>>>>> BJ Freeman
> >>>>>>>> Strategic Power Office with Supplier Automation<
> >>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>>>>>> Systems Integrator-- Glad to Assist
> >>>>>>>>
> >>>>>>>> Chat Y! messenger: bjfr33man
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> Kapil garg sent the following on 10/29/2010 1:01 PM:
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>> Does that mean that I dont need to associate a datsource I
> >>>>>>>>> create with a
> >>>>>>>>> delagator ? As in the datasource entry need not have a group
> >>>>>>>>> associated
> >>>>>>>>> with it? or a delagator associated with it?
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> Kapil Garg
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> Date: Fri, 29 Oct 2010 12:54:13 -0700
> >>>>>>>>>> From: bjfree@free-man.net
> >>>>>>>>>> To: user@ofbiz.apache.org
> >>>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing
> >>>>>>>>>> Schema
> >>>>>>>>>>
> >>>>>>>>>> you did add more than the datasource
> >>>>>>>>>> you make it default delegator.
> >>>>>>>>>> this will cause the database to be updated with ofbiz schema
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> =========================
> >>>>>>>>>>
> >>>>>>>>>> BJ Freeman
> >>>>>>>>>> Strategic Power Office with Supplier Automation<
> >>>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>>>>>>>> Systems Integrator-- Glad to Assist
> >>>>>>>>>>
> >>>>>>>>>> Chat Y! messenger: bjfr33man
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> Kapil garg sent the following on 10/29/2010 12:45 PM:
> >>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>> Yes I created only the datasource by putting an entry in the
> >>>>>>>>>>> entity-engine.xml file. I did not create anything else and
> >>>>>>>>>>> intentionally put
> >>>>>>>>>>> it in default delegator. Still I am not ale to Induce. IT
> >>>>>>>>>>> says unrecognised
> >>>>>>>>>>> datasource. I also get Null Pointer exception for localmysql
> >>>>>>>>>>> datasource
> >>>>>>>>>>> whose entry is already in there. DO I need to do anything else?
> >>>>>>>>>>>
> >>>>>>>>>>> Do I need to do ant run-install, restart before hitting induce?
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>> Kapil Garg
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>> Date: Fri, 29 Oct 2010 12:41:59 -0700
> >>>>>>>>>>>> From: bjfree@free-man.net
> >>>>>>>>>>>> To: user@ofbiz.apache.org
> >>>>>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing
> >>>>>>>>>>>> Schema
> >>>>>>>>>>>>
> >>>>>>>>>>>> only create a datasource. nothing else
> >>>>>>>>>>>> the mysql one you created you use the name.
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>> =========================
> >>>>>>>>>>>> BJ Freeman
> >>>>>>>>>>>> Strategic Power Office with Supplier Automation<
> >>>>>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>>>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>>>>>>>>>> Systems Integrator-- Glad to Assist
> >>>>>>>>>>>>
> >>>>>>>>>>>> Chat Y! messenger: bjfr33man
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>> Kapil garg sent the following on 10/29/2010 12:29 PM:
> >>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> I actually did use mysql as the datasource and tried using
> >>>>>>>>>>>>> the link
> >>>>>>>>>>>>> below by putting in the datasource name in the text box and
> >>>>>>>>>>>>> clicking on
> >>>>>>>>>>>>> Induce. For existing datasources name such as localmysql or
> >>>>>>>>>>>>> localderby, I
> >>>>>>>>>>>>> got a NullPointer Exception.
> >>>>>>>>>>>>> For the one that I had an new entry witin the default
> >>>>>>>>>>>>> delegator, I got
> >>>>>>>>>>>>> " unrecognized datasource" name sort of message. Do I need
> >>>>>>>>>>>>> to create a new
> >>>>>>>>>>>>> entity-group.xml file for the datasource mysql I created
> >>>>>>>>>>>>> below even if I am
> >>>>>>>>>>>>> using a default delagator similar to the data-source
> >>>>>>>>>>>>> localmysql? Does it
> >>>>>>>>>>>>> need to be having group name org.ofbiz or something else
> >>>>>>>>>>>>> within the
> >>>>>>>>>>>>> delegator tag?
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>> Date: Fri, 29 Oct 2010 12:23:37 -0700
> >>>>>>>>>>>>>> From: bjfree@free-man.net
> >>>>>>>>>>>>>> To: user@ofbiz.apache.org
> >>>>>>>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from
> >>>>>>>>>>>>>> existing Schema
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> use mysql as the datasource
> >>>>>>>>>>>>>> https://localhost:8443/webtools/control/view/ModelInduceFromDb
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> =========================
> >>>>>>>>>>>>>> BJ Freeman
> >>>>>>>>>>>>>> Strategic Power Office with Supplier Automation<
> >>>>>>>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>>>>>>>>>>>> Systems Integrator-- Glad to Assist
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> Chat Y! messenger: bjfr33man
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>> Kapil garg sent the following on 10/29/2010 12:09 PM:
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> I am trying to create a entities within OFbiz out of an
> >>>>>>>>>>>>>>> existing
> >>>>>>>>>>>>>>> schema in production. Not sure if this is the best way to
> >>>>>>>>>>>>>>> create entties out
> >>>>>>>>>>>>>>> of an existing schema. Suggestions are welcomed!!
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> I tried to add a datasource tag in default delegator in
> >>>>>>>>>>>>>>> entity-engine.xml
> >>>>>>>>>>>>>>> Followed the instructions on
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> Would like to know where I am going wrong. On restart, I
> >>>>>>>>>>>>>>> realised
> >>>>>>>>>>>>>>> that ofbiz does not finish to the point that I can get
> >>>>>>>>>>>>>>> webtools or even
> >>>>>>>>>>>>>>> login for ecommerce. IT has just stuck at soem point saying
> >>>>>>>>>>>>>>> ServiceDispatcher.java 584 INFO Sync service..
> >>>>>>>>>>>>>>> There is no exception or anything but OFbiz does not go
> >>>>>>>>>>>>>>> further with
> >>>>>>>>>>>>>>> complete laoding. Anything I am doing wrong?
> >>>>>>>>>>>>>>> Being a default delegaotr, there was no special
> >>>>>>>>>>>>>>> entity-group.xml
> >>>>>>>>>>>>>>> file in the ofbiz 9_04 code base. Hence I did not bother
> >>>>>>>>>>>>>>> to create an
> >>>>>>>>>>>>>>> entity-group.xml file
> >>>>>>>>>>>>>>> My schema name is lronline, following are the entries I
> >>>>>>>>>>>>>>> had in
> >>>>>>>>>>>>>>> entity-engine.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"
> >>>>>>>>>>>>>>> datasource-name="localderby"/>
> >>>>>>>>>>>>>>> <group-map group-name="org.ofbiz.olap"
> >>>>>>>>>>>>>>> datasource-name="localderbyolap"/>
> >>>>>>>>>>>>>>> <group-map group-name="org.ofbiz"
> >>>>>>>>>>>>>>> datasource-name="mysql"/>
> >>>>>>>>>>>>>>> </delegator>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> <datasource name="mysql"
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
> >>>>>>>>>>>>>>> field-type-name="mysql"
> >>>>>>>>>>>>>>> check-on-start="true"
> >>>>>>>>>>>>>>> add-missing-on-start="true"
> >>>>>>>>>>>>>>> check-pks-on-start="false"
> >>>>>>>>>>>>>>> use-foreign-keys="true"
> >>>>>>>>>>>>>>> join-style="ansi-no-parenthesis"
> >>>>>>>>>>>>>>> alias-view-columns="false"
> >>>>>>>>>>>>>>> drop-fk-use-foreign-key-keyword="true"
> >>>>>>>>>>>>>>> table-type="InnoDB"
> >>>>>>>>>>>>>>> character-set="latin1"
> >>>>>>>>>>>>>>> collate="latin1_general_cs">
> >>>>>>>>>>>>>>> <read-data reader-name="seed"/>
> >>>>>>>>>>>>>>> <read-data reader-name="seed-initial"/>
> >>>>>>>>>>>>>>> <read-data reader-name="demo"/>
> >>>>>>>>>>>>>>> <read-data reader-name="ext"/>
> >>>>>>>>>>>>>>> <inline-jdbc
> >>>>>>>>>>>>>>> jdbc-driver="com.mysql.jdbc.Driver"
> >>>>>>>>>>>>>>> jdbc-uri="jdbc:mysql://
> >>>>>>>>>>>>>>> 127.0.0.1/lronlineonedb?autoReconnect=true"
> >>>>>>>>>>>>>>> jdbc-username="root"
> >>>>>>>>>>>>>>> jdbc-password=""
> >>>>>>>>>>>>>>> isolation-level="ReadCommitted"
> >>>>>>>>>>>>>>> pool-minsize="2"
> >>>>>>>>>>>>>>> pool-maxsize="250"/>
> >>>>>>>>>>>>>>> <!--<jndi-jdbc jndi-server-name="localjndi"
> >>>>>>>>>>>>>>> jndi-name="java:/MySqlDataSource"
> >>>>>>>>>>>>>>> isolation-level="Serializable"/> -->
> >>>>>>>>>>>>>>> </datasource>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> Kapil Garg
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>
> >>>>
> >>>
> >>
> >
> >
> 
 		 	   		  

Re: Issues Creating Entities in Ofbiz from existing Schema

Posted by BJ Freeman <bj...@free-man.net>.
sorry yes you need to load the mysql drivers into the
framework/entity\lib\jdbc

=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man


BJ Freeman sent the following on 10/30/2010 7:47 AM:
> OTTB means you have not modified anything on which ever version you use.
> by default the DB that will be created is derby.
> for your experimentation, for inducing the entities this sufficient and
> less confusing.
>
> once you have done the
> ./ant run-install
> then will have demo data in the derby DB and will not get any start up
> errors.
>
> add your data source you created "mysql".
> then go to the induce link and it should work, using
> mysql as the data source
>
> =========================
> BJ Freeman
> Strategic Power Office with Supplier Automation
> <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> Specialtymarket.com <http://www.specialtymarket.com/>
> Systems Integrator-- Glad to Assist
>
> Chat Y! messenger: bjfr33man
>
>
> Kapil garg sent the following on 10/30/2010 7:32 AM:
>>
>> When your say OTTB ( as in Out of the box) are you referring to any
>> trunk version number for ofbiz?
>> Also in your instruction below are you saying to add the datasource
>> after running ant run-install? I believe that run-install would run
>> DBUtil code so wont be need to declare datasources before running ant
>> run-install?
>>
>> Regardless I am not able to connect to the DB. IS there a special jar
>> file for mysql driver for ofbiz?
>>
>>
>> Kapil Garg
>>
>>
>>
>>
>>
>>> Date: Sat, 30 Oct 2010 07:27:57 -0700
>>> From: bjfree@free-man.net
>>> To: user@ofbiz.apache.org
>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>
>>> all my instructions are based on
>>> 1) OTTB ofbiz
>>> 2) ./ant run-install was completed successfully
>>>
>>> then you add your datasource.
>>>
>>> =========================
>>> BJ Freeman
>>> Strategic Power Office with Supplier
>>> Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>
>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>> Systems Integrator-- Glad to Assist
>>>
>>> Chat Y! messenger: bjfr33man
>>>
>>>
>>> Kapil garg sent the following on 10/30/2010 6:56 AM:
>>>>
>>>> I already tried that it gives Null pointer exception. I created an
>>>> empty database Ofbiz with ofbiz/ofbiz as credentials and used the
>>>> normal localmysql that came in original file, it still gives
>>>> NullPointer Exception. For some reason at startup the DBUTIL is not
>>>> getting the connnectionURL paparmeter read from the
>>>> entity-engine-xml file and hence it gives NullPounter on this paramter.
>>>>
>>>> Is this somehting that is fixed in other release. I tried this on
>>>> 10.4 as well and got same NullpointerException and in debug the
>>>> connection URL is not getting read from the xml file. What else
>>>> could be wrong? Any other suggestions. I am willing to try
>>>> everything to get this working. Worst Case I would be hardcoding but
>>>> then it would create problem with localderby as it needs to be read.
>>>> Can localderby be copied to mysql?
>>>>
>>>>
>>>> Kapil Garg
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> Date: Sat, 30 Oct 2010 06:27:18 -0700
>>>>> From: bjfree@free-man.net
>>>>> To: user@ofbiz.apache.org
>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>
>>>>> I would suggest you return the entityengine.xml back to its original
>>>>> configuration, add your mysql datasource as the only modification
>>>>> to the
>>>>> file and try it again.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> =========================
>>>>> BJ Freeman
>>>>> Strategic Power Office with Supplier
>>>>> Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>
>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>> Systems Integrator-- Glad to Assist
>>>>>
>>>>> Chat Y! messenger: bjfr33man
>>>>> Kapil garg sent the following on 10/30/2010 4:30 AM:
>>>>>
>>>>>>
>>>>>> Hello Santosh
>>>>>> The IllegalArgument exception went away after I put in a tenatant
>>>>>> group name for localderby as show below. However Now I am getting
>>>>>> Null Pointer Exception
>>>>>> GenericDAO.induceModelFromDB() calls
>>>>>> DatabaseUtil.induceModelFromDB(). In
>>>>>> DatabaseUtil.induceModelFromDB() method, there is a line of code
>>>>>> this.getTableNames() which is comming out tobe null? ANy idea
>>>>>> why?Also the DBUTIL class is getting NULL value for connectionURL
>>>>>> paramter and the dirveName parameter is also coming out to be null.
>>>>>> Why is that? Hence th Nullpointer. I would imagine that this is
>>>>>> read from the helperName=localMysql which is howing correctly in
>>>>>> debug variable list. AM I missing anything here?
>>>>>>
>>>>>> Coudl you advise further as you seem to know about this?
>>>>>>
>>>>>>
>>>>>> Kapil Garg
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Date: Sat, 30 Oct 2010 09:51:54 +0530
>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>>> From: santoshs.indore@gmail.com
>>>>>>> To: user@ofbiz.apache.org
>>>>>>>
>>>>>>> *Hello Kapil,
>>>>>>> *Update your code, you are having two entries of same name it
>>>>>>> must look like
>>>>>>> <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="mysql"/>
>>>>>>> <group-map group-name="org.ofbiz.olap"
>>>>>>> datasource-name="localderbyolap"/>
>>>>>>> <group-map group-name="org.ofbiz.tenant"
>>>>>>> datasource-name="ocalderbytenant"/>
>>>>>>> </delegator>
>>>>>>> now create database and execute commands for "clean-all" and
>>>>>>> "run-install"
>>>>>>> Its done now.
>>>>>>> *
>>>>>>> Yours,
>>>>>>>
>>>>>>> Santosh Singh.*
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Sat, Oct 30, 2010 at 1:52 AM, BJ Freeman<bj...@free-man.net>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> just declare the datasource for you db.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> =========================
>>>>>>>> BJ Freeman
>>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>>
>>>>>>>> Chat Y! messenger: bjfr33man
>>>>>>>>
>>>>>>>>
>>>>>>>> Kapil garg sent the following on 10/29/2010 1:01 PM:
>>>>>>>>
>>>>>>>>
>>>>>>>>> Does that mean that I dont need to associate a datsource I
>>>>>>>>> create with a
>>>>>>>>> delagator ? As in the datasource entry need not have a group
>>>>>>>>> associated
>>>>>>>>> with it? or a delagator associated with it?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Kapil Garg
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Date: Fri, 29 Oct 2010 12:54:13 -0700
>>>>>>>>>> From: bjfree@free-man.net
>>>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing
>>>>>>>>>> Schema
>>>>>>>>>>
>>>>>>>>>> you did add more than the datasource
>>>>>>>>>> you make it default delegator.
>>>>>>>>>> this will cause the database to be updated with ofbiz schema
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> =========================
>>>>>>>>>>
>>>>>>>>>> BJ Freeman
>>>>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>>>>
>>>>>>>>>> Chat Y! messenger: bjfr33man
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Kapil garg sent the following on 10/29/2010 12:45 PM:
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Yes I created only the datasource by putting an entry in the
>>>>>>>>>>> entity-engine.xml file. I did not create anything else and
>>>>>>>>>>> intentionally put
>>>>>>>>>>> it in default delegator. Still I am not ale to Induce. IT
>>>>>>>>>>> says unrecognised
>>>>>>>>>>> datasource. I also get Null Pointer exception for localmysql
>>>>>>>>>>> datasource
>>>>>>>>>>> whose entry is already in there. DO I need to do anything else?
>>>>>>>>>>>
>>>>>>>>>>> Do I need to do ant run-install, restart before hitting induce?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Kapil Garg
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Date: Fri, 29 Oct 2010 12:41:59 -0700
>>>>>>>>>>>> From: bjfree@free-man.net
>>>>>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing
>>>>>>>>>>>> Schema
>>>>>>>>>>>>
>>>>>>>>>>>> only create a datasource. nothing else
>>>>>>>>>>>> the mysql one you created you use the name.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> =========================
>>>>>>>>>>>> BJ Freeman
>>>>>>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>>>>>>
>>>>>>>>>>>> Chat Y! messenger: bjfr33man
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Kapil garg sent the following on 10/29/2010 12:29 PM:
>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> I actually did use mysql as the datasource and tried using
>>>>>>>>>>>>> the link
>>>>>>>>>>>>> below by putting in the datasource name in the text box and
>>>>>>>>>>>>> clicking on
>>>>>>>>>>>>> Induce. For existing datasources name such as localmysql or
>>>>>>>>>>>>> localderby, I
>>>>>>>>>>>>> got a NullPointer Exception.
>>>>>>>>>>>>> For the one that I had an new entry witin the default
>>>>>>>>>>>>> delegator, I got
>>>>>>>>>>>>> " unrecognized datasource" name sort of message. Do I need
>>>>>>>>>>>>> to create a new
>>>>>>>>>>>>> entity-group.xml file for the datasource mysql I created
>>>>>>>>>>>>> below even if I am
>>>>>>>>>>>>> using a default delagator similar to the data-source
>>>>>>>>>>>>> localmysql? Does it
>>>>>>>>>>>>> need to be having group name org.ofbiz or something else
>>>>>>>>>>>>> within the
>>>>>>>>>>>>> delegator tag?
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Date: Fri, 29 Oct 2010 12:23:37 -0700
>>>>>>>>>>>>>> From: bjfree@free-man.net
>>>>>>>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from
>>>>>>>>>>>>>> existing Schema
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> use mysql as the datasource
>>>>>>>>>>>>>> https://localhost:8443/webtools/control/view/ModelInduceFromDb
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> =========================
>>>>>>>>>>>>>> BJ Freeman
>>>>>>>>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>>>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Chat Y! messenger: bjfr33man
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Kapil garg sent the following on 10/29/2010 12:09 PM:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I am trying to create a entities within OFbiz out of an
>>>>>>>>>>>>>>> existing
>>>>>>>>>>>>>>> schema in production. Not sure if this is the best way to
>>>>>>>>>>>>>>> create entties out
>>>>>>>>>>>>>>> of an existing schema. Suggestions are welcomed!!
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I tried to add a datasource tag in default delegator in
>>>>>>>>>>>>>>> entity-engine.xml
>>>>>>>>>>>>>>> Followed the instructions on
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Would like to know where I am going wrong. On restart, I
>>>>>>>>>>>>>>> realised
>>>>>>>>>>>>>>> that ofbiz does not finish to the point that I can get
>>>>>>>>>>>>>>> webtools or even
>>>>>>>>>>>>>>> login for ecommerce. IT has just stuck at soem point saying
>>>>>>>>>>>>>>> ServiceDispatcher.java 584 INFO Sync service..
>>>>>>>>>>>>>>> There is no exception or anything but OFbiz does not go
>>>>>>>>>>>>>>> further with
>>>>>>>>>>>>>>> complete laoding. Anything I am doing wrong?
>>>>>>>>>>>>>>> Being a default delegaotr, there was no special
>>>>>>>>>>>>>>> entity-group.xml
>>>>>>>>>>>>>>> file in the ofbiz 9_04 code base. Hence I did not bother
>>>>>>>>>>>>>>> to create an
>>>>>>>>>>>>>>> entity-group.xml file
>>>>>>>>>>>>>>> My schema name is lronline, following are the entries I
>>>>>>>>>>>>>>> had in
>>>>>>>>>>>>>>> entity-engine.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"
>>>>>>>>>>>>>>> datasource-name="localderby"/>
>>>>>>>>>>>>>>> <group-map group-name="org.ofbiz.olap"
>>>>>>>>>>>>>>> datasource-name="localderbyolap"/>
>>>>>>>>>>>>>>> <group-map group-name="org.ofbiz"
>>>>>>>>>>>>>>> datasource-name="mysql"/>
>>>>>>>>>>>>>>> </delegator>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> <datasource name="mysql"
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>>>>>>>>>>>>>> field-type-name="mysql"
>>>>>>>>>>>>>>> check-on-start="true"
>>>>>>>>>>>>>>> add-missing-on-start="true"
>>>>>>>>>>>>>>> check-pks-on-start="false"
>>>>>>>>>>>>>>> use-foreign-keys="true"
>>>>>>>>>>>>>>> join-style="ansi-no-parenthesis"
>>>>>>>>>>>>>>> alias-view-columns="false"
>>>>>>>>>>>>>>> drop-fk-use-foreign-key-keyword="true"
>>>>>>>>>>>>>>> table-type="InnoDB"
>>>>>>>>>>>>>>> character-set="latin1"
>>>>>>>>>>>>>>> collate="latin1_general_cs">
>>>>>>>>>>>>>>> <read-data reader-name="seed"/>
>>>>>>>>>>>>>>> <read-data reader-name="seed-initial"/>
>>>>>>>>>>>>>>> <read-data reader-name="demo"/>
>>>>>>>>>>>>>>> <read-data reader-name="ext"/>
>>>>>>>>>>>>>>> <inline-jdbc
>>>>>>>>>>>>>>> jdbc-driver="com.mysql.jdbc.Driver"
>>>>>>>>>>>>>>> jdbc-uri="jdbc:mysql://
>>>>>>>>>>>>>>> 127.0.0.1/lronlineonedb?autoReconnect=true"
>>>>>>>>>>>>>>> jdbc-username="root"
>>>>>>>>>>>>>>> jdbc-password=""
>>>>>>>>>>>>>>> isolation-level="ReadCommitted"
>>>>>>>>>>>>>>> pool-minsize="2"
>>>>>>>>>>>>>>> pool-maxsize="250"/>
>>>>>>>>>>>>>>> <!--<jndi-jdbc jndi-server-name="localjndi"
>>>>>>>>>>>>>>> jndi-name="java:/MySqlDataSource"
>>>>>>>>>>>>>>> isolation-level="Serializable"/> -->
>>>>>>>>>>>>>>> </datasource>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Kapil Garg
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>
>>>
>>
>
>


Re: Issues Creating Entities in Ofbiz from existing Schema

Posted by BJ Freeman <bj...@free-man.net>.
OTTB means you have not modified anything on which ever version you use.
by default the DB that will be created is derby.
for your experimentation, for inducing the entities this sufficient and 
less confusing.

once you have done the
./ant run-install
then will have demo data in the derby DB and will not get any start up 
errors.

add your data source you created "mysql".
then go to the induce link and it should work, using
mysql as the data source

=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man


Kapil garg sent the following on 10/30/2010 7:32 AM:
>
> When your say OTTB ( as in Out of the box) are you referring to any trunk version number for ofbiz?
> Also in your instruction below are you saying to add the datasource after running ant run-install? I believe that run-install would run DBUtil code so wont be need to declare datasources before running ant run-install?
>
> Regardless I am not able to connect to the DB. IS there a special jar file for mysql driver for ofbiz?
>
>
> Kapil Garg
>
>
>
>
>
>> Date: Sat, 30 Oct 2010 07:27:57 -0700
>> From: bjfree@free-man.net
>> To: user@ofbiz.apache.org
>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>
>> all my instructions are based on
>> 1) OTTB ofbiz
>> 2) ./ant run-install was completed successfully
>>
>> then you add your datasource.
>>
>> =========================
>> BJ Freeman
>> Strategic Power Office with Supplier Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>> Specialtymarket.com<http://www.specialtymarket.com/>
>> Systems Integrator-- Glad to Assist
>>
>> Chat  Y! messenger: bjfr33man
>>
>>
>> Kapil garg sent the following on 10/30/2010 6:56 AM:
>>>
>>> I already tried that it gives Null pointer exception. I created an empty database Ofbiz with ofbiz/ofbiz as credentials and used the normal localmysql that came in original file, it still gives NullPointer Exception. For some reason at startup the DBUTIL is not getting the connnectionURL paparmeter read from the entity-engine-xml file and hence it gives NullPounter on this paramter.
>>>
>>> Is this somehting that is fixed in other release. I tried this on 10.4 as well and got same NullpointerException and in debug the connection URL is not getting read from the xml file. What else could be wrong? Any other suggestions. I am willing to try everything to get this working. Worst Case I would be hardcoding but then it would create problem with localderby as it needs to be read. Can localderby be copied to mysql?
>>>
>>>
>>> Kapil Garg
>>>
>>>
>>>
>>>
>>>
>>>> Date: Sat, 30 Oct 2010 06:27:18 -0700
>>>> From: bjfree@free-man.net
>>>> To: user@ofbiz.apache.org
>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>
>>>> I would suggest you return the entityengine.xml back to its original
>>>> configuration, add your mysql datasource as the only modification to the
>>>> file and try it again.
>>>>
>>>>
>>>>
>>>>
>>>> =========================
>>>> BJ Freeman
>>>> Strategic Power Office with Supplier Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>> Systems Integrator-- Glad to Assist
>>>>
>>>> Chat  Y! messenger: bjfr33man
>>>> Kapil garg sent the following on 10/30/2010 4:30 AM:
>>>>
>>>>>
>>>>> Hello Santosh
>>>>> The IllegalArgument exception went away after I put in a tenatant group name for localderby as show below. However Now I am getting Null Pointer Exception
>>>>> GenericDAO.induceModelFromDB() calls DatabaseUtil.induceModelFromDB(). In DatabaseUtil.induceModelFromDB() method, there is a line of code this.getTableNames() which is comming out tobe null? ANy idea why?Also the DBUTIL class is getting NULL value for connectionURL paramter and the dirveName parameter is also coming out to be null.
>>>>> Why is that? Hence th Nullpointer. I would imagine that this is read from the helperName=localMysql which is howing correctly in debug variable list. AM I missing anything here?
>>>>>
>>>>> Coudl you advise further as you seem to know about this?
>>>>>
>>>>>
>>>>> Kapil Garg
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Date: Sat, 30 Oct 2010 09:51:54 +0530
>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>> From: santoshs.indore@gmail.com
>>>>>> To: user@ofbiz.apache.org
>>>>>>
>>>>>> *Hello  Kapil,
>>>>>> *Update your code, you are having two entries of same name it must look like
>>>>>>          <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="mysql"/>
>>>>>>               <group-map group-name="org.ofbiz.olap"
>>>>>> datasource-name="localderbyolap"/>
>>>>>>               <group-map group-name="org.ofbiz.tenant"
>>>>>> datasource-name="ocalderbytenant"/>
>>>>>>           </delegator>
>>>>>> now create database and execute commands for "clean-all" and "run-install"
>>>>>> Its done now.
>>>>>> *
>>>>>> Yours,
>>>>>>
>>>>>> Santosh Singh.*
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Sat, Oct 30, 2010 at 1:52 AM, BJ Freeman<bj...@free-man.net>    wrote:
>>>>>>
>>>>>>> just declare the datasource for you db.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> =========================
>>>>>>> BJ Freeman
>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>
>>>>>>> Chat  Y! messenger: bjfr33man
>>>>>>>
>>>>>>>
>>>>>>> Kapil garg sent the following on 10/29/2010 1:01 PM:
>>>>>>>
>>>>>>>
>>>>>>>> Does that mean that I dont need to associate a datsource I create with a
>>>>>>>> delagator ? As in the datasource entry need  not have a group associated
>>>>>>>> with it? or a delagator associated with it?
>>>>>>>>
>>>>>>>>
>>>>>>>> Kapil Garg
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>     Date: Fri, 29 Oct 2010 12:54:13 -0700
>>>>>>>>> From: bjfree@free-man.net
>>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>>>>>
>>>>>>>>> you did add more than the datasource
>>>>>>>>> you make it default delegator.
>>>>>>>>> this will cause the database to be updated with ofbiz schema
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> =========================
>>>>>>>>>
>>>>>>>>> BJ Freeman
>>>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>>>
>>>>>>>>> Chat  Y! messenger: bjfr33man
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Kapil garg sent the following on 10/29/2010 12:45 PM:
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Yes I created only the datasource by putting an entry in the
>>>>>>>>>> entity-engine.xml file. I did not create anything else and intentionally put
>>>>>>>>>> it in default delegator. Still I am not ale to Induce. IT says unrecognised
>>>>>>>>>> datasource. I also get Null Pointer exception for localmysql datasource
>>>>>>>>>> whose entry is already in there. DO I need to do anything else?
>>>>>>>>>>
>>>>>>>>>> Do I need to do ant run-install, restart before hitting induce?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Kapil Garg
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>     Date: Fri, 29 Oct 2010 12:41:59 -0700
>>>>>>>>>>> From: bjfree@free-man.net
>>>>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>>>>>>>
>>>>>>>>>>> only create a datasource. nothing else
>>>>>>>>>>> the mysql one you created you use the name.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> =========================
>>>>>>>>>>> BJ Freeman
>>>>>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>>>>>
>>>>>>>>>>> Chat  Y! messenger: bjfr33man
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Kapil garg sent the following on 10/29/2010 12:29 PM:
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> I actually did use mysql as the datasource and tried using the link
>>>>>>>>>>>> below by putting in the datasource name in the text box and clicking on
>>>>>>>>>>>> Induce. For existing datasources name such as localmysql or localderby, I
>>>>>>>>>>>> got a NullPointer Exception.
>>>>>>>>>>>> For the one that I had an new entry witin the default delegator, I got
>>>>>>>>>>>> " unrecognized datasource" name sort of message. Do I need to create a new
>>>>>>>>>>>> entity-group.xml file  for the datasource mysql I created below even if I am
>>>>>>>>>>>> using a default delagator similar to the data-source localmysql? Does it
>>>>>>>>>>>> need to be having group name org.ofbiz or something else within the
>>>>>>>>>>>> delegator tag?
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>     Date: Fri, 29 Oct 2010 12:23:37 -0700
>>>>>>>>>>>>> From: bjfree@free-man.net
>>>>>>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>>>>>>>>>
>>>>>>>>>>>>> use mysql as the datasource
>>>>>>>>>>>>> https://localhost:8443/webtools/control/view/ModelInduceFromDb
>>>>>>>>>>>>>
>>>>>>>>>>>>> =========================
>>>>>>>>>>>>> BJ Freeman
>>>>>>>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>>>>>>>
>>>>>>>>>>>>> Chat  Y! messenger: bjfr33man
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Kapil garg sent the following on 10/29/2010 12:09 PM:
>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I am trying to create a entities within OFbiz out of an existing
>>>>>>>>>>>>>> schema in production. Not sure if this is the best way to create entties out
>>>>>>>>>>>>>> of an existing schema. Suggestions are welcomed!!
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I tried to add a datasource tag in default delegator in
>>>>>>>>>>>>>> entity-engine.xml
>>>>>>>>>>>>>> Followed the instructions on
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
>>>>>>>>>>>>>> Would like to know where I am going wrong. On restart, I realised
>>>>>>>>>>>>>> that ofbiz does not finish to the point that I can get webtools or even
>>>>>>>>>>>>>> login for ecommerce. IT has just stuck at soem point saying
>>>>>>>>>>>>>>     ServiceDispatcher.java 584 INFO Sync service..
>>>>>>>>>>>>>> There is no exception or anything but OFbiz does not go further with
>>>>>>>>>>>>>> complete laoding. Anything I am doing wrong?
>>>>>>>>>>>>>> Being a default delegaotr, there was no special entity-group.xml
>>>>>>>>>>>>>> file in the ofbiz 9_04 code base. Hence I did not bother to create an
>>>>>>>>>>>>>> entity-group.xml file
>>>>>>>>>>>>>> My schema name is lronline, following are the entries I had in
>>>>>>>>>>>>>> entity-engine.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"
>>>>>>>>>>>>>> datasource-name="localderby"/>
>>>>>>>>>>>>>>               <group-map group-name="org.ofbiz.olap"
>>>>>>>>>>>>>> datasource-name="localderbyolap"/>
>>>>>>>>>>>>>>               <group-map group-name="org.ofbiz"
>>>>>>>>>>>>>> datasource-name="mysql"/>
>>>>>>>>>>>>>>           </delegator>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> <datasource name="mysql"
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>     helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>>>>>>>>>>>>>                   field-type-name="mysql"
>>>>>>>>>>>>>>                   check-on-start="true"
>>>>>>>>>>>>>>                   add-missing-on-start="true"
>>>>>>>>>>>>>>                   check-pks-on-start="false"
>>>>>>>>>>>>>>                   use-foreign-keys="true"
>>>>>>>>>>>>>>                   join-style="ansi-no-parenthesis"
>>>>>>>>>>>>>>                   alias-view-columns="false"
>>>>>>>>>>>>>>                   drop-fk-use-foreign-key-keyword="true"
>>>>>>>>>>>>>>                   table-type="InnoDB"
>>>>>>>>>>>>>>                   character-set="latin1"
>>>>>>>>>>>>>>                   collate="latin1_general_cs">
>>>>>>>>>>>>>>               <read-data reader-name="seed"/>
>>>>>>>>>>>>>>               <read-data reader-name="seed-initial"/>
>>>>>>>>>>>>>>               <read-data reader-name="demo"/>
>>>>>>>>>>>>>>               <read-data reader-name="ext"/>
>>>>>>>>>>>>>>               <inline-jdbc
>>>>>>>>>>>>>>                       jdbc-driver="com.mysql.jdbc.Driver"
>>>>>>>>>>>>>>                       jdbc-uri="jdbc:mysql://
>>>>>>>>>>>>>> 127.0.0.1/lronlineonedb?autoReconnect=true"
>>>>>>>>>>>>>>                       jdbc-username="root"
>>>>>>>>>>>>>>                       jdbc-password=""
>>>>>>>>>>>>>>                       isolation-level="ReadCommitted"
>>>>>>>>>>>>>>                       pool-minsize="2"
>>>>>>>>>>>>>>                       pool-maxsize="250"/>
>>>>>>>>>>>>>>               <!--<jndi-jdbc jndi-server-name="localjndi"
>>>>>>>>>>>>>> jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>        -->
>>>>>>>>>>>>>>           </datasource>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Kapil Garg
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>     		 	   		
>>>    		 	   		
>>
>   		 	   		


RE: Issues Creating Entities in Ofbiz from existing Schema

Posted by Kapil garg <ga...@hotmail.com>.
When your say OTTB ( as in Out of the box) are you referring to any trunk version number for ofbiz?
Also in your instruction below are you saying to add the datasource after running ant run-install? I believe that run-install would run DBUtil code so wont be need to declare datasources before running ant run-install?

Regardless I am not able to connect to the DB. IS there a special jar file for mysql driver for ofbiz?


Kapil Garg
 




> Date: Sat, 30 Oct 2010 07:27:57 -0700
> From: bjfree@free-man.net
> To: user@ofbiz.apache.org
> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> 
> all my instructions are based on
> 1) OTTB ofbiz
> 2) ./ant run-install was completed successfully
> 
> then you add your datasource.
> 
> =========================
> BJ Freeman
> Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> Specialtymarket.com  <http://www.specialtymarket.com/>
> Systems Integrator-- Glad to Assist
> 
> Chat  Y! messenger: bjfr33man
> 
> 
> Kapil garg sent the following on 10/30/2010 6:56 AM:
> >
> > I already tried that it gives Null pointer exception. I created an empty database Ofbiz with ofbiz/ofbiz as credentials and used the normal localmysql that came in original file, it still gives NullPointer Exception. For some reason at startup the DBUTIL is not getting the connnectionURL paparmeter read from the entity-engine-xml file and hence it gives NullPounter on this paramter.
> >
> > Is this somehting that is fixed in other release. I tried this on 10.4 as well and got same NullpointerException and in debug the connection URL is not getting read from the xml file. What else could be wrong? Any other suggestions. I am willing to try everything to get this working. Worst Case I would be hardcoding but then it would create problem with localderby as it needs to be read. Can localderby be copied to mysql?
> >
> >
> > Kapil Garg
> >
> >
> >
> >
> >
> >> Date: Sat, 30 Oct 2010 06:27:18 -0700
> >> From: bjfree@free-man.net
> >> To: user@ofbiz.apache.org
> >> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>
> >> I would suggest you return the entityengine.xml back to its original
> >> configuration, add your mysql datasource as the only modification to the
> >> file and try it again.
> >>
> >>
> >>
> >>
> >> =========================
> >> BJ Freeman
> >> Strategic Power Office with Supplier Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >> Specialtymarket.com<http://www.specialtymarket.com/>
> >> Systems Integrator-- Glad to Assist
> >>
> >> Chat  Y! messenger: bjfr33man
> >> Kapil garg sent the following on 10/30/2010 4:30 AM:
> >>
> >>>
> >>> Hello Santosh
> >>> The IllegalArgument exception went away after I put in a tenatant group name for localderby as show below. However Now I am getting Null Pointer Exception
> >>> GenericDAO.induceModelFromDB() calls DatabaseUtil.induceModelFromDB(). In DatabaseUtil.induceModelFromDB() method, there is a line of code this.getTableNames() which is comming out tobe null? ANy idea why?Also the DBUTIL class is getting NULL value for connectionURL paramter and the dirveName parameter is also coming out to be null.
> >>> Why is that? Hence th Nullpointer. I would imagine that this is read from the helperName=localMysql which is howing correctly in debug variable list. AM I missing anything here?
> >>>
> >>> Coudl you advise further as you seem to know about this?
> >>>
> >>>
> >>> Kapil Garg
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>> Date: Sat, 30 Oct 2010 09:51:54 +0530
> >>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>> From: santoshs.indore@gmail.com
> >>>> To: user@ofbiz.apache.org
> >>>>
> >>>> *Hello  Kapil,
> >>>> *Update your code, you are having two entries of same name it must look like
> >>>>         <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="mysql"/>
> >>>>              <group-map group-name="org.ofbiz.olap"
> >>>> datasource-name="localderbyolap"/>
> >>>>              <group-map group-name="org.ofbiz.tenant"
> >>>> datasource-name="ocalderbytenant"/>
> >>>>          </delegator>
> >>>> now create database and execute commands for "clean-all" and "run-install"
> >>>> Its done now.
> >>>> *
> >>>> Yours,
> >>>>
> >>>> Santosh Singh.*
> >>>>
> >>>>
> >>>>
> >>>> On Sat, Oct 30, 2010 at 1:52 AM, BJ Freeman<bj...@free-man.net>   wrote:
> >>>>
> >>>>> just declare the datasource for you db.
> >>>>>
> >>>>>
> >>>>>
> >>>>> =========================
> >>>>> BJ Freeman
> >>>>> Strategic Power Office with Supplier Automation<
> >>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>>> Systems Integrator-- Glad to Assist
> >>>>>
> >>>>> Chat  Y! messenger: bjfr33man
> >>>>>
> >>>>>
> >>>>> Kapil garg sent the following on 10/29/2010 1:01 PM:
> >>>>>
> >>>>>
> >>>>>> Does that mean that I dont need to associate a datsource I create with a
> >>>>>> delagator ? As in the datasource entry need  not have a group associated
> >>>>>> with it? or a delagator associated with it?
> >>>>>>
> >>>>>>
> >>>>>> Kapil Garg
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>    Date: Fri, 29 Oct 2010 12:54:13 -0700
> >>>>>>> From: bjfree@free-man.net
> >>>>>>> To: user@ofbiz.apache.org
> >>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>>>>>
> >>>>>>> you did add more than the datasource
> >>>>>>> you make it default delegator.
> >>>>>>> this will cause the database to be updated with ofbiz schema
> >>>>>>>
> >>>>>>>
> >>>>>>> =========================
> >>>>>>>
> >>>>>>> BJ Freeman
> >>>>>>> Strategic Power Office with Supplier Automation<
> >>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>>>>> Systems Integrator-- Glad to Assist
> >>>>>>>
> >>>>>>> Chat  Y! messenger: bjfr33man
> >>>>>>>
> >>>>>>>
> >>>>>>> Kapil garg sent the following on 10/29/2010 12:45 PM:
> >>>>>>>
> >>>>>>>>
> >>>>>>>> Yes I created only the datasource by putting an entry in the
> >>>>>>>> entity-engine.xml file. I did not create anything else and intentionally put
> >>>>>>>> it in default delegator. Still I am not ale to Induce. IT says unrecognised
> >>>>>>>> datasource. I also get Null Pointer exception for localmysql datasource
> >>>>>>>> whose entry is already in there. DO I need to do anything else?
> >>>>>>>>
> >>>>>>>> Do I need to do ant run-install, restart before hitting induce?
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> Kapil Garg
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>    Date: Fri, 29 Oct 2010 12:41:59 -0700
> >>>>>>>>> From: bjfree@free-man.net
> >>>>>>>>> To: user@ofbiz.apache.org
> >>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>>>>>>>
> >>>>>>>>> only create a datasource. nothing else
> >>>>>>>>> the mysql one you created you use the name.
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> =========================
> >>>>>>>>> BJ Freeman
> >>>>>>>>> Strategic Power Office with Supplier Automation<
> >>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>>>>>>> Systems Integrator-- Glad to Assist
> >>>>>>>>>
> >>>>>>>>> Chat  Y! messenger: bjfr33man
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> Kapil garg sent the following on 10/29/2010 12:29 PM:
> >>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> I actually did use mysql as the datasource and tried using the link
> >>>>>>>>>> below by putting in the datasource name in the text box and clicking on
> >>>>>>>>>> Induce. For existing datasources name such as localmysql or localderby, I
> >>>>>>>>>> got a NullPointer Exception.
> >>>>>>>>>> For the one that I had an new entry witin the default delegator, I got
> >>>>>>>>>> " unrecognized datasource" name sort of message. Do I need to create a new
> >>>>>>>>>> entity-group.xml file  for the datasource mysql I created below even if I am
> >>>>>>>>>> using a default delagator similar to the data-source localmysql? Does it
> >>>>>>>>>> need to be having group name org.ofbiz or something else within the
> >>>>>>>>>> delegator tag?
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>    Date: Fri, 29 Oct 2010 12:23:37 -0700
> >>>>>>>>>>> From: bjfree@free-man.net
> >>>>>>>>>>> To: user@ofbiz.apache.org
> >>>>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>>>>>>>>>
> >>>>>>>>>>> use mysql as the datasource
> >>>>>>>>>>> https://localhost:8443/webtools/control/view/ModelInduceFromDb
> >>>>>>>>>>>
> >>>>>>>>>>> =========================
> >>>>>>>>>>> BJ Freeman
> >>>>>>>>>>> Strategic Power Office with Supplier Automation<
> >>>>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>>>>>>>>> Systems Integrator-- Glad to Assist
> >>>>>>>>>>>
> >>>>>>>>>>> Chat  Y! messenger: bjfr33man
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>> Kapil garg sent the following on 10/29/2010 12:09 PM:
> >>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>> I am trying to create a entities within OFbiz out of an existing
> >>>>>>>>>>>> schema in production. Not sure if this is the best way to create entties out
> >>>>>>>>>>>> of an existing schema. Suggestions are welcomed!!
> >>>>>>>>>>>>
> >>>>>>>>>>>> I tried to add a datasource tag in default delegator in
> >>>>>>>>>>>> entity-engine.xml
> >>>>>>>>>>>> Followed the instructions on
> >>>>>>>>>>>>
> >>>>>>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> >>>>>>>>>>>> Would like to know where I am going wrong. On restart, I realised
> >>>>>>>>>>>> that ofbiz does not finish to the point that I can get webtools or even
> >>>>>>>>>>>> login for ecommerce. IT has just stuck at soem point saying
> >>>>>>>>>>>>    ServiceDispatcher.java 584 INFO Sync service..
> >>>>>>>>>>>> There is no exception or anything but OFbiz does not go further with
> >>>>>>>>>>>> complete laoding. Anything I am doing wrong?
> >>>>>>>>>>>> Being a default delegaotr, there was no special entity-group.xml
> >>>>>>>>>>>> file in the ofbiz 9_04 code base. Hence I did not bother to create an
> >>>>>>>>>>>> entity-group.xml file
> >>>>>>>>>>>> My schema name is lronline, following are the entries I had in
> >>>>>>>>>>>> entity-engine.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"
> >>>>>>>>>>>> datasource-name="localderby"/>
> >>>>>>>>>>>>              <group-map group-name="org.ofbiz.olap"
> >>>>>>>>>>>> datasource-name="localderbyolap"/>
> >>>>>>>>>>>>              <group-map group-name="org.ofbiz"
> >>>>>>>>>>>> datasource-name="mysql"/>
> >>>>>>>>>>>>          </delegator>
> >>>>>>>>>>>>
> >>>>>>>>>>>> <datasource name="mysql"
> >>>>>>>>>>>>
> >>>>>>>>>>>>    helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
> >>>>>>>>>>>>                  field-type-name="mysql"
> >>>>>>>>>>>>                  check-on-start="true"
> >>>>>>>>>>>>                  add-missing-on-start="true"
> >>>>>>>>>>>>                  check-pks-on-start="false"
> >>>>>>>>>>>>                  use-foreign-keys="true"
> >>>>>>>>>>>>                  join-style="ansi-no-parenthesis"
> >>>>>>>>>>>>                  alias-view-columns="false"
> >>>>>>>>>>>>                  drop-fk-use-foreign-key-keyword="true"
> >>>>>>>>>>>>                  table-type="InnoDB"
> >>>>>>>>>>>>                  character-set="latin1"
> >>>>>>>>>>>>                  collate="latin1_general_cs">
> >>>>>>>>>>>>              <read-data reader-name="seed"/>
> >>>>>>>>>>>>              <read-data reader-name="seed-initial"/>
> >>>>>>>>>>>>              <read-data reader-name="demo"/>
> >>>>>>>>>>>>              <read-data reader-name="ext"/>
> >>>>>>>>>>>>              <inline-jdbc
> >>>>>>>>>>>>                      jdbc-driver="com.mysql.jdbc.Driver"
> >>>>>>>>>>>>                      jdbc-uri="jdbc:mysql://
> >>>>>>>>>>>> 127.0.0.1/lronlineonedb?autoReconnect=true"
> >>>>>>>>>>>>                      jdbc-username="root"
> >>>>>>>>>>>>                      jdbc-password=""
> >>>>>>>>>>>>                      isolation-level="ReadCommitted"
> >>>>>>>>>>>>                      pool-minsize="2"
> >>>>>>>>>>>>                      pool-maxsize="250"/>
> >>>>>>>>>>>>              <!--<jndi-jdbc jndi-server-name="localjndi"
> >>>>>>>>>>>> jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>       -->
> >>>>>>>>>>>>          </datasource>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>> Kapil Garg
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>
> >>>>>
> >>>    		 	   		
> >   		 	   		
> 
 		 	   		  

Re: Issues Creating Entities in Ofbiz from existing Schema

Posted by BJ Freeman <bj...@free-man.net>.
all my instructions are based on
1) OTTB ofbiz
2) ./ant run-install was completed successfully

then you add your datasource.

=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man


Kapil garg sent the following on 10/30/2010 6:56 AM:
>
> I already tried that it gives Null pointer exception. I created an empty database Ofbiz with ofbiz/ofbiz as credentials and used the normal localmysql that came in original file, it still gives NullPointer Exception. For some reason at startup the DBUTIL is not getting the connnectionURL paparmeter read from the entity-engine-xml file and hence it gives NullPounter on this paramter.
>
> Is this somehting that is fixed in other release. I tried this on 10.4 as well and got same NullpointerException and in debug the connection URL is not getting read from the xml file. What else could be wrong? Any other suggestions. I am willing to try everything to get this working. Worst Case I would be hardcoding but then it would create problem with localderby as it needs to be read. Can localderby be copied to mysql?
>
>
> Kapil Garg
>
>
>
>
>
>> Date: Sat, 30 Oct 2010 06:27:18 -0700
>> From: bjfree@free-man.net
>> To: user@ofbiz.apache.org
>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>
>> I would suggest you return the entityengine.xml back to its original
>> configuration, add your mysql datasource as the only modification to the
>> file and try it again.
>>
>>
>>
>>
>> =========================
>> BJ Freeman
>> Strategic Power Office with Supplier Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>> Specialtymarket.com<http://www.specialtymarket.com/>
>> Systems Integrator-- Glad to Assist
>>
>> Chat  Y! messenger: bjfr33man
>> Kapil garg sent the following on 10/30/2010 4:30 AM:
>>
>>>
>>> Hello Santosh
>>> The IllegalArgument exception went away after I put in a tenatant group name for localderby as show below. However Now I am getting Null Pointer Exception
>>> GenericDAO.induceModelFromDB() calls DatabaseUtil.induceModelFromDB(). In DatabaseUtil.induceModelFromDB() method, there is a line of code this.getTableNames() which is comming out tobe null? ANy idea why?Also the DBUTIL class is getting NULL value for connectionURL paramter and the dirveName parameter is also coming out to be null.
>>> Why is that? Hence th Nullpointer. I would imagine that this is read from the helperName=localMysql which is howing correctly in debug variable list. AM I missing anything here?
>>>
>>> Coudl you advise further as you seem to know about this?
>>>
>>>
>>> Kapil Garg
>>>
>>>
>>>
>>>
>>>
>>>> Date: Sat, 30 Oct 2010 09:51:54 +0530
>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>> From: santoshs.indore@gmail.com
>>>> To: user@ofbiz.apache.org
>>>>
>>>> *Hello  Kapil,
>>>> *Update your code, you are having two entries of same name it must look like
>>>>         <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="mysql"/>
>>>>              <group-map group-name="org.ofbiz.olap"
>>>> datasource-name="localderbyolap"/>
>>>>              <group-map group-name="org.ofbiz.tenant"
>>>> datasource-name="ocalderbytenant"/>
>>>>          </delegator>
>>>> now create database and execute commands for "clean-all" and "run-install"
>>>> Its done now.
>>>> *
>>>> Yours,
>>>>
>>>> Santosh Singh.*
>>>>
>>>>
>>>>
>>>> On Sat, Oct 30, 2010 at 1:52 AM, BJ Freeman<bj...@free-man.net>   wrote:
>>>>
>>>>> just declare the datasource for you db.
>>>>>
>>>>>
>>>>>
>>>>> =========================
>>>>> BJ Freeman
>>>>> Strategic Power Office with Supplier Automation<
>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>> Systems Integrator-- Glad to Assist
>>>>>
>>>>> Chat  Y! messenger: bjfr33man
>>>>>
>>>>>
>>>>> Kapil garg sent the following on 10/29/2010 1:01 PM:
>>>>>
>>>>>
>>>>>> Does that mean that I dont need to associate a datsource I create with a
>>>>>> delagator ? As in the datasource entry need  not have a group associated
>>>>>> with it? or a delagator associated with it?
>>>>>>
>>>>>>
>>>>>> Kapil Garg
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>    Date: Fri, 29 Oct 2010 12:54:13 -0700
>>>>>>> From: bjfree@free-man.net
>>>>>>> To: user@ofbiz.apache.org
>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>>>
>>>>>>> you did add more than the datasource
>>>>>>> you make it default delegator.
>>>>>>> this will cause the database to be updated with ofbiz schema
>>>>>>>
>>>>>>>
>>>>>>> =========================
>>>>>>>
>>>>>>> BJ Freeman
>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>
>>>>>>> Chat  Y! messenger: bjfr33man
>>>>>>>
>>>>>>>
>>>>>>> Kapil garg sent the following on 10/29/2010 12:45 PM:
>>>>>>>
>>>>>>>>
>>>>>>>> Yes I created only the datasource by putting an entry in the
>>>>>>>> entity-engine.xml file. I did not create anything else and intentionally put
>>>>>>>> it in default delegator. Still I am not ale to Induce. IT says unrecognised
>>>>>>>> datasource. I also get Null Pointer exception for localmysql datasource
>>>>>>>> whose entry is already in there. DO I need to do anything else?
>>>>>>>>
>>>>>>>> Do I need to do ant run-install, restart before hitting induce?
>>>>>>>>
>>>>>>>>
>>>>>>>> Kapil Garg
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>    Date: Fri, 29 Oct 2010 12:41:59 -0700
>>>>>>>>> From: bjfree@free-man.net
>>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>>>>>
>>>>>>>>> only create a datasource. nothing else
>>>>>>>>> the mysql one you created you use the name.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> =========================
>>>>>>>>> BJ Freeman
>>>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>>>
>>>>>>>>> Chat  Y! messenger: bjfr33man
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Kapil garg sent the following on 10/29/2010 12:29 PM:
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> I actually did use mysql as the datasource and tried using the link
>>>>>>>>>> below by putting in the datasource name in the text box and clicking on
>>>>>>>>>> Induce. For existing datasources name such as localmysql or localderby, I
>>>>>>>>>> got a NullPointer Exception.
>>>>>>>>>> For the one that I had an new entry witin the default delegator, I got
>>>>>>>>>> " unrecognized datasource" name sort of message. Do I need to create a new
>>>>>>>>>> entity-group.xml file  for the datasource mysql I created below even if I am
>>>>>>>>>> using a default delagator similar to the data-source localmysql? Does it
>>>>>>>>>> need to be having group name org.ofbiz or something else within the
>>>>>>>>>> delegator tag?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>    Date: Fri, 29 Oct 2010 12:23:37 -0700
>>>>>>>>>>> From: bjfree@free-man.net
>>>>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>>>>>>>
>>>>>>>>>>> use mysql as the datasource
>>>>>>>>>>> https://localhost:8443/webtools/control/view/ModelInduceFromDb
>>>>>>>>>>>
>>>>>>>>>>> =========================
>>>>>>>>>>> BJ Freeman
>>>>>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>>>>>
>>>>>>>>>>> Chat  Y! messenger: bjfr33man
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Kapil garg sent the following on 10/29/2010 12:09 PM:
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> I am trying to create a entities within OFbiz out of an existing
>>>>>>>>>>>> schema in production. Not sure if this is the best way to create entties out
>>>>>>>>>>>> of an existing schema. Suggestions are welcomed!!
>>>>>>>>>>>>
>>>>>>>>>>>> I tried to add a datasource tag in default delegator in
>>>>>>>>>>>> entity-engine.xml
>>>>>>>>>>>> Followed the instructions on
>>>>>>>>>>>>
>>>>>>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
>>>>>>>>>>>> Would like to know where I am going wrong. On restart, I realised
>>>>>>>>>>>> that ofbiz does not finish to the point that I can get webtools or even
>>>>>>>>>>>> login for ecommerce. IT has just stuck at soem point saying
>>>>>>>>>>>>    ServiceDispatcher.java 584 INFO Sync service..
>>>>>>>>>>>> There is no exception or anything but OFbiz does not go further with
>>>>>>>>>>>> complete laoding. Anything I am doing wrong?
>>>>>>>>>>>> Being a default delegaotr, there was no special entity-group.xml
>>>>>>>>>>>> file in the ofbiz 9_04 code base. Hence I did not bother to create an
>>>>>>>>>>>> entity-group.xml file
>>>>>>>>>>>> My schema name is lronline, following are the entries I had in
>>>>>>>>>>>> entity-engine.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"
>>>>>>>>>>>> datasource-name="localderby"/>
>>>>>>>>>>>>              <group-map group-name="org.ofbiz.olap"
>>>>>>>>>>>> datasource-name="localderbyolap"/>
>>>>>>>>>>>>              <group-map group-name="org.ofbiz"
>>>>>>>>>>>> datasource-name="mysql"/>
>>>>>>>>>>>>          </delegator>
>>>>>>>>>>>>
>>>>>>>>>>>> <datasource name="mysql"
>>>>>>>>>>>>
>>>>>>>>>>>>    helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>>>>>>>>>>>                  field-type-name="mysql"
>>>>>>>>>>>>                  check-on-start="true"
>>>>>>>>>>>>                  add-missing-on-start="true"
>>>>>>>>>>>>                  check-pks-on-start="false"
>>>>>>>>>>>>                  use-foreign-keys="true"
>>>>>>>>>>>>                  join-style="ansi-no-parenthesis"
>>>>>>>>>>>>                  alias-view-columns="false"
>>>>>>>>>>>>                  drop-fk-use-foreign-key-keyword="true"
>>>>>>>>>>>>                  table-type="InnoDB"
>>>>>>>>>>>>                  character-set="latin1"
>>>>>>>>>>>>                  collate="latin1_general_cs">
>>>>>>>>>>>>              <read-data reader-name="seed"/>
>>>>>>>>>>>>              <read-data reader-name="seed-initial"/>
>>>>>>>>>>>>              <read-data reader-name="demo"/>
>>>>>>>>>>>>              <read-data reader-name="ext"/>
>>>>>>>>>>>>              <inline-jdbc
>>>>>>>>>>>>                      jdbc-driver="com.mysql.jdbc.Driver"
>>>>>>>>>>>>                      jdbc-uri="jdbc:mysql://
>>>>>>>>>>>> 127.0.0.1/lronlineonedb?autoReconnect=true"
>>>>>>>>>>>>                      jdbc-username="root"
>>>>>>>>>>>>                      jdbc-password=""
>>>>>>>>>>>>                      isolation-level="ReadCommitted"
>>>>>>>>>>>>                      pool-minsize="2"
>>>>>>>>>>>>                      pool-maxsize="250"/>
>>>>>>>>>>>>              <!--<jndi-jdbc jndi-server-name="localjndi"
>>>>>>>>>>>> jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>       -->
>>>>>>>>>>>>          </datasource>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Kapil Garg
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>    		 	   		
>   		 	   		


RE: Issues Creating Entities in Ofbiz from existing Schema

Posted by Kapil garg <ga...@hotmail.com>.
Yes I am able to connect to Mysql DB through my Navicat Client to many databases within it with different connections




> Date: Sat, 30 Oct 2010 07:23:23 -0700
> From: bjfree@free-man.net
> To: user@ofbiz.apache.org
> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> 
> using the settings can you connect to the db via other tools
> or command line?
> if you attempting to induce from a empty DB this will occur.
> 
> 
> =========================
> BJ Freeman
> Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> Specialtymarket.com  <http://www.specialtymarket.com/>
> Systems Integrator-- Glad to Assist
> 
> Chat  Y! messenger: bjfr33man
> 
> 
> Kapil garg sent the following on 10/30/2010 6:56 AM:
> >
> > I already tried that it gives Null pointer exception. I created an empty database Ofbiz with ofbiz/ofbiz as credentials and used the normal localmysql that came in original file, it still gives NullPointer Exception. For some reason at startup the DBUTIL is not getting the connnectionURL paparmeter read from the entity-engine-xml file and hence it gives NullPounter on this paramter.
> >
> > Is this somehting that is fixed in other release. I tried this on 10.4 as well and got same NullpointerException and in debug the connection URL is not getting read from the xml file. What else could be wrong? Any other suggestions. I am willing to try everything to get this working. Worst Case I would be hardcoding but then it would create problem with localderby as it needs to be read. Can localderby be copied to mysql?
> >
> >
> > Kapil Garg
> >
> >
> >
> >
> >
> >> Date: Sat, 30 Oct 2010 06:27:18 -0700
> >> From: bjfree@free-man.net
> >> To: user@ofbiz.apache.org
> >> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>
> >> I would suggest you return the entityengine.xml back to its original
> >> configuration, add your mysql datasource as the only modification to the
> >> file and try it again.
> >>
> >>
> >>
> >>
> >> =========================
> >> BJ Freeman
> >> Strategic Power Office with Supplier Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >> Specialtymarket.com<http://www.specialtymarket.com/>
> >> Systems Integrator-- Glad to Assist
> >>
> >> Chat  Y! messenger: bjfr33man
> >> Kapil garg sent the following on 10/30/2010 4:30 AM:
> >>
> >>>
> >>> Hello Santosh
> >>> The IllegalArgument exception went away after I put in a tenatant group name for localderby as show below. However Now I am getting Null Pointer Exception
> >>> GenericDAO.induceModelFromDB() calls DatabaseUtil.induceModelFromDB(). In DatabaseUtil.induceModelFromDB() method, there is a line of code this.getTableNames() which is comming out tobe null? ANy idea why?Also the DBUTIL class is getting NULL value for connectionURL paramter and the dirveName parameter is also coming out to be null.
> >>> Why is that? Hence th Nullpointer. I would imagine that this is read from the helperName=localMysql which is howing correctly in debug variable list. AM I missing anything here?
> >>>
> >>> Coudl you advise further as you seem to know about this?
> >>>
> >>>
> >>> Kapil Garg
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>> Date: Sat, 30 Oct 2010 09:51:54 +0530
> >>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>> From: santoshs.indore@gmail.com
> >>>> To: user@ofbiz.apache.org
> >>>>
> >>>> *Hello  Kapil,
> >>>> *Update your code, you are having two entries of same name it must look like
> >>>>         <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="mysql"/>
> >>>>              <group-map group-name="org.ofbiz.olap"
> >>>> datasource-name="localderbyolap"/>
> >>>>              <group-map group-name="org.ofbiz.tenant"
> >>>> datasource-name="ocalderbytenant"/>
> >>>>          </delegator>
> >>>> now create database and execute commands for "clean-all" and "run-install"
> >>>> Its done now.
> >>>> *
> >>>> Yours,
> >>>>
> >>>> Santosh Singh.*
> >>>>
> >>>>
> >>>>
> >>>> On Sat, Oct 30, 2010 at 1:52 AM, BJ Freeman<bj...@free-man.net>   wrote:
> >>>>
> >>>>> just declare the datasource for you db.
> >>>>>
> >>>>>
> >>>>>
> >>>>> =========================
> >>>>> BJ Freeman
> >>>>> Strategic Power Office with Supplier Automation<
> >>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>>> Systems Integrator-- Glad to Assist
> >>>>>
> >>>>> Chat  Y! messenger: bjfr33man
> >>>>>
> >>>>>
> >>>>> Kapil garg sent the following on 10/29/2010 1:01 PM:
> >>>>>
> >>>>>
> >>>>>> Does that mean that I dont need to associate a datsource I create with a
> >>>>>> delagator ? As in the datasource entry need  not have a group associated
> >>>>>> with it? or a delagator associated with it?
> >>>>>>
> >>>>>>
> >>>>>> Kapil Garg
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>    Date: Fri, 29 Oct 2010 12:54:13 -0700
> >>>>>>> From: bjfree@free-man.net
> >>>>>>> To: user@ofbiz.apache.org
> >>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>>>>>
> >>>>>>> you did add more than the datasource
> >>>>>>> you make it default delegator.
> >>>>>>> this will cause the database to be updated with ofbiz schema
> >>>>>>>
> >>>>>>>
> >>>>>>> =========================
> >>>>>>>
> >>>>>>> BJ Freeman
> >>>>>>> Strategic Power Office with Supplier Automation<
> >>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>>>>> Systems Integrator-- Glad to Assist
> >>>>>>>
> >>>>>>> Chat  Y! messenger: bjfr33man
> >>>>>>>
> >>>>>>>
> >>>>>>> Kapil garg sent the following on 10/29/2010 12:45 PM:
> >>>>>>>
> >>>>>>>>
> >>>>>>>> Yes I created only the datasource by putting an entry in the
> >>>>>>>> entity-engine.xml file. I did not create anything else and intentionally put
> >>>>>>>> it in default delegator. Still I am not ale to Induce. IT says unrecognised
> >>>>>>>> datasource. I also get Null Pointer exception for localmysql datasource
> >>>>>>>> whose entry is already in there. DO I need to do anything else?
> >>>>>>>>
> >>>>>>>> Do I need to do ant run-install, restart before hitting induce?
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> Kapil Garg
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>    Date: Fri, 29 Oct 2010 12:41:59 -0700
> >>>>>>>>> From: bjfree@free-man.net
> >>>>>>>>> To: user@ofbiz.apache.org
> >>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>>>>>>>
> >>>>>>>>> only create a datasource. nothing else
> >>>>>>>>> the mysql one you created you use the name.
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> =========================
> >>>>>>>>> BJ Freeman
> >>>>>>>>> Strategic Power Office with Supplier Automation<
> >>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>>>>>>> Systems Integrator-- Glad to Assist
> >>>>>>>>>
> >>>>>>>>> Chat  Y! messenger: bjfr33man
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> Kapil garg sent the following on 10/29/2010 12:29 PM:
> >>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> I actually did use mysql as the datasource and tried using the link
> >>>>>>>>>> below by putting in the datasource name in the text box and clicking on
> >>>>>>>>>> Induce. For existing datasources name such as localmysql or localderby, I
> >>>>>>>>>> got a NullPointer Exception.
> >>>>>>>>>> For the one that I had an new entry witin the default delegator, I got
> >>>>>>>>>> " unrecognized datasource" name sort of message. Do I need to create a new
> >>>>>>>>>> entity-group.xml file  for the datasource mysql I created below even if I am
> >>>>>>>>>> using a default delagator similar to the data-source localmysql? Does it
> >>>>>>>>>> need to be having group name org.ofbiz or something else within the
> >>>>>>>>>> delegator tag?
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>    Date: Fri, 29 Oct 2010 12:23:37 -0700
> >>>>>>>>>>> From: bjfree@free-man.net
> >>>>>>>>>>> To: user@ofbiz.apache.org
> >>>>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>>>>>>>>>
> >>>>>>>>>>> use mysql as the datasource
> >>>>>>>>>>> https://localhost:8443/webtools/control/view/ModelInduceFromDb
> >>>>>>>>>>>
> >>>>>>>>>>> =========================
> >>>>>>>>>>> BJ Freeman
> >>>>>>>>>>> Strategic Power Office with Supplier Automation<
> >>>>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>>>>>>>>> Systems Integrator-- Glad to Assist
> >>>>>>>>>>>
> >>>>>>>>>>> Chat  Y! messenger: bjfr33man
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>> Kapil garg sent the following on 10/29/2010 12:09 PM:
> >>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>> I am trying to create a entities within OFbiz out of an existing
> >>>>>>>>>>>> schema in production. Not sure if this is the best way to create entties out
> >>>>>>>>>>>> of an existing schema. Suggestions are welcomed!!
> >>>>>>>>>>>>
> >>>>>>>>>>>> I tried to add a datasource tag in default delegator in
> >>>>>>>>>>>> entity-engine.xml
> >>>>>>>>>>>> Followed the instructions on
> >>>>>>>>>>>>
> >>>>>>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> >>>>>>>>>>>> Would like to know where I am going wrong. On restart, I realised
> >>>>>>>>>>>> that ofbiz does not finish to the point that I can get webtools or even
> >>>>>>>>>>>> login for ecommerce. IT has just stuck at soem point saying
> >>>>>>>>>>>>    ServiceDispatcher.java 584 INFO Sync service..
> >>>>>>>>>>>> There is no exception or anything but OFbiz does not go further with
> >>>>>>>>>>>> complete laoding. Anything I am doing wrong?
> >>>>>>>>>>>> Being a default delegaotr, there was no special entity-group.xml
> >>>>>>>>>>>> file in the ofbiz 9_04 code base. Hence I did not bother to create an
> >>>>>>>>>>>> entity-group.xml file
> >>>>>>>>>>>> My schema name is lronline, following are the entries I had in
> >>>>>>>>>>>> entity-engine.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"
> >>>>>>>>>>>> datasource-name="localderby"/>
> >>>>>>>>>>>>              <group-map group-name="org.ofbiz.olap"
> >>>>>>>>>>>> datasource-name="localderbyolap"/>
> >>>>>>>>>>>>              <group-map group-name="org.ofbiz"
> >>>>>>>>>>>> datasource-name="mysql"/>
> >>>>>>>>>>>>          </delegator>
> >>>>>>>>>>>>
> >>>>>>>>>>>> <datasource name="mysql"
> >>>>>>>>>>>>
> >>>>>>>>>>>>    helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
> >>>>>>>>>>>>                  field-type-name="mysql"
> >>>>>>>>>>>>                  check-on-start="true"
> >>>>>>>>>>>>                  add-missing-on-start="true"
> >>>>>>>>>>>>                  check-pks-on-start="false"
> >>>>>>>>>>>>                  use-foreign-keys="true"
> >>>>>>>>>>>>                  join-style="ansi-no-parenthesis"
> >>>>>>>>>>>>                  alias-view-columns="false"
> >>>>>>>>>>>>                  drop-fk-use-foreign-key-keyword="true"
> >>>>>>>>>>>>                  table-type="InnoDB"
> >>>>>>>>>>>>                  character-set="latin1"
> >>>>>>>>>>>>                  collate="latin1_general_cs">
> >>>>>>>>>>>>              <read-data reader-name="seed"/>
> >>>>>>>>>>>>              <read-data reader-name="seed-initial"/>
> >>>>>>>>>>>>              <read-data reader-name="demo"/>
> >>>>>>>>>>>>              <read-data reader-name="ext"/>
> >>>>>>>>>>>>              <inline-jdbc
> >>>>>>>>>>>>                      jdbc-driver="com.mysql.jdbc.Driver"
> >>>>>>>>>>>>                      jdbc-uri="jdbc:mysql://
> >>>>>>>>>>>> 127.0.0.1/lronlineonedb?autoReconnect=true"
> >>>>>>>>>>>>                      jdbc-username="root"
> >>>>>>>>>>>>                      jdbc-password=""
> >>>>>>>>>>>>                      isolation-level="ReadCommitted"
> >>>>>>>>>>>>                      pool-minsize="2"
> >>>>>>>>>>>>                      pool-maxsize="250"/>
> >>>>>>>>>>>>              <!--<jndi-jdbc jndi-server-name="localjndi"
> >>>>>>>>>>>> jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>       -->
> >>>>>>>>>>>>          </datasource>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>> Kapil Garg
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>
> >>>>>
> >>>    		 	   		
> >   		 	   		
> 
 		 	   		  

Re: Issues Creating Entities in Ofbiz from existing Schema

Posted by BJ Freeman <bj...@free-man.net>.
using the settings can you connect to the db via other tools
or command line?
if you attempting to induce from a empty DB this will occur.


=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man


Kapil garg sent the following on 10/30/2010 6:56 AM:
>
> I already tried that it gives Null pointer exception. I created an empty database Ofbiz with ofbiz/ofbiz as credentials and used the normal localmysql that came in original file, it still gives NullPointer Exception. For some reason at startup the DBUTIL is not getting the connnectionURL paparmeter read from the entity-engine-xml file and hence it gives NullPounter on this paramter.
>
> Is this somehting that is fixed in other release. I tried this on 10.4 as well and got same NullpointerException and in debug the connection URL is not getting read from the xml file. What else could be wrong? Any other suggestions. I am willing to try everything to get this working. Worst Case I would be hardcoding but then it would create problem with localderby as it needs to be read. Can localderby be copied to mysql?
>
>
> Kapil Garg
>
>
>
>
>
>> Date: Sat, 30 Oct 2010 06:27:18 -0700
>> From: bjfree@free-man.net
>> To: user@ofbiz.apache.org
>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>
>> I would suggest you return the entityengine.xml back to its original
>> configuration, add your mysql datasource as the only modification to the
>> file and try it again.
>>
>>
>>
>>
>> =========================
>> BJ Freeman
>> Strategic Power Office with Supplier Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>> Specialtymarket.com<http://www.specialtymarket.com/>
>> Systems Integrator-- Glad to Assist
>>
>> Chat  Y! messenger: bjfr33man
>> Kapil garg sent the following on 10/30/2010 4:30 AM:
>>
>>>
>>> Hello Santosh
>>> The IllegalArgument exception went away after I put in a tenatant group name for localderby as show below. However Now I am getting Null Pointer Exception
>>> GenericDAO.induceModelFromDB() calls DatabaseUtil.induceModelFromDB(). In DatabaseUtil.induceModelFromDB() method, there is a line of code this.getTableNames() which is comming out tobe null? ANy idea why?Also the DBUTIL class is getting NULL value for connectionURL paramter and the dirveName parameter is also coming out to be null.
>>> Why is that? Hence th Nullpointer. I would imagine that this is read from the helperName=localMysql which is howing correctly in debug variable list. AM I missing anything here?
>>>
>>> Coudl you advise further as you seem to know about this?
>>>
>>>
>>> Kapil Garg
>>>
>>>
>>>
>>>
>>>
>>>> Date: Sat, 30 Oct 2010 09:51:54 +0530
>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>> From: santoshs.indore@gmail.com
>>>> To: user@ofbiz.apache.org
>>>>
>>>> *Hello  Kapil,
>>>> *Update your code, you are having two entries of same name it must look like
>>>>         <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="mysql"/>
>>>>              <group-map group-name="org.ofbiz.olap"
>>>> datasource-name="localderbyolap"/>
>>>>              <group-map group-name="org.ofbiz.tenant"
>>>> datasource-name="ocalderbytenant"/>
>>>>          </delegator>
>>>> now create database and execute commands for "clean-all" and "run-install"
>>>> Its done now.
>>>> *
>>>> Yours,
>>>>
>>>> Santosh Singh.*
>>>>
>>>>
>>>>
>>>> On Sat, Oct 30, 2010 at 1:52 AM, BJ Freeman<bj...@free-man.net>   wrote:
>>>>
>>>>> just declare the datasource for you db.
>>>>>
>>>>>
>>>>>
>>>>> =========================
>>>>> BJ Freeman
>>>>> Strategic Power Office with Supplier Automation<
>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>> Systems Integrator-- Glad to Assist
>>>>>
>>>>> Chat  Y! messenger: bjfr33man
>>>>>
>>>>>
>>>>> Kapil garg sent the following on 10/29/2010 1:01 PM:
>>>>>
>>>>>
>>>>>> Does that mean that I dont need to associate a datsource I create with a
>>>>>> delagator ? As in the datasource entry need  not have a group associated
>>>>>> with it? or a delagator associated with it?
>>>>>>
>>>>>>
>>>>>> Kapil Garg
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>    Date: Fri, 29 Oct 2010 12:54:13 -0700
>>>>>>> From: bjfree@free-man.net
>>>>>>> To: user@ofbiz.apache.org
>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>>>
>>>>>>> you did add more than the datasource
>>>>>>> you make it default delegator.
>>>>>>> this will cause the database to be updated with ofbiz schema
>>>>>>>
>>>>>>>
>>>>>>> =========================
>>>>>>>
>>>>>>> BJ Freeman
>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>
>>>>>>> Chat  Y! messenger: bjfr33man
>>>>>>>
>>>>>>>
>>>>>>> Kapil garg sent the following on 10/29/2010 12:45 PM:
>>>>>>>
>>>>>>>>
>>>>>>>> Yes I created only the datasource by putting an entry in the
>>>>>>>> entity-engine.xml file. I did not create anything else and intentionally put
>>>>>>>> it in default delegator. Still I am not ale to Induce. IT says unrecognised
>>>>>>>> datasource. I also get Null Pointer exception for localmysql datasource
>>>>>>>> whose entry is already in there. DO I need to do anything else?
>>>>>>>>
>>>>>>>> Do I need to do ant run-install, restart before hitting induce?
>>>>>>>>
>>>>>>>>
>>>>>>>> Kapil Garg
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>    Date: Fri, 29 Oct 2010 12:41:59 -0700
>>>>>>>>> From: bjfree@free-man.net
>>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>>>>>
>>>>>>>>> only create a datasource. nothing else
>>>>>>>>> the mysql one you created you use the name.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> =========================
>>>>>>>>> BJ Freeman
>>>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>>>
>>>>>>>>> Chat  Y! messenger: bjfr33man
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Kapil garg sent the following on 10/29/2010 12:29 PM:
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> I actually did use mysql as the datasource and tried using the link
>>>>>>>>>> below by putting in the datasource name in the text box and clicking on
>>>>>>>>>> Induce. For existing datasources name such as localmysql or localderby, I
>>>>>>>>>> got a NullPointer Exception.
>>>>>>>>>> For the one that I had an new entry witin the default delegator, I got
>>>>>>>>>> " unrecognized datasource" name sort of message. Do I need to create a new
>>>>>>>>>> entity-group.xml file  for the datasource mysql I created below even if I am
>>>>>>>>>> using a default delagator similar to the data-source localmysql? Does it
>>>>>>>>>> need to be having group name org.ofbiz or something else within the
>>>>>>>>>> delegator tag?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>    Date: Fri, 29 Oct 2010 12:23:37 -0700
>>>>>>>>>>> From: bjfree@free-man.net
>>>>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>>>>>>>
>>>>>>>>>>> use mysql as the datasource
>>>>>>>>>>> https://localhost:8443/webtools/control/view/ModelInduceFromDb
>>>>>>>>>>>
>>>>>>>>>>> =========================
>>>>>>>>>>> BJ Freeman
>>>>>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>>>>>
>>>>>>>>>>> Chat  Y! messenger: bjfr33man
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Kapil garg sent the following on 10/29/2010 12:09 PM:
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> I am trying to create a entities within OFbiz out of an existing
>>>>>>>>>>>> schema in production. Not sure if this is the best way to create entties out
>>>>>>>>>>>> of an existing schema. Suggestions are welcomed!!
>>>>>>>>>>>>
>>>>>>>>>>>> I tried to add a datasource tag in default delegator in
>>>>>>>>>>>> entity-engine.xml
>>>>>>>>>>>> Followed the instructions on
>>>>>>>>>>>>
>>>>>>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
>>>>>>>>>>>> Would like to know where I am going wrong. On restart, I realised
>>>>>>>>>>>> that ofbiz does not finish to the point that I can get webtools or even
>>>>>>>>>>>> login for ecommerce. IT has just stuck at soem point saying
>>>>>>>>>>>>    ServiceDispatcher.java 584 INFO Sync service..
>>>>>>>>>>>> There is no exception or anything but OFbiz does not go further with
>>>>>>>>>>>> complete laoding. Anything I am doing wrong?
>>>>>>>>>>>> Being a default delegaotr, there was no special entity-group.xml
>>>>>>>>>>>> file in the ofbiz 9_04 code base. Hence I did not bother to create an
>>>>>>>>>>>> entity-group.xml file
>>>>>>>>>>>> My schema name is lronline, following are the entries I had in
>>>>>>>>>>>> entity-engine.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"
>>>>>>>>>>>> datasource-name="localderby"/>
>>>>>>>>>>>>              <group-map group-name="org.ofbiz.olap"
>>>>>>>>>>>> datasource-name="localderbyolap"/>
>>>>>>>>>>>>              <group-map group-name="org.ofbiz"
>>>>>>>>>>>> datasource-name="mysql"/>
>>>>>>>>>>>>          </delegator>
>>>>>>>>>>>>
>>>>>>>>>>>> <datasource name="mysql"
>>>>>>>>>>>>
>>>>>>>>>>>>    helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>>>>>>>>>>>                  field-type-name="mysql"
>>>>>>>>>>>>                  check-on-start="true"
>>>>>>>>>>>>                  add-missing-on-start="true"
>>>>>>>>>>>>                  check-pks-on-start="false"
>>>>>>>>>>>>                  use-foreign-keys="true"
>>>>>>>>>>>>                  join-style="ansi-no-parenthesis"
>>>>>>>>>>>>                  alias-view-columns="false"
>>>>>>>>>>>>                  drop-fk-use-foreign-key-keyword="true"
>>>>>>>>>>>>                  table-type="InnoDB"
>>>>>>>>>>>>                  character-set="latin1"
>>>>>>>>>>>>                  collate="latin1_general_cs">
>>>>>>>>>>>>              <read-data reader-name="seed"/>
>>>>>>>>>>>>              <read-data reader-name="seed-initial"/>
>>>>>>>>>>>>              <read-data reader-name="demo"/>
>>>>>>>>>>>>              <read-data reader-name="ext"/>
>>>>>>>>>>>>              <inline-jdbc
>>>>>>>>>>>>                      jdbc-driver="com.mysql.jdbc.Driver"
>>>>>>>>>>>>                      jdbc-uri="jdbc:mysql://
>>>>>>>>>>>> 127.0.0.1/lronlineonedb?autoReconnect=true"
>>>>>>>>>>>>                      jdbc-username="root"
>>>>>>>>>>>>                      jdbc-password=""
>>>>>>>>>>>>                      isolation-level="ReadCommitted"
>>>>>>>>>>>>                      pool-minsize="2"
>>>>>>>>>>>>                      pool-maxsize="250"/>
>>>>>>>>>>>>              <!--<jndi-jdbc jndi-server-name="localjndi"
>>>>>>>>>>>> jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>       -->
>>>>>>>>>>>>          </datasource>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Kapil Garg
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>    		 	   		
>   		 	   		


RE: Issues Creating Entities in Ofbiz from existing Schema

Posted by Kapil garg <ga...@hotmail.com>.
I already tried that it gives Null pointer exception. I created an empty database Ofbiz with ofbiz/ofbiz as credentials and used the normal localmysql that came in original file, it still gives NullPointer Exception. For some reason at startup the DBUTIL is not getting the connnectionURL paparmeter read from the entity-engine-xml file and hence it gives NullPounter on this paramter.

Is this somehting that is fixed in other release. I tried this on 10.4 as well and got same NullpointerException and in debug the connection URL is not getting read from the xml file. What else could be wrong? Any other suggestions. I am willing to try everything to get this working. Worst Case I would be hardcoding but then it would create problem with localderby as it needs to be read. Can localderby be copied to mysql?


Kapil Garg
 




> Date: Sat, 30 Oct 2010 06:27:18 -0700
> From: bjfree@free-man.net
> To: user@ofbiz.apache.org
> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> 
> I would suggest you return the entityengine.xml back to its original 
> configuration, add your mysql datasource as the only modification to the 
> file and try it again.
> 
> 
> 
> 
> =========================
> BJ Freeman
> Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> Specialtymarket.com  <http://www.specialtymarket.com/>
> Systems Integrator-- Glad to Assist
> 
> Chat  Y! messenger: bjfr33man
> Kapil garg sent the following on 10/30/2010 4:30 AM:
> 
> >
> > Hello Santosh
> > The IllegalArgument exception went away after I put in a tenatant group name for localderby as show below. However Now I am getting Null Pointer Exception
> > GenericDAO.induceModelFromDB() calls DatabaseUtil.induceModelFromDB(). In DatabaseUtil.induceModelFromDB() method, there is a line of code this.getTableNames() which is comming out tobe null? ANy idea why?Also the DBUTIL class is getting NULL value for connectionURL paramter and the dirveName parameter is also coming out to be null.
> > Why is that? Hence th Nullpointer. I would imagine that this is read from the helperName=localMysql which is howing correctly in debug variable list. AM I missing anything here?
> >
> > Coudl you advise further as you seem to know about this?
> >
> >
> > Kapil Garg
> >
> >
> >
> >
> >
> >> Date: Sat, 30 Oct 2010 09:51:54 +0530
> >> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >> From: santoshs.indore@gmail.com
> >> To: user@ofbiz.apache.org
> >>
> >> *Hello  Kapil,
> >> *Update your code, you are having two entries of same name it must look like
> >>        <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="mysql"/>
> >>             <group-map group-name="org.ofbiz.olap"
> >> datasource-name="localderbyolap"/>
> >>             <group-map group-name="org.ofbiz.tenant"
> >> datasource-name="ocalderbytenant"/>
> >>         </delegator>
> >> now create database and execute commands for "clean-all" and "run-install"
> >> Its done now.
> >> *
> >> Yours,
> >>
> >> Santosh Singh.*
> >>
> >>
> >>
> >> On Sat, Oct 30, 2010 at 1:52 AM, BJ Freeman<bj...@free-man.net>  wrote:
> >>
> >>> just declare the datasource for you db.
> >>>
> >>>
> >>>
> >>> =========================
> >>> BJ Freeman
> >>> Strategic Power Office with Supplier Automation<
> >>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>> Systems Integrator-- Glad to Assist
> >>>
> >>> Chat  Y! messenger: bjfr33man
> >>>
> >>>
> >>> Kapil garg sent the following on 10/29/2010 1:01 PM:
> >>>
> >>>
> >>>> Does that mean that I dont need to associate a datsource I create with a
> >>>> delagator ? As in the datasource entry need  not have a group associated
> >>>> with it? or a delagator associated with it?
> >>>>
> >>>>
> >>>> Kapil Garg
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>   Date: Fri, 29 Oct 2010 12:54:13 -0700
> >>>>> From: bjfree@free-man.net
> >>>>> To: user@ofbiz.apache.org
> >>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>>>
> >>>>> you did add more than the datasource
> >>>>> you make it default delegator.
> >>>>> this will cause the database to be updated with ofbiz schema
> >>>>>
> >>>>>
> >>>>> =========================
> >>>>>
> >>>>> BJ Freeman
> >>>>> Strategic Power Office with Supplier Automation<
> >>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>>> Systems Integrator-- Glad to Assist
> >>>>>
> >>>>> Chat  Y! messenger: bjfr33man
> >>>>>
> >>>>>
> >>>>> Kapil garg sent the following on 10/29/2010 12:45 PM:
> >>>>>
> >>>>>>
> >>>>>> Yes I created only the datasource by putting an entry in the
> >>>>>> entity-engine.xml file. I did not create anything else and intentionally put
> >>>>>> it in default delegator. Still I am not ale to Induce. IT says unrecognised
> >>>>>> datasource. I also get Null Pointer exception for localmysql datasource
> >>>>>> whose entry is already in there. DO I need to do anything else?
> >>>>>>
> >>>>>> Do I need to do ant run-install, restart before hitting induce?
> >>>>>>
> >>>>>>
> >>>>>> Kapil Garg
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>   Date: Fri, 29 Oct 2010 12:41:59 -0700
> >>>>>>> From: bjfree@free-man.net
> >>>>>>> To: user@ofbiz.apache.org
> >>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>>>>>
> >>>>>>> only create a datasource. nothing else
> >>>>>>> the mysql one you created you use the name.
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> =========================
> >>>>>>> BJ Freeman
> >>>>>>> Strategic Power Office with Supplier Automation<
> >>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>>>>> Systems Integrator-- Glad to Assist
> >>>>>>>
> >>>>>>> Chat  Y! messenger: bjfr33man
> >>>>>>>
> >>>>>>>
> >>>>>>> Kapil garg sent the following on 10/29/2010 12:29 PM:
> >>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> I actually did use mysql as the datasource and tried using the link
> >>>>>>>> below by putting in the datasource name in the text box and clicking on
> >>>>>>>> Induce. For existing datasources name such as localmysql or localderby, I
> >>>>>>>> got a NullPointer Exception.
> >>>>>>>> For the one that I had an new entry witin the default delegator, I got
> >>>>>>>> " unrecognized datasource" name sort of message. Do I need to create a new
> >>>>>>>> entity-group.xml file  for the datasource mysql I created below even if I am
> >>>>>>>> using a default delagator similar to the data-source localmysql? Does it
> >>>>>>>> need to be having group name org.ofbiz or something else within the
> >>>>>>>> delegator tag?
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>   Date: Fri, 29 Oct 2010 12:23:37 -0700
> >>>>>>>>> From: bjfree@free-man.net
> >>>>>>>>> To: user@ofbiz.apache.org
> >>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>>>>>>>
> >>>>>>>>> use mysql as the datasource
> >>>>>>>>> https://localhost:8443/webtools/control/view/ModelInduceFromDb
> >>>>>>>>>
> >>>>>>>>> =========================
> >>>>>>>>> BJ Freeman
> >>>>>>>>> Strategic Power Office with Supplier Automation<
> >>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>>>>>>> Systems Integrator-- Glad to Assist
> >>>>>>>>>
> >>>>>>>>> Chat  Y! messenger: bjfr33man
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> Kapil garg sent the following on 10/29/2010 12:09 PM:
> >>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> I am trying to create a entities within OFbiz out of an existing
> >>>>>>>>>> schema in production. Not sure if this is the best way to create entties out
> >>>>>>>>>> of an existing schema. Suggestions are welcomed!!
> >>>>>>>>>>
> >>>>>>>>>> I tried to add a datasource tag in default delegator in
> >>>>>>>>>> entity-engine.xml
> >>>>>>>>>> Followed the instructions on
> >>>>>>>>>>
> >>>>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> >>>>>>>>>> Would like to know where I am going wrong. On restart, I realised
> >>>>>>>>>> that ofbiz does not finish to the point that I can get webtools or even
> >>>>>>>>>> login for ecommerce. IT has just stuck at soem point saying
> >>>>>>>>>>   ServiceDispatcher.java 584 INFO Sync service..
> >>>>>>>>>> There is no exception or anything but OFbiz does not go further with
> >>>>>>>>>> complete laoding. Anything I am doing wrong?
> >>>>>>>>>> Being a default delegaotr, there was no special entity-group.xml
> >>>>>>>>>> file in the ofbiz 9_04 code base. Hence I did not bother to create an
> >>>>>>>>>> entity-group.xml file
> >>>>>>>>>> My schema name is lronline, following are the entries I had in
> >>>>>>>>>> entity-engine.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"
> >>>>>>>>>> datasource-name="localderby"/>
> >>>>>>>>>>             <group-map group-name="org.ofbiz.olap"
> >>>>>>>>>> datasource-name="localderbyolap"/>
> >>>>>>>>>>             <group-map group-name="org.ofbiz"
> >>>>>>>>>> datasource-name="mysql"/>
> >>>>>>>>>>         </delegator>
> >>>>>>>>>>
> >>>>>>>>>> <datasource name="mysql"
> >>>>>>>>>>
> >>>>>>>>>>   helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
> >>>>>>>>>>                 field-type-name="mysql"
> >>>>>>>>>>                 check-on-start="true"
> >>>>>>>>>>                 add-missing-on-start="true"
> >>>>>>>>>>                 check-pks-on-start="false"
> >>>>>>>>>>                 use-foreign-keys="true"
> >>>>>>>>>>                 join-style="ansi-no-parenthesis"
> >>>>>>>>>>                 alias-view-columns="false"
> >>>>>>>>>>                 drop-fk-use-foreign-key-keyword="true"
> >>>>>>>>>>                 table-type="InnoDB"
> >>>>>>>>>>                 character-set="latin1"
> >>>>>>>>>>                 collate="latin1_general_cs">
> >>>>>>>>>>             <read-data reader-name="seed"/>
> >>>>>>>>>>             <read-data reader-name="seed-initial"/>
> >>>>>>>>>>             <read-data reader-name="demo"/>
> >>>>>>>>>>             <read-data reader-name="ext"/>
> >>>>>>>>>>             <inline-jdbc
> >>>>>>>>>>                     jdbc-driver="com.mysql.jdbc.Driver"
> >>>>>>>>>>                     jdbc-uri="jdbc:mysql://
> >>>>>>>>>> 127.0.0.1/lronlineonedb?autoReconnect=true"
> >>>>>>>>>>                     jdbc-username="root"
> >>>>>>>>>>                     jdbc-password=""
> >>>>>>>>>>                     isolation-level="ReadCommitted"
> >>>>>>>>>>                     pool-minsize="2"
> >>>>>>>>>>                     pool-maxsize="250"/>
> >>>>>>>>>>             <!--<jndi-jdbc jndi-server-name="localjndi"
> >>>>>>>>>> jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>      -->
> >>>>>>>>>>         </datasource>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>> Kapil Garg
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>
> >>>>>
> >>>>
> >>>
> >>>
> >   		 	   		
 		 	   		  

Re: Issues Creating Entities in Ofbiz from existing Schema

Posted by BJ Freeman <bj...@free-man.net>.
I would suggest you return the entityengine.xml back to its original 
configuration, add your mysql datasource as the only modification to the 
file and try it again.




=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man
Kapil garg sent the following on 10/30/2010 4:30 AM:

>
> Hello Santosh
> The IllegalArgument exception went away after I put in a tenatant group name for localderby as show below. However Now I am getting Null Pointer Exception
> GenericDAO.induceModelFromDB() calls DatabaseUtil.induceModelFromDB(). In DatabaseUtil.induceModelFromDB() method, there is a line of code this.getTableNames() which is comming out tobe null? ANy idea why?Also the DBUTIL class is getting NULL value for connectionURL paramter and the dirveName parameter is also coming out to be null.
> Why is that? Hence th Nullpointer. I would imagine that this is read from the helperName=localMysql which is howing correctly in debug variable list. AM I missing anything here?
>
> Coudl you advise further as you seem to know about this?
>
>
> Kapil Garg
>
>
>
>
>
>> Date: Sat, 30 Oct 2010 09:51:54 +0530
>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>> From: santoshs.indore@gmail.com
>> To: user@ofbiz.apache.org
>>
>> *Hello  Kapil,
>> *Update your code, you are having two entries of same name it must look like
>>        <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="mysql"/>
>>             <group-map group-name="org.ofbiz.olap"
>> datasource-name="localderbyolap"/>
>>             <group-map group-name="org.ofbiz.tenant"
>> datasource-name="ocalderbytenant"/>
>>         </delegator>
>> now create database and execute commands for "clean-all" and "run-install"
>> Its done now.
>> *
>> Yours,
>>
>> Santosh Singh.*
>>
>>
>>
>> On Sat, Oct 30, 2010 at 1:52 AM, BJ Freeman<bj...@free-man.net>  wrote:
>>
>>> just declare the datasource for you db.
>>>
>>>
>>>
>>> =========================
>>> BJ Freeman
>>> Strategic Power Office with Supplier Automation<
>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>> Systems Integrator-- Glad to Assist
>>>
>>> Chat  Y! messenger: bjfr33man
>>>
>>>
>>> Kapil garg sent the following on 10/29/2010 1:01 PM:
>>>
>>>
>>>> Does that mean that I dont need to associate a datsource I create with a
>>>> delagator ? As in the datasource entry need  not have a group associated
>>>> with it? or a delagator associated with it?
>>>>
>>>>
>>>> Kapil Garg
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>   Date: Fri, 29 Oct 2010 12:54:13 -0700
>>>>> From: bjfree@free-man.net
>>>>> To: user@ofbiz.apache.org
>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>
>>>>> you did add more than the datasource
>>>>> you make it default delegator.
>>>>> this will cause the database to be updated with ofbiz schema
>>>>>
>>>>>
>>>>> =========================
>>>>>
>>>>> BJ Freeman
>>>>> Strategic Power Office with Supplier Automation<
>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>> Systems Integrator-- Glad to Assist
>>>>>
>>>>> Chat  Y! messenger: bjfr33man
>>>>>
>>>>>
>>>>> Kapil garg sent the following on 10/29/2010 12:45 PM:
>>>>>
>>>>>>
>>>>>> Yes I created only the datasource by putting an entry in the
>>>>>> entity-engine.xml file. I did not create anything else and intentionally put
>>>>>> it in default delegator. Still I am not ale to Induce. IT says unrecognised
>>>>>> datasource. I also get Null Pointer exception for localmysql datasource
>>>>>> whose entry is already in there. DO I need to do anything else?
>>>>>>
>>>>>> Do I need to do ant run-install, restart before hitting induce?
>>>>>>
>>>>>>
>>>>>> Kapil Garg
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>   Date: Fri, 29 Oct 2010 12:41:59 -0700
>>>>>>> From: bjfree@free-man.net
>>>>>>> To: user@ofbiz.apache.org
>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>>>
>>>>>>> only create a datasource. nothing else
>>>>>>> the mysql one you created you use the name.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> =========================
>>>>>>> BJ Freeman
>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>
>>>>>>> Chat  Y! messenger: bjfr33man
>>>>>>>
>>>>>>>
>>>>>>> Kapil garg sent the following on 10/29/2010 12:29 PM:
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> I actually did use mysql as the datasource and tried using the link
>>>>>>>> below by putting in the datasource name in the text box and clicking on
>>>>>>>> Induce. For existing datasources name such as localmysql or localderby, I
>>>>>>>> got a NullPointer Exception.
>>>>>>>> For the one that I had an new entry witin the default delegator, I got
>>>>>>>> " unrecognized datasource" name sort of message. Do I need to create a new
>>>>>>>> entity-group.xml file  for the datasource mysql I created below even if I am
>>>>>>>> using a default delagator similar to the data-source localmysql? Does it
>>>>>>>> need to be having group name org.ofbiz or something else within the
>>>>>>>> delegator tag?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>   Date: Fri, 29 Oct 2010 12:23:37 -0700
>>>>>>>>> From: bjfree@free-man.net
>>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>>>>>
>>>>>>>>> use mysql as the datasource
>>>>>>>>> https://localhost:8443/webtools/control/view/ModelInduceFromDb
>>>>>>>>>
>>>>>>>>> =========================
>>>>>>>>> BJ Freeman
>>>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>>>
>>>>>>>>> Chat  Y! messenger: bjfr33man
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Kapil garg sent the following on 10/29/2010 12:09 PM:
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> I am trying to create a entities within OFbiz out of an existing
>>>>>>>>>> schema in production. Not sure if this is the best way to create entties out
>>>>>>>>>> of an existing schema. Suggestions are welcomed!!
>>>>>>>>>>
>>>>>>>>>> I tried to add a datasource tag in default delegator in
>>>>>>>>>> entity-engine.xml
>>>>>>>>>> Followed the instructions on
>>>>>>>>>>
>>>>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
>>>>>>>>>> Would like to know where I am going wrong. On restart, I realised
>>>>>>>>>> that ofbiz does not finish to the point that I can get webtools or even
>>>>>>>>>> login for ecommerce. IT has just stuck at soem point saying
>>>>>>>>>>   ServiceDispatcher.java 584 INFO Sync service..
>>>>>>>>>> There is no exception or anything but OFbiz does not go further with
>>>>>>>>>> complete laoding. Anything I am doing wrong?
>>>>>>>>>> Being a default delegaotr, there was no special entity-group.xml
>>>>>>>>>> file in the ofbiz 9_04 code base. Hence I did not bother to create an
>>>>>>>>>> entity-group.xml file
>>>>>>>>>> My schema name is lronline, following are the entries I had in
>>>>>>>>>> entity-engine.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"
>>>>>>>>>> datasource-name="localderby"/>
>>>>>>>>>>             <group-map group-name="org.ofbiz.olap"
>>>>>>>>>> datasource-name="localderbyolap"/>
>>>>>>>>>>             <group-map group-name="org.ofbiz"
>>>>>>>>>> datasource-name="mysql"/>
>>>>>>>>>>         </delegator>
>>>>>>>>>>
>>>>>>>>>> <datasource name="mysql"
>>>>>>>>>>
>>>>>>>>>>   helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>>>>>>>>>                 field-type-name="mysql"
>>>>>>>>>>                 check-on-start="true"
>>>>>>>>>>                 add-missing-on-start="true"
>>>>>>>>>>                 check-pks-on-start="false"
>>>>>>>>>>                 use-foreign-keys="true"
>>>>>>>>>>                 join-style="ansi-no-parenthesis"
>>>>>>>>>>                 alias-view-columns="false"
>>>>>>>>>>                 drop-fk-use-foreign-key-keyword="true"
>>>>>>>>>>                 table-type="InnoDB"
>>>>>>>>>>                 character-set="latin1"
>>>>>>>>>>                 collate="latin1_general_cs">
>>>>>>>>>>             <read-data reader-name="seed"/>
>>>>>>>>>>             <read-data reader-name="seed-initial"/>
>>>>>>>>>>             <read-data reader-name="demo"/>
>>>>>>>>>>             <read-data reader-name="ext"/>
>>>>>>>>>>             <inline-jdbc
>>>>>>>>>>                     jdbc-driver="com.mysql.jdbc.Driver"
>>>>>>>>>>                     jdbc-uri="jdbc:mysql://
>>>>>>>>>> 127.0.0.1/lronlineonedb?autoReconnect=true"
>>>>>>>>>>                     jdbc-username="root"
>>>>>>>>>>                     jdbc-password=""
>>>>>>>>>>                     isolation-level="ReadCommitted"
>>>>>>>>>>                     pool-minsize="2"
>>>>>>>>>>                     pool-maxsize="250"/>
>>>>>>>>>>             <!--<jndi-jdbc jndi-server-name="localjndi"
>>>>>>>>>> jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>      -->
>>>>>>>>>>         </datasource>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Kapil Garg
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>   		 	   		

RE: Issues Creating Entities in Ofbiz from existing Schema

Posted by Kapil garg <ga...@hotmail.com>.
Hello Santosh
The IllegalArgument exception went away after I put in a tenatant group name for localderby as show below. However Now I am getting Null Pointer Exception 
GenericDAO.induceModelFromDB() calls DatabaseUtil.induceModelFromDB(). In DatabaseUtil.induceModelFromDB() method, there is a line of code this.getTableNames() which is comming out tobe null? ANy idea why?Also the DBUTIL class is getting NULL value for connectionURL paramter and the dirveName parameter is also coming out to be null.
Why is that? Hence th Nullpointer. I would imagine that this is read from the helperName=localMysql which is howing correctly in debug variable list. AM I missing anything here?

Coudl you advise further as you seem to know about this?


Kapil Garg
 




> Date: Sat, 30 Oct 2010 09:51:54 +0530
> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> From: santoshs.indore@gmail.com
> To: user@ofbiz.apache.org
> 
> *Hello  Kapil,
> *Update your code, you are having two entries of same name it must look like
>       <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="mysql"/>
>            <group-map group-name="org.ofbiz.olap"
> datasource-name="localderbyolap"/>
>            <group-map group-name="org.ofbiz.tenant"
> datasource-name="ocalderbytenant"/>
>        </delegator>
> now create database and execute commands for "clean-all" and "run-install"
> Its done now.
> *
> Yours,
> 
> Santosh Singh.*
> 
> 
> 
> On Sat, Oct 30, 2010 at 1:52 AM, BJ Freeman <bj...@free-man.net> wrote:
> 
> > just declare the datasource for you db.
> >
> >
> >
> > =========================
> > BJ Freeman
> > Strategic Power Office with Supplier Automation  <
> > http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> > Specialtymarket.com  <http://www.specialtymarket.com/>
> > Systems Integrator-- Glad to Assist
> >
> > Chat  Y! messenger: bjfr33man
> >
> >
> > Kapil garg sent the following on 10/29/2010 1:01 PM:
> >
> >
> >> Does that mean that I dont need to associate a datsource I create with a
> >> delagator ? As in the datasource entry need  not have a group associated
> >> with it? or a delagator associated with it?
> >>
> >>
> >> Kapil Garg
> >>
> >>
> >>
> >>
> >>
> >>  Date: Fri, 29 Oct 2010 12:54:13 -0700
> >>> From: bjfree@free-man.net
> >>> To: user@ofbiz.apache.org
> >>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>
> >>> you did add more than the datasource
> >>> you make it default delegator.
> >>> this will cause the database to be updated with ofbiz schema
> >>>
> >>>
> >>> =========================
> >>>
> >>> BJ Freeman
> >>> Strategic Power Office with Supplier Automation<
> >>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>> Systems Integrator-- Glad to Assist
> >>>
> >>> Chat  Y! messenger: bjfr33man
> >>>
> >>>
> >>> Kapil garg sent the following on 10/29/2010 12:45 PM:
> >>>
> >>>>
> >>>> Yes I created only the datasource by putting an entry in the
> >>>> entity-engine.xml file. I did not create anything else and intentionally put
> >>>> it in default delegator. Still I am not ale to Induce. IT says unrecognised
> >>>> datasource. I also get Null Pointer exception for localmysql datasource
> >>>> whose entry is already in there. DO I need to do anything else?
> >>>>
> >>>> Do I need to do ant run-install, restart before hitting induce?
> >>>>
> >>>>
> >>>> Kapil Garg
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>  Date: Fri, 29 Oct 2010 12:41:59 -0700
> >>>>> From: bjfree@free-man.net
> >>>>> To: user@ofbiz.apache.org
> >>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>>>
> >>>>> only create a datasource. nothing else
> >>>>> the mysql one you created you use the name.
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> =========================
> >>>>> BJ Freeman
> >>>>> Strategic Power Office with Supplier Automation<
> >>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>>> Systems Integrator-- Glad to Assist
> >>>>>
> >>>>> Chat  Y! messenger: bjfr33man
> >>>>>
> >>>>>
> >>>>> Kapil garg sent the following on 10/29/2010 12:29 PM:
> >>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> I actually did use mysql as the datasource and tried using the link
> >>>>>> below by putting in the datasource name in the text box and clicking on
> >>>>>> Induce. For existing datasources name such as localmysql or localderby, I
> >>>>>> got a NullPointer Exception.
> >>>>>> For the one that I had an new entry witin the default delegator, I got
> >>>>>> " unrecognized datasource" name sort of message. Do I need to create a new
> >>>>>> entity-group.xml file  for the datasource mysql I created below even if I am
> >>>>>> using a default delagator similar to the data-source localmysql? Does it
> >>>>>> need to be having group name org.ofbiz or something else within the
> >>>>>> delegator tag?
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>  Date: Fri, 29 Oct 2010 12:23:37 -0700
> >>>>>>> From: bjfree@free-man.net
> >>>>>>> To: user@ofbiz.apache.org
> >>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>>>>>
> >>>>>>> use mysql as the datasource
> >>>>>>> https://localhost:8443/webtools/control/view/ModelInduceFromDb
> >>>>>>>
> >>>>>>> =========================
> >>>>>>> BJ Freeman
> >>>>>>> Strategic Power Office with Supplier Automation<
> >>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>>>>> Systems Integrator-- Glad to Assist
> >>>>>>>
> >>>>>>> Chat  Y! messenger: bjfr33man
> >>>>>>>
> >>>>>>>
> >>>>>>> Kapil garg sent the following on 10/29/2010 12:09 PM:
> >>>>>>>
> >>>>>>>>
> >>>>>>>> I am trying to create a entities within OFbiz out of an existing
> >>>>>>>> schema in production. Not sure if this is the best way to create entties out
> >>>>>>>> of an existing schema. Suggestions are welcomed!!
> >>>>>>>>
> >>>>>>>> I tried to add a datasource tag in default delegator in
> >>>>>>>> entity-engine.xml
> >>>>>>>> Followed the instructions on
> >>>>>>>>
> >>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> >>>>>>>> Would like to know where I am going wrong. On restart, I realised
> >>>>>>>> that ofbiz does not finish to the point that I can get webtools or even
> >>>>>>>> login for ecommerce. IT has just stuck at soem point saying
> >>>>>>>>  ServiceDispatcher.java 584 INFO Sync service..
> >>>>>>>> There is no exception or anything but OFbiz does not go further with
> >>>>>>>> complete laoding. Anything I am doing wrong?
> >>>>>>>> Being a default delegaotr, there was no special entity-group.xml
> >>>>>>>> file in the ofbiz 9_04 code base. Hence I did not bother to create an
> >>>>>>>> entity-group.xml file
> >>>>>>>> My schema name is lronline, following are the entries I had in
> >>>>>>>> entity-engine.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"
> >>>>>>>> datasource-name="localderby"/>
> >>>>>>>>            <group-map group-name="org.ofbiz.olap"
> >>>>>>>> datasource-name="localderbyolap"/>
> >>>>>>>>            <group-map group-name="org.ofbiz"
> >>>>>>>> datasource-name="mysql"/>
> >>>>>>>>        </delegator>
> >>>>>>>>
> >>>>>>>> <datasource name="mysql"
> >>>>>>>>
> >>>>>>>>  helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
> >>>>>>>>                field-type-name="mysql"
> >>>>>>>>                check-on-start="true"
> >>>>>>>>                add-missing-on-start="true"
> >>>>>>>>                check-pks-on-start="false"
> >>>>>>>>                use-foreign-keys="true"
> >>>>>>>>                join-style="ansi-no-parenthesis"
> >>>>>>>>                alias-view-columns="false"
> >>>>>>>>                drop-fk-use-foreign-key-keyword="true"
> >>>>>>>>                table-type="InnoDB"
> >>>>>>>>                character-set="latin1"
> >>>>>>>>                collate="latin1_general_cs">
> >>>>>>>>            <read-data reader-name="seed"/>
> >>>>>>>>            <read-data reader-name="seed-initial"/>
> >>>>>>>>            <read-data reader-name="demo"/>
> >>>>>>>>            <read-data reader-name="ext"/>
> >>>>>>>>            <inline-jdbc
> >>>>>>>>                    jdbc-driver="com.mysql.jdbc.Driver"
> >>>>>>>>                    jdbc-uri="jdbc:mysql://
> >>>>>>>> 127.0.0.1/lronlineonedb?autoReconnect=true"
> >>>>>>>>                    jdbc-username="root"
> >>>>>>>>                    jdbc-password=""
> >>>>>>>>                    isolation-level="ReadCommitted"
> >>>>>>>>                    pool-minsize="2"
> >>>>>>>>                    pool-maxsize="250"/>
> >>>>>>>>            <!--<jndi-jdbc jndi-server-name="localjndi"
> >>>>>>>> jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>     -->
> >>>>>>>>        </datasource>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> Kapil Garg
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>
> >>>>>
> >>>>
> >>>
> >>>
> >>
> >
> >
 		 	   		  

RE: Stack Trace here for IllegalArgumentException--> Issues Creating Entities in Ofbiz from existing Schema

Posted by Kapil garg <ga...@hotmail.com>.
The link here talks about adding the connector jar and  having a delegator entry, which I already did, still I am still getting IllegalArgumentException
http://www.higherpass.com/apache/Tutorials/Configuring-Ofbiz-To-Use-A-Mysql-Database/

What about the creat-component task, do I need to run that and have a component so that mysql DB can be loaded?


Kapil Garg
 




> From: gargkapil@hotmail.com
> To: user@ofbiz.apache.org
> Subject: RE:Stack Trace here for IllegalArgumentException--> Issues Creating Entities in Ofbiz from existing Schema
> Date: Sat, 30 Oct 2010 19:16:51 +1000
> 
> 
> 
> This is the complete Stack Trace. Do I need a delegaotr for this. I did not put it as suggested by BJ however I d like to know what am I missing? I need to generate entities out of the existing schema in mysql
> 2010-10-30 11:12:07,809 (http-0.0.0.0-8443-1) [      ContextFilter.java:193:INFO ] [Request]: /webtools/control/view/ModelInduceFromDb
> 2010-10-30 11:12:07,810 (http-0.0.0.0-8443-1) [     ControlServlet.java:131:INFO ] [[[view] Request Begun, encoding=[UTF-8]- total:0.0,since last(Begin):0.0]]
> 2010-10-30 11:12:07,814 (http-0.0.0.0-8443-1) [     RequestHandler.java:697:INFO ] Rendering View [ModelInduceFromDb], sessionId=BEE5B18BDD3CE034ACFFCAAC40D343BC.jvm1
> 2010-10-30 11:12:07,838 (http-0.0.0.0-8443-1) [ApplicationDispatcher.java:662:ERROR] Servlet.service() for servlet jsp threw exception
> java.lang.IllegalArgumentException: Could not find a datasource/helper with the name mysql
>         at org.ofbiz.entity.model.ModelFieldTypeReader.getModelFieldTypeReader(ModelFieldTypeReader.java:62)
>         at org.ofbiz.entity.datasource.GenericDAO.<init>(GenericDAO.java:87)
>         at org.ofbiz.entity.datasource.GenericDAO.getGenericDAO(GenericDAO.java:77)
>         at org.apache.jsp.entity.ModelInduceFromDb_jsp._jspService(ModelInduceFromDb_jsp.java:100)
>         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
>         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
>         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
>         at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
>         at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
>         at org.ofbiz.webapp.view.JspViewHandler.render(JspViewHandler.java:76)
>         at org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:789)
>         at org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:533)
>         at org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:202)
>         at org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:78)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:259)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
>         at org.ofbiz.catalina.container.CrossSubdomainSessionValve.invoke(CrossSubdomainSessionValve.java:62)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>         at java.lang.Thread.run(Thread.java:619)
> 2010-10-30 11:12:07,847 (http-0.0.0.0-8443-1) [     JspViewHandler.java:87 :ERROR]
> ---- runtime exception report --------------------------------------------------
> ServletException rendering JSP view
> Exception: java.lang.IllegalArgumentException
> Message: Could not find a datasource/helper with the name mysql
> ---- stack trace ---------------------------------------------------------------
> java.lang.IllegalArgumentException: Could not find a datasource/helper with the name mysql
> org.ofbiz.entity.model.ModelFieldTypeReader.getModelFieldTypeReader(ModelFieldTypeReader.java:62)
> org.ofbiz.entity.datasource.GenericDAO.<init>(GenericDAO.java:87)
> org.ofbiz.entity.datasource.GenericDAO.getGenericDAO(GenericDAO.java:77)
> org.apache.jsp.entity.ModelInduceFromDb_jsp._jspService(ModelInduceFromDb_jsp.java:100)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
> org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
> org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
> org.ofbiz.webapp.view.JspViewHandler.render(JspViewHandler.java:76)
> org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:789)
> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:533)
> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:202)
> org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:78)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:259)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
> org.ofbiz.catalina.container.CrossSubdomainSessionValve.invoke(CrossSubdomainSessionValve.java:62)
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> java.lang.Thread.run(Thread.java:619)
> --------------------------------------------------------------------------------
> 
> 2010-10-30 11:12:07,850 (http-0.0.0.0-8443-1) [     ControlServlet.java:205:ERROR]
> ---- runtime exception report --------------------------------------------------
> Error in request handler:
> Exception: java.lang.IllegalArgumentException
> Message: Could not find a datasource/helper with the name mysql
> ---- stack trace ---------------------------------------------------------------
> java.lang.IllegalArgumentException: Could not find a datasource/helper with the name mysql
> org.ofbiz.entity.model.ModelFieldTypeReader.getModelFieldTypeReader(ModelFieldTypeReader.java:62)
> org.ofbiz.entity.datasource.GenericDAO.<init>(GenericDAO.java:87)
> org.ofbiz.entity.datasource.GenericDAO.getGenericDAO(GenericDAO.java:77)
> org.apache.jsp.entity.ModelInduceFromDb_jsp._jspService(ModelInduceFromDb_jsp.java:100)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
> org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
> org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
> org.ofbiz.webapp.view.JspViewHandler.render(JspViewHandler.java:76)
> org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:789)
> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:533)
> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:202)
> org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:78)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:259)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
> org.ofbiz.catalina.container.CrossSubdomainSessionValve.invoke(CrossSubdomainSessionValve.java:62)
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> java.lang.Thread.run(Thread.java:619)
> --------------------------------------------------------------------------------
> 
> 2010-10-30 11:12:07,851 (http-0.0.0.0-8443-1) [     ControlServlet.java:221:ERROR] An error occurred, going to the errorPage: /error/error.jsp
> 2010-10-30 11:12:07,851 (http-0.0.0.0-8443-1) [     ControlServlet.java:228:ERROR] Including errorPage: /error/error.jsp
> 2010-10-30 11:12:08,213 (http-0.0.0.0-8443-1) [     ControlServlet.java:302:INFO ] [[[view] Request Done- total:0.403,since last([view] Request Be...):0.403]]
> 
> 
> 
> Kapil Garg
>  
> 
> 
> 
> 
> > From: gargkapil@hotmail.com
> > To: user@ofbiz.apache.org
> > Subject: IllegalArgumentException--> Issues Creating Entities in Ofbiz from existing Schema
> > Date: Sat, 30 Oct 2010 18:57:04 +1000
> > 
> > 
> > I just added mysql datasource tag but I got
> > java.lang.IllegalArgumentException: Could not find a datasource/helper with the name mysql
> > I restarted and still got the same exception. ANy help? This is a pretty coomon task for any application to do. Ofbiz being bottom up, someone has to statr with the defined external schema. I am quiete hopeful on ofbiz and the use rlist here, so would appreciate if you guys could contribute in spreading this technology so that more and more people could use it without difficulty.
> > 
> > 
> > Kapil Garg
> >  
> > 
> > 
> > 
> > 
> > > Date: Sat, 30 Oct 2010 00:59:02 -0700
> > > From: bjfree@free-man.net
> > > To: user@ofbiz.apache.org
> > > Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> > > 
> > > you should not assign the datasource as your default.
> > > you should not change any of the code having to do with decelerators for 
> > > this step.
> > > 
> > > 
> > > 
> > > =========================
> > > BJ Freeman
> > > Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> > > Specialtymarket.com  <http://www.specialtymarket.com/>
> > > Systems Integrator-- Glad to Assist
> > > 
> > > Chat  Y! messenger: bjfr33man
> > > Santosh Singh sent the following on 10/29/2010 9:21 PM:
> > > > *Hello  Kapil,
> > > > *Update your code, you are having two entries of same name it must look like
> > > >        <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="mysql"/>
> > > >             <group-map group-name="org.ofbiz.olap"
> > > > datasource-name="localderbyolap"/>
> > > >             <group-map group-name="org.ofbiz.tenant"
> > > > datasource-name="ocalderbytenant"/>
> > > >         </delegator>
> > > > now create database and execute commands for "clean-all" and "run-install"
> > > > Its done now.
> > > > *
> > > > Yours,
> > > >
> > > > Santosh Singh.*
> > > >
> > > >
> > > >
> > > > On Sat, Oct 30, 2010 at 1:52 AM, BJ Freeman<bj...@free-man.net>  wrote:
> > > >
> > > >> just declare the datasource for you db.
> > > >>
> > > >>
> > > >>
> > > >> =========================
> > > >> BJ Freeman
> > > >> Strategic Power Office with Supplier Automation<
> > > >> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> > > >> Specialtymarket.com<http://www.specialtymarket.com/>
> > > >> Systems Integrator-- Glad to Assist
> > > >>
> > > >> Chat  Y! messenger: bjfr33man
> > > >>
> > > >>
> > > >> Kapil garg sent the following on 10/29/2010 1:01 PM:
> > > >>
> > > >>
> > > >>> Does that mean that I dont need to associate a datsource I create with a
> > > >>> delagator ? As in the datasource entry need  not have a group associated
> > > >>> with it? or a delagator associated with it?
> > > >>>
> > > >>>
> > > >>> Kapil Garg
> > > >>>
> > > >>>
> > > >>>
> > > >>>
> > > >>>
> > > >>>   Date: Fri, 29 Oct 2010 12:54:13 -0700
> > > >>>> From: bjfree@free-man.net
> > > >>>> To: user@ofbiz.apache.org
> > > >>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> > > >>>>
> > > >>>> you did add more than the datasource
> > > >>>> you make it default delegator.
> > > >>>> this will cause the database to be updated with ofbiz schema
> > > >>>>
> > > >>>>
> > > >>>> =========================
> > > >>>>
> > > >>>> BJ Freeman
> > > >>>> Strategic Power Office with Supplier Automation<
> > > >>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> > > >>>> Specialtymarket.com<http://www.specialtymarket.com/>
> > > >>>> Systems Integrator-- Glad to Assist
> > > >>>>
> > > >>>> Chat  Y! messenger: bjfr33man
> > > >>>>
> > > >>>>
> > > >>>> Kapil garg sent the following on 10/29/2010 12:45 PM:
> > > >>>>
> > > >>>>>
> > > >>>>> Yes I created only the datasource by putting an entry in the
> > > >>>>> entity-engine.xml file. I did not create anything else and intentionally put
> > > >>>>> it in default delegator. Still I am not ale to Induce. IT says unrecognised
> > > >>>>> datasource. I also get Null Pointer exception for localmysql datasource
> > > >>>>> whose entry is already in there. DO I need to do anything else?
> > > >>>>>
> > > >>>>> Do I need to do ant run-install, restart before hitting induce?
> > > >>>>>
> > > >>>>>
> > > >>>>> Kapil Garg
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>>
> > > >>>>>   Date: Fri, 29 Oct 2010 12:41:59 -0700
> > > >>>>>> From: bjfree@free-man.net
> > > >>>>>> To: user@ofbiz.apache.org
> > > >>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> > > >>>>>>
> > > >>>>>> only create a datasource. nothing else
> > > >>>>>> the mysql one you created you use the name.
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>> =========================
> > > >>>>>> BJ Freeman
> > > >>>>>> Strategic Power Office with Supplier Automation<
> > > >>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> > > >>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> > > >>>>>> Systems Integrator-- Glad to Assist
> > > >>>>>>
> > > >>>>>> Chat  Y! messenger: bjfr33man
> > > >>>>>>
> > > >>>>>>
> > > >>>>>> Kapil garg sent the following on 10/29/2010 12:29 PM:
> > > >>>>>>
> > > >>>>>>>
> > > >>>>>>>
> > > >>>>>>>
> > > >>>>>>> I actually did use mysql as the datasource and tried using the link
> > > >>>>>>> below by putting in the datasource name in the text box and clicking on
> > > >>>>>>> Induce. For existing datasources name such as localmysql or localderby, I
> > > >>>>>>> got a NullPointer Exception.
> > > >>>>>>> For the one that I had an new entry witin the default delegator, I got
> > > >>>>>>> " unrecognized datasource" name sort of message. Do I need to create a new
> > > >>>>>>> entity-group.xml file  for the datasource mysql I created below even if I am
> > > >>>>>>> using a default delagator similar to the data-source localmysql? Does it
> > > >>>>>>> need to be having group name org.ofbiz or something else within the
> > > >>>>>>> delegator tag?
> > > >>>>>>>
> > > >>>>>>>
> > > >>>>>>>
> > > >>>>>>>   Date: Fri, 29 Oct 2010 12:23:37 -0700
> > > >>>>>>>> From: bjfree@free-man.net
> > > >>>>>>>> To: user@ofbiz.apache.org
> > > >>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> > > >>>>>>>>
> > > >>>>>>>> use mysql as the datasource
> > > >>>>>>>> https://localhost:8443/webtools/control/view/ModelInduceFromDb
> > > >>>>>>>>
> > > >>>>>>>> =========================
> > > >>>>>>>> BJ Freeman
> > > >>>>>>>> Strategic Power Office with Supplier Automation<
> > > >>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> > > >>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> > > >>>>>>>> Systems Integrator-- Glad to Assist
> > > >>>>>>>>
> > > >>>>>>>> Chat  Y! messenger: bjfr33man
> > > >>>>>>>>
> > > >>>>>>>>
> > > >>>>>>>> Kapil garg sent the following on 10/29/2010 12:09 PM:
> > > >>>>>>>>
> > > >>>>>>>>>
> > > >>>>>>>>> I am trying to create a entities within OFbiz out of an existing
> > > >>>>>>>>> schema in production. Not sure if this is the best way to create entties out
> > > >>>>>>>>> of an existing schema. Suggestions are welcomed!!
> > > >>>>>>>>>
> > > >>>>>>>>> I tried to add a datasource tag in default delegator in
> > > >>>>>>>>> entity-engine.xml
> > > >>>>>>>>> Followed the instructions on
> > > >>>>>>>>>
> > > >>>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> > > >>>>>>>>> Would like to know where I am going wrong. On restart, I realised
> > > >>>>>>>>> that ofbiz does not finish to the point that I can get webtools or even
> > > >>>>>>>>> login for ecommerce. IT has just stuck at soem point saying
> > > >>>>>>>>>   ServiceDispatcher.java 584 INFO Sync service..
> > > >>>>>>>>> There is no exception or anything but OFbiz does not go further with
> > > >>>>>>>>> complete laoding. Anything I am doing wrong?
> > > >>>>>>>>> Being a default delegaotr, there was no special entity-group.xml
> > > >>>>>>>>> file in the ofbiz 9_04 code base. Hence I did not bother to create an
> > > >>>>>>>>> entity-group.xml file
> > > >>>>>>>>> My schema name is lronline, following are the entries I had in
> > > >>>>>>>>> entity-engine.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"
> > > >>>>>>>>> datasource-name="localderby"/>
> > > >>>>>>>>>             <group-map group-name="org.ofbiz.olap"
> > > >>>>>>>>> datasource-name="localderbyolap"/>
> > > >>>>>>>>>             <group-map group-name="org.ofbiz"
> > > >>>>>>>>> datasource-name="mysql"/>
> > > >>>>>>>>>         </delegator>
> > > >>>>>>>>>
> > > >>>>>>>>> <datasource name="mysql"
> > > >>>>>>>>>
> > > >>>>>>>>>   helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
> > > >>>>>>>>>                 field-type-name="mysql"
> > > >>>>>>>>>                 check-on-start="true"
> > > >>>>>>>>>                 add-missing-on-start="true"
> > > >>>>>>>>>                 check-pks-on-start="false"
> > > >>>>>>>>>                 use-foreign-keys="true"
> > > >>>>>>>>>                 join-style="ansi-no-parenthesis"
> > > >>>>>>>>>                 alias-view-columns="false"
> > > >>>>>>>>>                 drop-fk-use-foreign-key-keyword="true"
> > > >>>>>>>>>                 table-type="InnoDB"
> > > >>>>>>>>>                 character-set="latin1"
> > > >>>>>>>>>                 collate="latin1_general_cs">
> > > >>>>>>>>>             <read-data reader-name="seed"/>
> > > >>>>>>>>>             <read-data reader-name="seed-initial"/>
> > > >>>>>>>>>             <read-data reader-name="demo"/>
> > > >>>>>>>>>             <read-data reader-name="ext"/>
> > > >>>>>>>>>             <inline-jdbc
> > > >>>>>>>>>                     jdbc-driver="com.mysql.jdbc.Driver"
> > > >>>>>>>>>                     jdbc-uri="jdbc:mysql://
> > > >>>>>>>>> 127.0.0.1/lronlineonedb?autoReconnect=true"
> > > >>>>>>>>>                     jdbc-username="root"
> > > >>>>>>>>>                     jdbc-password=""
> > > >>>>>>>>>                     isolation-level="ReadCommitted"
> > > >>>>>>>>>                     pool-minsize="2"
> > > >>>>>>>>>                     pool-maxsize="250"/>
> > > >>>>>>>>>             <!--<jndi-jdbc jndi-server-name="localjndi"
> > > >>>>>>>>> jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>      -->
> > > >>>>>>>>>         </datasource>
> > > >>>>>>>>>
> > > >>>>>>>>>
> > > >>>>>>>>>
> > > >>>>>>>>> Kapil Garg
> > > >>>>>>>>>
> > > >>>>>>>>>
> > > >>>>>>>>>
> > > >>>>>>>>>
> > > >>>>>>>>>
> > > >>>>>>>>
> > > >>>>>>>>
> > > >>>>>>>
> > > >>>>>>
> > > >>>>>>
> > > >>>>>
> > > >>>>
> > > >>>>
> > > >>>
> > > >>
> > > >>
> > > >
> >  		 	   		  
>  		 	   		  
 		 	   		  

RE:Stack Trace here for IllegalArgumentException--> Issues Creating Entities in Ofbiz from existing Schema

Posted by Kapil garg <ga...@hotmail.com>.

This is the complete Stack Trace. Do I need a delegaotr for this. I did not put it as suggested by BJ however I d like to know what am I missing? I need to generate entities out of the existing schema in mysql
2010-10-30 11:12:07,809 (http-0.0.0.0-8443-1) [      ContextFilter.java:193:INFO ] [Request]: /webtools/control/view/ModelInduceFromDb
2010-10-30 11:12:07,810 (http-0.0.0.0-8443-1) [     ControlServlet.java:131:INFO ] [[[view] Request Begun, encoding=[UTF-8]- total:0.0,since last(Begin):0.0]]
2010-10-30 11:12:07,814 (http-0.0.0.0-8443-1) [     RequestHandler.java:697:INFO ] Rendering View [ModelInduceFromDb], sessionId=BEE5B18BDD3CE034ACFFCAAC40D343BC.jvm1
2010-10-30 11:12:07,838 (http-0.0.0.0-8443-1) [ApplicationDispatcher.java:662:ERROR] Servlet.service() for servlet jsp threw exception
java.lang.IllegalArgumentException: Could not find a datasource/helper with the name mysql
        at org.ofbiz.entity.model.ModelFieldTypeReader.getModelFieldTypeReader(ModelFieldTypeReader.java:62)
        at org.ofbiz.entity.datasource.GenericDAO.<init>(GenericDAO.java:87)
        at org.ofbiz.entity.datasource.GenericDAO.getGenericDAO(GenericDAO.java:77)
        at org.apache.jsp.entity.ModelInduceFromDb_jsp._jspService(ModelInduceFromDb_jsp.java:100)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
        at org.ofbiz.webapp.view.JspViewHandler.render(JspViewHandler.java:76)
        at org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:789)
        at org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:533)
        at org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:202)
        at org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:78)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:259)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
        at org.ofbiz.catalina.container.CrossSubdomainSessionValve.invoke(CrossSubdomainSessionValve.java:62)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:619)
2010-10-30 11:12:07,847 (http-0.0.0.0-8443-1) [     JspViewHandler.java:87 :ERROR]
---- runtime exception report --------------------------------------------------
ServletException rendering JSP view
Exception: java.lang.IllegalArgumentException
Message: Could not find a datasource/helper with the name mysql
---- stack trace ---------------------------------------------------------------
java.lang.IllegalArgumentException: Could not find a datasource/helper with the name mysql
org.ofbiz.entity.model.ModelFieldTypeReader.getModelFieldTypeReader(ModelFieldTypeReader.java:62)
org.ofbiz.entity.datasource.GenericDAO.<init>(GenericDAO.java:87)
org.ofbiz.entity.datasource.GenericDAO.getGenericDAO(GenericDAO.java:77)
org.apache.jsp.entity.ModelInduceFromDb_jsp._jspService(ModelInduceFromDb_jsp.java:100)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
org.ofbiz.webapp.view.JspViewHandler.render(JspViewHandler.java:76)
org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:789)
org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:533)
org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:202)
org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:78)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:259)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
org.ofbiz.catalina.container.CrossSubdomainSessionValve.invoke(CrossSubdomainSessionValve.java:62)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:619)
--------------------------------------------------------------------------------

2010-10-30 11:12:07,850 (http-0.0.0.0-8443-1) [     ControlServlet.java:205:ERROR]
---- runtime exception report --------------------------------------------------
Error in request handler:
Exception: java.lang.IllegalArgumentException
Message: Could not find a datasource/helper with the name mysql
---- stack trace ---------------------------------------------------------------
java.lang.IllegalArgumentException: Could not find a datasource/helper with the name mysql
org.ofbiz.entity.model.ModelFieldTypeReader.getModelFieldTypeReader(ModelFieldTypeReader.java:62)
org.ofbiz.entity.datasource.GenericDAO.<init>(GenericDAO.java:87)
org.ofbiz.entity.datasource.GenericDAO.getGenericDAO(GenericDAO.java:77)
org.apache.jsp.entity.ModelInduceFromDb_jsp._jspService(ModelInduceFromDb_jsp.java:100)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
org.ofbiz.webapp.view.JspViewHandler.render(JspViewHandler.java:76)
org.ofbiz.webapp.control.RequestHandler.renderView(RequestHandler.java:789)
org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:533)
org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:202)
org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:78)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:259)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
org.ofbiz.catalina.container.CrossSubdomainSessionValve.invoke(CrossSubdomainSessionValve.java:62)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:619)
--------------------------------------------------------------------------------

2010-10-30 11:12:07,851 (http-0.0.0.0-8443-1) [     ControlServlet.java:221:ERROR] An error occurred, going to the errorPage: /error/error.jsp
2010-10-30 11:12:07,851 (http-0.0.0.0-8443-1) [     ControlServlet.java:228:ERROR] Including errorPage: /error/error.jsp
2010-10-30 11:12:08,213 (http-0.0.0.0-8443-1) [     ControlServlet.java:302:INFO ] [[[view] Request Done- total:0.403,since last([view] Request Be...):0.403]]



Kapil Garg
 




> From: gargkapil@hotmail.com
> To: user@ofbiz.apache.org
> Subject: IllegalArgumentException--> Issues Creating Entities in Ofbiz from existing Schema
> Date: Sat, 30 Oct 2010 18:57:04 +1000
> 
> 
> I just added mysql datasource tag but I got
> java.lang.IllegalArgumentException: Could not find a datasource/helper with the name mysql
> I restarted and still got the same exception. ANy help? This is a pretty coomon task for any application to do. Ofbiz being bottom up, someone has to statr with the defined external schema. I am quiete hopeful on ofbiz and the use rlist here, so would appreciate if you guys could contribute in spreading this technology so that more and more people could use it without difficulty.
> 
> 
> Kapil Garg
>  
> 
> 
> 
> 
> > Date: Sat, 30 Oct 2010 00:59:02 -0700
> > From: bjfree@free-man.net
> > To: user@ofbiz.apache.org
> > Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> > 
> > you should not assign the datasource as your default.
> > you should not change any of the code having to do with decelerators for 
> > this step.
> > 
> > 
> > 
> > =========================
> > BJ Freeman
> > Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> > Specialtymarket.com  <http://www.specialtymarket.com/>
> > Systems Integrator-- Glad to Assist
> > 
> > Chat  Y! messenger: bjfr33man
> > Santosh Singh sent the following on 10/29/2010 9:21 PM:
> > > *Hello  Kapil,
> > > *Update your code, you are having two entries of same name it must look like
> > >        <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="mysql"/>
> > >             <group-map group-name="org.ofbiz.olap"
> > > datasource-name="localderbyolap"/>
> > >             <group-map group-name="org.ofbiz.tenant"
> > > datasource-name="ocalderbytenant"/>
> > >         </delegator>
> > > now create database and execute commands for "clean-all" and "run-install"
> > > Its done now.
> > > *
> > > Yours,
> > >
> > > Santosh Singh.*
> > >
> > >
> > >
> > > On Sat, Oct 30, 2010 at 1:52 AM, BJ Freeman<bj...@free-man.net>  wrote:
> > >
> > >> just declare the datasource for you db.
> > >>
> > >>
> > >>
> > >> =========================
> > >> BJ Freeman
> > >> Strategic Power Office with Supplier Automation<
> > >> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> > >> Specialtymarket.com<http://www.specialtymarket.com/>
> > >> Systems Integrator-- Glad to Assist
> > >>
> > >> Chat  Y! messenger: bjfr33man
> > >>
> > >>
> > >> Kapil garg sent the following on 10/29/2010 1:01 PM:
> > >>
> > >>
> > >>> Does that mean that I dont need to associate a datsource I create with a
> > >>> delagator ? As in the datasource entry need  not have a group associated
> > >>> with it? or a delagator associated with it?
> > >>>
> > >>>
> > >>> Kapil Garg
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>   Date: Fri, 29 Oct 2010 12:54:13 -0700
> > >>>> From: bjfree@free-man.net
> > >>>> To: user@ofbiz.apache.org
> > >>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> > >>>>
> > >>>> you did add more than the datasource
> > >>>> you make it default delegator.
> > >>>> this will cause the database to be updated with ofbiz schema
> > >>>>
> > >>>>
> > >>>> =========================
> > >>>>
> > >>>> BJ Freeman
> > >>>> Strategic Power Office with Supplier Automation<
> > >>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> > >>>> Specialtymarket.com<http://www.specialtymarket.com/>
> > >>>> Systems Integrator-- Glad to Assist
> > >>>>
> > >>>> Chat  Y! messenger: bjfr33man
> > >>>>
> > >>>>
> > >>>> Kapil garg sent the following on 10/29/2010 12:45 PM:
> > >>>>
> > >>>>>
> > >>>>> Yes I created only the datasource by putting an entry in the
> > >>>>> entity-engine.xml file. I did not create anything else and intentionally put
> > >>>>> it in default delegator. Still I am not ale to Induce. IT says unrecognised
> > >>>>> datasource. I also get Null Pointer exception for localmysql datasource
> > >>>>> whose entry is already in there. DO I need to do anything else?
> > >>>>>
> > >>>>> Do I need to do ant run-install, restart before hitting induce?
> > >>>>>
> > >>>>>
> > >>>>> Kapil Garg
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>   Date: Fri, 29 Oct 2010 12:41:59 -0700
> > >>>>>> From: bjfree@free-man.net
> > >>>>>> To: user@ofbiz.apache.org
> > >>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> > >>>>>>
> > >>>>>> only create a datasource. nothing else
> > >>>>>> the mysql one you created you use the name.
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>> =========================
> > >>>>>> BJ Freeman
> > >>>>>> Strategic Power Office with Supplier Automation<
> > >>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> > >>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> > >>>>>> Systems Integrator-- Glad to Assist
> > >>>>>>
> > >>>>>> Chat  Y! messenger: bjfr33man
> > >>>>>>
> > >>>>>>
> > >>>>>> Kapil garg sent the following on 10/29/2010 12:29 PM:
> > >>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>> I actually did use mysql as the datasource and tried using the link
> > >>>>>>> below by putting in the datasource name in the text box and clicking on
> > >>>>>>> Induce. For existing datasources name such as localmysql or localderby, I
> > >>>>>>> got a NullPointer Exception.
> > >>>>>>> For the one that I had an new entry witin the default delegator, I got
> > >>>>>>> " unrecognized datasource" name sort of message. Do I need to create a new
> > >>>>>>> entity-group.xml file  for the datasource mysql I created below even if I am
> > >>>>>>> using a default delagator similar to the data-source localmysql? Does it
> > >>>>>>> need to be having group name org.ofbiz or something else within the
> > >>>>>>> delegator tag?
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>   Date: Fri, 29 Oct 2010 12:23:37 -0700
> > >>>>>>>> From: bjfree@free-man.net
> > >>>>>>>> To: user@ofbiz.apache.org
> > >>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> > >>>>>>>>
> > >>>>>>>> use mysql as the datasource
> > >>>>>>>> https://localhost:8443/webtools/control/view/ModelInduceFromDb
> > >>>>>>>>
> > >>>>>>>> =========================
> > >>>>>>>> BJ Freeman
> > >>>>>>>> Strategic Power Office with Supplier Automation<
> > >>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> > >>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> > >>>>>>>> Systems Integrator-- Glad to Assist
> > >>>>>>>>
> > >>>>>>>> Chat  Y! messenger: bjfr33man
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>> Kapil garg sent the following on 10/29/2010 12:09 PM:
> > >>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>> I am trying to create a entities within OFbiz out of an existing
> > >>>>>>>>> schema in production. Not sure if this is the best way to create entties out
> > >>>>>>>>> of an existing schema. Suggestions are welcomed!!
> > >>>>>>>>>
> > >>>>>>>>> I tried to add a datasource tag in default delegator in
> > >>>>>>>>> entity-engine.xml
> > >>>>>>>>> Followed the instructions on
> > >>>>>>>>>
> > >>>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> > >>>>>>>>> Would like to know where I am going wrong. On restart, I realised
> > >>>>>>>>> that ofbiz does not finish to the point that I can get webtools or even
> > >>>>>>>>> login for ecommerce. IT has just stuck at soem point saying
> > >>>>>>>>>   ServiceDispatcher.java 584 INFO Sync service..
> > >>>>>>>>> There is no exception or anything but OFbiz does not go further with
> > >>>>>>>>> complete laoding. Anything I am doing wrong?
> > >>>>>>>>> Being a default delegaotr, there was no special entity-group.xml
> > >>>>>>>>> file in the ofbiz 9_04 code base. Hence I did not bother to create an
> > >>>>>>>>> entity-group.xml file
> > >>>>>>>>> My schema name is lronline, following are the entries I had in
> > >>>>>>>>> entity-engine.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"
> > >>>>>>>>> datasource-name="localderby"/>
> > >>>>>>>>>             <group-map group-name="org.ofbiz.olap"
> > >>>>>>>>> datasource-name="localderbyolap"/>
> > >>>>>>>>>             <group-map group-name="org.ofbiz"
> > >>>>>>>>> datasource-name="mysql"/>
> > >>>>>>>>>         </delegator>
> > >>>>>>>>>
> > >>>>>>>>> <datasource name="mysql"
> > >>>>>>>>>
> > >>>>>>>>>   helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
> > >>>>>>>>>                 field-type-name="mysql"
> > >>>>>>>>>                 check-on-start="true"
> > >>>>>>>>>                 add-missing-on-start="true"
> > >>>>>>>>>                 check-pks-on-start="false"
> > >>>>>>>>>                 use-foreign-keys="true"
> > >>>>>>>>>                 join-style="ansi-no-parenthesis"
> > >>>>>>>>>                 alias-view-columns="false"
> > >>>>>>>>>                 drop-fk-use-foreign-key-keyword="true"
> > >>>>>>>>>                 table-type="InnoDB"
> > >>>>>>>>>                 character-set="latin1"
> > >>>>>>>>>                 collate="latin1_general_cs">
> > >>>>>>>>>             <read-data reader-name="seed"/>
> > >>>>>>>>>             <read-data reader-name="seed-initial"/>
> > >>>>>>>>>             <read-data reader-name="demo"/>
> > >>>>>>>>>             <read-data reader-name="ext"/>
> > >>>>>>>>>             <inline-jdbc
> > >>>>>>>>>                     jdbc-driver="com.mysql.jdbc.Driver"
> > >>>>>>>>>                     jdbc-uri="jdbc:mysql://
> > >>>>>>>>> 127.0.0.1/lronlineonedb?autoReconnect=true"
> > >>>>>>>>>                     jdbc-username="root"
> > >>>>>>>>>                     jdbc-password=""
> > >>>>>>>>>                     isolation-level="ReadCommitted"
> > >>>>>>>>>                     pool-minsize="2"
> > >>>>>>>>>                     pool-maxsize="250"/>
> > >>>>>>>>>             <!--<jndi-jdbc jndi-server-name="localjndi"
> > >>>>>>>>> jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>      -->
> > >>>>>>>>>         </datasource>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>> Kapil Garg
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>
> > >>>>>>>>
> > >>>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>
> > >>>>
> > >>>>
> > >>>
> > >>
> > >>
> > >
>  		 	   		  
 		 	   		  

IllegalArgumentException--> Issues Creating Entities in Ofbiz from existing Schema

Posted by Kapil garg <ga...@hotmail.com>.
I just added mysql datasource tag but I got
java.lang.IllegalArgumentException: Could not find a datasource/helper with the name mysql
I restarted and still got the same exception. ANy help? This is a pretty coomon task for any application to do. Ofbiz being bottom up, someone has to statr with the defined external schema. I am quiete hopeful on ofbiz and the use rlist here, so would appreciate if you guys could contribute in spreading this technology so that more and more people could use it without difficulty.


Kapil Garg
 




> Date: Sat, 30 Oct 2010 00:59:02 -0700
> From: bjfree@free-man.net
> To: user@ofbiz.apache.org
> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> 
> you should not assign the datasource as your default.
> you should not change any of the code having to do with decelerators for 
> this step.
> 
> 
> 
> =========================
> BJ Freeman
> Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> Specialtymarket.com  <http://www.specialtymarket.com/>
> Systems Integrator-- Glad to Assist
> 
> Chat  Y! messenger: bjfr33man
> Santosh Singh sent the following on 10/29/2010 9:21 PM:
> > *Hello  Kapil,
> > *Update your code, you are having two entries of same name it must look like
> >        <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="mysql"/>
> >             <group-map group-name="org.ofbiz.olap"
> > datasource-name="localderbyolap"/>
> >             <group-map group-name="org.ofbiz.tenant"
> > datasource-name="ocalderbytenant"/>
> >         </delegator>
> > now create database and execute commands for "clean-all" and "run-install"
> > Its done now.
> > *
> > Yours,
> >
> > Santosh Singh.*
> >
> >
> >
> > On Sat, Oct 30, 2010 at 1:52 AM, BJ Freeman<bj...@free-man.net>  wrote:
> >
> >> just declare the datasource for you db.
> >>
> >>
> >>
> >> =========================
> >> BJ Freeman
> >> Strategic Power Office with Supplier Automation<
> >> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >> Specialtymarket.com<http://www.specialtymarket.com/>
> >> Systems Integrator-- Glad to Assist
> >>
> >> Chat  Y! messenger: bjfr33man
> >>
> >>
> >> Kapil garg sent the following on 10/29/2010 1:01 PM:
> >>
> >>
> >>> Does that mean that I dont need to associate a datsource I create with a
> >>> delagator ? As in the datasource entry need  not have a group associated
> >>> with it? or a delagator associated with it?
> >>>
> >>>
> >>> Kapil Garg
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>   Date: Fri, 29 Oct 2010 12:54:13 -0700
> >>>> From: bjfree@free-man.net
> >>>> To: user@ofbiz.apache.org
> >>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>>
> >>>> you did add more than the datasource
> >>>> you make it default delegator.
> >>>> this will cause the database to be updated with ofbiz schema
> >>>>
> >>>>
> >>>> =========================
> >>>>
> >>>> BJ Freeman
> >>>> Strategic Power Office with Supplier Automation<
> >>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>> Systems Integrator-- Glad to Assist
> >>>>
> >>>> Chat  Y! messenger: bjfr33man
> >>>>
> >>>>
> >>>> Kapil garg sent the following on 10/29/2010 12:45 PM:
> >>>>
> >>>>>
> >>>>> Yes I created only the datasource by putting an entry in the
> >>>>> entity-engine.xml file. I did not create anything else and intentionally put
> >>>>> it in default delegator. Still I am not ale to Induce. IT says unrecognised
> >>>>> datasource. I also get Null Pointer exception for localmysql datasource
> >>>>> whose entry is already in there. DO I need to do anything else?
> >>>>>
> >>>>> Do I need to do ant run-install, restart before hitting induce?
> >>>>>
> >>>>>
> >>>>> Kapil Garg
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>   Date: Fri, 29 Oct 2010 12:41:59 -0700
> >>>>>> From: bjfree@free-man.net
> >>>>>> To: user@ofbiz.apache.org
> >>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>>>>
> >>>>>> only create a datasource. nothing else
> >>>>>> the mysql one you created you use the name.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> =========================
> >>>>>> BJ Freeman
> >>>>>> Strategic Power Office with Supplier Automation<
> >>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>>>> Systems Integrator-- Glad to Assist
> >>>>>>
> >>>>>> Chat  Y! messenger: bjfr33man
> >>>>>>
> >>>>>>
> >>>>>> Kapil garg sent the following on 10/29/2010 12:29 PM:
> >>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> I actually did use mysql as the datasource and tried using the link
> >>>>>>> below by putting in the datasource name in the text box and clicking on
> >>>>>>> Induce. For existing datasources name such as localmysql or localderby, I
> >>>>>>> got a NullPointer Exception.
> >>>>>>> For the one that I had an new entry witin the default delegator, I got
> >>>>>>> " unrecognized datasource" name sort of message. Do I need to create a new
> >>>>>>> entity-group.xml file  for the datasource mysql I created below even if I am
> >>>>>>> using a default delagator similar to the data-source localmysql? Does it
> >>>>>>> need to be having group name org.ofbiz or something else within the
> >>>>>>> delegator tag?
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>   Date: Fri, 29 Oct 2010 12:23:37 -0700
> >>>>>>>> From: bjfree@free-man.net
> >>>>>>>> To: user@ofbiz.apache.org
> >>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>>>>>>
> >>>>>>>> use mysql as the datasource
> >>>>>>>> https://localhost:8443/webtools/control/view/ModelInduceFromDb
> >>>>>>>>
> >>>>>>>> =========================
> >>>>>>>> BJ Freeman
> >>>>>>>> Strategic Power Office with Supplier Automation<
> >>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>>>>>> Systems Integrator-- Glad to Assist
> >>>>>>>>
> >>>>>>>> Chat  Y! messenger: bjfr33man
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> Kapil garg sent the following on 10/29/2010 12:09 PM:
> >>>>>>>>
> >>>>>>>>>
> >>>>>>>>> I am trying to create a entities within OFbiz out of an existing
> >>>>>>>>> schema in production. Not sure if this is the best way to create entties out
> >>>>>>>>> of an existing schema. Suggestions are welcomed!!
> >>>>>>>>>
> >>>>>>>>> I tried to add a datasource tag in default delegator in
> >>>>>>>>> entity-engine.xml
> >>>>>>>>> Followed the instructions on
> >>>>>>>>>
> >>>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> >>>>>>>>> Would like to know where I am going wrong. On restart, I realised
> >>>>>>>>> that ofbiz does not finish to the point that I can get webtools or even
> >>>>>>>>> login for ecommerce. IT has just stuck at soem point saying
> >>>>>>>>>   ServiceDispatcher.java 584 INFO Sync service..
> >>>>>>>>> There is no exception or anything but OFbiz does not go further with
> >>>>>>>>> complete laoding. Anything I am doing wrong?
> >>>>>>>>> Being a default delegaotr, there was no special entity-group.xml
> >>>>>>>>> file in the ofbiz 9_04 code base. Hence I did not bother to create an
> >>>>>>>>> entity-group.xml file
> >>>>>>>>> My schema name is lronline, following are the entries I had in
> >>>>>>>>> entity-engine.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"
> >>>>>>>>> datasource-name="localderby"/>
> >>>>>>>>>             <group-map group-name="org.ofbiz.olap"
> >>>>>>>>> datasource-name="localderbyolap"/>
> >>>>>>>>>             <group-map group-name="org.ofbiz"
> >>>>>>>>> datasource-name="mysql"/>
> >>>>>>>>>         </delegator>
> >>>>>>>>>
> >>>>>>>>> <datasource name="mysql"
> >>>>>>>>>
> >>>>>>>>>   helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
> >>>>>>>>>                 field-type-name="mysql"
> >>>>>>>>>                 check-on-start="true"
> >>>>>>>>>                 add-missing-on-start="true"
> >>>>>>>>>                 check-pks-on-start="false"
> >>>>>>>>>                 use-foreign-keys="true"
> >>>>>>>>>                 join-style="ansi-no-parenthesis"
> >>>>>>>>>                 alias-view-columns="false"
> >>>>>>>>>                 drop-fk-use-foreign-key-keyword="true"
> >>>>>>>>>                 table-type="InnoDB"
> >>>>>>>>>                 character-set="latin1"
> >>>>>>>>>                 collate="latin1_general_cs">
> >>>>>>>>>             <read-data reader-name="seed"/>
> >>>>>>>>>             <read-data reader-name="seed-initial"/>
> >>>>>>>>>             <read-data reader-name="demo"/>
> >>>>>>>>>             <read-data reader-name="ext"/>
> >>>>>>>>>             <inline-jdbc
> >>>>>>>>>                     jdbc-driver="com.mysql.jdbc.Driver"
> >>>>>>>>>                     jdbc-uri="jdbc:mysql://
> >>>>>>>>> 127.0.0.1/lronlineonedb?autoReconnect=true"
> >>>>>>>>>                     jdbc-username="root"
> >>>>>>>>>                     jdbc-password=""
> >>>>>>>>>                     isolation-level="ReadCommitted"
> >>>>>>>>>                     pool-minsize="2"
> >>>>>>>>>                     pool-maxsize="250"/>
> >>>>>>>>>             <!--<jndi-jdbc jndi-server-name="localjndi"
> >>>>>>>>> jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>      -->
> >>>>>>>>>         </datasource>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>> Kapil Garg
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>>
> >>>>>
> >>>>
> >>>>
> >>>
> >>
> >>
> >
 		 	   		  

Re: Issues Creating Entities in Ofbiz from existing Schema

Posted by BJ Freeman <bj...@free-man.net>.
you should not assign the datasource as your default.
you should not change any of the code having to do with decelerators for 
this step.



=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man
Santosh Singh sent the following on 10/29/2010 9:21 PM:
> *Hello  Kapil,
> *Update your code, you are having two entries of same name it must look like
>        <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="mysql"/>
>             <group-map group-name="org.ofbiz.olap"
> datasource-name="localderbyolap"/>
>             <group-map group-name="org.ofbiz.tenant"
> datasource-name="ocalderbytenant"/>
>         </delegator>
> now create database and execute commands for "clean-all" and "run-install"
> Its done now.
> *
> Yours,
>
> Santosh Singh.*
>
>
>
> On Sat, Oct 30, 2010 at 1:52 AM, BJ Freeman<bj...@free-man.net>  wrote:
>
>> just declare the datasource for you db.
>>
>>
>>
>> =========================
>> BJ Freeman
>> Strategic Power Office with Supplier Automation<
>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>> Specialtymarket.com<http://www.specialtymarket.com/>
>> Systems Integrator-- Glad to Assist
>>
>> Chat  Y! messenger: bjfr33man
>>
>>
>> Kapil garg sent the following on 10/29/2010 1:01 PM:
>>
>>
>>> Does that mean that I dont need to associate a datsource I create with a
>>> delagator ? As in the datasource entry need  not have a group associated
>>> with it? or a delagator associated with it?
>>>
>>>
>>> Kapil Garg
>>>
>>>
>>>
>>>
>>>
>>>   Date: Fri, 29 Oct 2010 12:54:13 -0700
>>>> From: bjfree@free-man.net
>>>> To: user@ofbiz.apache.org
>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>
>>>> you did add more than the datasource
>>>> you make it default delegator.
>>>> this will cause the database to be updated with ofbiz schema
>>>>
>>>>
>>>> =========================
>>>>
>>>> BJ Freeman
>>>> Strategic Power Office with Supplier Automation<
>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>> Systems Integrator-- Glad to Assist
>>>>
>>>> Chat  Y! messenger: bjfr33man
>>>>
>>>>
>>>> Kapil garg sent the following on 10/29/2010 12:45 PM:
>>>>
>>>>>
>>>>> Yes I created only the datasource by putting an entry in the
>>>>> entity-engine.xml file. I did not create anything else and intentionally put
>>>>> it in default delegator. Still I am not ale to Induce. IT says unrecognised
>>>>> datasource. I also get Null Pointer exception for localmysql datasource
>>>>> whose entry is already in there. DO I need to do anything else?
>>>>>
>>>>> Do I need to do ant run-install, restart before hitting induce?
>>>>>
>>>>>
>>>>> Kapil Garg
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>   Date: Fri, 29 Oct 2010 12:41:59 -0700
>>>>>> From: bjfree@free-man.net
>>>>>> To: user@ofbiz.apache.org
>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>>
>>>>>> only create a datasource. nothing else
>>>>>> the mysql one you created you use the name.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> =========================
>>>>>> BJ Freeman
>>>>>> Strategic Power Office with Supplier Automation<
>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>> Systems Integrator-- Glad to Assist
>>>>>>
>>>>>> Chat  Y! messenger: bjfr33man
>>>>>>
>>>>>>
>>>>>> Kapil garg sent the following on 10/29/2010 12:29 PM:
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I actually did use mysql as the datasource and tried using the link
>>>>>>> below by putting in the datasource name in the text box and clicking on
>>>>>>> Induce. For existing datasources name such as localmysql or localderby, I
>>>>>>> got a NullPointer Exception.
>>>>>>> For the one that I had an new entry witin the default delegator, I got
>>>>>>> " unrecognized datasource" name sort of message. Do I need to create a new
>>>>>>> entity-group.xml file  for the datasource mysql I created below even if I am
>>>>>>> using a default delagator similar to the data-source localmysql? Does it
>>>>>>> need to be having group name org.ofbiz or something else within the
>>>>>>> delegator tag?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>   Date: Fri, 29 Oct 2010 12:23:37 -0700
>>>>>>>> From: bjfree@free-man.net
>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>>>>
>>>>>>>> use mysql as the datasource
>>>>>>>> https://localhost:8443/webtools/control/view/ModelInduceFromDb
>>>>>>>>
>>>>>>>> =========================
>>>>>>>> BJ Freeman
>>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>>
>>>>>>>> Chat  Y! messenger: bjfr33man
>>>>>>>>
>>>>>>>>
>>>>>>>> Kapil garg sent the following on 10/29/2010 12:09 PM:
>>>>>>>>
>>>>>>>>>
>>>>>>>>> I am trying to create a entities within OFbiz out of an existing
>>>>>>>>> schema in production. Not sure if this is the best way to create entties out
>>>>>>>>> of an existing schema. Suggestions are welcomed!!
>>>>>>>>>
>>>>>>>>> I tried to add a datasource tag in default delegator in
>>>>>>>>> entity-engine.xml
>>>>>>>>> Followed the instructions on
>>>>>>>>>
>>>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
>>>>>>>>> Would like to know where I am going wrong. On restart, I realised
>>>>>>>>> that ofbiz does not finish to the point that I can get webtools or even
>>>>>>>>> login for ecommerce. IT has just stuck at soem point saying
>>>>>>>>>   ServiceDispatcher.java 584 INFO Sync service..
>>>>>>>>> There is no exception or anything but OFbiz does not go further with
>>>>>>>>> complete laoding. Anything I am doing wrong?
>>>>>>>>> Being a default delegaotr, there was no special entity-group.xml
>>>>>>>>> file in the ofbiz 9_04 code base. Hence I did not bother to create an
>>>>>>>>> entity-group.xml file
>>>>>>>>> My schema name is lronline, following are the entries I had in
>>>>>>>>> entity-engine.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"
>>>>>>>>> datasource-name="localderby"/>
>>>>>>>>>             <group-map group-name="org.ofbiz.olap"
>>>>>>>>> datasource-name="localderbyolap"/>
>>>>>>>>>             <group-map group-name="org.ofbiz"
>>>>>>>>> datasource-name="mysql"/>
>>>>>>>>>         </delegator>
>>>>>>>>>
>>>>>>>>> <datasource name="mysql"
>>>>>>>>>
>>>>>>>>>   helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>>>>>>>>                 field-type-name="mysql"
>>>>>>>>>                 check-on-start="true"
>>>>>>>>>                 add-missing-on-start="true"
>>>>>>>>>                 check-pks-on-start="false"
>>>>>>>>>                 use-foreign-keys="true"
>>>>>>>>>                 join-style="ansi-no-parenthesis"
>>>>>>>>>                 alias-view-columns="false"
>>>>>>>>>                 drop-fk-use-foreign-key-keyword="true"
>>>>>>>>>                 table-type="InnoDB"
>>>>>>>>>                 character-set="latin1"
>>>>>>>>>                 collate="latin1_general_cs">
>>>>>>>>>             <read-data reader-name="seed"/>
>>>>>>>>>             <read-data reader-name="seed-initial"/>
>>>>>>>>>             <read-data reader-name="demo"/>
>>>>>>>>>             <read-data reader-name="ext"/>
>>>>>>>>>             <inline-jdbc
>>>>>>>>>                     jdbc-driver="com.mysql.jdbc.Driver"
>>>>>>>>>                     jdbc-uri="jdbc:mysql://
>>>>>>>>> 127.0.0.1/lronlineonedb?autoReconnect=true"
>>>>>>>>>                     jdbc-username="root"
>>>>>>>>>                     jdbc-password=""
>>>>>>>>>                     isolation-level="ReadCommitted"
>>>>>>>>>                     pool-minsize="2"
>>>>>>>>>                     pool-maxsize="250"/>
>>>>>>>>>             <!--<jndi-jdbc jndi-server-name="localjndi"
>>>>>>>>> jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>      -->
>>>>>>>>>         </datasource>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Kapil Garg
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>>
>

Re: Issues Creating Entities in Ofbiz from existing Schema

Posted by Santosh Singh <sa...@gmail.com>.
*Hello  Kapil,
*Update your code, you are having two entries of same name it must look like
      <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="mysql"/>
           <group-map group-name="org.ofbiz.olap"
datasource-name="localderbyolap"/>
           <group-map group-name="org.ofbiz.tenant"
datasource-name="ocalderbytenant"/>
       </delegator>
now create database and execute commands for "clean-all" and "run-install"
Its done now.
*
Yours,

Santosh Singh.*



On Sat, Oct 30, 2010 at 1:52 AM, BJ Freeman <bj...@free-man.net> wrote:

> just declare the datasource for you db.
>
>
>
> =========================
> BJ Freeman
> Strategic Power Office with Supplier Automation  <
> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> Specialtymarket.com  <http://www.specialtymarket.com/>
> Systems Integrator-- Glad to Assist
>
> Chat  Y! messenger: bjfr33man
>
>
> Kapil garg sent the following on 10/29/2010 1:01 PM:
>
>
>> Does that mean that I dont need to associate a datsource I create with a
>> delagator ? As in the datasource entry need  not have a group associated
>> with it? or a delagator associated with it?
>>
>>
>> Kapil Garg
>>
>>
>>
>>
>>
>>  Date: Fri, 29 Oct 2010 12:54:13 -0700
>>> From: bjfree@free-man.net
>>> To: user@ofbiz.apache.org
>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>
>>> you did add more than the datasource
>>> you make it default delegator.
>>> this will cause the database to be updated with ofbiz schema
>>>
>>>
>>> =========================
>>>
>>> BJ Freeman
>>> Strategic Power Office with Supplier Automation<
>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>> Systems Integrator-- Glad to Assist
>>>
>>> Chat  Y! messenger: bjfr33man
>>>
>>>
>>> Kapil garg sent the following on 10/29/2010 12:45 PM:
>>>
>>>>
>>>> Yes I created only the datasource by putting an entry in the
>>>> entity-engine.xml file. I did not create anything else and intentionally put
>>>> it in default delegator. Still I am not ale to Induce. IT says unrecognised
>>>> datasource. I also get Null Pointer exception for localmysql datasource
>>>> whose entry is already in there. DO I need to do anything else?
>>>>
>>>> Do I need to do ant run-install, restart before hitting induce?
>>>>
>>>>
>>>> Kapil Garg
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>  Date: Fri, 29 Oct 2010 12:41:59 -0700
>>>>> From: bjfree@free-man.net
>>>>> To: user@ofbiz.apache.org
>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>
>>>>> only create a datasource. nothing else
>>>>> the mysql one you created you use the name.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> =========================
>>>>> BJ Freeman
>>>>> Strategic Power Office with Supplier Automation<
>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>> Systems Integrator-- Glad to Assist
>>>>>
>>>>> Chat  Y! messenger: bjfr33man
>>>>>
>>>>>
>>>>> Kapil garg sent the following on 10/29/2010 12:29 PM:
>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> I actually did use mysql as the datasource and tried using the link
>>>>>> below by putting in the datasource name in the text box and clicking on
>>>>>> Induce. For existing datasources name such as localmysql or localderby, I
>>>>>> got a NullPointer Exception.
>>>>>> For the one that I had an new entry witin the default delegator, I got
>>>>>> " unrecognized datasource" name sort of message. Do I need to create a new
>>>>>> entity-group.xml file  for the datasource mysql I created below even if I am
>>>>>> using a default delagator similar to the data-source localmysql? Does it
>>>>>> need to be having group name org.ofbiz or something else within the
>>>>>> delegator tag?
>>>>>>
>>>>>>
>>>>>>
>>>>>>  Date: Fri, 29 Oct 2010 12:23:37 -0700
>>>>>>> From: bjfree@free-man.net
>>>>>>> To: user@ofbiz.apache.org
>>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>>>
>>>>>>> use mysql as the datasource
>>>>>>> https://localhost:8443/webtools/control/view/ModelInduceFromDb
>>>>>>>
>>>>>>> =========================
>>>>>>> BJ Freeman
>>>>>>> Strategic Power Office with Supplier Automation<
>>>>>>> http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>>> Systems Integrator-- Glad to Assist
>>>>>>>
>>>>>>> Chat  Y! messenger: bjfr33man
>>>>>>>
>>>>>>>
>>>>>>> Kapil garg sent the following on 10/29/2010 12:09 PM:
>>>>>>>
>>>>>>>>
>>>>>>>> I am trying to create a entities within OFbiz out of an existing
>>>>>>>> schema in production. Not sure if this is the best way to create entties out
>>>>>>>> of an existing schema. Suggestions are welcomed!!
>>>>>>>>
>>>>>>>> I tried to add a datasource tag in default delegator in
>>>>>>>> entity-engine.xml
>>>>>>>> Followed the instructions on
>>>>>>>>
>>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
>>>>>>>> Would like to know where I am going wrong. On restart, I realised
>>>>>>>> that ofbiz does not finish to the point that I can get webtools or even
>>>>>>>> login for ecommerce. IT has just stuck at soem point saying
>>>>>>>>  ServiceDispatcher.java 584 INFO Sync service..
>>>>>>>> There is no exception or anything but OFbiz does not go further with
>>>>>>>> complete laoding. Anything I am doing wrong?
>>>>>>>> Being a default delegaotr, there was no special entity-group.xml
>>>>>>>> file in the ofbiz 9_04 code base. Hence I did not bother to create an
>>>>>>>> entity-group.xml file
>>>>>>>> My schema name is lronline, following are the entries I had in
>>>>>>>> entity-engine.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"
>>>>>>>> datasource-name="localderby"/>
>>>>>>>>            <group-map group-name="org.ofbiz.olap"
>>>>>>>> datasource-name="localderbyolap"/>
>>>>>>>>            <group-map group-name="org.ofbiz"
>>>>>>>> datasource-name="mysql"/>
>>>>>>>>        </delegator>
>>>>>>>>
>>>>>>>> <datasource name="mysql"
>>>>>>>>
>>>>>>>>  helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>>>>>>>                field-type-name="mysql"
>>>>>>>>                check-on-start="true"
>>>>>>>>                add-missing-on-start="true"
>>>>>>>>                check-pks-on-start="false"
>>>>>>>>                use-foreign-keys="true"
>>>>>>>>                join-style="ansi-no-parenthesis"
>>>>>>>>                alias-view-columns="false"
>>>>>>>>                drop-fk-use-foreign-key-keyword="true"
>>>>>>>>                table-type="InnoDB"
>>>>>>>>                character-set="latin1"
>>>>>>>>                collate="latin1_general_cs">
>>>>>>>>            <read-data reader-name="seed"/>
>>>>>>>>            <read-data reader-name="seed-initial"/>
>>>>>>>>            <read-data reader-name="demo"/>
>>>>>>>>            <read-data reader-name="ext"/>
>>>>>>>>            <inline-jdbc
>>>>>>>>                    jdbc-driver="com.mysql.jdbc.Driver"
>>>>>>>>                    jdbc-uri="jdbc:mysql://
>>>>>>>> 127.0.0.1/lronlineonedb?autoReconnect=true"
>>>>>>>>                    jdbc-username="root"
>>>>>>>>                    jdbc-password=""
>>>>>>>>                    isolation-level="ReadCommitted"
>>>>>>>>                    pool-minsize="2"
>>>>>>>>                    pool-maxsize="250"/>
>>>>>>>>            <!--<jndi-jdbc jndi-server-name="localjndi"
>>>>>>>> jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>     -->
>>>>>>>>        </datasource>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Kapil Garg
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>
>

Re: Issues Creating Entities in Ofbiz from existing Schema

Posted by BJ Freeman <bj...@free-man.net>.
just declare the datasource for you db.


=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man


Kapil garg sent the following on 10/29/2010 1:01 PM:
>
> Does that mean that I dont need to associate a datsource I create with a delagator ? As in the datasource entry need  not have a group associated with it? or a delagator associated with it?
>
>
> Kapil Garg
>
>
>
>
>
>> Date: Fri, 29 Oct 2010 12:54:13 -0700
>> From: bjfree@free-man.net
>> To: user@ofbiz.apache.org
>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>
>> you did add more than the datasource
>> you make it default delegator.
>> this will cause the database to be updated with ofbiz schema
>>
>>
>> =========================
>>
>> BJ Freeman
>> Strategic Power Office with Supplier Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>> Specialtymarket.com<http://www.specialtymarket.com/>
>> Systems Integrator-- Glad to Assist
>>
>> Chat  Y! messenger: bjfr33man
>>
>>
>> Kapil garg sent the following on 10/29/2010 12:45 PM:
>>>
>>> Yes I created only the datasource by putting an entry in the entity-engine.xml file. I did not create anything else and intentionally put it in default delegator. Still I am not ale to Induce. IT says unrecognised datasource. I also get Null Pointer exception for localmysql datasource whose entry is already in there. DO I need to do anything else?
>>>
>>> Do I need to do ant run-install, restart before hitting induce?
>>>
>>>
>>> Kapil Garg
>>>
>>>
>>>
>>>
>>>
>>>> Date: Fri, 29 Oct 2010 12:41:59 -0700
>>>> From: bjfree@free-man.net
>>>> To: user@ofbiz.apache.org
>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>
>>>> only create a datasource. nothing else
>>>> the mysql one you created you use the name.
>>>>
>>>>
>>>>
>>>>
>>>> =========================
>>>> BJ Freeman
>>>> Strategic Power Office with Supplier Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>> Systems Integrator-- Glad to Assist
>>>>
>>>> Chat  Y! messenger: bjfr33man
>>>>
>>>>
>>>> Kapil garg sent the following on 10/29/2010 12:29 PM:
>>>>>
>>>>>
>>>>>
>>>>> I actually did use mysql as the datasource and tried using the link below by putting in the datasource name in the text box and clicking on Induce. For existing datasources name such as localmysql or localderby, I got a NullPointer Exception.
>>>>> For the one that I had an new entry witin the default delegator, I got " unrecognized datasource" name sort of message. Do I need to create a new entity-group.xml file  for the datasource mysql I created below even if I am using a default delagator similar to the data-source localmysql? Does it need to be having group name org.ofbiz or something else within the delegator tag?
>>>>>
>>>>>
>>>>>
>>>>>> Date: Fri, 29 Oct 2010 12:23:37 -0700
>>>>>> From: bjfree@free-man.net
>>>>>> To: user@ofbiz.apache.org
>>>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>>>
>>>>>> use mysql as the datasource
>>>>>> https://localhost:8443/webtools/control/view/ModelInduceFromDb
>>>>>>
>>>>>> =========================
>>>>>> BJ Freeman
>>>>>> Strategic Power Office with Supplier Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>>>> Systems Integrator-- Glad to Assist
>>>>>>
>>>>>> Chat  Y! messenger: bjfr33man
>>>>>>
>>>>>>
>>>>>> Kapil garg sent the following on 10/29/2010 12:09 PM:
>>>>>>>
>>>>>>> I am trying to create a entities within OFbiz out of an existing schema in production. Not sure if this is the best way to create entties out of an existing schema. Suggestions are welcomed!!
>>>>>>>
>>>>>>> I tried to add a datasource tag in default delegator in entity-engine.xml
>>>>>>> Followed the instructions on
>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
>>>>>>> Would like to know where I am going wrong. On restart, I realised that ofbiz does not finish to the point that I can get webtools or even login for ecommerce. IT has just stuck at soem point saying  ServiceDispatcher.java 584 INFO Sync service..
>>>>>>> There is no exception or anything but OFbiz does not go further with complete laoding. Anything I am doing wrong?
>>>>>>> Being a default delegaotr, there was no special entity-group.xml file in the ofbiz 9_04 code base. Hence I did not bother to create an entity-group.xml file
>>>>>>> My schema name is lronline, following are the entries I had in entity-engine.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" datasource-name="localderby"/>
>>>>>>>             <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>
>>>>>>>             <group-map group-name="org.ofbiz" datasource-name="mysql"/>
>>>>>>>         </delegator>
>>>>>>>
>>>>>>> <datasource name="mysql"
>>>>>>>                 helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>>>>>>                 field-type-name="mysql"
>>>>>>>                 check-on-start="true"
>>>>>>>                 add-missing-on-start="true"
>>>>>>>                 check-pks-on-start="false"
>>>>>>>                 use-foreign-keys="true"
>>>>>>>                 join-style="ansi-no-parenthesis"
>>>>>>>                 alias-view-columns="false"
>>>>>>>                 drop-fk-use-foreign-key-keyword="true"
>>>>>>>                 table-type="InnoDB"
>>>>>>>                 character-set="latin1"
>>>>>>>                 collate="latin1_general_cs">
>>>>>>>             <read-data reader-name="seed"/>
>>>>>>>             <read-data reader-name="seed-initial"/>
>>>>>>>             <read-data reader-name="demo"/>
>>>>>>>             <read-data reader-name="ext"/>
>>>>>>>             <inline-jdbc
>>>>>>>                     jdbc-driver="com.mysql.jdbc.Driver"
>>>>>>>                     jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
>>>>>>>                     jdbc-username="root"
>>>>>>>                     jdbc-password=""
>>>>>>>                     isolation-level="ReadCommitted"
>>>>>>>                     pool-minsize="2"
>>>>>>>                     pool-maxsize="250"/>
>>>>>>>             <!--<jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>     -->
>>>>>>>         </datasource>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Kapil Garg
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>      		 	   		
>>>>>>
>>>>>     		 	   		
>>>>
>>>    		 	   		
>>
>   		 	   		


RE: Issues Creating Entities in Ofbiz from existing Schema

Posted by Kapil garg <ga...@hotmail.com>.
Does that mean that I dont need to associate a datsource I create with a delagator ? As in the datasource entry need  not have a group associated with it? or a delagator associated with it?


Kapil Garg
 




> Date: Fri, 29 Oct 2010 12:54:13 -0700
> From: bjfree@free-man.net
> To: user@ofbiz.apache.org
> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> 
> you did add more than the datasource
> you make it default delegator.
> this will cause the database to be updated with ofbiz schema
> 
> 
> =========================
> 
> BJ Freeman
> Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> Specialtymarket.com  <http://www.specialtymarket.com/>
> Systems Integrator-- Glad to Assist
> 
> Chat  Y! messenger: bjfr33man
> 
> 
> Kapil garg sent the following on 10/29/2010 12:45 PM:
> >
> > Yes I created only the datasource by putting an entry in the entity-engine.xml file. I did not create anything else and intentionally put it in default delegator. Still I am not ale to Induce. IT says unrecognised datasource. I also get Null Pointer exception for localmysql datasource whose entry is already in there. DO I need to do anything else?
> >
> > Do I need to do ant run-install, restart before hitting induce?
> >
> >
> > Kapil Garg
> >
> >
> >
> >
> >
> >> Date: Fri, 29 Oct 2010 12:41:59 -0700
> >> From: bjfree@free-man.net
> >> To: user@ofbiz.apache.org
> >> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>
> >> only create a datasource. nothing else
> >> the mysql one you created you use the name.
> >>
> >>
> >>
> >>
> >> =========================
> >> BJ Freeman
> >> Strategic Power Office with Supplier Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >> Specialtymarket.com<http://www.specialtymarket.com/>
> >> Systems Integrator-- Glad to Assist
> >>
> >> Chat  Y! messenger: bjfr33man
> >>
> >>
> >> Kapil garg sent the following on 10/29/2010 12:29 PM:
> >>>
> >>>
> >>>
> >>> I actually did use mysql as the datasource and tried using the link below by putting in the datasource name in the text box and clicking on Induce. For existing datasources name such as localmysql or localderby, I got a NullPointer Exception.
> >>> For the one that I had an new entry witin the default delegator, I got " unrecognized datasource" name sort of message. Do I need to create a new entity-group.xml file  for the datasource mysql I created below even if I am using a default delagator similar to the data-source localmysql? Does it need to be having group name org.ofbiz or something else within the delegator tag?
> >>>
> >>>
> >>>
> >>>> Date: Fri, 29 Oct 2010 12:23:37 -0700
> >>>> From: bjfree@free-man.net
> >>>> To: user@ofbiz.apache.org
> >>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>>>
> >>>> use mysql as the datasource
> >>>> https://localhost:8443/webtools/control/view/ModelInduceFromDb
> >>>>
> >>>> =========================
> >>>> BJ Freeman
> >>>> Strategic Power Office with Supplier Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >>>> Specialtymarket.com<http://www.specialtymarket.com/>
> >>>> Systems Integrator-- Glad to Assist
> >>>>
> >>>> Chat  Y! messenger: bjfr33man
> >>>>
> >>>>
> >>>> Kapil garg sent the following on 10/29/2010 12:09 PM:
> >>>>>
> >>>>> I am trying to create a entities within OFbiz out of an existing schema in production. Not sure if this is the best way to create entties out of an existing schema. Suggestions are welcomed!!
> >>>>>
> >>>>> I tried to add a datasource tag in default delegator in entity-engine.xml
> >>>>> Followed the instructions on
> >>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> >>>>> Would like to know where I am going wrong. On restart, I realised that ofbiz does not finish to the point that I can get webtools or even login for ecommerce. IT has just stuck at soem point saying  ServiceDispatcher.java 584 INFO Sync service..
> >>>>> There is no exception or anything but OFbiz does not go further with complete laoding. Anything I am doing wrong?
> >>>>> Being a default delegaotr, there was no special entity-group.xml file in the ofbiz 9_04 code base. Hence I did not bother to create an entity-group.xml file
> >>>>> My schema name is lronline, following are the entries I had in entity-engine.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" datasource-name="localderby"/>
> >>>>>            <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>
> >>>>>            <group-map group-name="org.ofbiz" datasource-name="mysql"/>
> >>>>>        </delegator>
> >>>>>
> >>>>> <datasource name="mysql"
> >>>>>                helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
> >>>>>                field-type-name="mysql"
> >>>>>                check-on-start="true"
> >>>>>                add-missing-on-start="true"
> >>>>>                check-pks-on-start="false"
> >>>>>                use-foreign-keys="true"
> >>>>>                join-style="ansi-no-parenthesis"
> >>>>>                alias-view-columns="false"
> >>>>>                drop-fk-use-foreign-key-keyword="true"
> >>>>>                table-type="InnoDB"
> >>>>>                character-set="latin1"
> >>>>>                collate="latin1_general_cs">
> >>>>>            <read-data reader-name="seed"/>
> >>>>>            <read-data reader-name="seed-initial"/>
> >>>>>            <read-data reader-name="demo"/>
> >>>>>            <read-data reader-name="ext"/>
> >>>>>            <inline-jdbc
> >>>>>                    jdbc-driver="com.mysql.jdbc.Driver"
> >>>>>                    jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
> >>>>>                    jdbc-username="root"
> >>>>>                    jdbc-password=""
> >>>>>                    isolation-level="ReadCommitted"
> >>>>>                    pool-minsize="2"
> >>>>>                    pool-maxsize="250"/>
> >>>>>            <!--<jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>    -->
> >>>>>        </datasource>
> >>>>>
> >>>>>
> >>>>>
> >>>>> Kapil Garg
> >>>>>
> >>>>>
> >>>>>
> >>>>>     		 	   		
> >>>>
> >>>    		 	   		
> >>
> >   		 	   		
> 
 		 	   		  

Re: Issues Creating Entities in Ofbiz from existing Schema

Posted by BJ Freeman <bj...@free-man.net>.
you did add more than the datasource
you make it default delegator.
this will cause the database to be updated with ofbiz schema


=========================

BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man


Kapil garg sent the following on 10/29/2010 12:45 PM:
>
> Yes I created only the datasource by putting an entry in the entity-engine.xml file. I did not create anything else and intentionally put it in default delegator. Still I am not ale to Induce. IT says unrecognised datasource. I also get Null Pointer exception for localmysql datasource whose entry is already in there. DO I need to do anything else?
>
> Do I need to do ant run-install, restart before hitting induce?
>
>
> Kapil Garg
>
>
>
>
>
>> Date: Fri, 29 Oct 2010 12:41:59 -0700
>> From: bjfree@free-man.net
>> To: user@ofbiz.apache.org
>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>
>> only create a datasource. nothing else
>> the mysql one you created you use the name.
>>
>>
>>
>>
>> =========================
>> BJ Freeman
>> Strategic Power Office with Supplier Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>> Specialtymarket.com<http://www.specialtymarket.com/>
>> Systems Integrator-- Glad to Assist
>>
>> Chat  Y! messenger: bjfr33man
>>
>>
>> Kapil garg sent the following on 10/29/2010 12:29 PM:
>>>
>>>
>>>
>>> I actually did use mysql as the datasource and tried using the link below by putting in the datasource name in the text box and clicking on Induce. For existing datasources name such as localmysql or localderby, I got a NullPointer Exception.
>>> For the one that I had an new entry witin the default delegator, I got " unrecognized datasource" name sort of message. Do I need to create a new entity-group.xml file  for the datasource mysql I created below even if I am using a default delagator similar to the data-source localmysql? Does it need to be having group name org.ofbiz or something else within the delegator tag?
>>>
>>>
>>>
>>>> Date: Fri, 29 Oct 2010 12:23:37 -0700
>>>> From: bjfree@free-man.net
>>>> To: user@ofbiz.apache.org
>>>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>>>
>>>> use mysql as the datasource
>>>> https://localhost:8443/webtools/control/view/ModelInduceFromDb
>>>>
>>>> =========================
>>>> BJ Freeman
>>>> Strategic Power Office with Supplier Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>>> Systems Integrator-- Glad to Assist
>>>>
>>>> Chat  Y! messenger: bjfr33man
>>>>
>>>>
>>>> Kapil garg sent the following on 10/29/2010 12:09 PM:
>>>>>
>>>>> I am trying to create a entities within OFbiz out of an existing schema in production. Not sure if this is the best way to create entties out of an existing schema. Suggestions are welcomed!!
>>>>>
>>>>> I tried to add a datasource tag in default delegator in entity-engine.xml
>>>>> Followed the instructions on
>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
>>>>> Would like to know where I am going wrong. On restart, I realised that ofbiz does not finish to the point that I can get webtools or even login for ecommerce. IT has just stuck at soem point saying  ServiceDispatcher.java 584 INFO Sync service..
>>>>> There is no exception or anything but OFbiz does not go further with complete laoding. Anything I am doing wrong?
>>>>> Being a default delegaotr, there was no special entity-group.xml file in the ofbiz 9_04 code base. Hence I did not bother to create an entity-group.xml file
>>>>> My schema name is lronline, following are the entries I had in entity-engine.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" datasource-name="localderby"/>
>>>>>            <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>
>>>>>            <group-map group-name="org.ofbiz" datasource-name="mysql"/>
>>>>>        </delegator>
>>>>>
>>>>> <datasource name="mysql"
>>>>>                helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>>>>                field-type-name="mysql"
>>>>>                check-on-start="true"
>>>>>                add-missing-on-start="true"
>>>>>                check-pks-on-start="false"
>>>>>                use-foreign-keys="true"
>>>>>                join-style="ansi-no-parenthesis"
>>>>>                alias-view-columns="false"
>>>>>                drop-fk-use-foreign-key-keyword="true"
>>>>>                table-type="InnoDB"
>>>>>                character-set="latin1"
>>>>>                collate="latin1_general_cs">
>>>>>            <read-data reader-name="seed"/>
>>>>>            <read-data reader-name="seed-initial"/>
>>>>>            <read-data reader-name="demo"/>
>>>>>            <read-data reader-name="ext"/>
>>>>>            <inline-jdbc
>>>>>                    jdbc-driver="com.mysql.jdbc.Driver"
>>>>>                    jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
>>>>>                    jdbc-username="root"
>>>>>                    jdbc-password=""
>>>>>                    isolation-level="ReadCommitted"
>>>>>                    pool-minsize="2"
>>>>>                    pool-maxsize="250"/>
>>>>>            <!--<jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>    -->
>>>>>        </datasource>
>>>>>
>>>>>
>>>>>
>>>>> Kapil Garg
>>>>>
>>>>>
>>>>>
>>>>>     		 	   		
>>>>
>>>    		 	   		
>>
>   		 	   		


RE: Issues Creating Entities in Ofbiz from existing Schema

Posted by Kapil garg <ga...@hotmail.com>.
Yes I created only the datasource by putting an entry in the entity-engine.xml file. I did not create anything else and intentionally put it in default delegator. Still I am not ale to Induce. IT says unrecognised datasource. I also get Null Pointer exception for localmysql datasource whose entry is already in there. DO I need to do anything else?

Do I need to do ant run-install, restart before hitting induce?


Kapil Garg
 




> Date: Fri, 29 Oct 2010 12:41:59 -0700
> From: bjfree@free-man.net
> To: user@ofbiz.apache.org
> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> 
> only create a datasource. nothing else
> the mysql one you created you use the name.
> 
> 
> 
> 
> =========================
> BJ Freeman
> Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> Specialtymarket.com  <http://www.specialtymarket.com/>
> Systems Integrator-- Glad to Assist
> 
> Chat  Y! messenger: bjfr33man
> 
> 
> Kapil garg sent the following on 10/29/2010 12:29 PM:
> >
> >
> >
> > I actually did use mysql as the datasource and tried using the link below by putting in the datasource name in the text box and clicking on Induce. For existing datasources name such as localmysql or localderby, I got a NullPointer Exception.
> > For the one that I had an new entry witin the default delegator, I got " unrecognized datasource" name sort of message. Do I need to create a new entity-group.xml file  for the datasource mysql I created below even if I am using a default delagator similar to the data-source localmysql? Does it need to be having group name org.ofbiz or something else within the delegator tag?
> >
> >
> >
> >> Date: Fri, 29 Oct 2010 12:23:37 -0700
> >> From: bjfree@free-man.net
> >> To: user@ofbiz.apache.org
> >> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> >>
> >> use mysql as the datasource
> >> https://localhost:8443/webtools/control/view/ModelInduceFromDb
> >>
> >> =========================
> >> BJ Freeman
> >> Strategic Power Office with Supplier Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> >> Specialtymarket.com<http://www.specialtymarket.com/>
> >> Systems Integrator-- Glad to Assist
> >>
> >> Chat  Y! messenger: bjfr33man
> >>
> >>
> >> Kapil garg sent the following on 10/29/2010 12:09 PM:
> >>>
> >>> I am trying to create a entities within OFbiz out of an existing schema in production. Not sure if this is the best way to create entties out of an existing schema. Suggestions are welcomed!!
> >>>
> >>> I tried to add a datasource tag in default delegator in entity-engine.xml
> >>> Followed the instructions on
> >>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> >>> Would like to know where I am going wrong. On restart, I realised that ofbiz does not finish to the point that I can get webtools or even login for ecommerce. IT has just stuck at soem point saying  ServiceDispatcher.java 584 INFO Sync service..
> >>> There is no exception or anything but OFbiz does not go further with complete laoding. Anything I am doing wrong?
> >>> Being a default delegaotr, there was no special entity-group.xml file in the ofbiz 9_04 code base. Hence I did not bother to create an entity-group.xml file
> >>> My schema name is lronline, following are the entries I had in entity-engine.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" datasource-name="localderby"/>
> >>>           <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>
> >>>           <group-map group-name="org.ofbiz" datasource-name="mysql"/>
> >>>       </delegator>
> >>>
> >>> <datasource name="mysql"
> >>>               helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
> >>>               field-type-name="mysql"
> >>>               check-on-start="true"
> >>>               add-missing-on-start="true"
> >>>               check-pks-on-start="false"
> >>>               use-foreign-keys="true"
> >>>               join-style="ansi-no-parenthesis"
> >>>               alias-view-columns="false"
> >>>               drop-fk-use-foreign-key-keyword="true"
> >>>               table-type="InnoDB"
> >>>               character-set="latin1"
> >>>               collate="latin1_general_cs">
> >>>           <read-data reader-name="seed"/>
> >>>           <read-data reader-name="seed-initial"/>
> >>>           <read-data reader-name="demo"/>
> >>>           <read-data reader-name="ext"/>
> >>>           <inline-jdbc
> >>>                   jdbc-driver="com.mysql.jdbc.Driver"
> >>>                   jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
> >>>                   jdbc-username="root"
> >>>                   jdbc-password=""
> >>>                   isolation-level="ReadCommitted"
> >>>                   pool-minsize="2"
> >>>                   pool-maxsize="250"/>
> >>>           <!--<jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>   -->
> >>>       </datasource>
> >>>
> >>>
> >>>
> >>> Kapil Garg
> >>>
> >>>
> >>>
> >>>    		 	   		
> >>
> >   		 	   		
> 
 		 	   		  

Re: Issues Creating Entities in Ofbiz from existing Schema

Posted by BJ Freeman <bj...@free-man.net>.
only create a datasource. nothing else
the mysql one you created you use the name.




=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man


Kapil garg sent the following on 10/29/2010 12:29 PM:
>
>
>
> I actually did use mysql as the datasource and tried using the link below by putting in the datasource name in the text box and clicking on Induce. For existing datasources name such as localmysql or localderby, I got a NullPointer Exception.
> For the one that I had an new entry witin the default delegator, I got " unrecognized datasource" name sort of message. Do I need to create a new entity-group.xml file  for the datasource mysql I created below even if I am using a default delagator similar to the data-source localmysql? Does it need to be having group name org.ofbiz or something else within the delegator tag?
>
>
>
>> Date: Fri, 29 Oct 2010 12:23:37 -0700
>> From: bjfree@free-man.net
>> To: user@ofbiz.apache.org
>> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
>>
>> use mysql as the datasource
>> https://localhost:8443/webtools/control/view/ModelInduceFromDb
>>
>> =========================
>> BJ Freeman
>> Strategic Power Office with Supplier Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>> Specialtymarket.com<http://www.specialtymarket.com/>
>> Systems Integrator-- Glad to Assist
>>
>> Chat  Y! messenger: bjfr33man
>>
>>
>> Kapil garg sent the following on 10/29/2010 12:09 PM:
>>>
>>> I am trying to create a entities within OFbiz out of an existing schema in production. Not sure if this is the best way to create entties out of an existing schema. Suggestions are welcomed!!
>>>
>>> I tried to add a datasource tag in default delegator in entity-engine.xml
>>> Followed the instructions on
>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
>>> Would like to know where I am going wrong. On restart, I realised that ofbiz does not finish to the point that I can get webtools or even login for ecommerce. IT has just stuck at soem point saying  ServiceDispatcher.java 584 INFO Sync service..
>>> There is no exception or anything but OFbiz does not go further with complete laoding. Anything I am doing wrong?
>>> Being a default delegaotr, there was no special entity-group.xml file in the ofbiz 9_04 code base. Hence I did not bother to create an entity-group.xml file
>>> My schema name is lronline, following are the entries I had in entity-engine.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" datasource-name="localderby"/>
>>>           <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>
>>>           <group-map group-name="org.ofbiz" datasource-name="mysql"/>
>>>       </delegator>
>>>
>>> <datasource name="mysql"
>>>               helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>>               field-type-name="mysql"
>>>               check-on-start="true"
>>>               add-missing-on-start="true"
>>>               check-pks-on-start="false"
>>>               use-foreign-keys="true"
>>>               join-style="ansi-no-parenthesis"
>>>               alias-view-columns="false"
>>>               drop-fk-use-foreign-key-keyword="true"
>>>               table-type="InnoDB"
>>>               character-set="latin1"
>>>               collate="latin1_general_cs">
>>>           <read-data reader-name="seed"/>
>>>           <read-data reader-name="seed-initial"/>
>>>           <read-data reader-name="demo"/>
>>>           <read-data reader-name="ext"/>
>>>           <inline-jdbc
>>>                   jdbc-driver="com.mysql.jdbc.Driver"
>>>                   jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
>>>                   jdbc-username="root"
>>>                   jdbc-password=""
>>>                   isolation-level="ReadCommitted"
>>>                   pool-minsize="2"
>>>                   pool-maxsize="250"/>
>>>           <!--<jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>   -->
>>>       </datasource>
>>>
>>>
>>>
>>> Kapil Garg
>>>
>>>
>>>
>>>    		 	   		
>>
>   		 	   		


RE: Issues Creating Entities in Ofbiz from existing Schema

Posted by Kapil garg <ga...@hotmail.com>.


I actually did use mysql as the datasource and tried using the link below by putting in the datasource name in the text box and clicking on Induce. For existing datasources name such as localmysql or localderby, I got a NullPointer Exception.
For the one that I had an new entry witin the default delegator, I got " unrecognized datasource" name sort of message. Do I need to create a new entity-group.xml file  for the datasource mysql I created below even if I am using a default delagator similar to the data-source localmysql? Does it need to be having group name org.ofbiz or something else within the delegator tag?



> Date: Fri, 29 Oct 2010 12:23:37 -0700
> From: bjfree@free-man.net
> To: user@ofbiz.apache.org
> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> 
> use mysql as the datasource
> https://localhost:8443/webtools/control/view/ModelInduceFromDb
> 
> =========================
> BJ Freeman
> Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> Specialtymarket.com  <http://www.specialtymarket.com/>
> Systems Integrator-- Glad to Assist
> 
> Chat  Y! messenger: bjfr33man
> 
> 
> Kapil garg sent the following on 10/29/2010 12:09 PM:
> >
> > I am trying to create a entities within OFbiz out of an existing schema in production. Not sure if this is the best way to create entties out of an existing schema. Suggestions are welcomed!!
> >
> > I tried to add a datasource tag in default delegator in entity-engine.xml
> > Followed the instructions on
> > https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> > Would like to know where I am going wrong. On restart, I realised that ofbiz does not finish to the point that I can get webtools or even login for ecommerce. IT has just stuck at soem point saying  ServiceDispatcher.java 584 INFO Sync service..
> > There is no exception or anything but OFbiz does not go further with complete laoding. Anything I am doing wrong?
> > Being a default delegaotr, there was no special entity-group.xml file in the ofbiz 9_04 code base. Hence I did not bother to create an entity-group.xml file
> > My schema name is lronline, following are the entries I had in entity-engine.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" datasource-name="localderby"/>
> >          <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>
> >          <group-map group-name="org.ofbiz" datasource-name="mysql"/>
> >      </delegator>
> >
> > <datasource name="mysql"
> >              helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
> >              field-type-name="mysql"
> >              check-on-start="true"
> >              add-missing-on-start="true"
> >              check-pks-on-start="false"
> >              use-foreign-keys="true"
> >              join-style="ansi-no-parenthesis"
> >              alias-view-columns="false"
> >              drop-fk-use-foreign-key-keyword="true"
> >              table-type="InnoDB"
> >              character-set="latin1"
> >              collate="latin1_general_cs">
> >          <read-data reader-name="seed"/>
> >          <read-data reader-name="seed-initial"/>
> >          <read-data reader-name="demo"/>
> >          <read-data reader-name="ext"/>
> >          <inline-jdbc
> >                  jdbc-driver="com.mysql.jdbc.Driver"
> >                  jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
> >                  jdbc-username="root"
> >                  jdbc-password=""
> >                  isolation-level="ReadCommitted"
> >                  pool-minsize="2"
> >                  pool-maxsize="250"/>
> >          <!--<jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>  -->
> >      </datasource>
> >
> >
> >
> > Kapil Garg
> >
> >
> >
> >   		 	   		
> 
 		 	   		  

Re: Issues Creating Entities in Ofbiz from existing Schema

Posted by BJ Freeman <bj...@free-man.net>.
use mysql as the datasource
https://localhost:8443/webtools/control/view/ModelInduceFromDb

=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man


Kapil garg sent the following on 10/29/2010 12:09 PM:
>
> I am trying to create a entities within OFbiz out of an existing schema in production. Not sure if this is the best way to create entties out of an existing schema. Suggestions are welcomed!!
>
> I tried to add a datasource tag in default delegator in entity-engine.xml
> Followed the instructions on
> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> Would like to know where I am going wrong. On restart, I realised that ofbiz does not finish to the point that I can get webtools or even login for ecommerce. IT has just stuck at soem point saying  ServiceDispatcher.java 584 INFO Sync service..
> There is no exception or anything but OFbiz does not go further with complete laoding. Anything I am doing wrong?
> Being a default delegaotr, there was no special entity-group.xml file in the ofbiz 9_04 code base. Hence I did not bother to create an entity-group.xml file
> My schema name is lronline, following are the entries I had in entity-engine.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" datasource-name="localderby"/>
>          <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>
>          <group-map group-name="org.ofbiz" datasource-name="mysql"/>
>      </delegator>
>
> <datasource name="mysql"
>              helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>              field-type-name="mysql"
>              check-on-start="true"
>              add-missing-on-start="true"
>              check-pks-on-start="false"
>              use-foreign-keys="true"
>              join-style="ansi-no-parenthesis"
>              alias-view-columns="false"
>              drop-fk-use-foreign-key-keyword="true"
>              table-type="InnoDB"
>              character-set="latin1"
>              collate="latin1_general_cs">
>          <read-data reader-name="seed"/>
>          <read-data reader-name="seed-initial"/>
>          <read-data reader-name="demo"/>
>          <read-data reader-name="ext"/>
>          <inline-jdbc
>                  jdbc-driver="com.mysql.jdbc.Driver"
>                  jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
>                  jdbc-username="root"
>                  jdbc-password=""
>                  isolation-level="ReadCommitted"
>                  pool-minsize="2"
>                  pool-maxsize="250"/>
>          <!--<jndi-jdbc jndi-server-name="localjndi" jndi-name="java:/MySqlDataSource" isolation-level="Serializable"/>  -->
>      </datasource>
>
>
>
> Kapil Garg
>
>
>
>   		 	   		


Re: Issues Creating Entities in Ofbiz from existing Schema

Posted by BJ Freeman <bj...@free-man.net>.
once you induce the entities from your db you will see a lot of those 
answered.

=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man

> Kapil garg sent the following on 10/30/2010 10:47 AM:
> Sure Adrian
> Appreciate your reply.
> My question was while creating entity-group.xml file what is the entity name I need to give? Does it map to some table name. IF I do create this file with entity attribute then what do I need to put in entity-model.xml file for this entity?
>
>
> Kapil Garg
>
>
>
>
>
>> Date: Sat, 30 Oct 2010 08:29:37 -0700
>> From: adrian.crum@yahoo.com
>> Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
>> To: user@ofbiz.apache.org
>>
>> You are asking a lot of questions, and they can all be answered, but it might be best to answer them one at a time.
>>
>> I thought you were trying to connect OFBiz to an external database - and my instructions will do that. Once you have that working, we can move on to the other questions.
>>
>> -Adrian
>>
>> --- On Sat, 10/30/10, Kapil garg<ga...@hotmail.com>  wrote:
>>
>>> From: Kapil garg<ga...@hotmail.com>
>>> Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
>>> To: user@ofbiz.apache.org
>>> Date: Saturday, October 30, 2010, 8:21 AM
>>>
>>> how do we know which table or view does it map to? May it
>>> does not map to any of the tables and is just an entity by
>>> itself needed for ofbiz framework? If I were to put this
>>> entity entry then I would need to also create an
>>> entitymodel.xml file which would have some field tags? How
>>> do i now which ones are they? Are they mapping to one on one
>>> to a table in the schema? I would have imgined if that is
>>> the case then is there an ant target to create entity group
>>> or enity model xml files as it could be error prone given
>>> they conform to in built entity-model.xsd schemas
>>>
>>> Aain how many such entitties do I need to create. If it is
>>> one per table then I have to create as many entites equal to
>>> the total numer off tables in the schemas. What about views
>>> oe indices etc How are they mapped? What about Stored
>>> Procedures, can they be converted to mmini lang or service
>>> classes?
>>>
>>>
>>> Kapil Garg
>>>
>>>
>>>
>>>
>>>
>>>> Date: Sat, 30 Oct 2010 08:13:53 -0700
>>>> From: adrian.crum@yahoo.com
>>>> Subject: RE: Issues Creating Entities in Ofbiz from
>>> existing Schema
>>>> To: user@ofbiz.apache.org
>>>>
>>>> Correct, you will need an entity-group.xml file. It
>>> should cntain one entry per external entity (or table).
>>>>
>>>> -Adrian
>>>>
>>>> --- On Sat, 10/30/10, Kapil garg<ga...@hotmail.com>
>>> wrote:
>>>>
>>>>> From: Kapil garg<ga...@hotmail.com>
>>>>> Subject: RE: Issues Creating Entities in Ofbiz
>>> from existing Schema
>>>>> To: user@ofbiz.apache.org
>>>>> Date: Saturday, October 30, 2010, 8:11 AM
>>>>>
>>>>> but if it is in a default group then do I need to
>>> create an
>>>>> enity-group.xml file? Since all the groups within
>>> the
>>>>> default group do not have an entity-group.xml
>>> file I assumed
>>>>> creating a datasource within a default group does
>>> not
>>>>> require an entity-group.xml file. There isnt one
>>> for
>>>>> locaderby datasource which is a default one. But
>>> I could be
>>>>> wrong
>>>>> While creating the enitygroup file what name do I
>>> need to
>>>>> give to Entity atritbute of  entity-group?
>>> Random or
>>>>> schema name? Does each of this entity name map to
>>> a specific
>>>>> table or just the whole DB?
>>>>> <entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>
>>>>> xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitygroup.xsd">
>>>>>
>>>>>
>>>>>      <entity-group
>>> group="org.ofbiz" entity="IS
>>>>> THIS A RANDOM NAME??"/>
>>>>>
>>>>>
>>>>>      <entity-group
>>> group="org.ofbiz"
>>>>> entity="HOW MANY ENTITIES DO I NEED TO HAVE??ONE
>>> per
>>>>> Datasource or ONE Per Schema???"/>
>>>>>
>>>>> </entitygroup>
>>>>>
>>>>> Kapil Garg
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Date: Sat, 30 Oct 2010 08:04:51 -0700
>>>>>> From: adrian.crum@yahoo.com
>>>>>> Subject: Re: Issues Creating Entities in
>>> Ofbiz from
>>>>> existing Schema
>>>>>> To: user@ofbiz.apache.org
>>>>>>
>>>>>> You need to give your external datasource a
>>>>> group-name. Then in your external entity
>>> definitions, assign
>>>>> the entities to that group.
>>>>>>
>>>>>> -Adrian
>>>>>>
>>>>>> --- On Fri, 10/29/10, Kapil garg<ga...@hotmail.com>
>>>>> wrote:
>>>>>>
>>>>>>> From: Kapil garg<ga...@hotmail.com>
>>>>>>> Subject: Issues Creating Entities in
>>> Ofbiz from
>>>>> existing Schema
>>>>>>> To: user@ofbiz.apache.org
>>>>>>> Date: Friday, October 29, 2010, 12:09
>>> PM
>>>>>>>
>>>>>>> I am trying to create a entities within
>>> OFbiz out
>>>>> of an
>>>>>>> existing schema in production. Not sure
>>> if this
>>>>> is the best
>>>>>>> way to create entties out of an
>>> existing schema.
>>>>> Suggestions
>>>>>>> are welcomed!!
>>>>>>>
>>>>>>> I tried to add a datasource tag in
>>> default
>>>>> delegator in
>>>>>>> entity-engine.xml
>>>>>>> Followed the instructions on
>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
>>>>>>> Would like to know where I am going
>>> wrong. On
>>>>> restart, I
>>>>>>> realised that ofbiz does not finish to
>>> the point
>>>>> that I can
>>>>>>> get webtools or even login for
>>> ecommerce. IT has
>>>>> just stuck
>>>>>>> at soem point saying
>>> ServiceDispatcher.java
>>>>> 584 INFO
>>>>>>> Sync service..
>>>>>>> There is no exception or anything but
>>> OFbiz does
>>>>> not go
>>>>>>> further with complete laoding. Anything
>>> I am
>>>>> doing wrong?
>>>>>>> Being a default delegaotr, there was no
>>> special
>>>>>>> entity-group.xml file in the ofbiz 9_04
>>> code
>>>>> base. Hence I
>>>>>>> did not bother to create an
>>> entity-group.xml
>>>>> file
>>>>>>> My schema name is lronline, following
>>> are the
>>>>> entries I had
>>>>>>> in entity-engine.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"
>>>>> datasource-name="localderby"/>
>>>>>>>
>>>>>     <group-map
>>>>>>> group-name="org.ofbiz.olap"
>>>>>>> datasource-name="localderbyolap"/>
>>>>>>>
>>>>>     <group-map
>>>>>>> group-name="org.ofbiz"
>>>>> datasource-name="mysql"/>
>>>>>>>
>>>     </delegator>
>>>>>>>
>>>>>>> <datasource name="mysql"
>>>>>>>
>>>
>>>>>>>
>>>>>
>>> helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>>>>>>
>>>
>>>>>>> field-type-name="mysql"
>>>>>>>
>>>
>>>>>>> check-on-start="true"
>>>>>>>
>>>
>>>>>>> add-missing-on-start="true"
>>>>>>>
>>>
>>>>>>> check-pks-on-start="false"
>>>>>>>
>>>
>>>>>>> use-foreign-keys="true"
>>>>>>>
>>>
>>>>>>> join-style="ansi-no-parenthesis"
>>>>>>>
>>>
>>>>>>> alias-view-columns="false"
>>>>>>>
>>>
>>>>>>> drop-fk-use-foreign-key-keyword="true"
>>>>>>>
>>>
>>>>>>> table-type="InnoDB"
>>>>>>>
>>>
>>>>>>> character-set="latin1"
>>>>>>>
>>>
>>>>>>> collate="latin1_general_cs">
>>>>>>>
>>>>>     <read-data
>>>>>>> reader-name="seed"/>
>>>>>>>
>>>>>     <read-data
>>>>>>> reader-name="seed-initial"/>
>>>>>>>
>>>>>     <read-data
>>>>>>> reader-name="demo"/>
>>>>>>>
>>>>>     <read-data
>>>>>>> reader-name="ext"/>
>>>>>>>
>>>>>     <inline-jdbc
>>>>>>>
>>>
>>>>>
>>>>>>> jdbc-driver="com.mysql.jdbc.Driver"
>>>>>>>
>>>
>>>>>
>>>>>>>
>>>>>
>>> jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
>>>>>>>
>>>
>>>>>
>>>>>>> jdbc-username="root"
>>>>>>>
>>>
>>>>>
>>>>>>> jdbc-password=""
>>>>>>>
>>>
>>>>>
>>>>>>> isolation-level="ReadCommitted"
>>>>>>>
>>>
>>>>>
>>>>>>> pool-minsize="2"
>>>>>>>
>>>
>>>>>
>>>>>>> pool-maxsize="250"/>
>>>>>>>
>>>     <!--
>>>>> <jndi-jdbc
>>>>>>> jndi-server-name="localjndi"
>>>>>>> jndi-name="java:/MySqlDataSource"
>>>>>>> isolation-level="Serializable"/>
>>> -->
>>>>>>>
>>>     </datasource>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Kapil Garg
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>   		 	   		

Re: how to View the Entities after Inducing msql DB

Posted by BJ Freeman <bj...@free-man.net>.
I updated
https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data

=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man


BJ Freeman sent the following on 10/30/2010 11:11 AM:
> you do a view source of the resultant webpage, then copy and paste into
> hot-deploy/mycomponetname/entitydef/entitymodel.xml
> it is recomended you use
> ./ant create-component
> this will put the necessary structure for you component in hot-deploy
> next you need to clean up the entities that match your current DB.
>
> you can use
> https://cwiki.apache.org/OFBIZ/ofbiz-tutorial-a-beginners-development-guide.html
>
> as a reference.
>
> =========================
>
> BJ Freeman
> Strategic Power Office with Supplier Automation
> <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> Specialtymarket.com <http://www.specialtymarket.com/>
> Systems Integrator-- Glad to Assist
>
> Chat Y! messenger: bjfr33man
>
>
> Kapil garg sent the following on 10/30/2010 11:52 AM:
>>
>> I d like to know what exact entities have been created . Perhaps what
>> has just happened after successful induction? What does this induce do
>> eventually? What is the end result?Are there a list of entities
>> created mapped to tables in the database?Can I see them in webtools
>> under entity performance or somewhere? What all activities I could do
>> with these entities if at at all they are created? Can they be used in
>> any other component? How so? If I were to use them in Ecommerce
>> component, do I need to add them in that component's entity def folder?
>>
>>
>> Kapil Garg
>>
>>
>>
>>
>>
>>> Date: Sat, 30 Oct 2010 10:46:26 -0700
>>> From: bjfree@free-man.net
>>> To: user@ofbiz.apache.org
>>> Subject: Re: how to View the Entities after Inducing msql DB
>>>
>>> please explain more what you mean by view
>>>
>>> =========================
>>> BJ Freeman
>>> Strategic Power Office with Supplier
>>> Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>>>
>>> Specialtymarket.com<http://www.specialtymarket.com/>
>>> Systems Integrator-- Glad to Assist
>>>
>>> Chat Y! messenger: bjfr33man
>>>
>>>
>>> Kapil garg sent the following on 10/30/2010 11:33 AM:
>>>>
>>>> Hello All
>>>> I was able to induce successfully the database with some error for
>>>> unknown primary key without any group file or model file. I am not
>>>> sure what was wrong with the
>>>>
>>>> I need to now view the entities.
>>>>
>>>> HOw do I do it?
>>>>
>>>>
>>>> Kapil Garg
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> From: gargkapil@hotmail.com
>>>>> To: user@ofbiz.apache.org
>>>>> Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
>>>>> Date: Sun, 31 Oct 2010 03:47:41 +1000
>>>>>
>>>>>
>>>>> Sure Adrian
>>>>> Appreciate your reply.
>>>>> My question was while creating entity-group.xml file what is the
>>>>> entity name I need to give? Does it map to some table name. IF I do
>>>>> create this file with entity attribute then what do I need to put
>>>>> in entity-model.xml file for this entity?
>>>>>
>>>>>
>>>>> Kapil Garg
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Date: Sat, 30 Oct 2010 08:29:37 -0700
>>>>>> From: adrian.crum@yahoo.com
>>>>>> Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
>>>>>> To: user@ofbiz.apache.org
>>>>>>
>>>>>> You are asking a lot of questions, and they can all be answered,
>>>>>> but it might be best to answer them one at a time.
>>>>>>
>>>>>> I thought you were trying to connect OFBiz to an external database
>>>>>> - and my instructions will do that. Once you have that working, we
>>>>>> can move on to the other questions.
>>>>>>
>>>>>> -Adrian
>>>>>>
>>>>>> --- On Sat, 10/30/10, Kapil garg<ga...@hotmail.com> wrote:
>>>>>>
>>>>>>> From: Kapil garg<ga...@hotmail.com>
>>>>>>> Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
>>>>>>> To: user@ofbiz.apache.org
>>>>>>> Date: Saturday, October 30, 2010, 8:21 AM
>>>>>>>
>>>>>>> how do we know which table or view does it map to? May it
>>>>>>> does not map to any of the tables and is just an entity by
>>>>>>> itself needed for ofbiz framework? If I were to put this
>>>>>>> entity entry then I would need to also create an
>>>>>>> entitymodel.xml file which would have some field tags? How
>>>>>>> do i now which ones are they? Are they mapping to one on one
>>>>>>> to a table in the schema? I would have imgined if that is
>>>>>>> the case then is there an ant target to create entity group
>>>>>>> or enity model xml files as it could be error prone given
>>>>>>> they conform to in built entity-model.xsd schemas
>>>>>>>
>>>>>>> Aain how many such entitties do I need to create. If it is
>>>>>>> one per table then I have to create as many entites equal to
>>>>>>> the total numer off tables in the schemas. What about views
>>>>>>> oe indices etc How are they mapped? What about Stored
>>>>>>> Procedures, can they be converted to mmini lang or service
>>>>>>> classes?
>>>>>>>
>>>>>>>
>>>>>>> Kapil Garg
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> Date: Sat, 30 Oct 2010 08:13:53 -0700
>>>>>>>> From: adrian.crum@yahoo.com
>>>>>>>> Subject: RE: Issues Creating Entities in Ofbiz from
>>>>>>> existing Schema
>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>
>>>>>>>> Correct, you will need an entity-group.xml file. It
>>>>>>> should cntain one entry per external entity (or table).
>>>>>>>>
>>>>>>>> -Adrian
>>>>>>>>
>>>>>>>> --- On Sat, 10/30/10, Kapil garg<ga...@hotmail.com>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> From: Kapil garg<ga...@hotmail.com>
>>>>>>>>> Subject: RE: Issues Creating Entities in Ofbiz
>>>>>>> from existing Schema
>>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>> Date: Saturday, October 30, 2010, 8:11 AM
>>>>>>>>>
>>>>>>>>> but if it is in a default group then do I need to
>>>>>>> create an
>>>>>>>>> enity-group.xml file? Since all the groups within
>>>>>>> the
>>>>>>>>> default group do not have an entity-group.xml
>>>>>>> file I assumed
>>>>>>>>> creating a datasource within a default group does
>>>>>>> not
>>>>>>>>> require an entity-group.xml file. There isnt one
>>>>>>> for
>>>>>>>>> locaderby datasource which is a default one. But
>>>>>>> I could be
>>>>>>>>> wrong
>>>>>>>>> While creating the enitygroup file what name do I
>>>>>>> need to
>>>>>>>>> give to Entity atritbute of entity-group?
>>>>>>> Random or
>>>>>>>>> schema name? Does each of this entity name map to
>>>>>>> a specific
>>>>>>>>> table or just the whole DB?
>>>>>>>>> <entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>>>>>
>>>>>>>>> xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitygroup.xsd">
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> <entity-group
>>>>>>> group="org.ofbiz" entity="IS
>>>>>>>>> THIS A RANDOM NAME??"/>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> <entity-group
>>>>>>> group="org.ofbiz"
>>>>>>>>> entity="HOW MANY ENTITIES DO I NEED TO HAVE??ONE
>>>>>>> per
>>>>>>>>> Datasource or ONE Per Schema???"/>
>>>>>>>>>
>>>>>>>>> </entitygroup>
>>>>>>>>>
>>>>>>>>> Kapil Garg
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Date: Sat, 30 Oct 2010 08:04:51 -0700
>>>>>>>>>> From: adrian.crum@yahoo.com
>>>>>>>>>> Subject: Re: Issues Creating Entities in
>>>>>>> Ofbiz from
>>>>>>>>> existing Schema
>>>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>>>
>>>>>>>>>> You need to give your external datasource a
>>>>>>>>> group-name. Then in your external entity
>>>>>>> definitions, assign
>>>>>>>>> the entities to that group.
>>>>>>>>>>
>>>>>>>>>> -Adrian
>>>>>>>>>>
>>>>>>>>>> --- On Fri, 10/29/10, Kapil garg<ga...@hotmail.com>
>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> From: Kapil garg<ga...@hotmail.com>
>>>>>>>>>>> Subject: Issues Creating Entities in
>>>>>>> Ofbiz from
>>>>>>>>> existing Schema
>>>>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>>>> Date: Friday, October 29, 2010, 12:09
>>>>>>> PM
>>>>>>>>>>>
>>>>>>>>>>> I am trying to create a entities within
>>>>>>> OFbiz out
>>>>>>>>> of an
>>>>>>>>>>> existing schema in production. Not sure
>>>>>>> if this
>>>>>>>>> is the best
>>>>>>>>>>> way to create entties out of an
>>>>>>> existing schema.
>>>>>>>>> Suggestions
>>>>>>>>>>> are welcomed!!
>>>>>>>>>>>
>>>>>>>>>>> I tried to add a datasource tag in
>>>>>>> default
>>>>>>>>> delegator in
>>>>>>>>>>> entity-engine.xml
>>>>>>>>>>> Followed the instructions on
>>>>>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
>>>>>>>>>>>
>>>>>>>>>>> Would like to know where I am going
>>>>>>> wrong. On
>>>>>>>>> restart, I
>>>>>>>>>>> realised that ofbiz does not finish to
>>>>>>> the point
>>>>>>>>> that I can
>>>>>>>>>>> get webtools or even login for
>>>>>>> ecommerce. IT has
>>>>>>>>> just stuck
>>>>>>>>>>> at soem point saying
>>>>>>> ServiceDispatcher.java
>>>>>>>>> 584 INFO
>>>>>>>>>>> Sync service..
>>>>>>>>>>> There is no exception or anything but
>>>>>>> OFbiz does
>>>>>>>>> not go
>>>>>>>>>>> further with complete laoding. Anything
>>>>>>> I am
>>>>>>>>> doing wrong?
>>>>>>>>>>> Being a default delegaotr, there was no
>>>>>>> special
>>>>>>>>>>> entity-group.xml file in the ofbiz 9_04
>>>>>>> code
>>>>>>>>> base. Hence I
>>>>>>>>>>> did not bother to create an
>>>>>>> entity-group.xml
>>>>>>>>> file
>>>>>>>>>>> My schema name is lronline, following
>>>>>>> are the
>>>>>>>>> entries I had
>>>>>>>>>>> in entity-engine.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"
>>>>>>>>> datasource-name="localderby"/>
>>>>>>>>>>>
>>>>>>>>> <group-map
>>>>>>>>>>> group-name="org.ofbiz.olap"
>>>>>>>>>>> datasource-name="localderbyolap"/>
>>>>>>>>>>>
>>>>>>>>> <group-map
>>>>>>>>>>> group-name="org.ofbiz"
>>>>>>>>> datasource-name="mysql"/>
>>>>>>>>>>>
>>>>>>> </delegator>
>>>>>>>>>>>
>>>>>>>>>>> <datasource name="mysql"
>>>>>>>>>>>
>>>>>>>
>>>>>>>>>>>
>>>>>>>>>
>>>>>>> helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>>>>>>>>>>
>>>>>>>
>>>>>>>>>>> field-type-name="mysql"
>>>>>>>>>>>
>>>>>>>
>>>>>>>>>>> check-on-start="true"
>>>>>>>>>>>
>>>>>>>
>>>>>>>>>>> add-missing-on-start="true"
>>>>>>>>>>>
>>>>>>>
>>>>>>>>>>> check-pks-on-start="false"
>>>>>>>>>>>
>>>>>>>
>>>>>>>>>>> use-foreign-keys="true"
>>>>>>>>>>>
>>>>>>>
>>>>>>>>>>> join-style="ansi-no-parenthesis"
>>>>>>>>>>>
>>>>>>>
>>>>>>>>>>> alias-view-columns="false"
>>>>>>>>>>>
>>>>>>>
>>>>>>>>>>> drop-fk-use-foreign-key-keyword="true"
>>>>>>>>>>>
>>>>>>>
>>>>>>>>>>> table-type="InnoDB"
>>>>>>>>>>>
>>>>>>>
>>>>>>>>>>> character-set="latin1"
>>>>>>>>>>>
>>>>>>>
>>>>>>>>>>> collate="latin1_general_cs">
>>>>>>>>>>>
>>>>>>>>> <read-data
>>>>>>>>>>> reader-name="seed"/>
>>>>>>>>>>>
>>>>>>>>> <read-data
>>>>>>>>>>> reader-name="seed-initial"/>
>>>>>>>>>>>
>>>>>>>>> <read-data
>>>>>>>>>>> reader-name="demo"/>
>>>>>>>>>>>
>>>>>>>>> <read-data
>>>>>>>>>>> reader-name="ext"/>
>>>>>>>>>>>
>>>>>>>>> <inline-jdbc
>>>>>>>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>>>> jdbc-driver="com.mysql.jdbc.Driver"
>>>>>>>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>
>>>>>>> jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
>>>>>>>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>>>> jdbc-username="root"
>>>>>>>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>>>> jdbc-password=""
>>>>>>>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>>>> isolation-level="ReadCommitted"
>>>>>>>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>>>> pool-minsize="2"
>>>>>>>>>>>
>>>>>>>
>>>>>>>>>
>>>>>>>>>>> pool-maxsize="250"/>
>>>>>>>>>>>
>>>>>>> <!--
>>>>>>>>> <jndi-jdbc
>>>>>>>>>>> jndi-server-name="localjndi"
>>>>>>>>>>> jndi-name="java:/MySqlDataSource"
>>>>>>>>>>> isolation-level="Serializable"/>
>>>>>>> -->
>>>>>>>>>>>
>>>>>>> </datasource>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Kapil Garg
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
>


Re: how to View the Entities after Inducing msql DB

Posted by BJ Freeman <bj...@free-man.net>.
you do a view source of the resultant webpage, then copy and paste into 
hot-deploy/mycomponetname/entitydef/entitymodel.xml
it is recomended you use
./ant create-component
this will put the necessary structure for you component in hot-deploy
next you need to clean up the entities that match your current DB.

you can use
https://cwiki.apache.org/OFBIZ/ofbiz-tutorial-a-beginners-development-guide.html
as a reference.

=========================

BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man


Kapil garg sent the following on 10/30/2010 11:52 AM:
>
> I d like to know what exact entities have been created .  Perhaps what has just happened after successful induction? What does this induce do eventually?  What is the end result?Are there a list of entities created mapped to tables in the database?Can I see them in webtools under entity performance or somewhere? What all activities I could do with these entities if at at all they are created? Can they be used in any other component? How so? If I were to use them in Ecommerce component, do I need to add them in  that component's entity def folder?
>
>
> Kapil Garg
>
>
>
>
>
>> Date: Sat, 30 Oct 2010 10:46:26 -0700
>> From: bjfree@free-man.net
>> To: user@ofbiz.apache.org
>> Subject: Re: how to View the Entities after Inducing msql DB
>>
>> please explain more what you mean by view
>>
>> =========================
>> BJ Freeman
>> Strategic Power Office with Supplier Automation<http://www.businessesnetwork.com/automation/viewforum.php?f=52>
>> Specialtymarket.com<http://www.specialtymarket.com/>
>> Systems Integrator-- Glad to Assist
>>
>> Chat  Y! messenger: bjfr33man
>>
>>
>> Kapil garg sent the following on 10/30/2010 11:33 AM:
>>>
>>> Hello All
>>> I was able to induce successfully the database with some error for unknown primary key without any group file or model file. I am not sure what was wrong with the
>>>
>>>    I need to now view the entities.
>>>
>>> HOw do I do it?
>>>
>>>
>>> Kapil Garg
>>>
>>>
>>>
>>>
>>>
>>>> From: gargkapil@hotmail.com
>>>> To: user@ofbiz.apache.org
>>>> Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
>>>> Date: Sun, 31 Oct 2010 03:47:41 +1000
>>>>
>>>>
>>>> Sure Adrian
>>>> Appreciate your reply.
>>>> My question was while creating entity-group.xml file what is the entity name I need to give? Does it map to some table name. IF I do create this file with entity attribute then what do I need to put in entity-model.xml file for this entity?
>>>>
>>>>
>>>> Kapil Garg
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> Date: Sat, 30 Oct 2010 08:29:37 -0700
>>>>> From: adrian.crum@yahoo.com
>>>>> Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
>>>>> To: user@ofbiz.apache.org
>>>>>
>>>>> You are asking a lot of questions, and they can all be answered, but it might be best to answer them one at a time.
>>>>>
>>>>> I thought you were trying to connect OFBiz to an external database - and my instructions will do that. Once you have that working, we can move on to the other questions.
>>>>>
>>>>> -Adrian
>>>>>
>>>>> --- On Sat, 10/30/10, Kapil garg<ga...@hotmail.com>   wrote:
>>>>>
>>>>>> From: Kapil garg<ga...@hotmail.com>
>>>>>> Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
>>>>>> To: user@ofbiz.apache.org
>>>>>> Date: Saturday, October 30, 2010, 8:21 AM
>>>>>>
>>>>>> how do we know which table or view does it map to? May it
>>>>>> does not map to any of the tables and is just an entity by
>>>>>> itself needed for ofbiz framework? If I were to put this
>>>>>> entity entry then I would need to also create an
>>>>>> entitymodel.xml file which would have some field tags? How
>>>>>> do i now which ones are they? Are they mapping to one on one
>>>>>> to a table in the schema? I would have imgined if that is
>>>>>> the case then is there an ant target to create entity group
>>>>>> or enity model xml files as it could be error prone given
>>>>>> they conform to in built entity-model.xsd schemas
>>>>>>
>>>>>> Aain how many such entitties do I need to create. If it is
>>>>>> one per table then I have to create as many entites equal to
>>>>>> the total numer off tables in the schemas. What about views
>>>>>> oe indices etc How are they mapped? What about Stored
>>>>>> Procedures, can they be converted to mmini lang or service
>>>>>> classes?
>>>>>>
>>>>>>
>>>>>> Kapil Garg
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Date: Sat, 30 Oct 2010 08:13:53 -0700
>>>>>>> From: adrian.crum@yahoo.com
>>>>>>> Subject: RE: Issues Creating Entities in Ofbiz from
>>>>>> existing Schema
>>>>>>> To: user@ofbiz.apache.org
>>>>>>>
>>>>>>> Correct, you will need an entity-group.xml file. It
>>>>>> should cntain one entry per external entity (or table).
>>>>>>>
>>>>>>> -Adrian
>>>>>>>
>>>>>>> --- On Sat, 10/30/10, Kapil garg<ga...@hotmail.com>
>>>>>> wrote:
>>>>>>>
>>>>>>>> From: Kapil garg<ga...@hotmail.com>
>>>>>>>> Subject: RE: Issues Creating Entities in Ofbiz
>>>>>> from existing Schema
>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>> Date: Saturday, October 30, 2010, 8:11 AM
>>>>>>>>
>>>>>>>> but if it is in a default group then do I need to
>>>>>> create an
>>>>>>>> enity-group.xml file? Since all the groups within
>>>>>> the
>>>>>>>> default group do not have an entity-group.xml
>>>>>> file I assumed
>>>>>>>> creating a datasource within a default group does
>>>>>> not
>>>>>>>> require an entity-group.xml file. There isnt one
>>>>>> for
>>>>>>>> locaderby datasource which is a default one. But
>>>>>> I could be
>>>>>>>> wrong
>>>>>>>> While creating the enitygroup file what name do I
>>>>>> need to
>>>>>>>> give to Entity atritbute of  entity-group?
>>>>>> Random or
>>>>>>>> schema name? Does each of this entity name map to
>>>>>> a specific
>>>>>>>> table or just the whole DB?
>>>>>>>> <entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>>>>
>>>>>>>> xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitygroup.xsd">
>>>>>>>>
>>>>>>>>
>>>>>>>>       <entity-group
>>>>>> group="org.ofbiz" entity="IS
>>>>>>>> THIS A RANDOM NAME??"/>
>>>>>>>>
>>>>>>>>
>>>>>>>>       <entity-group
>>>>>> group="org.ofbiz"
>>>>>>>> entity="HOW MANY ENTITIES DO I NEED TO HAVE??ONE
>>>>>> per
>>>>>>>> Datasource or ONE Per Schema???"/>
>>>>>>>>
>>>>>>>> </entitygroup>
>>>>>>>>
>>>>>>>> Kapil Garg
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> Date: Sat, 30 Oct 2010 08:04:51 -0700
>>>>>>>>> From: adrian.crum@yahoo.com
>>>>>>>>> Subject: Re: Issues Creating Entities in
>>>>>> Ofbiz from
>>>>>>>> existing Schema
>>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>>
>>>>>>>>> You need to give your external datasource a
>>>>>>>> group-name. Then in your external entity
>>>>>> definitions, assign
>>>>>>>> the entities to that group.
>>>>>>>>>
>>>>>>>>> -Adrian
>>>>>>>>>
>>>>>>>>> --- On Fri, 10/29/10, Kapil garg<ga...@hotmail.com>
>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> From: Kapil garg<ga...@hotmail.com>
>>>>>>>>>> Subject: Issues Creating Entities in
>>>>>> Ofbiz from
>>>>>>>> existing Schema
>>>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>>>> Date: Friday, October 29, 2010, 12:09
>>>>>> PM
>>>>>>>>>>
>>>>>>>>>> I am trying to create a entities within
>>>>>> OFbiz out
>>>>>>>> of an
>>>>>>>>>> existing schema in production. Not sure
>>>>>> if this
>>>>>>>> is the best
>>>>>>>>>> way to create entties out of an
>>>>>> existing schema.
>>>>>>>> Suggestions
>>>>>>>>>> are welcomed!!
>>>>>>>>>>
>>>>>>>>>> I tried to add a datasource tag in
>>>>>> default
>>>>>>>> delegator in
>>>>>>>>>> entity-engine.xml
>>>>>>>>>> Followed the instructions on
>>>>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
>>>>>>>>>> Would like to know where I am going
>>>>>> wrong. On
>>>>>>>> restart, I
>>>>>>>>>> realised that ofbiz does not finish to
>>>>>> the point
>>>>>>>> that I can
>>>>>>>>>> get webtools or even login for
>>>>>> ecommerce. IT has
>>>>>>>> just stuck
>>>>>>>>>> at soem point saying
>>>>>> ServiceDispatcher.java
>>>>>>>> 584 INFO
>>>>>>>>>> Sync service..
>>>>>>>>>> There is no exception or anything but
>>>>>> OFbiz does
>>>>>>>> not go
>>>>>>>>>> further with complete laoding. Anything
>>>>>> I am
>>>>>>>> doing wrong?
>>>>>>>>>> Being a default delegaotr, there was no
>>>>>> special
>>>>>>>>>> entity-group.xml file in the ofbiz 9_04
>>>>>> code
>>>>>>>> base. Hence I
>>>>>>>>>> did not bother to create an
>>>>>> entity-group.xml
>>>>>>>> file
>>>>>>>>>> My schema name is lronline, following
>>>>>> are the
>>>>>>>> entries I had
>>>>>>>>>> in entity-engine.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"
>>>>>>>> datasource-name="localderby"/>
>>>>>>>>>>
>>>>>>>>      <group-map
>>>>>>>>>> group-name="org.ofbiz.olap"
>>>>>>>>>> datasource-name="localderbyolap"/>
>>>>>>>>>>
>>>>>>>>      <group-map
>>>>>>>>>> group-name="org.ofbiz"
>>>>>>>> datasource-name="mysql"/>
>>>>>>>>>>
>>>>>>      </delegator>
>>>>>>>>>>
>>>>>>>>>> <datasource name="mysql"
>>>>>>>>>>
>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>> helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>>>>>>>>>
>>>>>>
>>>>>>>>>> field-type-name="mysql"
>>>>>>>>>>
>>>>>>
>>>>>>>>>> check-on-start="true"
>>>>>>>>>>
>>>>>>
>>>>>>>>>> add-missing-on-start="true"
>>>>>>>>>>
>>>>>>
>>>>>>>>>> check-pks-on-start="false"
>>>>>>>>>>
>>>>>>
>>>>>>>>>> use-foreign-keys="true"
>>>>>>>>>>
>>>>>>
>>>>>>>>>> join-style="ansi-no-parenthesis"
>>>>>>>>>>
>>>>>>
>>>>>>>>>> alias-view-columns="false"
>>>>>>>>>>
>>>>>>
>>>>>>>>>> drop-fk-use-foreign-key-keyword="true"
>>>>>>>>>>
>>>>>>
>>>>>>>>>> table-type="InnoDB"
>>>>>>>>>>
>>>>>>
>>>>>>>>>> character-set="latin1"
>>>>>>>>>>
>>>>>>
>>>>>>>>>> collate="latin1_general_cs">
>>>>>>>>>>
>>>>>>>>      <read-data
>>>>>>>>>> reader-name="seed"/>
>>>>>>>>>>
>>>>>>>>      <read-data
>>>>>>>>>> reader-name="seed-initial"/>
>>>>>>>>>>
>>>>>>>>      <read-data
>>>>>>>>>> reader-name="demo"/>
>>>>>>>>>>
>>>>>>>>      <read-data
>>>>>>>>>> reader-name="ext"/>
>>>>>>>>>>
>>>>>>>>      <inline-jdbc
>>>>>>>>>>
>>>>>>
>>>>>>>>
>>>>>>>>>> jdbc-driver="com.mysql.jdbc.Driver"
>>>>>>>>>>
>>>>>>
>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>> jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
>>>>>>>>>>
>>>>>>
>>>>>>>>
>>>>>>>>>> jdbc-username="root"
>>>>>>>>>>
>>>>>>
>>>>>>>>
>>>>>>>>>> jdbc-password=""
>>>>>>>>>>
>>>>>>
>>>>>>>>
>>>>>>>>>> isolation-level="ReadCommitted"
>>>>>>>>>>
>>>>>>
>>>>>>>>
>>>>>>>>>> pool-minsize="2"
>>>>>>>>>>
>>>>>>
>>>>>>>>
>>>>>>>>>> pool-maxsize="250"/>
>>>>>>>>>>
>>>>>>      <!--
>>>>>>>> <jndi-jdbc
>>>>>>>>>> jndi-server-name="localjndi"
>>>>>>>>>> jndi-name="java:/MySqlDataSource"
>>>>>>>>>> isolation-level="Serializable"/>
>>>>>> -->
>>>>>>>>>>
>>>>>>      </datasource>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Kapil Garg
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>    		 	   		
>>>    		 	   		
>>
>   		 	   		


RE: how to View the Entities after Inducing msql DB

Posted by Kapil garg <ga...@hotmail.com>.
I d like to know what exact entities have been created .  Perhaps what has just happened after successful induction? What does this induce do eventually?  What is the end result?Are there a list of entities created mapped to tables in the database?Can I see them in webtools under entity performance or somewhere? What all activities I could do with these entities if at at all they are created? Can they be used in any other component? How so? If I were to use them in Ecommerce component, do I need to add them in  that component's entity def folder?


Kapil Garg
 




> Date: Sat, 30 Oct 2010 10:46:26 -0700
> From: bjfree@free-man.net
> To: user@ofbiz.apache.org
> Subject: Re: how to View the Entities after Inducing msql DB
> 
> please explain more what you mean by view
> 
> =========================
> BJ Freeman
> Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> Specialtymarket.com  <http://www.specialtymarket.com/>
> Systems Integrator-- Glad to Assist
> 
> Chat  Y! messenger: bjfr33man
> 
> 
> Kapil garg sent the following on 10/30/2010 11:33 AM:
> >
> > Hello All
> > I was able to induce successfully the database with some error for unknown primary key without any group file or model file. I am not sure what was wrong with the
> >
> >   I need to now view the entities.
> >
> > HOw do I do it?
> >
> >
> > Kapil Garg
> >
> >
> >
> >
> >
> >> From: gargkapil@hotmail.com
> >> To: user@ofbiz.apache.org
> >> Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
> >> Date: Sun, 31 Oct 2010 03:47:41 +1000
> >>
> >>
> >> Sure Adrian
> >> Appreciate your reply.
> >> My question was while creating entity-group.xml file what is the entity name I need to give? Does it map to some table name. IF I do create this file with entity attribute then what do I need to put in entity-model.xml file for this entity?
> >>
> >>
> >> Kapil Garg
> >>
> >>
> >>
> >>
> >>
> >>> Date: Sat, 30 Oct 2010 08:29:37 -0700
> >>> From: adrian.crum@yahoo.com
> >>> Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
> >>> To: user@ofbiz.apache.org
> >>>
> >>> You are asking a lot of questions, and they can all be answered, but it might be best to answer them one at a time.
> >>>
> >>> I thought you were trying to connect OFBiz to an external database - and my instructions will do that. Once you have that working, we can move on to the other questions.
> >>>
> >>> -Adrian
> >>>
> >>> --- On Sat, 10/30/10, Kapil garg<ga...@hotmail.com>  wrote:
> >>>
> >>>> From: Kapil garg<ga...@hotmail.com>
> >>>> Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
> >>>> To: user@ofbiz.apache.org
> >>>> Date: Saturday, October 30, 2010, 8:21 AM
> >>>>
> >>>> how do we know which table or view does it map to? May it
> >>>> does not map to any of the tables and is just an entity by
> >>>> itself needed for ofbiz framework? If I were to put this
> >>>> entity entry then I would need to also create an
> >>>> entitymodel.xml file which would have some field tags? How
> >>>> do i now which ones are they? Are they mapping to one on one
> >>>> to a table in the schema? I would have imgined if that is
> >>>> the case then is there an ant target to create entity group
> >>>> or enity model xml files as it could be error prone given
> >>>> they conform to in built entity-model.xsd schemas
> >>>>
> >>>> Aain how many such entitties do I need to create. If it is
> >>>> one per table then I have to create as many entites equal to
> >>>> the total numer off tables in the schemas. What about views
> >>>> oe indices etc How are they mapped? What about Stored
> >>>> Procedures, can they be converted to mmini lang or service
> >>>> classes?
> >>>>
> >>>>
> >>>> Kapil Garg
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>> Date: Sat, 30 Oct 2010 08:13:53 -0700
> >>>>> From: adrian.crum@yahoo.com
> >>>>> Subject: RE: Issues Creating Entities in Ofbiz from
> >>>> existing Schema
> >>>>> To: user@ofbiz.apache.org
> >>>>>
> >>>>> Correct, you will need an entity-group.xml file. It
> >>>> should cntain one entry per external entity (or table).
> >>>>>
> >>>>> -Adrian
> >>>>>
> >>>>> --- On Sat, 10/30/10, Kapil garg<ga...@hotmail.com>
> >>>> wrote:
> >>>>>
> >>>>>> From: Kapil garg<ga...@hotmail.com>
> >>>>>> Subject: RE: Issues Creating Entities in Ofbiz
> >>>> from existing Schema
> >>>>>> To: user@ofbiz.apache.org
> >>>>>> Date: Saturday, October 30, 2010, 8:11 AM
> >>>>>>
> >>>>>> but if it is in a default group then do I need to
> >>>> create an
> >>>>>> enity-group.xml file? Since all the groups within
> >>>> the
> >>>>>> default group do not have an entity-group.xml
> >>>> file I assumed
> >>>>>> creating a datasource within a default group does
> >>>> not
> >>>>>> require an entity-group.xml file. There isnt one
> >>>> for
> >>>>>> locaderby datasource which is a default one. But
> >>>> I could be
> >>>>>> wrong
> >>>>>> While creating the enitygroup file what name do I
> >>>> need to
> >>>>>> give to Entity atritbute of  entity-group?
> >>>> Random or
> >>>>>> schema name? Does each of this entity name map to
> >>>> a specific
> >>>>>> table or just the whole DB?
> >>>>>> <entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >>>>>>
> >>>>>> xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitygroup.xsd">
> >>>>>>
> >>>>>>
> >>>>>>      <entity-group
> >>>> group="org.ofbiz" entity="IS
> >>>>>> THIS A RANDOM NAME??"/>
> >>>>>>
> >>>>>>
> >>>>>>      <entity-group
> >>>> group="org.ofbiz"
> >>>>>> entity="HOW MANY ENTITIES DO I NEED TO HAVE??ONE
> >>>> per
> >>>>>> Datasource or ONE Per Schema???"/>
> >>>>>>
> >>>>>> </entitygroup>
> >>>>>>
> >>>>>> Kapil Garg
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>> Date: Sat, 30 Oct 2010 08:04:51 -0700
> >>>>>>> From: adrian.crum@yahoo.com
> >>>>>>> Subject: Re: Issues Creating Entities in
> >>>> Ofbiz from
> >>>>>> existing Schema
> >>>>>>> To: user@ofbiz.apache.org
> >>>>>>>
> >>>>>>> You need to give your external datasource a
> >>>>>> group-name. Then in your external entity
> >>>> definitions, assign
> >>>>>> the entities to that group.
> >>>>>>>
> >>>>>>> -Adrian
> >>>>>>>
> >>>>>>> --- On Fri, 10/29/10, Kapil garg<ga...@hotmail.com>
> >>>>>> wrote:
> >>>>>>>
> >>>>>>>> From: Kapil garg<ga...@hotmail.com>
> >>>>>>>> Subject: Issues Creating Entities in
> >>>> Ofbiz from
> >>>>>> existing Schema
> >>>>>>>> To: user@ofbiz.apache.org
> >>>>>>>> Date: Friday, October 29, 2010, 12:09
> >>>> PM
> >>>>>>>>
> >>>>>>>> I am trying to create a entities within
> >>>> OFbiz out
> >>>>>> of an
> >>>>>>>> existing schema in production. Not sure
> >>>> if this
> >>>>>> is the best
> >>>>>>>> way to create entties out of an
> >>>> existing schema.
> >>>>>> Suggestions
> >>>>>>>> are welcomed!!
> >>>>>>>>
> >>>>>>>> I tried to add a datasource tag in
> >>>> default
> >>>>>> delegator in
> >>>>>>>> entity-engine.xml
> >>>>>>>> Followed the instructions on
> >>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> >>>>>>>> Would like to know where I am going
> >>>> wrong. On
> >>>>>> restart, I
> >>>>>>>> realised that ofbiz does not finish to
> >>>> the point
> >>>>>> that I can
> >>>>>>>> get webtools or even login for
> >>>> ecommerce. IT has
> >>>>>> just stuck
> >>>>>>>> at soem point saying
> >>>> ServiceDispatcher.java
> >>>>>> 584 INFO
> >>>>>>>> Sync service..
> >>>>>>>> There is no exception or anything but
> >>>> OFbiz does
> >>>>>> not go
> >>>>>>>> further with complete laoding. Anything
> >>>> I am
> >>>>>> doing wrong?
> >>>>>>>> Being a default delegaotr, there was no
> >>>> special
> >>>>>>>> entity-group.xml file in the ofbiz 9_04
> >>>> code
> >>>>>> base. Hence I
> >>>>>>>> did not bother to create an
> >>>> entity-group.xml
> >>>>>> file
> >>>>>>>> My schema name is lronline, following
> >>>> are the
> >>>>>> entries I had
> >>>>>>>> in entity-engine.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"
> >>>>>> datasource-name="localderby"/>
> >>>>>>>>
> >>>>>>     <group-map
> >>>>>>>> group-name="org.ofbiz.olap"
> >>>>>>>> datasource-name="localderbyolap"/>
> >>>>>>>>
> >>>>>>     <group-map
> >>>>>>>> group-name="org.ofbiz"
> >>>>>> datasource-name="mysql"/>
> >>>>>>>>
> >>>>     </delegator>
> >>>>>>>>
> >>>>>>>> <datasource name="mysql"
> >>>>>>>>
> >>>>
> >>>>>>>>
> >>>>>>
> >>>> helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
> >>>>>>>>
> >>>>
> >>>>>>>> field-type-name="mysql"
> >>>>>>>>
> >>>>
> >>>>>>>> check-on-start="true"
> >>>>>>>>
> >>>>
> >>>>>>>> add-missing-on-start="true"
> >>>>>>>>
> >>>>
> >>>>>>>> check-pks-on-start="false"
> >>>>>>>>
> >>>>
> >>>>>>>> use-foreign-keys="true"
> >>>>>>>>
> >>>>
> >>>>>>>> join-style="ansi-no-parenthesis"
> >>>>>>>>
> >>>>
> >>>>>>>> alias-view-columns="false"
> >>>>>>>>
> >>>>
> >>>>>>>> drop-fk-use-foreign-key-keyword="true"
> >>>>>>>>
> >>>>
> >>>>>>>> table-type="InnoDB"
> >>>>>>>>
> >>>>
> >>>>>>>> character-set="latin1"
> >>>>>>>>
> >>>>
> >>>>>>>> collate="latin1_general_cs">
> >>>>>>>>
> >>>>>>     <read-data
> >>>>>>>> reader-name="seed"/>
> >>>>>>>>
> >>>>>>     <read-data
> >>>>>>>> reader-name="seed-initial"/>
> >>>>>>>>
> >>>>>>     <read-data
> >>>>>>>> reader-name="demo"/>
> >>>>>>>>
> >>>>>>     <read-data
> >>>>>>>> reader-name="ext"/>
> >>>>>>>>
> >>>>>>     <inline-jdbc
> >>>>>>>>
> >>>>
> >>>>>>
> >>>>>>>> jdbc-driver="com.mysql.jdbc.Driver"
> >>>>>>>>
> >>>>
> >>>>>>
> >>>>>>>>
> >>>>>>
> >>>> jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
> >>>>>>>>
> >>>>
> >>>>>>
> >>>>>>>> jdbc-username="root"
> >>>>>>>>
> >>>>
> >>>>>>
> >>>>>>>> jdbc-password=""
> >>>>>>>>
> >>>>
> >>>>>>
> >>>>>>>> isolation-level="ReadCommitted"
> >>>>>>>>
> >>>>
> >>>>>>
> >>>>>>>> pool-minsize="2"
> >>>>>>>>
> >>>>
> >>>>>>
> >>>>>>>> pool-maxsize="250"/>
> >>>>>>>>
> >>>>     <!--
> >>>>>> <jndi-jdbc
> >>>>>>>> jndi-server-name="localjndi"
> >>>>>>>> jndi-name="java:/MySqlDataSource"
> >>>>>>>> isolation-level="Serializable"/>
> >>>> -->
> >>>>>>>>
> >>>>     </datasource>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> Kapil Garg
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>
> >>>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>   		 	   		
> >   		 	   		
> 
 		 	   		  

Re: how to View the Entities after Inducing msql DB

Posted by BJ Freeman <bj...@free-man.net>.
please explain more what you mean by view

=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man


Kapil garg sent the following on 10/30/2010 11:33 AM:
>
> Hello All
> I was able to induce successfully the database with some error for unknown primary key without any group file or model file. I am not sure what was wrong with the
>
>   I need to now view the entities.
>
> HOw do I do it?
>
>
> Kapil Garg
>
>
>
>
>
>> From: gargkapil@hotmail.com
>> To: user@ofbiz.apache.org
>> Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
>> Date: Sun, 31 Oct 2010 03:47:41 +1000
>>
>>
>> Sure Adrian
>> Appreciate your reply.
>> My question was while creating entity-group.xml file what is the entity name I need to give? Does it map to some table name. IF I do create this file with entity attribute then what do I need to put in entity-model.xml file for this entity?
>>
>>
>> Kapil Garg
>>
>>
>>
>>
>>
>>> Date: Sat, 30 Oct 2010 08:29:37 -0700
>>> From: adrian.crum@yahoo.com
>>> Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
>>> To: user@ofbiz.apache.org
>>>
>>> You are asking a lot of questions, and they can all be answered, but it might be best to answer them one at a time.
>>>
>>> I thought you were trying to connect OFBiz to an external database - and my instructions will do that. Once you have that working, we can move on to the other questions.
>>>
>>> -Adrian
>>>
>>> --- On Sat, 10/30/10, Kapil garg<ga...@hotmail.com>  wrote:
>>>
>>>> From: Kapil garg<ga...@hotmail.com>
>>>> Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
>>>> To: user@ofbiz.apache.org
>>>> Date: Saturday, October 30, 2010, 8:21 AM
>>>>
>>>> how do we know which table or view does it map to? May it
>>>> does not map to any of the tables and is just an entity by
>>>> itself needed for ofbiz framework? If I were to put this
>>>> entity entry then I would need to also create an
>>>> entitymodel.xml file which would have some field tags? How
>>>> do i now which ones are they? Are they mapping to one on one
>>>> to a table in the schema? I would have imgined if that is
>>>> the case then is there an ant target to create entity group
>>>> or enity model xml files as it could be error prone given
>>>> they conform to in built entity-model.xsd schemas
>>>>
>>>> Aain how many such entitties do I need to create. If it is
>>>> one per table then I have to create as many entites equal to
>>>> the total numer off tables in the schemas. What about views
>>>> oe indices etc How are they mapped? What about Stored
>>>> Procedures, can they be converted to mmini lang or service
>>>> classes?
>>>>
>>>>
>>>> Kapil Garg
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> Date: Sat, 30 Oct 2010 08:13:53 -0700
>>>>> From: adrian.crum@yahoo.com
>>>>> Subject: RE: Issues Creating Entities in Ofbiz from
>>>> existing Schema
>>>>> To: user@ofbiz.apache.org
>>>>>
>>>>> Correct, you will need an entity-group.xml file. It
>>>> should cntain one entry per external entity (or table).
>>>>>
>>>>> -Adrian
>>>>>
>>>>> --- On Sat, 10/30/10, Kapil garg<ga...@hotmail.com>
>>>> wrote:
>>>>>
>>>>>> From: Kapil garg<ga...@hotmail.com>
>>>>>> Subject: RE: Issues Creating Entities in Ofbiz
>>>> from existing Schema
>>>>>> To: user@ofbiz.apache.org
>>>>>> Date: Saturday, October 30, 2010, 8:11 AM
>>>>>>
>>>>>> but if it is in a default group then do I need to
>>>> create an
>>>>>> enity-group.xml file? Since all the groups within
>>>> the
>>>>>> default group do not have an entity-group.xml
>>>> file I assumed
>>>>>> creating a datasource within a default group does
>>>> not
>>>>>> require an entity-group.xml file. There isnt one
>>>> for
>>>>>> locaderby datasource which is a default one. But
>>>> I could be
>>>>>> wrong
>>>>>> While creating the enitygroup file what name do I
>>>> need to
>>>>>> give to Entity atritbute of  entity-group?
>>>> Random or
>>>>>> schema name? Does each of this entity name map to
>>>> a specific
>>>>>> table or just the whole DB?
>>>>>> <entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>>
>>>>>> xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitygroup.xsd">
>>>>>>
>>>>>>
>>>>>>      <entity-group
>>>> group="org.ofbiz" entity="IS
>>>>>> THIS A RANDOM NAME??"/>
>>>>>>
>>>>>>
>>>>>>      <entity-group
>>>> group="org.ofbiz"
>>>>>> entity="HOW MANY ENTITIES DO I NEED TO HAVE??ONE
>>>> per
>>>>>> Datasource or ONE Per Schema???"/>
>>>>>>
>>>>>> </entitygroup>
>>>>>>
>>>>>> Kapil Garg
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Date: Sat, 30 Oct 2010 08:04:51 -0700
>>>>>>> From: adrian.crum@yahoo.com
>>>>>>> Subject: Re: Issues Creating Entities in
>>>> Ofbiz from
>>>>>> existing Schema
>>>>>>> To: user@ofbiz.apache.org
>>>>>>>
>>>>>>> You need to give your external datasource a
>>>>>> group-name. Then in your external entity
>>>> definitions, assign
>>>>>> the entities to that group.
>>>>>>>
>>>>>>> -Adrian
>>>>>>>
>>>>>>> --- On Fri, 10/29/10, Kapil garg<ga...@hotmail.com>
>>>>>> wrote:
>>>>>>>
>>>>>>>> From: Kapil garg<ga...@hotmail.com>
>>>>>>>> Subject: Issues Creating Entities in
>>>> Ofbiz from
>>>>>> existing Schema
>>>>>>>> To: user@ofbiz.apache.org
>>>>>>>> Date: Friday, October 29, 2010, 12:09
>>>> PM
>>>>>>>>
>>>>>>>> I am trying to create a entities within
>>>> OFbiz out
>>>>>> of an
>>>>>>>> existing schema in production. Not sure
>>>> if this
>>>>>> is the best
>>>>>>>> way to create entties out of an
>>>> existing schema.
>>>>>> Suggestions
>>>>>>>> are welcomed!!
>>>>>>>>
>>>>>>>> I tried to add a datasource tag in
>>>> default
>>>>>> delegator in
>>>>>>>> entity-engine.xml
>>>>>>>> Followed the instructions on
>>>>>>>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
>>>>>>>> Would like to know where I am going
>>>> wrong. On
>>>>>> restart, I
>>>>>>>> realised that ofbiz does not finish to
>>>> the point
>>>>>> that I can
>>>>>>>> get webtools or even login for
>>>> ecommerce. IT has
>>>>>> just stuck
>>>>>>>> at soem point saying
>>>> ServiceDispatcher.java
>>>>>> 584 INFO
>>>>>>>> Sync service..
>>>>>>>> There is no exception or anything but
>>>> OFbiz does
>>>>>> not go
>>>>>>>> further with complete laoding. Anything
>>>> I am
>>>>>> doing wrong?
>>>>>>>> Being a default delegaotr, there was no
>>>> special
>>>>>>>> entity-group.xml file in the ofbiz 9_04
>>>> code
>>>>>> base. Hence I
>>>>>>>> did not bother to create an
>>>> entity-group.xml
>>>>>> file
>>>>>>>> My schema name is lronline, following
>>>> are the
>>>>>> entries I had
>>>>>>>> in entity-engine.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"
>>>>>> datasource-name="localderby"/>
>>>>>>>>
>>>>>>     <group-map
>>>>>>>> group-name="org.ofbiz.olap"
>>>>>>>> datasource-name="localderbyolap"/>
>>>>>>>>
>>>>>>     <group-map
>>>>>>>> group-name="org.ofbiz"
>>>>>> datasource-name="mysql"/>
>>>>>>>>
>>>>     </delegator>
>>>>>>>>
>>>>>>>> <datasource name="mysql"
>>>>>>>>
>>>>
>>>>>>>>
>>>>>>
>>>> helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>>>>>>>
>>>>
>>>>>>>> field-type-name="mysql"
>>>>>>>>
>>>>
>>>>>>>> check-on-start="true"
>>>>>>>>
>>>>
>>>>>>>> add-missing-on-start="true"
>>>>>>>>
>>>>
>>>>>>>> check-pks-on-start="false"
>>>>>>>>
>>>>
>>>>>>>> use-foreign-keys="true"
>>>>>>>>
>>>>
>>>>>>>> join-style="ansi-no-parenthesis"
>>>>>>>>
>>>>
>>>>>>>> alias-view-columns="false"
>>>>>>>>
>>>>
>>>>>>>> drop-fk-use-foreign-key-keyword="true"
>>>>>>>>
>>>>
>>>>>>>> table-type="InnoDB"
>>>>>>>>
>>>>
>>>>>>>> character-set="latin1"
>>>>>>>>
>>>>
>>>>>>>> collate="latin1_general_cs">
>>>>>>>>
>>>>>>     <read-data
>>>>>>>> reader-name="seed"/>
>>>>>>>>
>>>>>>     <read-data
>>>>>>>> reader-name="seed-initial"/>
>>>>>>>>
>>>>>>     <read-data
>>>>>>>> reader-name="demo"/>
>>>>>>>>
>>>>>>     <read-data
>>>>>>>> reader-name="ext"/>
>>>>>>>>
>>>>>>     <inline-jdbc
>>>>>>>>
>>>>
>>>>>>
>>>>>>>> jdbc-driver="com.mysql.jdbc.Driver"
>>>>>>>>
>>>>
>>>>>>
>>>>>>>>
>>>>>>
>>>> jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
>>>>>>>>
>>>>
>>>>>>
>>>>>>>> jdbc-username="root"
>>>>>>>>
>>>>
>>>>>>
>>>>>>>> jdbc-password=""
>>>>>>>>
>>>>
>>>>>>
>>>>>>>> isolation-level="ReadCommitted"
>>>>>>>>
>>>>
>>>>>>
>>>>>>>> pool-minsize="2"
>>>>>>>>
>>>>
>>>>>>
>>>>>>>> pool-maxsize="250"/>
>>>>>>>>
>>>>     <!--
>>>>>> <jndi-jdbc
>>>>>>>> jndi-server-name="localjndi"
>>>>>>>> jndi-name="java:/MySqlDataSource"
>>>>>>>> isolation-level="Serializable"/>
>>>> -->
>>>>>>>>
>>>>     </datasource>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Kapil Garg
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>   		 	   		
>   		 	   		


how to View the Entities after Inducing msql DB

Posted by Kapil garg <ga...@hotmail.com>.
Hello All
I was able to induce successfully the database with some error for unknown primary key without any group file or model file. I am not sure what was wrong with the

 I need to now view the entities. 

HOw do I do it?


Kapil Garg
 




> From: gargkapil@hotmail.com
> To: user@ofbiz.apache.org
> Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
> Date: Sun, 31 Oct 2010 03:47:41 +1000
> 
> 
> Sure Adrian
> Appreciate your reply. 
> My question was while creating entity-group.xml file what is the entity name I need to give? Does it map to some table name. IF I do create this file with entity attribute then what do I need to put in entity-model.xml file for this entity?
> 
> 
> Kapil Garg
>  
> 
> 
> 
> 
> > Date: Sat, 30 Oct 2010 08:29:37 -0700
> > From: adrian.crum@yahoo.com
> > Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
> > To: user@ofbiz.apache.org
> > 
> > You are asking a lot of questions, and they can all be answered, but it might be best to answer them one at a time.
> > 
> > I thought you were trying to connect OFBiz to an external database - and my instructions will do that. Once you have that working, we can move on to the other questions.
> > 
> > -Adrian
> > 
> > --- On Sat, 10/30/10, Kapil garg <ga...@hotmail.com> wrote:
> > 
> > > From: Kapil garg <ga...@hotmail.com>
> > > Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
> > > To: user@ofbiz.apache.org
> > > Date: Saturday, October 30, 2010, 8:21 AM
> > > 
> > > how do we know which table or view does it map to? May it
> > > does not map to any of the tables and is just an entity by
> > > itself needed for ofbiz framework? If I were to put this
> > > entity entry then I would need to also create an
> > > entitymodel.xml file which would have some field tags? How
> > > do i now which ones are they? Are they mapping to one on one
> > > to a table in the schema? I would have imgined if that is
> > > the case then is there an ant target to create entity group
> > > or enity model xml files as it could be error prone given
> > > they conform to in built entity-model.xsd schemas
> > > 
> > > Aain how many such entitties do I need to create. If it is
> > > one per table then I have to create as many entites equal to
> > > the total numer off tables in the schemas. What about views
> > > oe indices etc How are they mapped? What about Stored
> > > Procedures, can they be converted to mmini lang or service
> > > classes?
> > > 
> > > 
> > > Kapil Garg
> > >  
> > > 
> > > 
> > > 
> > > 
> > > > Date: Sat, 30 Oct 2010 08:13:53 -0700
> > > > From: adrian.crum@yahoo.com
> > > > Subject: RE: Issues Creating Entities in Ofbiz from
> > > existing Schema
> > > > To: user@ofbiz.apache.org
> > > > 
> > > > Correct, you will need an entity-group.xml file. It
> > > should cntain one entry per external entity (or table).
> > > > 
> > > > -Adrian
> > > > 
> > > > --- On Sat, 10/30/10, Kapil garg <ga...@hotmail.com>
> > > wrote:
> > > > 
> > > > > From: Kapil garg <ga...@hotmail.com>
> > > > > Subject: RE: Issues Creating Entities in Ofbiz
> > > from existing Schema
> > > > > To: user@ofbiz.apache.org
> > > > > Date: Saturday, October 30, 2010, 8:11 AM
> > > > > 
> > > > > but if it is in a default group then do I need to
> > > create an
> > > > > enity-group.xml file? Since all the groups within
> > > the
> > > > > default group do not have an entity-group.xml
> > > file I assumed
> > > > > creating a datasource within a default group does
> > > not
> > > > > require an entity-group.xml file. There isnt one
> > > for
> > > > > locaderby datasource which is a default one. But
> > > I could be
> > > > > wrong
> > > > > While creating the enitygroup file what name do I
> > > need to
> > > > > give to Entity atritbute of  entity-group?
> > > Random or
> > > > > schema name? Does each of this entity name map to
> > > a specific
> > > > > table or just the whole DB?
> > > > > <entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > > > >        
> > > > > xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitygroup.xsd">
> > > > > 
> > > > >   
> > > > >     <entity-group
> > > group="org.ofbiz" entity="IS
> > > > > THIS A RANDOM NAME??"/>
> > > > > 
> > > > >  
> > > > >     <entity-group
> > > group="org.ofbiz"
> > > > > entity="HOW MANY ENTITIES DO I NEED TO HAVE??ONE
> > > per
> > > > > Datasource or ONE Per Schema???"/>
> > > > > 
> > > > > </entitygroup>
> > > > > 
> > > > > Kapil Garg
> > > > >  
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > > Date: Sat, 30 Oct 2010 08:04:51 -0700
> > > > > > From: adrian.crum@yahoo.com
> > > > > > Subject: Re: Issues Creating Entities in
> > > Ofbiz from
> > > > > existing Schema
> > > > > > To: user@ofbiz.apache.org
> > > > > > 
> > > > > > You need to give your external datasource a
> > > > > group-name. Then in your external entity
> > > definitions, assign
> > > > > the entities to that group.
> > > > > > 
> > > > > > -Adrian
> > > > > > 
> > > > > > --- On Fri, 10/29/10, Kapil garg <ga...@hotmail.com>
> > > > > wrote:
> > > > > > 
> > > > > > > From: Kapil garg <ga...@hotmail.com>
> > > > > > > Subject: Issues Creating Entities in
> > > Ofbiz from
> > > > > existing Schema
> > > > > > > To: user@ofbiz.apache.org
> > > > > > > Date: Friday, October 29, 2010, 12:09
> > > PM
> > > > > > > 
> > > > > > > I am trying to create a entities within
> > > OFbiz out
> > > > > of an
> > > > > > > existing schema in production. Not sure
> > > if this
> > > > > is the best
> > > > > > > way to create entties out of an
> > > existing schema.
> > > > > Suggestions
> > > > > > > are welcomed!!
> > > > > > > 
> > > > > > > I tried to add a datasource tag in
> > > default
> > > > > delegator in
> > > > > > > entity-engine.xml
> > > > > > > Followed the instructions on
> > > > > > > https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> > > > > > > Would like to know where I am going
> > > wrong. On
> > > > > restart, I
> > > > > > > realised that ofbiz does not finish to
> > > the point
> > > > > that I can
> > > > > > > get webtools or even login for
> > > ecommerce. IT has
> > > > > just stuck
> > > > > > > at soem point saying 
> > > ServiceDispatcher.java
> > > > > 584 INFO
> > > > > > > Sync service..
> > > > > > > There is no exception or anything but
> > > OFbiz does
> > > > > not go
> > > > > > > further with complete laoding. Anything
> > > I am
> > > > > doing wrong?
> > > > > > > Being a default delegaotr, there was no
> > > special
> > > > > > > entity-group.xml file in the ofbiz 9_04
> > > code
> > > > > base. Hence I
> > > > > > > did not bother to create an
> > > entity-group.xml
> > > > > file
> > > > > > > My schema name is lronline, following
> > > are the
> > > > > entries I had
> > > > > > > in entity-engine.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"
> > > > > datasource-name="localderby"/>
> > > > > > >     
> > > > >    <group-map
> > > > > > > group-name="org.ofbiz.olap"
> > > > > > > datasource-name="localderbyolap"/>
> > > > > > >     
> > > > >    <group-map
> > > > > > > group-name="org.ofbiz"
> > > > > datasource-name="mysql"/>
> > > > > > > 
> > >    </delegator>
> > > > > > > 
> > > > > > > <datasource name="mysql"
> > > > > > >         
> > >   
> > > > > > >
> > > > >
> > > helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
> > > > > > >         
> > >   
> > > > > > > field-type-name="mysql"
> > > > > > >         
> > >   
> > > > > > > check-on-start="true"
> > > > > > >         
> > >   
> > > > > > > add-missing-on-start="true"
> > > > > > >         
> > >   
> > > > > > > check-pks-on-start="false"
> > > > > > >         
> > >   
> > > > > > > use-foreign-keys="true"
> > > > > > >         
> > >   
> > > > > > > join-style="ansi-no-parenthesis"
> > > > > > >         
> > >   
> > > > > > > alias-view-columns="false"
> > > > > > >         
> > >   
> > > > > > > drop-fk-use-foreign-key-keyword="true"
> > > > > > >         
> > >   
> > > > > > > table-type="InnoDB"
> > > > > > >         
> > >   
> > > > > > > character-set="latin1"
> > > > > > >         
> > >   
> > > > > > > collate="latin1_general_cs">
> > > > > > >     
> > > > >    <read-data
> > > > > > > reader-name="seed"/>
> > > > > > >     
> > > > >    <read-data
> > > > > > > reader-name="seed-initial"/>
> > > > > > >     
> > > > >    <read-data
> > > > > > > reader-name="demo"/>
> > > > > > >     
> > > > >    <read-data
> > > > > > > reader-name="ext"/>
> > > > > > >     
> > > > >    <inline-jdbc
> > > > > > >         
> > >    
> > > > >   
> > > > > > > jdbc-driver="com.mysql.jdbc.Driver"
> > > > > > >         
> > >    
> > > > >   
> > > > > > >
> > > > >
> > > jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
> > > > > > >         
> > >    
> > > > >   
> > > > > > > jdbc-username="root"
> > > > > > >         
> > >    
> > > > >   
> > > > > > > jdbc-password=""
> > > > > > >         
> > >    
> > > > >   
> > > > > > > isolation-level="ReadCommitted"
> > > > > > >         
> > >    
> > > > >   
> > > > > > > pool-minsize="2"
> > > > > > >         
> > >    
> > > > >   
> > > > > > > pool-maxsize="250"/>
> > > > > > >     
> > >    <!--
> > > > > <jndi-jdbc
> > > > > > > jndi-server-name="localjndi"
> > > > > > > jndi-name="java:/MySqlDataSource"
> > > > > > > isolation-level="Serializable"/>
> > > -->
> > > > > > > 
> > >    </datasource>
> > > > > > >     
> > > > > > > 
> > > > > > > 
> > > > > > > Kapil Garg
> > > > > > >  
> > > > > > > 
> > > > > > > 
> > > > > > >     
> > > > > > >         
> > > > > > >       
> > >    
> > > > > > >   
> > > > > > 
> > > > > > 
> > > > > >       
> > > > >     
> > > > >         
> > > > >           
> > > > >   
> > > > 
> > > > 
> > > >       
> > >     
> > >         
> > >           
> > >   
> > 
> > 
> >       
>  		 	   		  
 		 	   		  

Re: Issues Creating Entities in Ofbiz from existing Schema

Posted by Jacques Le Roux <ja...@les7arts.com>.
Yes, BJ explained it in details at
https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data

Jacques

From: "Adrian Crum" <ad...@yahoo.com>
> You would create entity definitions for your external tables (each table would be an entity). Assign those entities to a unique 
> group-name by including them in an entity-group.xml file. Add the new group-name to the group-map element in entityengine.xml file 
> and you are ready to go. You can then access your external entities using the delegator.
>
> -Adrian
>
> --- On Sat, 10/30/10, Kapil garg <ga...@hotmail.com> wrote:
>> Sure Adrian
>> Appreciate your reply.
>> My question was while creating entity-group.xml file what
>> is the entity name I need to give? Does it map to some table
>> name. IF I do create this file with entity attribute then
>> what do I need to put in entity-model.xml file for this
>> entity?
>>
>>
>> Kapil Garg
>>
>>
>>
>>
>>
>> > Date: Sat, 30 Oct 2010 08:29:37 -0700
>> > From: adrian.crum@yahoo.com
>> > Subject: RE: Issues Creating Entities in Ofbiz from
>> existing Schema
>> > To: user@ofbiz.apache.org
>> >
>> > You are asking a lot of questions, and they can all be
>> answered, but it might be best to answer them one at a
>> time.
>> >
>> > I thought you were trying to connect OFBiz to an
>> external database - and my instructions will do that. Once
>> you have that working, we can move on to the other
>> questions.
>> >
>> > -Adrian
>> >
>> > --- On Sat, 10/30/10, Kapil garg <ga...@hotmail.com>
>> wrote:
>> >
>> > > From: Kapil garg <ga...@hotmail.com>
>> > > Subject: RE: Issues Creating Entities in Ofbiz
>> from existing Schema
>> > > To: user@ofbiz.apache.org
>> > > Date: Saturday, October 30, 2010, 8:21 AM
>> > >
>> > > how do we know which table or view does it map
>> to? May it
>> > > does not map to any of the tables and is just an
>> entity by
>> > > itself needed for ofbiz framework? If I were to
>> put this
>> > > entity entry then I would need to also create an
>> > > entitymodel.xml file which would have some field
>> tags? How
>> > > do i now which ones are they? Are they mapping to
>> one on one
>> > > to a table in the schema? I would have imgined if
>> that is
>> > > the case then is there an ant target to create
>> entity group
>> > > or enity model xml files as it could be error
>> prone given
>> > > they conform to in built entity-model.xsd
>> schemas
>> > >
>> > > Aain how many such entitties do I need to create.
>> If it is
>> > > one per table then I have to create as many
>> entites equal to
>> > > the total numer off tables in the schemas. What
>> about views
>> > > oe indices etc How are they mapped? What about
>> Stored
>> > > Procedures, can they be converted to mmini lang
>> or service
>> > > classes?
>> > >
>> > >
>> > > Kapil Garg
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > > Date: Sat, 30 Oct 2010 08:13:53 -0700
>> > > > From: adrian.crum@yahoo.com
>> > > > Subject: RE: Issues Creating Entities in
>> Ofbiz from
>> > > existing Schema
>> > > > To: user@ofbiz.apache.org
>> > > >
>> > > > Correct, you will need an entity-group.xml
>> file. It
>> > > should cntain one entry per external entity (or
>> table).
>> > > >
>> > > > -Adrian
>> > > >
>> > > > --- On Sat, 10/30/10, Kapil garg <ga...@hotmail.com>
>> > > wrote:
>> > > >
>> > > > > From: Kapil garg <ga...@hotmail.com>
>> > > > > Subject: RE: Issues Creating Entities
>> in Ofbiz
>> > > from existing Schema
>> > > > > To: user@ofbiz.apache.org
>> > > > > Date: Saturday, October 30, 2010, 8:11
>> AM
>> > > > >
>> > > > > but if it is in a default group then do
>> I need to
>> > > create an
>> > > > > enity-group.xml file? Since all the
>> groups within
>> > > the
>> > > > > default group do not have an
>> entity-group.xml
>> > > file I assumed
>> > > > > creating a datasource within a default
>> group does
>> > > not
>> > > > > require an entity-group.xml file. There
>> isnt one
>> > > for
>> > > > > locaderby datasource which is a default
>> one. But
>> > > I could be
>> > > > > wrong
>> > > > > While creating the enitygroup file what
>> name do I
>> > > need to
>> > > > > give to Entity atritbute of
>> entity-group?
>> > > Random or
>> > > > > schema name? Does each of this entity
>> name map to
>> > > a specific
>> > > > > table or just the whole DB?
>> > > > > <entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> > > > >
>> > > > > xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitygroup.xsd">
>> > > > >
>> > > > >
>> > > > >
>> <entity-group
>> > > group="org.ofbiz" entity="IS
>> > > > > THIS A RANDOM NAME??"/>
>> > > > >
>> > > > >
>> > > > >
>> <entity-group
>> > > group="org.ofbiz"
>> > > > > entity="HOW MANY ENTITIES DO I NEED TO
>> HAVE??ONE
>> > > per
>> > > > > Datasource or ONE Per Schema???"/>
>> > > > >
>> > > > > </entitygroup>
>> > > > >
>> > > > > Kapil Garg
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > > > Date: Sat, 30 Oct 2010 08:04:51
>> -0700
>> > > > > > From: adrian.crum@yahoo.com
>> > > > > > Subject: Re: Issues Creating
>> Entities in
>> > > Ofbiz from
>> > > > > existing Schema
>> > > > > > To: user@ofbiz.apache.org
>> > > > > >
>> > > > > > You need to give your external
>> datasource a
>> > > > > group-name. Then in your external
>> entity
>> > > definitions, assign
>> > > > > the entities to that group.
>> > > > > >
>> > > > > > -Adrian
>> > > > > >
>> > > > > > --- On Fri, 10/29/10, Kapil garg
>> <ga...@hotmail.com>
>> > > > > wrote:
>> > > > > >
>> > > > > > > From: Kapil garg <ga...@hotmail.com>
>> > > > > > > Subject: Issues Creating
>> Entities in
>> > > Ofbiz from
>> > > > > existing Schema
>> > > > > > > To: user@ofbiz.apache.org
>> > > > > > > Date: Friday, October 29,
>> 2010, 12:09
>> > > PM
>> > > > > > >
>> > > > > > > I am trying to create a
>> entities within
>> > > OFbiz out
>> > > > > of an
>> > > > > > > existing schema in
>> production. Not sure
>> > > if this
>> > > > > is the best
>> > > > > > > way to create entties out of
>> an
>> > > existing schema.
>> > > > > Suggestions
>> > > > > > > are welcomed!!
>> > > > > > >
>> > > > > > > I tried to add a datasource
>> tag in
>> > > default
>> > > > > delegator in
>> > > > > > > entity-engine.xml
>> > > > > > > Followed the instructions on
>> > > > > > > https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
>> > > > > > > Would like to know where I am
>> going
>> > > wrong. On
>> > > > > restart, I
>> > > > > > > realised that ofbiz does not
>> finish to
>> > > the point
>> > > > > that I can
>> > > > > > > get webtools or even login
>> for
>> > > ecommerce. IT has
>> > > > > just stuck
>> > > > > > > at soem point saying
>> > > ServiceDispatcher.java
>> > > > > 584 INFO
>> > > > > > > Sync service..
>> > > > > > > There is no exception or
>> anything but
>> > > OFbiz does
>> > > > > not go
>> > > > > > > further with complete
>> laoding. Anything
>> > > I am
>> > > > > doing wrong?
>> > > > > > > Being a default delegaotr,
>> there was no
>> > > special
>> > > > > > > entity-group.xml file in the
>> ofbiz 9_04
>> > > code
>> > > > > base. Hence I
>> > > > > > > did not bother to create an
>> > > entity-group.xml
>> > > > > file
>> > > > > > > My schema name is lronline,
>> following
>> > > are the
>> > > > > entries I had
>> > > > > > > in entity-engine.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"
>> > > > > datasource-name="localderby"/>
>> > > > > > >
>> > > > > <group-map
>> > > > > > > group-name="org.ofbiz.olap"
>> > > > > > >
>> datasource-name="localderbyolap"/>
>> > > > > > >
>> > > > > <group-map
>> > > > > > > group-name="org.ofbiz"
>> > > > > datasource-name="mysql"/>
>> > > > > > >
>> > > </delegator>
>> > > > > > >
>> > > > > > > <datasource name="mysql"
>> > > > > > >
>>
>> > >
>> > > > > > >
>> > > > >
>> > >
>> helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>> > > > > > >
>>
>> > >
>> > > > > > > field-type-name="mysql"
>> > > > > > >
>>
>> > >
>> > > > > > > check-on-start="true"
>> > > > > > >
>>
>> > >
>> > > > > > > add-missing-on-start="true"
>> > > > > > >
>>
>> > >
>> > > > > > > check-pks-on-start="false"
>> > > > > > >
>>
>> > >
>> > > > > > > use-foreign-keys="true"
>> > > > > > >
>>
>> > >
>> > > > > > >
>> join-style="ansi-no-parenthesis"
>> > > > > > >
>>
>> > >
>> > > > > > > alias-view-columns="false"
>> > > > > > >
>>
>> > >
>> > > > > > >
>> drop-fk-use-foreign-key-keyword="true"
>> > > > > > >
>>
>> > >
>> > > > > > > table-type="InnoDB"
>> > > > > > >
>>
>> > >
>> > > > > > > character-set="latin1"
>> > > > > > >
>>
>> > >
>> > > > > > >
>> collate="latin1_general_cs">
>> > > > > > >
>> > > > > <read-data
>> > > > > > > reader-name="seed"/>
>> > > > > > >
>> > > > > <read-data
>> > > > > > >
>> reader-name="seed-initial"/>
>> > > > > > >
>> > > > > <read-data
>> > > > > > > reader-name="demo"/>
>> > > > > > >
>> > > > > <read-data
>> > > > > > > reader-name="ext"/>
>> > > > > > >
>> > > > > <inline-jdbc
>> > > > > > >
>>
>> > >
>> > > > >
>> > > > > > >
>> jdbc-driver="com.mysql.jdbc.Driver"
>> > > > > > >
>>
>> > >
>> > > > >
>> > > > > > >
>> > > > >
>> > >
>> jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
>> > > > > > >
>>
>> > >
>> > > > >
>> > > > > > > jdbc-username="root"
>> > > > > > >
>>
>> > >
>> > > > >
>> > > > > > > jdbc-password=""
>> > > > > > >
>>
>> > >
>> > > > >
>> > > > > > >
>> isolation-level="ReadCommitted"
>> > > > > > >
>>
>> > >
>> > > > >
>> > > > > > > pool-minsize="2"
>> > > > > > >
>>
>> > >
>> > > > >
>> > > > > > > pool-maxsize="250"/>
>> > > > > > >
>> > > <!--
>> > > > > <jndi-jdbc
>> > > > > > > jndi-server-name="localjndi"
>> > > > > > >
>> jndi-name="java:/MySqlDataSource"
>> > > > > > >
>> isolation-level="Serializable"/>
>> > > -->
>> > > > > > >
>> > > </datasource>
>> > > > > > >
>> > > > > > >
>> > > > > > >
>> > > > > > > Kapil Garg
>> > > > > > >
>> > > > > > >
>> > > > > > >
>> > > > > > >
>> > > > > > >
>>
>> > > > > > >
>>
>> > >
>> > > > > > >
>> > > > > >
>> > > > > >
>> > > > > >
>> > > > >
>> > > > >
>> > > > >
>>
>> > > > >
>> > > >
>> > > >
>> > > >
>> > >
>> > >
>> > >
>> > >
>> >
>> >
>> >
>>
>>
>>
>>
>
>
>
> 



RE: Issues Creating Entities in Ofbiz from existing Schema

Posted by Adrian Crum <ad...@yahoo.com>.
You would create entity definitions for your external tables (each table would be an entity). Assign those entities to a unique group-name by including them in an entity-group.xml file. Add the new group-name to the group-map element in entityengine.xml file and you are ready to go. You can then access your external entities using the delegator.

-Adrian

--- On Sat, 10/30/10, Kapil garg <ga...@hotmail.com> wrote:
> Sure Adrian
> Appreciate your reply. 
> My question was while creating entity-group.xml file what
> is the entity name I need to give? Does it map to some table
> name. IF I do create this file with entity attribute then
> what do I need to put in entity-model.xml file for this
> entity?
> 
> 
> Kapil Garg
>  
> 
> 
> 
> 
> > Date: Sat, 30 Oct 2010 08:29:37 -0700
> > From: adrian.crum@yahoo.com
> > Subject: RE: Issues Creating Entities in Ofbiz from
> existing Schema
> > To: user@ofbiz.apache.org
> > 
> > You are asking a lot of questions, and they can all be
> answered, but it might be best to answer them one at a
> time.
> > 
> > I thought you were trying to connect OFBiz to an
> external database - and my instructions will do that. Once
> you have that working, we can move on to the other
> questions.
> > 
> > -Adrian
> > 
> > --- On Sat, 10/30/10, Kapil garg <ga...@hotmail.com>
> wrote:
> > 
> > > From: Kapil garg <ga...@hotmail.com>
> > > Subject: RE: Issues Creating Entities in Ofbiz
> from existing Schema
> > > To: user@ofbiz.apache.org
> > > Date: Saturday, October 30, 2010, 8:21 AM
> > > 
> > > how do we know which table or view does it map
> to? May it
> > > does not map to any of the tables and is just an
> entity by
> > > itself needed for ofbiz framework? If I were to
> put this
> > > entity entry then I would need to also create an
> > > entitymodel.xml file which would have some field
> tags? How
> > > do i now which ones are they? Are they mapping to
> one on one
> > > to a table in the schema? I would have imgined if
> that is
> > > the case then is there an ant target to create
> entity group
> > > or enity model xml files as it could be error
> prone given
> > > they conform to in built entity-model.xsd
> schemas
> > > 
> > > Aain how many such entitties do I need to create.
> If it is
> > > one per table then I have to create as many
> entites equal to
> > > the total numer off tables in the schemas. What
> about views
> > > oe indices etc How are they mapped? What about
> Stored
> > > Procedures, can they be converted to mmini lang
> or service
> > > classes?
> > > 
> > > 
> > > Kapil Garg
> > >  
> > > 
> > > 
> > > 
> > > 
> > > > Date: Sat, 30 Oct 2010 08:13:53 -0700
> > > > From: adrian.crum@yahoo.com
> > > > Subject: RE: Issues Creating Entities in
> Ofbiz from
> > > existing Schema
> > > > To: user@ofbiz.apache.org
> > > > 
> > > > Correct, you will need an entity-group.xml
> file. It
> > > should cntain one entry per external entity (or
> table).
> > > > 
> > > > -Adrian
> > > > 
> > > > --- On Sat, 10/30/10, Kapil garg <ga...@hotmail.com>
> > > wrote:
> > > > 
> > > > > From: Kapil garg <ga...@hotmail.com>
> > > > > Subject: RE: Issues Creating Entities
> in Ofbiz
> > > from existing Schema
> > > > > To: user@ofbiz.apache.org
> > > > > Date: Saturday, October 30, 2010, 8:11
> AM
> > > > > 
> > > > > but if it is in a default group then do
> I need to
> > > create an
> > > > > enity-group.xml file? Since all the
> groups within
> > > the
> > > > > default group do not have an
> entity-group.xml
> > > file I assumed
> > > > > creating a datasource within a default
> group does
> > > not
> > > > > require an entity-group.xml file. There
> isnt one
> > > for
> > > > > locaderby datasource which is a default
> one. But
> > > I could be
> > > > > wrong
> > > > > While creating the enitygroup file what
> name do I
> > > need to
> > > > > give to Entity atritbute of 
> entity-group?
> > > Random or
> > > > > schema name? Does each of this entity
> name map to
> > > a specific
> > > > > table or just the whole DB?
> > > > > <entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > > > >        
> > > > > xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitygroup.xsd">
> > > > > 
> > > > >   
> > > > > 
>    <entity-group
> > > group="org.ofbiz" entity="IS
> > > > > THIS A RANDOM NAME??"/>
> > > > > 
> > > > >  
> > > > > 
>    <entity-group
> > > group="org.ofbiz"
> > > > > entity="HOW MANY ENTITIES DO I NEED TO
> HAVE??ONE
> > > per
> > > > > Datasource or ONE Per Schema???"/>
> > > > > 
> > > > > </entitygroup>
> > > > > 
> > > > > Kapil Garg
> > > > >  
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > > Date: Sat, 30 Oct 2010 08:04:51
> -0700
> > > > > > From: adrian.crum@yahoo.com
> > > > > > Subject: Re: Issues Creating
> Entities in
> > > Ofbiz from
> > > > > existing Schema
> > > > > > To: user@ofbiz.apache.org
> > > > > > 
> > > > > > You need to give your external
> datasource a
> > > > > group-name. Then in your external
> entity
> > > definitions, assign
> > > > > the entities to that group.
> > > > > > 
> > > > > > -Adrian
> > > > > > 
> > > > > > --- On Fri, 10/29/10, Kapil garg
> <ga...@hotmail.com>
> > > > > wrote:
> > > > > > 
> > > > > > > From: Kapil garg <ga...@hotmail.com>
> > > > > > > Subject: Issues Creating
> Entities in
> > > Ofbiz from
> > > > > existing Schema
> > > > > > > To: user@ofbiz.apache.org
> > > > > > > Date: Friday, October 29,
> 2010, 12:09
> > > PM
> > > > > > > 
> > > > > > > I am trying to create a
> entities within
> > > OFbiz out
> > > > > of an
> > > > > > > existing schema in
> production. Not sure
> > > if this
> > > > > is the best
> > > > > > > way to create entties out of
> an
> > > existing schema.
> > > > > Suggestions
> > > > > > > are welcomed!!
> > > > > > > 
> > > > > > > I tried to add a datasource
> tag in
> > > default
> > > > > delegator in
> > > > > > > entity-engine.xml
> > > > > > > Followed the instructions on
> > > > > > > https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> > > > > > > Would like to know where I am
> going
> > > wrong. On
> > > > > restart, I
> > > > > > > realised that ofbiz does not
> finish to
> > > the point
> > > > > that I can
> > > > > > > get webtools or even login
> for
> > > ecommerce. IT has
> > > > > just stuck
> > > > > > > at soem point saying 
> > > ServiceDispatcher.java
> > > > > 584 INFO
> > > > > > > Sync service..
> > > > > > > There is no exception or
> anything but
> > > OFbiz does
> > > > > not go
> > > > > > > further with complete
> laoding. Anything
> > > I am
> > > > > doing wrong?
> > > > > > > Being a default delegaotr,
> there was no
> > > special
> > > > > > > entity-group.xml file in the
> ofbiz 9_04
> > > code
> > > > > base. Hence I
> > > > > > > did not bother to create an
> > > entity-group.xml
> > > > > file
> > > > > > > My schema name is lronline,
> following
> > > are the
> > > > > entries I had
> > > > > > > in entity-engine.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"
> > > > > datasource-name="localderby"/>
> > > > > > >     
> > > > >    <group-map
> > > > > > > group-name="org.ofbiz.olap"
> > > > > > >
> datasource-name="localderbyolap"/>
> > > > > > >     
> > > > >    <group-map
> > > > > > > group-name="org.ofbiz"
> > > > > datasource-name="mysql"/>
> > > > > > > 
> > >    </delegator>
> > > > > > > 
> > > > > > > <datasource name="mysql"
> > > > > > >     
>    
> > >   
> > > > > > >
> > > > >
> > >
> helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
> > > > > > >     
>    
> > >   
> > > > > > > field-type-name="mysql"
> > > > > > >     
>    
> > >   
> > > > > > > check-on-start="true"
> > > > > > >     
>    
> > >   
> > > > > > > add-missing-on-start="true"
> > > > > > >     
>    
> > >   
> > > > > > > check-pks-on-start="false"
> > > > > > >     
>    
> > >   
> > > > > > > use-foreign-keys="true"
> > > > > > >     
>    
> > >   
> > > > > > >
> join-style="ansi-no-parenthesis"
> > > > > > >     
>    
> > >   
> > > > > > > alias-view-columns="false"
> > > > > > >     
>    
> > >   
> > > > > > >
> drop-fk-use-foreign-key-keyword="true"
> > > > > > >     
>    
> > >   
> > > > > > > table-type="InnoDB"
> > > > > > >     
>    
> > >   
> > > > > > > character-set="latin1"
> > > > > > >     
>    
> > >   
> > > > > > >
> collate="latin1_general_cs">
> > > > > > >     
> > > > >    <read-data
> > > > > > > reader-name="seed"/>
> > > > > > >     
> > > > >    <read-data
> > > > > > >
> reader-name="seed-initial"/>
> > > > > > >     
> > > > >    <read-data
> > > > > > > reader-name="demo"/>
> > > > > > >     
> > > > >    <read-data
> > > > > > > reader-name="ext"/>
> > > > > > >     
> > > > >    <inline-jdbc
> > > > > > >     
>    
> > >    
> > > > >   
> > > > > > >
> jdbc-driver="com.mysql.jdbc.Driver"
> > > > > > >     
>    
> > >    
> > > > >   
> > > > > > >
> > > > >
> > >
> jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
> > > > > > >     
>    
> > >    
> > > > >   
> > > > > > > jdbc-username="root"
> > > > > > >     
>    
> > >    
> > > > >   
> > > > > > > jdbc-password=""
> > > > > > >     
>    
> > >    
> > > > >   
> > > > > > >
> isolation-level="ReadCommitted"
> > > > > > >     
>    
> > >    
> > > > >   
> > > > > > > pool-minsize="2"
> > > > > > >     
>    
> > >    
> > > > >   
> > > > > > > pool-maxsize="250"/>
> > > > > > >     
> > >    <!--
> > > > > <jndi-jdbc
> > > > > > > jndi-server-name="localjndi"
> > > > > > >
> jndi-name="java:/MySqlDataSource"
> > > > > > >
> isolation-level="Serializable"/>
> > > -->
> > > > > > > 
> > >    </datasource>
> > > > > > >     
> > > > > > > 
> > > > > > > 
> > > > > > > Kapil Garg
> > > > > > >  
> > > > > > > 
> > > > > > > 
> > > > > > >     
> > > > > > >     
>    
> > > > > > >   
>    
> > >    
> > > > > > >   
> > > > > > 
> > > > > > 
> > > > > >       
> > > > >     
> > > > >         
> > > > >       
>    
> > > > >   
> > > > 
> > > > 
> > > >       
> > >     
> > >         
> > >           
> > >   
> > 
> > 
> >       
>     
>         
>           
>   


      

RE: Issues Creating Entities in Ofbiz from existing Schema

Posted by Kapil garg <ga...@hotmail.com>.
Sure Adrian
Appreciate your reply. 
My question was while creating entity-group.xml file what is the entity name I need to give? Does it map to some table name. IF I do create this file with entity attribute then what do I need to put in entity-model.xml file for this entity?


Kapil Garg
 




> Date: Sat, 30 Oct 2010 08:29:37 -0700
> From: adrian.crum@yahoo.com
> Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
> To: user@ofbiz.apache.org
> 
> You are asking a lot of questions, and they can all be answered, but it might be best to answer them one at a time.
> 
> I thought you were trying to connect OFBiz to an external database - and my instructions will do that. Once you have that working, we can move on to the other questions.
> 
> -Adrian
> 
> --- On Sat, 10/30/10, Kapil garg <ga...@hotmail.com> wrote:
> 
> > From: Kapil garg <ga...@hotmail.com>
> > Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
> > To: user@ofbiz.apache.org
> > Date: Saturday, October 30, 2010, 8:21 AM
> > 
> > how do we know which table or view does it map to? May it
> > does not map to any of the tables and is just an entity by
> > itself needed for ofbiz framework? If I were to put this
> > entity entry then I would need to also create an
> > entitymodel.xml file which would have some field tags? How
> > do i now which ones are they? Are they mapping to one on one
> > to a table in the schema? I would have imgined if that is
> > the case then is there an ant target to create entity group
> > or enity model xml files as it could be error prone given
> > they conform to in built entity-model.xsd schemas
> > 
> > Aain how many such entitties do I need to create. If it is
> > one per table then I have to create as many entites equal to
> > the total numer off tables in the schemas. What about views
> > oe indices etc How are they mapped? What about Stored
> > Procedures, can they be converted to mmini lang or service
> > classes?
> > 
> > 
> > Kapil Garg
> >  
> > 
> > 
> > 
> > 
> > > Date: Sat, 30 Oct 2010 08:13:53 -0700
> > > From: adrian.crum@yahoo.com
> > > Subject: RE: Issues Creating Entities in Ofbiz from
> > existing Schema
> > > To: user@ofbiz.apache.org
> > > 
> > > Correct, you will need an entity-group.xml file. It
> > should cntain one entry per external entity (or table).
> > > 
> > > -Adrian
> > > 
> > > --- On Sat, 10/30/10, Kapil garg <ga...@hotmail.com>
> > wrote:
> > > 
> > > > From: Kapil garg <ga...@hotmail.com>
> > > > Subject: RE: Issues Creating Entities in Ofbiz
> > from existing Schema
> > > > To: user@ofbiz.apache.org
> > > > Date: Saturday, October 30, 2010, 8:11 AM
> > > > 
> > > > but if it is in a default group then do I need to
> > create an
> > > > enity-group.xml file? Since all the groups within
> > the
> > > > default group do not have an entity-group.xml
> > file I assumed
> > > > creating a datasource within a default group does
> > not
> > > > require an entity-group.xml file. There isnt one
> > for
> > > > locaderby datasource which is a default one. But
> > I could be
> > > > wrong
> > > > While creating the enitygroup file what name do I
> > need to
> > > > give to Entity atritbute of  entity-group?
> > Random or
> > > > schema name? Does each of this entity name map to
> > a specific
> > > > table or just the whole DB?
> > > > <entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > > >        
> > > > xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitygroup.xsd">
> > > > 
> > > >   
> > > >     <entity-group
> > group="org.ofbiz" entity="IS
> > > > THIS A RANDOM NAME??"/>
> > > > 
> > > >  
> > > >     <entity-group
> > group="org.ofbiz"
> > > > entity="HOW MANY ENTITIES DO I NEED TO HAVE??ONE
> > per
> > > > Datasource or ONE Per Schema???"/>
> > > > 
> > > > </entitygroup>
> > > > 
> > > > Kapil Garg
> > > >  
> > > > 
> > > > 
> > > > 
> > > > 
> > > > > Date: Sat, 30 Oct 2010 08:04:51 -0700
> > > > > From: adrian.crum@yahoo.com
> > > > > Subject: Re: Issues Creating Entities in
> > Ofbiz from
> > > > existing Schema
> > > > > To: user@ofbiz.apache.org
> > > > > 
> > > > > You need to give your external datasource a
> > > > group-name. Then in your external entity
> > definitions, assign
> > > > the entities to that group.
> > > > > 
> > > > > -Adrian
> > > > > 
> > > > > --- On Fri, 10/29/10, Kapil garg <ga...@hotmail.com>
> > > > wrote:
> > > > > 
> > > > > > From: Kapil garg <ga...@hotmail.com>
> > > > > > Subject: Issues Creating Entities in
> > Ofbiz from
> > > > existing Schema
> > > > > > To: user@ofbiz.apache.org
> > > > > > Date: Friday, October 29, 2010, 12:09
> > PM
> > > > > > 
> > > > > > I am trying to create a entities within
> > OFbiz out
> > > > of an
> > > > > > existing schema in production. Not sure
> > if this
> > > > is the best
> > > > > > way to create entties out of an
> > existing schema.
> > > > Suggestions
> > > > > > are welcomed!!
> > > > > > 
> > > > > > I tried to add a datasource tag in
> > default
> > > > delegator in
> > > > > > entity-engine.xml
> > > > > > Followed the instructions on
> > > > > > https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> > > > > > Would like to know where I am going
> > wrong. On
> > > > restart, I
> > > > > > realised that ofbiz does not finish to
> > the point
> > > > that I can
> > > > > > get webtools or even login for
> > ecommerce. IT has
> > > > just stuck
> > > > > > at soem point saying 
> > ServiceDispatcher.java
> > > > 584 INFO
> > > > > > Sync service..
> > > > > > There is no exception or anything but
> > OFbiz does
> > > > not go
> > > > > > further with complete laoding. Anything
> > I am
> > > > doing wrong?
> > > > > > Being a default delegaotr, there was no
> > special
> > > > > > entity-group.xml file in the ofbiz 9_04
> > code
> > > > base. Hence I
> > > > > > did not bother to create an
> > entity-group.xml
> > > > file
> > > > > > My schema name is lronline, following
> > are the
> > > > entries I had
> > > > > > in entity-engine.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"
> > > > datasource-name="localderby"/>
> > > > > >     
> > > >    <group-map
> > > > > > group-name="org.ofbiz.olap"
> > > > > > datasource-name="localderbyolap"/>
> > > > > >     
> > > >    <group-map
> > > > > > group-name="org.ofbiz"
> > > > datasource-name="mysql"/>
> > > > > > 
> >    </delegator>
> > > > > > 
> > > > > > <datasource name="mysql"
> > > > > >         
> >   
> > > > > >
> > > >
> > helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
> > > > > >         
> >   
> > > > > > field-type-name="mysql"
> > > > > >         
> >   
> > > > > > check-on-start="true"
> > > > > >         
> >   
> > > > > > add-missing-on-start="true"
> > > > > >         
> >   
> > > > > > check-pks-on-start="false"
> > > > > >         
> >   
> > > > > > use-foreign-keys="true"
> > > > > >         
> >   
> > > > > > join-style="ansi-no-parenthesis"
> > > > > >         
> >   
> > > > > > alias-view-columns="false"
> > > > > >         
> >   
> > > > > > drop-fk-use-foreign-key-keyword="true"
> > > > > >         
> >   
> > > > > > table-type="InnoDB"
> > > > > >         
> >   
> > > > > > character-set="latin1"
> > > > > >         
> >   
> > > > > > collate="latin1_general_cs">
> > > > > >     
> > > >    <read-data
> > > > > > reader-name="seed"/>
> > > > > >     
> > > >    <read-data
> > > > > > reader-name="seed-initial"/>
> > > > > >     
> > > >    <read-data
> > > > > > reader-name="demo"/>
> > > > > >     
> > > >    <read-data
> > > > > > reader-name="ext"/>
> > > > > >     
> > > >    <inline-jdbc
> > > > > >         
> >    
> > > >   
> > > > > > jdbc-driver="com.mysql.jdbc.Driver"
> > > > > >         
> >    
> > > >   
> > > > > >
> > > >
> > jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
> > > > > >         
> >    
> > > >   
> > > > > > jdbc-username="root"
> > > > > >         
> >    
> > > >   
> > > > > > jdbc-password=""
> > > > > >         
> >    
> > > >   
> > > > > > isolation-level="ReadCommitted"
> > > > > >         
> >    
> > > >   
> > > > > > pool-minsize="2"
> > > > > >         
> >    
> > > >   
> > > > > > pool-maxsize="250"/>
> > > > > >     
> >    <!--
> > > > <jndi-jdbc
> > > > > > jndi-server-name="localjndi"
> > > > > > jndi-name="java:/MySqlDataSource"
> > > > > > isolation-level="Serializable"/>
> > -->
> > > > > > 
> >    </datasource>
> > > > > >     
> > > > > > 
> > > > > > 
> > > > > > Kapil Garg
> > > > > >  
> > > > > > 
> > > > > > 
> > > > > >     
> > > > > >         
> > > > > >       
> >    
> > > > > >   
> > > > > 
> > > > > 
> > > > >       
> > > >     
> > > >         
> > > >           
> > > >   
> > > 
> > > 
> > >       
> >     
> >         
> >           
> >   
> 
> 
>       
 		 	   		  

RE: Issues Creating Entities in Ofbiz from existing Schema

Posted by Adrian Crum <ad...@yahoo.com>.
You are asking a lot of questions, and they can all be answered, but it might be best to answer them one at a time.

I thought you were trying to connect OFBiz to an external database - and my instructions will do that. Once you have that working, we can move on to the other questions.

-Adrian

--- On Sat, 10/30/10, Kapil garg <ga...@hotmail.com> wrote:

> From: Kapil garg <ga...@hotmail.com>
> Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
> To: user@ofbiz.apache.org
> Date: Saturday, October 30, 2010, 8:21 AM
> 
> how do we know which table or view does it map to? May it
> does not map to any of the tables and is just an entity by
> itself needed for ofbiz framework? If I were to put this
> entity entry then I would need to also create an
> entitymodel.xml file which would have some field tags? How
> do i now which ones are they? Are they mapping to one on one
> to a table in the schema? I would have imgined if that is
> the case then is there an ant target to create entity group
> or enity model xml files as it could be error prone given
> they conform to in built entity-model.xsd schemas
> 
> Aain how many such entitties do I need to create. If it is
> one per table then I have to create as many entites equal to
> the total numer off tables in the schemas. What about views
> oe indices etc How are they mapped? What about Stored
> Procedures, can they be converted to mmini lang or service
> classes?
> 
> 
> Kapil Garg
>  
> 
> 
> 
> 
> > Date: Sat, 30 Oct 2010 08:13:53 -0700
> > From: adrian.crum@yahoo.com
> > Subject: RE: Issues Creating Entities in Ofbiz from
> existing Schema
> > To: user@ofbiz.apache.org
> > 
> > Correct, you will need an entity-group.xml file. It
> should cntain one entry per external entity (or table).
> > 
> > -Adrian
> > 
> > --- On Sat, 10/30/10, Kapil garg <ga...@hotmail.com>
> wrote:
> > 
> > > From: Kapil garg <ga...@hotmail.com>
> > > Subject: RE: Issues Creating Entities in Ofbiz
> from existing Schema
> > > To: user@ofbiz.apache.org
> > > Date: Saturday, October 30, 2010, 8:11 AM
> > > 
> > > but if it is in a default group then do I need to
> create an
> > > enity-group.xml file? Since all the groups within
> the
> > > default group do not have an entity-group.xml
> file I assumed
> > > creating a datasource within a default group does
> not
> > > require an entity-group.xml file. There isnt one
> for
> > > locaderby datasource which is a default one. But
> I could be
> > > wrong
> > > While creating the enitygroup file what name do I
> need to
> > > give to Entity atritbute of  entity-group?
> Random or
> > > schema name? Does each of this entity name map to
> a specific
> > > table or just the whole DB?
> > > <entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > >        
> > > xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitygroup.xsd">
> > > 
> > >   
> > >     <entity-group
> group="org.ofbiz" entity="IS
> > > THIS A RANDOM NAME??"/>
> > > 
> > >  
> > >     <entity-group
> group="org.ofbiz"
> > > entity="HOW MANY ENTITIES DO I NEED TO HAVE??ONE
> per
> > > Datasource or ONE Per Schema???"/>
> > > 
> > > </entitygroup>
> > > 
> > > Kapil Garg
> > >  
> > > 
> > > 
> > > 
> > > 
> > > > Date: Sat, 30 Oct 2010 08:04:51 -0700
> > > > From: adrian.crum@yahoo.com
> > > > Subject: Re: Issues Creating Entities in
> Ofbiz from
> > > existing Schema
> > > > To: user@ofbiz.apache.org
> > > > 
> > > > You need to give your external datasource a
> > > group-name. Then in your external entity
> definitions, assign
> > > the entities to that group.
> > > > 
> > > > -Adrian
> > > > 
> > > > --- On Fri, 10/29/10, Kapil garg <ga...@hotmail.com>
> > > wrote:
> > > > 
> > > > > From: Kapil garg <ga...@hotmail.com>
> > > > > Subject: Issues Creating Entities in
> Ofbiz from
> > > existing Schema
> > > > > To: user@ofbiz.apache.org
> > > > > Date: Friday, October 29, 2010, 12:09
> PM
> > > > > 
> > > > > I am trying to create a entities within
> OFbiz out
> > > of an
> > > > > existing schema in production. Not sure
> if this
> > > is the best
> > > > > way to create entties out of an
> existing schema.
> > > Suggestions
> > > > > are welcomed!!
> > > > > 
> > > > > I tried to add a datasource tag in
> default
> > > delegator in
> > > > > entity-engine.xml
> > > > > Followed the instructions on
> > > > > https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> > > > > Would like to know where I am going
> wrong. On
> > > restart, I
> > > > > realised that ofbiz does not finish to
> the point
> > > that I can
> > > > > get webtools or even login for
> ecommerce. IT has
> > > just stuck
> > > > > at soem point saying 
> ServiceDispatcher.java
> > > 584 INFO
> > > > > Sync service..
> > > > > There is no exception or anything but
> OFbiz does
> > > not go
> > > > > further with complete laoding. Anything
> I am
> > > doing wrong?
> > > > > Being a default delegaotr, there was no
> special
> > > > > entity-group.xml file in the ofbiz 9_04
> code
> > > base. Hence I
> > > > > did not bother to create an
> entity-group.xml
> > > file
> > > > > My schema name is lronline, following
> are the
> > > entries I had
> > > > > in entity-engine.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"
> > > datasource-name="localderby"/>
> > > > >     
> > >    <group-map
> > > > > group-name="org.ofbiz.olap"
> > > > > datasource-name="localderbyolap"/>
> > > > >     
> > >    <group-map
> > > > > group-name="org.ofbiz"
> > > datasource-name="mysql"/>
> > > > > 
>    </delegator>
> > > > > 
> > > > > <datasource name="mysql"
> > > > >         
>   
> > > > >
> > >
> helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
> > > > >         
>   
> > > > > field-type-name="mysql"
> > > > >         
>   
> > > > > check-on-start="true"
> > > > >         
>   
> > > > > add-missing-on-start="true"
> > > > >         
>   
> > > > > check-pks-on-start="false"
> > > > >         
>   
> > > > > use-foreign-keys="true"
> > > > >         
>   
> > > > > join-style="ansi-no-parenthesis"
> > > > >         
>   
> > > > > alias-view-columns="false"
> > > > >         
>   
> > > > > drop-fk-use-foreign-key-keyword="true"
> > > > >         
>   
> > > > > table-type="InnoDB"
> > > > >         
>   
> > > > > character-set="latin1"
> > > > >         
>   
> > > > > collate="latin1_general_cs">
> > > > >     
> > >    <read-data
> > > > > reader-name="seed"/>
> > > > >     
> > >    <read-data
> > > > > reader-name="seed-initial"/>
> > > > >     
> > >    <read-data
> > > > > reader-name="demo"/>
> > > > >     
> > >    <read-data
> > > > > reader-name="ext"/>
> > > > >     
> > >    <inline-jdbc
> > > > >         
>    
> > >   
> > > > > jdbc-driver="com.mysql.jdbc.Driver"
> > > > >         
>    
> > >   
> > > > >
> > >
> jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
> > > > >         
>    
> > >   
> > > > > jdbc-username="root"
> > > > >         
>    
> > >   
> > > > > jdbc-password=""
> > > > >         
>    
> > >   
> > > > > isolation-level="ReadCommitted"
> > > > >         
>    
> > >   
> > > > > pool-minsize="2"
> > > > >         
>    
> > >   
> > > > > pool-maxsize="250"/>
> > > > >     
>    <!--
> > > <jndi-jdbc
> > > > > jndi-server-name="localjndi"
> > > > > jndi-name="java:/MySqlDataSource"
> > > > > isolation-level="Serializable"/>
> -->
> > > > > 
>    </datasource>
> > > > >     
> > > > > 
> > > > > 
> > > > > Kapil Garg
> > > > >  
> > > > > 
> > > > > 
> > > > >     
> > > > >         
> > > > >       
>    
> > > > >   
> > > > 
> > > > 
> > > >       
> > >     
> > >         
> > >           
> > >   
> > 
> > 
> >       
>     
>         
>           
>   


      

RE: Issues Creating Entities in Ofbiz from existing Schema

Posted by Kapil garg <ga...@hotmail.com>.
how do we know which table or view does it map to? May it does not map to any of the tables and is just an entity by itself needed for ofbiz framework? If I were to put this entity entry then I would need to also create an entitymodel.xml file which would have some field tags? How do i now which ones are they? Are they mapping to one on one to a table in the schema? I would have imgined if that is the case then is there an ant target to create entity group or enity model xml files as it could be error prone given they conform to in built entity-model.xsd schemas

Aain how many such entitties do I need to create. If it is one per table then I have to create as many entites equal to the total numer off tables in the schemas. What about views oe indices etc How are they mapped? What about Stored Procedures, can they be converted to mmini lang or service classes?


Kapil Garg
 




> Date: Sat, 30 Oct 2010 08:13:53 -0700
> From: adrian.crum@yahoo.com
> Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
> To: user@ofbiz.apache.org
> 
> Correct, you will need an entity-group.xml file. It should cntain one entry per external entity (or table).
> 
> -Adrian
> 
> --- On Sat, 10/30/10, Kapil garg <ga...@hotmail.com> wrote:
> 
> > From: Kapil garg <ga...@hotmail.com>
> > Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
> > To: user@ofbiz.apache.org
> > Date: Saturday, October 30, 2010, 8:11 AM
> > 
> > but if it is in a default group then do I need to create an
> > enity-group.xml file? Since all the groups within the
> > default group do not have an entity-group.xml file I assumed
> > creating a datasource within a default group does not
> > require an entity-group.xml file. There isnt one for
> > locaderby datasource which is a default one. But I could be
> > wrong
> > While creating the enitygroup file what name do I need to
> > give to Entity atritbute of  entity-group? Random or
> > schema name? Does each of this entity name map to a specific
> > table or just the whole DB?
> > <entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >        
> > xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitygroup.xsd">
> > 
> >   
> >     <entity-group group="org.ofbiz" entity="IS
> > THIS A RANDOM NAME??"/>
> > 
> >  
> >     <entity-group group="org.ofbiz"
> > entity="HOW MANY ENTITIES DO I NEED TO HAVE??ONE per
> > Datasource or ONE Per Schema???"/>
> > 
> > </entitygroup>
> > 
> > Kapil Garg
> >  
> > 
> > 
> > 
> > 
> > > Date: Sat, 30 Oct 2010 08:04:51 -0700
> > > From: adrian.crum@yahoo.com
> > > Subject: Re: Issues Creating Entities in Ofbiz from
> > existing Schema
> > > To: user@ofbiz.apache.org
> > > 
> > > You need to give your external datasource a
> > group-name. Then in your external entity definitions, assign
> > the entities to that group.
> > > 
> > > -Adrian
> > > 
> > > --- On Fri, 10/29/10, Kapil garg <ga...@hotmail.com>
> > wrote:
> > > 
> > > > From: Kapil garg <ga...@hotmail.com>
> > > > Subject: Issues Creating Entities in Ofbiz from
> > existing Schema
> > > > To: user@ofbiz.apache.org
> > > > Date: Friday, October 29, 2010, 12:09 PM
> > > > 
> > > > I am trying to create a entities within OFbiz out
> > of an
> > > > existing schema in production. Not sure if this
> > is the best
> > > > way to create entties out of an existing schema.
> > Suggestions
> > > > are welcomed!!
> > > > 
> > > > I tried to add a datasource tag in default
> > delegator in
> > > > entity-engine.xml
> > > > Followed the instructions on
> > > > https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> > > > Would like to know where I am going wrong. On
> > restart, I
> > > > realised that ofbiz does not finish to the point
> > that I can
> > > > get webtools or even login for ecommerce. IT has
> > just stuck
> > > > at soem point saying  ServiceDispatcher.java
> > 584 INFO
> > > > Sync service..
> > > > There is no exception or anything but OFbiz does
> > not go
> > > > further with complete laoding. Anything I am
> > doing wrong?
> > > > Being a default delegaotr, there was no special
> > > > entity-group.xml file in the ofbiz 9_04 code
> > base. Hence I
> > > > did not bother to create an entity-group.xml
> > file
> > > > My schema name is lronline, following are the
> > entries I had
> > > > in entity-engine.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"
> > datasource-name="localderby"/>
> > > >     
> >    <group-map
> > > > group-name="org.ofbiz.olap"
> > > > datasource-name="localderbyolap"/>
> > > >     
> >    <group-map
> > > > group-name="org.ofbiz"
> > datasource-name="mysql"/>
> > > >     </delegator>
> > > > 
> > > > <datasource name="mysql"
> > > >            
> > > >
> > helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
> > > >            
> > > > field-type-name="mysql"
> > > >            
> > > > check-on-start="true"
> > > >            
> > > > add-missing-on-start="true"
> > > >            
> > > > check-pks-on-start="false"
> > > >            
> > > > use-foreign-keys="true"
> > > >            
> > > > join-style="ansi-no-parenthesis"
> > > >            
> > > > alias-view-columns="false"
> > > >            
> > > > drop-fk-use-foreign-key-keyword="true"
> > > >            
> > > > table-type="InnoDB"
> > > >            
> > > > character-set="latin1"
> > > >            
> > > > collate="latin1_general_cs">
> > > >     
> >    <read-data
> > > > reader-name="seed"/>
> > > >     
> >    <read-data
> > > > reader-name="seed-initial"/>
> > > >     
> >    <read-data
> > > > reader-name="demo"/>
> > > >     
> >    <read-data
> > > > reader-name="ext"/>
> > > >     
> >    <inline-jdbc
> > > >             
> >   
> > > > jdbc-driver="com.mysql.jdbc.Driver"
> > > >             
> >   
> > > >
> > jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
> > > >             
> >   
> > > > jdbc-username="root"
> > > >             
> >   
> > > > jdbc-password=""
> > > >             
> >   
> > > > isolation-level="ReadCommitted"
> > > >             
> >   
> > > > pool-minsize="2"
> > > >             
> >   
> > > > pool-maxsize="250"/>
> > > >         <!--
> > <jndi-jdbc
> > > > jndi-server-name="localjndi"
> > > > jndi-name="java:/MySqlDataSource"
> > > > isolation-level="Serializable"/> -->
> > > >     </datasource>
> > > >     
> > > > 
> > > > 
> > > > Kapil Garg
> > > >  
> > > > 
> > > > 
> > > >     
> > > >         
> > > >           
> > > >   
> > > 
> > > 
> > >       
> >     
> >         
> >           
> >   
> 
> 
>       
 		 	   		  

RE: Issues Creating Entities in Ofbiz from existing Schema

Posted by Adrian Crum <ad...@yahoo.com>.
Correct, you will need an entity-group.xml file. It should cntain one entry per external entity (or table).

-Adrian

--- On Sat, 10/30/10, Kapil garg <ga...@hotmail.com> wrote:

> From: Kapil garg <ga...@hotmail.com>
> Subject: RE: Issues Creating Entities in Ofbiz from existing Schema
> To: user@ofbiz.apache.org
> Date: Saturday, October 30, 2010, 8:11 AM
> 
> but if it is in a default group then do I need to create an
> enity-group.xml file? Since all the groups within the
> default group do not have an entity-group.xml file I assumed
> creating a datasource within a default group does not
> require an entity-group.xml file. There isnt one for
> locaderby datasource which is a default one. But I could be
> wrong
> While creating the enitygroup file what name do I need to
> give to Entity atritbute of  entity-group? Random or
> schema name? Does each of this entity name map to a specific
> table or just the whole DB?
> <entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        
> xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitygroup.xsd">
> 
>   
>     <entity-group group="org.ofbiz" entity="IS
> THIS A RANDOM NAME??"/>
> 
>  
>     <entity-group group="org.ofbiz"
> entity="HOW MANY ENTITIES DO I NEED TO HAVE??ONE per
> Datasource or ONE Per Schema???"/>
> 
> </entitygroup>
> 
> Kapil Garg
>  
> 
> 
> 
> 
> > Date: Sat, 30 Oct 2010 08:04:51 -0700
> > From: adrian.crum@yahoo.com
> > Subject: Re: Issues Creating Entities in Ofbiz from
> existing Schema
> > To: user@ofbiz.apache.org
> > 
> > You need to give your external datasource a
> group-name. Then in your external entity definitions, assign
> the entities to that group.
> > 
> > -Adrian
> > 
> > --- On Fri, 10/29/10, Kapil garg <ga...@hotmail.com>
> wrote:
> > 
> > > From: Kapil garg <ga...@hotmail.com>
> > > Subject: Issues Creating Entities in Ofbiz from
> existing Schema
> > > To: user@ofbiz.apache.org
> > > Date: Friday, October 29, 2010, 12:09 PM
> > > 
> > > I am trying to create a entities within OFbiz out
> of an
> > > existing schema in production. Not sure if this
> is the best
> > > way to create entties out of an existing schema.
> Suggestions
> > > are welcomed!!
> > > 
> > > I tried to add a datasource tag in default
> delegator in
> > > entity-engine.xml
> > > Followed the instructions on
> > > https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> > > Would like to know where I am going wrong. On
> restart, I
> > > realised that ofbiz does not finish to the point
> that I can
> > > get webtools or even login for ecommerce. IT has
> just stuck
> > > at soem point saying  ServiceDispatcher.java
> 584 INFO
> > > Sync service..
> > > There is no exception or anything but OFbiz does
> not go
> > > further with complete laoding. Anything I am
> doing wrong?
> > > Being a default delegaotr, there was no special
> > > entity-group.xml file in the ofbiz 9_04 code
> base. Hence I
> > > did not bother to create an entity-group.xml
> file
> > > My schema name is lronline, following are the
> entries I had
> > > in entity-engine.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"
> datasource-name="localderby"/>
> > >     
>    <group-map
> > > group-name="org.ofbiz.olap"
> > > datasource-name="localderbyolap"/>
> > >     
>    <group-map
> > > group-name="org.ofbiz"
> datasource-name="mysql"/>
> > >     </delegator>
> > > 
> > > <datasource name="mysql"
> > >            
> > >
> helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
> > >            
> > > field-type-name="mysql"
> > >            
> > > check-on-start="true"
> > >            
> > > add-missing-on-start="true"
> > >            
> > > check-pks-on-start="false"
> > >            
> > > use-foreign-keys="true"
> > >            
> > > join-style="ansi-no-parenthesis"
> > >            
> > > alias-view-columns="false"
> > >            
> > > drop-fk-use-foreign-key-keyword="true"
> > >            
> > > table-type="InnoDB"
> > >            
> > > character-set="latin1"
> > >            
> > > collate="latin1_general_cs">
> > >     
>    <read-data
> > > reader-name="seed"/>
> > >     
>    <read-data
> > > reader-name="seed-initial"/>
> > >     
>    <read-data
> > > reader-name="demo"/>
> > >     
>    <read-data
> > > reader-name="ext"/>
> > >     
>    <inline-jdbc
> > >             
>   
> > > jdbc-driver="com.mysql.jdbc.Driver"
> > >             
>   
> > >
> jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
> > >             
>   
> > > jdbc-username="root"
> > >             
>   
> > > jdbc-password=""
> > >             
>   
> > > isolation-level="ReadCommitted"
> > >             
>   
> > > pool-minsize="2"
> > >             
>   
> > > pool-maxsize="250"/>
> > >         <!--
> <jndi-jdbc
> > > jndi-server-name="localjndi"
> > > jndi-name="java:/MySqlDataSource"
> > > isolation-level="Serializable"/> -->
> > >     </datasource>
> > >     
> > > 
> > > 
> > > Kapil Garg
> > >  
> > > 
> > > 
> > >     
> > >         
> > >           
> > >   
> > 
> > 
> >       
>     
>         
>           
>   


      

RE: Issues Creating Entities in Ofbiz from existing Schema

Posted by Kapil garg <ga...@hotmail.com>.
but if it is in a default group then do I need to create an enity-group.xml file? Since all the groups within the default group do not have an entity-group.xml file I assumed creating a datasource within a default group does not require an entity-group.xml file. There isnt one for locaderby datasource which is a default one. But I could be wrong
While creating the enitygroup file what name do I need to give to Entity atritbute of  entity-group? Random or schema name? Does each of this entity name map to a specific table or just the whole DB?
<entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitygroup.xsd">

  
    <entity-group group="org.ofbiz" entity="IS THIS A RANDOM NAME??"/>

 
    <entity-group group="org.ofbiz" entity="HOW MANY ENTITIES DO I NEED TO HAVE??ONE per Datasource or ONE Per Schema???"/>

</entitygroup>

Kapil Garg
 




> Date: Sat, 30 Oct 2010 08:04:51 -0700
> From: adrian.crum@yahoo.com
> Subject: Re: Issues Creating Entities in Ofbiz from existing Schema
> To: user@ofbiz.apache.org
> 
> You need to give your external datasource a group-name. Then in your external entity definitions, assign the entities to that group.
> 
> -Adrian
> 
> --- On Fri, 10/29/10, Kapil garg <ga...@hotmail.com> wrote:
> 
> > From: Kapil garg <ga...@hotmail.com>
> > Subject: Issues Creating Entities in Ofbiz from existing Schema
> > To: user@ofbiz.apache.org
> > Date: Friday, October 29, 2010, 12:09 PM
> > 
> > I am trying to create a entities within OFbiz out of an
> > existing schema in production. Not sure if this is the best
> > way to create entties out of an existing schema. Suggestions
> > are welcomed!!
> > 
> > I tried to add a datasource tag in default delegator in
> > entity-engine.xml
> > Followed the instructions on
> > https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> > Would like to know where I am going wrong. On restart, I
> > realised that ofbiz does not finish to the point that I can
> > get webtools or even login for ecommerce. IT has just stuck
> > at soem point saying  ServiceDispatcher.java 584 INFO
> > Sync service..
> > There is no exception or anything but OFbiz does not go
> > further with complete laoding. Anything I am doing wrong?
> > Being a default delegaotr, there was no special
> > entity-group.xml file in the ofbiz 9_04 code base. Hence I
> > did not bother to create an entity-group.xml file
> > My schema name is lronline, following are the entries I had
> > in entity-engine.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" datasource-name="localderby"/>
> >         <group-map
> > group-name="org.ofbiz.olap"
> > datasource-name="localderbyolap"/>
> >         <group-map
> > group-name="org.ofbiz" datasource-name="mysql"/>
> >     </delegator>
> > 
> > <datasource name="mysql"
> >            
> > helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
> >            
> > field-type-name="mysql"
> >            
> > check-on-start="true"
> >            
> > add-missing-on-start="true"
> >            
> > check-pks-on-start="false"
> >            
> > use-foreign-keys="true"
> >            
> > join-style="ansi-no-parenthesis"
> >            
> > alias-view-columns="false"
> >            
> > drop-fk-use-foreign-key-keyword="true"
> >            
> > table-type="InnoDB"
> >            
> > character-set="latin1"
> >            
> > collate="latin1_general_cs">
> >         <read-data
> > reader-name="seed"/>
> >         <read-data
> > reader-name="seed-initial"/>
> >         <read-data
> > reader-name="demo"/>
> >         <read-data
> > reader-name="ext"/>
> >         <inline-jdbc
> >                
> > jdbc-driver="com.mysql.jdbc.Driver"
> >                
> > jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
> >                
> > jdbc-username="root"
> >                
> > jdbc-password=""
> >                
> > isolation-level="ReadCommitted"
> >                
> > pool-minsize="2"
> >                
> > pool-maxsize="250"/>
> >         <!-- <jndi-jdbc
> > jndi-server-name="localjndi"
> > jndi-name="java:/MySqlDataSource"
> > isolation-level="Serializable"/> -->
> >     </datasource>
> >     
> > 
> > 
> > Kapil Garg
> >  
> > 
> > 
> >     
> >         
> >           
> >   
> 
> 
>       
 		 	   		  

Re: Issues Creating Entities in Ofbiz from existing Schema

Posted by BJ Freeman <bj...@free-man.net>.
Adam this is just to induce the entities from an external source.
yours is the next step once they are ready to beused.


=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man


Adrian Crum sent the following on 10/30/2010 8:04 AM:
> You need to give your external datasource a group-name. Then in your external entity definitions, assign the entities to that group.
>
> -Adrian
>
> --- On Fri, 10/29/10, Kapil garg<ga...@hotmail.com>  wrote:
>
>> From: Kapil garg<ga...@hotmail.com>
>> Subject: Issues Creating Entities in Ofbiz from existing Schema
>> To: user@ofbiz.apache.org
>> Date: Friday, October 29, 2010, 12:09 PM
>>
>> I am trying to create a entities within OFbiz out of an
>> existing schema in production. Not sure if this is the best
>> way to create entties out of an existing schema. Suggestions
>> are welcomed!!
>>
>> I tried to add a datasource tag in default delegator in
>> entity-engine.xml
>> Followed the instructions on
>> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
>> Would like to know where I am going wrong. On restart, I
>> realised that ofbiz does not finish to the point that I can
>> get webtools or even login for ecommerce. IT has just stuck
>> at soem point saying  ServiceDispatcher.java 584 INFO
>> Sync service..
>> There is no exception or anything but OFbiz does not go
>> further with complete laoding. Anything I am doing wrong?
>> Being a default delegaotr, there was no special
>> entity-group.xml file in the ofbiz 9_04 code base. Hence I
>> did not bother to create an entity-group.xml file
>> My schema name is lronline, following are the entries I had
>> in entity-engine.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" datasource-name="localderby"/>
>>          <group-map
>> group-name="org.ofbiz.olap"
>> datasource-name="localderbyolap"/>
>>          <group-map
>> group-name="org.ofbiz" datasource-name="mysql"/>
>>      </delegator>
>>
>> <datasource name="mysql"
>>
>> helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>>
>> field-type-name="mysql"
>>
>> check-on-start="true"
>>
>> add-missing-on-start="true"
>>
>> check-pks-on-start="false"
>>
>> use-foreign-keys="true"
>>
>> join-style="ansi-no-parenthesis"
>>
>> alias-view-columns="false"
>>
>> drop-fk-use-foreign-key-keyword="true"
>>
>> table-type="InnoDB"
>>
>> character-set="latin1"
>>
>> collate="latin1_general_cs">
>>          <read-data
>> reader-name="seed"/>
>>          <read-data
>> reader-name="seed-initial"/>
>>          <read-data
>> reader-name="demo"/>
>>          <read-data
>> reader-name="ext"/>
>>          <inline-jdbc
>>
>> jdbc-driver="com.mysql.jdbc.Driver"
>>
>> jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
>>
>> jdbc-username="root"
>>
>> jdbc-password=""
>>
>> isolation-level="ReadCommitted"
>>
>> pool-minsize="2"
>>
>> pool-maxsize="250"/>
>>          <!--<jndi-jdbc
>> jndi-server-name="localjndi"
>> jndi-name="java:/MySqlDataSource"
>> isolation-level="Serializable"/>  -->
>>      </datasource>
>>
>>
>>
>> Kapil Garg
>>
>>
>>
>>
>>
>>
>>
>
>
>
>


Re: Issues Creating Entities in Ofbiz from existing Schema

Posted by Adrian Crum <ad...@yahoo.com>.
You need to give your external datasource a group-name. Then in your external entity definitions, assign the entities to that group.

-Adrian

--- On Fri, 10/29/10, Kapil garg <ga...@hotmail.com> wrote:

> From: Kapil garg <ga...@hotmail.com>
> Subject: Issues Creating Entities in Ofbiz from existing Schema
> To: user@ofbiz.apache.org
> Date: Friday, October 29, 2010, 12:09 PM
> 
> I am trying to create a entities within OFbiz out of an
> existing schema in production. Not sure if this is the best
> way to create entties out of an existing schema. Suggestions
> are welcomed!!
> 
> I tried to add a datasource tag in default delegator in
> entity-engine.xml
> Followed the instructions on
> https://cwiki.apache.org/confluence/display/OFBIZ/Handling+of+External+data
> Would like to know where I am going wrong. On restart, I
> realised that ofbiz does not finish to the point that I can
> get webtools or even login for ecommerce. IT has just stuck
> at soem point saying  ServiceDispatcher.java 584 INFO
> Sync service..
> There is no exception or anything but OFbiz does not go
> further with complete laoding. Anything I am doing wrong?
> Being a default delegaotr, there was no special
> entity-group.xml file in the ofbiz 9_04 code base. Hence I
> did not bother to create an entity-group.xml file
> My schema name is lronline, following are the entries I had
> in entity-engine.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" datasource-name="localderby"/>
>         <group-map
> group-name="org.ofbiz.olap"
> datasource-name="localderbyolap"/>
>         <group-map
> group-name="org.ofbiz" datasource-name="mysql"/>
>     </delegator>
> 
> <datasource name="mysql"
>            
> helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>            
> field-type-name="mysql"
>            
> check-on-start="true"
>            
> add-missing-on-start="true"
>            
> check-pks-on-start="false"
>            
> use-foreign-keys="true"
>            
> join-style="ansi-no-parenthesis"
>            
> alias-view-columns="false"
>            
> drop-fk-use-foreign-key-keyword="true"
>            
> table-type="InnoDB"
>            
> character-set="latin1"
>            
> collate="latin1_general_cs">
>         <read-data
> reader-name="seed"/>
>         <read-data
> reader-name="seed-initial"/>
>         <read-data
> reader-name="demo"/>
>         <read-data
> reader-name="ext"/>
>         <inline-jdbc
>                
> jdbc-driver="com.mysql.jdbc.Driver"
>                
> jdbc-uri="jdbc:mysql://127.0.0.1/lronlineonedb?autoReconnect=true"
>                
> jdbc-username="root"
>                
> jdbc-password=""
>                
> isolation-level="ReadCommitted"
>                
> pool-minsize="2"
>                
> pool-maxsize="250"/>
>         <!-- <jndi-jdbc
> jndi-server-name="localjndi"
> jndi-name="java:/MySqlDataSource"
> isolation-level="Serializable"/> -->
>     </datasource>
>     
> 
> 
> Kapil Garg
>  
> 
> 
>     
>         
>           
>