Getting delegator/entity engine working from command line run

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

Getting delegator/entity engine working from command line run

Ritesh Trivedi
Hi,

I am writing a data import utility which can be run as a service from Service Engine (in which case you get GenericDelegator from the DispatchContext) as well as can be run from the command line.

Problem now is, if the utility is run from the command line, in order to be able to initialize "default" delegator, one will have to set the classpath correctly in order for GenericDelegator.getGenericDelegator("default") to find entityengine.xml and other related config files as well as libs. This in other words means I am trying to use entity engine from "outside" of Ofbiz - not literally but indirectly.

I looked at Start.java and references from there - which initializes classpath and loads containers which includes loading all the framework, application, hotdeploy directories etc.

Question is, if one wants to instantiate default delegator from java application, what are the min classpath and other house keeping tasks that needs to be done before it can be used and if there is any "entity engine loader class" which does the required house keeping based on just "ofbiz.home" location somewhere that can be used?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Getting delegator/entity engine working from command line run

Ritesh Trivedi
Hi,

I havent heard anything on this post... Does anyone out there have any experience using Entity Engine API  in standalone mode meaning without going through the startup process of ofbiz?

Thanks

Ritz123 wrote
Hi,

I am writing a data import utility which can be run as a service from Service Engine (in which case you get GenericDelegator from the DispatchContext) as well as can be run from the command line.

Problem now is, if the utility is run from the command line, in order to be able to initialize "default" delegator, one will have to set the classpath correctly in order for GenericDelegator.getGenericDelegator("default") to find entityengine.xml and other related config files as well as libs. This in other words means I am trying to use entity engine from "outside" of Ofbiz - not literally but indirectly.

I looked at Start.java and references from there - which initializes classpath and loads containers which includes loading all the framework, application, hotdeploy directories etc.

Question is, if one wants to instantiate default delegator from java application, what are the min classpath and other house keeping tasks that needs to be done before it can be used and if there is any "entity engine loader class" which does the required house keeping based on just "ofbiz.home" location somewhere that can be used?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Getting delegator/entity engine working from command line run

Jacques Le Roux
Administrator
I know this was done by Atlassian for Jira, which uses OFBiz entity engine. There are other projects, I believe there is at least
another one in Germany but I can't remember the name.
You might want to check
http://docs.ofbiz.org/display/OFBIZ/Apache+OFBiz+User+List#ApacheOFBizUserList-ProductsandProjectsbasedonApacheOFBiz. BTW I don't
thnink the German project I think about is in this list.

Jacques

From: "Ritz123" <[hidden email]>

>
> Hi,
>
> I havent heard anything on this post... Does anyone out there have any
> experience using Entity Engine API  in standalone mode meaning without going
> through the startup process of ofbiz?
>
> Thanks
>
>
> Ritz123 wrote:
>>
>> Hi,
>>
>> I am writing a data import utility which can be run as a service from
>> Service Engine (in which case you get GenericDelegator from the
>> DispatchContext) as well as can be run from the command line.
>>
>> Problem now is, if the utility is run from the command line, in order to
>> be able to initialize "default" delegator, one will have to set the
>> classpath correctly in order for
>> GenericDelegator.getGenericDelegator("default") to find entityengine.xml
>> and other related config files as well as libs. This in other words means
>> I am trying to use entity engine from "outside" of Ofbiz - not literally
>> but indirectly.
>>
>> I looked at Start.java and references from there - which initializes
>> classpath and loads containers which includes loading all the framework,
>> application, hotdeploy directories etc.
>>
>> Question is, if one wants to instantiate default delegator from java
>> application, what are the min classpath and other house keeping tasks that
>> needs to be done before it can be used and if there is any "entity engine
>> loader class" which does the required house keeping based on just
>> "ofbiz.home" location somewhere that can be used?
>>
>> Thanks
>>
>
> --
> View this message in context:
> http://www.nabble.com/Getting-delegator-entity-engine-working-from-command-line-run-tp14891395p15006445.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
>