You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Ritesh Trivedi <ri...@gmail.com> on 2008/07/31 00:41:48 UTC

ofbiz-component.xml classpath values - classloader

Hi,

I am trying to call Ofbiz Service from java using RequestHandler.runEvent
directly from the java code. While calling simple method based service, I
get file not found exception for the xml file containing the simple method.
Seems like the classloader being used does not have ofbiz-component.xml
specific classpaths. Any idea on which classloader to use while calling
services from java and/or how to add those classpaths to the current
classloader and have that classloader passed so that service executes
correctly?
-- 
View this message in context: http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18744345.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: ofbiz-component.xml classpath values - classloader

Posted by BJ Freeman <bj...@free-man.net>.
sorry mean dispatcher not delegator.

BJ Freeman sent the following on 7/30/2008 6:20 PM:
> Please don't double post.
> the services that ofbiz uses delegators.
> you need to understand how ofbiz works to program in it.
> takes more than understanding DB and java.
> Please read and view:
> http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Documentation+Index
> 
> 
> Ritesh Trivedi sent the following on 7/30/2008 3:41 PM:
>> Hi,
>>
>> I am trying to call Ofbiz Service from java using RequestHandler.runEvent
>> directly from the java code. While calling simple method based service, I
>> get file not found exception for the xml file containing the simple method.
>> Seems like the classloader being used does not have ofbiz-component.xml
>> specific classpaths. Any idea on which classloader to use while calling
>> services from java and/or how to add those classpaths to the current
>> classloader and have that classloader passed so that service executes
>> correctly?
> 
> 
> 
> 


Re: ofbiz-component.xml classpath values - classloader

Posted by Ritesh Trivedi <ri...@gmail.com>.
Sorry for the double post - after posting to the users group, I felt the
question was probably more suited for the dev group. 

Not sure what gave you an impression that I am only looking or know java and
db and may not have reviewed the documents already. Thanks for those
pointers, but I had already gone through them and needed some specific
pointers.


BJ Freeman wrote:
> 
> Please don't double post.
> the services that ofbiz uses delegators.
> you need to understand how ofbiz works to program in it.
> takes more than understanding DB and java.
> Please read and view:
> http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Documentation+Index
> 
> 
> Ritesh Trivedi sent the following on 7/30/2008 3:41 PM:
>> Hi,
>> 
>> I am trying to call Ofbiz Service from java using RequestHandler.runEvent
>> directly from the java code. While calling simple method based service, I
>> get file not found exception for the xml file containing the simple
>> method.
>> Seems like the classloader being used does not have ofbiz-component.xml
>> specific classpaths. Any idea on which classloader to use while calling
>> services from java and/or how to add those classpaths to the current
>> classloader and have that classloader passed so that service executes
>> correctly?
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18757509.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: ofbiz-component.xml classpath values - classloader

Posted by BJ Freeman <bj...@free-man.net>.
Please don't double post.
the services that ofbiz uses delegators.
you need to understand how ofbiz works to program in it.
takes more than understanding DB and java.
Please read and view:
http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Documentation+Index


Ritesh Trivedi sent the following on 7/30/2008 3:41 PM:
> Hi,
> 
> I am trying to call Ofbiz Service from java using RequestHandler.runEvent
> directly from the java code. While calling simple method based service, I
> get file not found exception for the xml file containing the simple method.
> Seems like the classloader being used does not have ofbiz-component.xml
> specific classpaths. Any idea on which classloader to use while calling
> services from java and/or how to add those classpaths to the current
> classloader and have that classloader passed so that service executes
> correctly?


Re: ofbiz-component.xml classpath values - classloader

Posted by BJ Freeman <bj...@free-man.net>.
I agree with you
however it calls that thru the controller
    <request-map uri="scheduleService">
        <security https="true" auth="true"/>
        <event type="java" path="org.ofbiz.webapp.event.CoreEvents"
invoke="scheduleService"/>
        <response name="success" type="view" value="jobList"/>
        <response name="sync_success" type="view" value="serviceResult"/>
        <response name="error" type="view" value="scheduleJob"/>
    </request-map>
which I said before.

Ritesh Trivedi sent the following on 7/31/2008 12:05 PM:
> BJ,
> 
> Its using ServiceEventHandler (Please see CoreEvents.java runService() -
> please read the post and the code before you reply. I dont mean to
> discourage or under appreciate your being so active on the mailing list and
> very responsive. But I will appreciate if you post more constructive
> replies.
> 
> Again, I dont mean to be rude or discouraging. 
> 
> 
> 
> BJ Freeman wrote:
>> that is using a dispatcher, however is it accomplishing what you want?
>>
>> Ritesh Trivedi sent the following on 7/31/2008 11:28 AM:
>>> In Webtools I can see the transmitRequest service and I am able to call
>>> it
>>> thru the webtools runservice.
>>>
>>>
>>>
>>> Ritesh Trivedi wrote:
>>>> Yes it is in the component-load.xml and I tried it in debug mode, it
>>>> reads
>>>> the services.xml and ofbiz-component.xml files - How else can I make
>>>> sure
>>>> the component is loaded?
>>>>
>>>>
>>>> Adrian Crum wrote:
>>>>> Are you sure the googleCheckout component is loaded? You might have to 
>>>>> add it to the component-load.xml file.
>>>>>
>>>>> -Adrian
>>>>>
>>>>> Ritesh Trivedi wrote:
>>>>>> For the sake of trying, I just tried calling the service
>>>>>> transmitRequest
>>>>>> from
>>>>>> googleCheckout services using LocalDispatcher.runSync directly and I
>>>>>> get
>>>>>> the
>>>>>> same exception as calling RequestHandler.runEvent
>>>>>>
>>>>>> 2008-07-31 10:59:52,058 (http-8443-2) [      
>>>>>> CheckoutPage.java:452:ERROR]
>>>>>> Error
>>>>>>  processing google checkout org.ofbiz.service.GenericServiceException:
>>>>>> Error
>>>>>> run
>>>>>> ning simple method [transmitRequest] in XML file
>>>>>> [org/ofbiz/googleCheckout/Prepa
>>>>>> reXMLTemplate.xml]:  (Could not find SimpleMethod XML document in
>>>>>> resource:
>>>>>> org/
>>>>>> ofbiz/googleCheckout/PrepareXMLTemplate.xml)
>>>>>> org.ofbiz.service.GenericServiceException: Error running simple method
>>>>>> [transmit
>>>>>> Request] in XML file
>>>>>> [org/ofbiz/googleCheckout/PrepareXMLTemplate.xml]: 
>>>>>> (Could
>>>>>> not find SimpleMethod XML document in resource:
>>>>>> org/ofbiz/googleCheckout/Prepare
>>>>>> XMLTemplate.xml)
>>>>>>         at
>>>>>> org.ofbiz.minilang.SimpleServiceEngine.serviceInvoker(SimpleServiceEn
>>>>>> gine.java:81)
>>>>>>         at
>>>>>> org.ofbiz.minilang.SimpleServiceEngine.runSync(SimpleServiceEngine.ja
>>>>>> va:51)
>>>>>>         at
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:38
>>>>>> 4)
>>>>>>         at
>>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:21
>>>>>> 3)
>>>>>>         at
>>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:14
>>>>>> 9)
>>>>>>         at
>>>>>> com.neobits.web.pages.CheckoutPage.processGoogleCheckout(CheckoutPage
>>>>>> .java:438)
>>>>>>
>>>>>>
>>>>>>
>>>>>> Ritesh Trivedi wrote:
>>>>>>> Because service events are handled differently than calling service
>>>>>>> directly.
>>>>>>>
>>>>>>> ServiceEventHandler constructs the context out of the request params
>>>>>>> which
>>>>>>> wont happen if I call the service through the dispatcher directly.
>>>>>>>
>>>>>>>
>>>>>>> Adrian Crum wrote:
>>>>>>>> Why can't you use the dispatcher? Why do you require 
>>>>>>>> RequestHandler.runEvent?
>>>>>>>>
>>>>>>>> -Adrian
>>>>>>>>
>>>>>>>> Ritesh Trivedi wrote:
>>>>>>>>> Here is what I had in my post
>>>>>>>>>> my java code is
>>>>>>>>>> running in the same container (Tomcat) as the ofbiz infact its an
>>>>>>>>>> ofbiz
>>>>>>>>>> application vs the pointer you gave is standalone
>>>>>>>>> How do I not have the benefit of ofbiz container? Again as I
>>>>>>>>> mentioned,
>>>>>>>>> my
>>>>>>>>> application is running as ofbiz component - the only thing is I am
>>>>>>>>> trying to
>>>>>>>>> call the service EVENT directly.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> BJ Freeman wrote:
>>>>>>>>>> you can look at start.java to see about class paths.
>>>>>>>>>> once you outside ofbiz you don't have the benefit of the ofbiz
>>>>>>>>>> container.
>>>>>>>>>> also  googleCheckout calls ofbiz specific components,webapp,
>>>>>>>>>> widgets.
>>>>>>>>>>
>>>>>>>>>> so basically you would have to re-invent framework to use the
>>>>>>>>>> googleCheckout.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Ritesh Trivedi sent the following on 7/31/2008 10:18 AM:
>>>>>>>>>>> JLR thanks for the response.
>>>>>>>>>>>
>>>>>>>>>>> I looked at GenerateContainer.java which has geronimo and wasce
>>>>>>>>>>> specific
>>>>>>>>>>> things you mentioned. Problem is, if I understand correctly, my
>>>>>>>>>>> java
>>>>>>>>>>> code
>>>>>>>>>>> is
>>>>>>>>>>> running in the same container (Tomcat) as the ofbiz infact its an
>>>>>>>>>>> ofbiz
>>>>>>>>>>> application vs the pointer you gave is standalone - which makes
>>>>>>>>>>> it
>>>>>>>>>>> easier
>>>>>>>>>>> to
>>>>>>>>>>> find and load things. I need RequestHandler.runEvent and chain of
>>>>>>>>>>> calls
>>>>>>>>>>> need
>>>>>>>>>>> to be able load the correct classloader or have it "add" certain
>>>>>>>>>>> paths
>>>>>>>>>>> which
>>>>>>>>>>> I Can specify at runtime
>>>>>>>>>>> (ofbiz.home/specialpurpose/googleCheckout/scripts
>>>>>>>>>>> and ofbiz.home/specialpurpose/googleCheckout/config). Adding to
>>>>>>>>>>> the
>>>>>>>>>>> system
>>>>>>>>>>> classpath at runtime is not helping since  System classloader
>>>>>>>>>>> does
>>>>>>>>>>> not
>>>>>>>>>>> re-read the system class path it seems.
>>>>>>>>>>>
>>>>>>>>>>> What I fail to understand though is that I am calling 
>>>>>>>>>>> RequestHandler.runEvent() from my java code - which is similar to
>>>>>>>>>>> how
>>>>>>>>>>> requesthandler calls to handle events, not sure if some how
>>>>>>>>>>> webapp
>>>>>>>>>>> (ofbiz
>>>>>>>>>>> component) specific classloader gets loaded from somewhere which
>>>>>>>>>>> has
>>>>>>>>>>> the
>>>>>>>>>>> correct classpath corresponding to the classpath tags in the
>>>>>>>>>>> ofbiz-component.xml file while executing the simple service.
>>>>>>>>>>>
>>>>>>>>>>> The only option I can see at this point is to add
>>>>>>>>>>> googleCheckout/scripts
>>>>>>>>>>> and
>>>>>>>>>>> config directories to the system classpath by putting them in the
>>>>>>>>>>> server
>>>>>>>>>>> start up script. But I would like to avoid that if possible.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> jacques.le.roux wrote:
>>>>>>>>>>>> Having seen this post later, I answered on dev ML with an
>>>>>>>>>>>> explanation
>>>>>>>>>>>> why
>>>>>>>>>>>> such posts should only go here
>>>>>>>>>>>>
>>>>>>>>>>>> Jacques
>>>>>>>>>>>>
>>>>>>>>>>>> From: "Ritesh Trivedi" <ri...@gmail.com>
>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>
>>>>>>>>>>>>> I am trying to call Ofbiz Service from java using
>>>>>>>>>>>>> RequestHandler.runEvent
>>>>>>>>>>>>> directly from the java code. While calling simple method based
>>>>>>>>>>>>> service,
>>>>>>>>>>>>> I
>>>>>>>>>>>>> get file not found exception for the xml file containing the
>>>>>>>>>>>>> simple
>>>>>>>>>>>>> method.
>>>>>>>>>>>>> Seems like the classloader being used does not have
>>>>>>>>>>>>> ofbiz-component.xml
>>>>>>>>>>>>> specific classpaths. Any idea on which classloader to use while
>>>>>>>>>>>>> calling
>>>>>>>>>>>>> services from java and/or how to add those classpaths to the
>>>>>>>>>>>>> current
>>>>>>>>>>>>> classloader and have that classloader passed so that service
>>>>>>>>>>>>> executes
>>>>>>>>>>>>> correctly?
>>>>>>>>>>>>> -- 
>>>>>>>>>>>>> View this message in context:
>>>>>>>>>>>>> http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18744345.html
>>>>>>>>>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>>>>>>>>>>
>>
>>
> 


Re: ofbiz-component.xml classpath values - classloader

Posted by Ritesh Trivedi <ri...@gmail.com>.
BJ,

Its using ServiceEventHandler (Please see CoreEvents.java runService() -
please read the post and the code before you reply. I dont mean to
discourage or under appreciate your being so active on the mailing list and
very responsive. But I will appreciate if you post more constructive
replies.

Again, I dont mean to be rude or discouraging. 



BJ Freeman wrote:
> 
> that is using a dispatcher, however is it accomplishing what you want?
> 
> Ritesh Trivedi sent the following on 7/31/2008 11:28 AM:
>> In Webtools I can see the transmitRequest service and I am able to call
>> it
>> thru the webtools runservice.
>> 
>> 
>> 
>> Ritesh Trivedi wrote:
>>> Yes it is in the component-load.xml and I tried it in debug mode, it
>>> reads
>>> the services.xml and ofbiz-component.xml files - How else can I make
>>> sure
>>> the component is loaded?
>>>
>>>
>>> Adrian Crum wrote:
>>>> Are you sure the googleCheckout component is loaded? You might have to 
>>>> add it to the component-load.xml file.
>>>>
>>>> -Adrian
>>>>
>>>> Ritesh Trivedi wrote:
>>>>> For the sake of trying, I just tried calling the service
>>>>> transmitRequest
>>>>> from
>>>>> googleCheckout services using LocalDispatcher.runSync directly and I
>>>>> get
>>>>> the
>>>>> same exception as calling RequestHandler.runEvent
>>>>>
>>>>> 2008-07-31 10:59:52,058 (http-8443-2) [      
>>>>> CheckoutPage.java:452:ERROR]
>>>>> Error
>>>>>  processing google checkout org.ofbiz.service.GenericServiceException:
>>>>> Error
>>>>> run
>>>>> ning simple method [transmitRequest] in XML file
>>>>> [org/ofbiz/googleCheckout/Prepa
>>>>> reXMLTemplate.xml]:  (Could not find SimpleMethod XML document in
>>>>> resource:
>>>>> org/
>>>>> ofbiz/googleCheckout/PrepareXMLTemplate.xml)
>>>>> org.ofbiz.service.GenericServiceException: Error running simple method
>>>>> [transmit
>>>>> Request] in XML file
>>>>> [org/ofbiz/googleCheckout/PrepareXMLTemplate.xml]: 
>>>>> (Could
>>>>> not find SimpleMethod XML document in resource:
>>>>> org/ofbiz/googleCheckout/Prepare
>>>>> XMLTemplate.xml)
>>>>>         at
>>>>> org.ofbiz.minilang.SimpleServiceEngine.serviceInvoker(SimpleServiceEn
>>>>> gine.java:81)
>>>>>         at
>>>>> org.ofbiz.minilang.SimpleServiceEngine.runSync(SimpleServiceEngine.ja
>>>>> va:51)
>>>>>         at
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:38
>>>>> 4)
>>>>>         at
>>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:21
>>>>> 3)
>>>>>         at
>>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:14
>>>>> 9)
>>>>>         at
>>>>> com.neobits.web.pages.CheckoutPage.processGoogleCheckout(CheckoutPage
>>>>> .java:438)
>>>>>
>>>>>
>>>>>
>>>>> Ritesh Trivedi wrote:
>>>>>> Because service events are handled differently than calling service
>>>>>> directly.
>>>>>>
>>>>>> ServiceEventHandler constructs the context out of the request params
>>>>>> which
>>>>>> wont happen if I call the service through the dispatcher directly.
>>>>>>
>>>>>>
>>>>>> Adrian Crum wrote:
>>>>>>> Why can't you use the dispatcher? Why do you require 
>>>>>>> RequestHandler.runEvent?
>>>>>>>
>>>>>>> -Adrian
>>>>>>>
>>>>>>> Ritesh Trivedi wrote:
>>>>>>>> Here is what I had in my post
>>>>>>>>> my java code is
>>>>>>>>> running in the same container (Tomcat) as the ofbiz infact its an
>>>>>>>>> ofbiz
>>>>>>>>> application vs the pointer you gave is standalone
>>>>>>>> How do I not have the benefit of ofbiz container? Again as I
>>>>>>>> mentioned,
>>>>>>>> my
>>>>>>>> application is running as ofbiz component - the only thing is I am
>>>>>>>> trying to
>>>>>>>> call the service EVENT directly.
>>>>>>>>
>>>>>>>>
>>>>>>>> BJ Freeman wrote:
>>>>>>>>> you can look at start.java to see about class paths.
>>>>>>>>> once you outside ofbiz you don't have the benefit of the ofbiz
>>>>>>>>> container.
>>>>>>>>> also  googleCheckout calls ofbiz specific components,webapp,
>>>>>>>>> widgets.
>>>>>>>>>
>>>>>>>>> so basically you would have to re-invent framework to use the
>>>>>>>>> googleCheckout.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Ritesh Trivedi sent the following on 7/31/2008 10:18 AM:
>>>>>>>>>> JLR thanks for the response.
>>>>>>>>>>
>>>>>>>>>> I looked at GenerateContainer.java which has geronimo and wasce
>>>>>>>>>> specific
>>>>>>>>>> things you mentioned. Problem is, if I understand correctly, my
>>>>>>>>>> java
>>>>>>>>>> code
>>>>>>>>>> is
>>>>>>>>>> running in the same container (Tomcat) as the ofbiz infact its an
>>>>>>>>>> ofbiz
>>>>>>>>>> application vs the pointer you gave is standalone - which makes
>>>>>>>>>> it
>>>>>>>>>> easier
>>>>>>>>>> to
>>>>>>>>>> find and load things. I need RequestHandler.runEvent and chain of
>>>>>>>>>> calls
>>>>>>>>>> need
>>>>>>>>>> to be able load the correct classloader or have it "add" certain
>>>>>>>>>> paths
>>>>>>>>>> which
>>>>>>>>>> I Can specify at runtime
>>>>>>>>>> (ofbiz.home/specialpurpose/googleCheckout/scripts
>>>>>>>>>> and ofbiz.home/specialpurpose/googleCheckout/config). Adding to
>>>>>>>>>> the
>>>>>>>>>> system
>>>>>>>>>> classpath at runtime is not helping since  System classloader
>>>>>>>>>> does
>>>>>>>>>> not
>>>>>>>>>> re-read the system class path it seems.
>>>>>>>>>>
>>>>>>>>>> What I fail to understand though is that I am calling 
>>>>>>>>>> RequestHandler.runEvent() from my java code - which is similar to
>>>>>>>>>> how
>>>>>>>>>> requesthandler calls to handle events, not sure if some how
>>>>>>>>>> webapp
>>>>>>>>>> (ofbiz
>>>>>>>>>> component) specific classloader gets loaded from somewhere which
>>>>>>>>>> has
>>>>>>>>>> the
>>>>>>>>>> correct classpath corresponding to the classpath tags in the
>>>>>>>>>> ofbiz-component.xml file while executing the simple service.
>>>>>>>>>>
>>>>>>>>>> The only option I can see at this point is to add
>>>>>>>>>> googleCheckout/scripts
>>>>>>>>>> and
>>>>>>>>>> config directories to the system classpath by putting them in the
>>>>>>>>>> server
>>>>>>>>>> start up script. But I would like to avoid that if possible.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> jacques.le.roux wrote:
>>>>>>>>>>> Having seen this post later, I answered on dev ML with an
>>>>>>>>>>> explanation
>>>>>>>>>>> why
>>>>>>>>>>> such posts should only go here
>>>>>>>>>>>
>>>>>>>>>>> Jacques
>>>>>>>>>>>
>>>>>>>>>>> From: "Ritesh Trivedi" <ri...@gmail.com>
>>>>>>>>>>>> Hi,
>>>>>>>>>>>>
>>>>>>>>>>>> I am trying to call Ofbiz Service from java using
>>>>>>>>>>>> RequestHandler.runEvent
>>>>>>>>>>>> directly from the java code. While calling simple method based
>>>>>>>>>>>> service,
>>>>>>>>>>>> I
>>>>>>>>>>>> get file not found exception for the xml file containing the
>>>>>>>>>>>> simple
>>>>>>>>>>>> method.
>>>>>>>>>>>> Seems like the classloader being used does not have
>>>>>>>>>>>> ofbiz-component.xml
>>>>>>>>>>>> specific classpaths. Any idea on which classloader to use while
>>>>>>>>>>>> calling
>>>>>>>>>>>> services from java and/or how to add those classpaths to the
>>>>>>>>>>>> current
>>>>>>>>>>>> classloader and have that classloader passed so that service
>>>>>>>>>>>> executes
>>>>>>>>>>>> correctly?
>>>>>>>>>>>> -- 
>>>>>>>>>>>> View this message in context:
>>>>>>>>>>>> http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18744345.html
>>>>>>>>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>>>>>>>>>
>>>>
>>>
>> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18761302.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: ofbiz-component.xml classpath values - classloader

Posted by BJ Freeman <bj...@free-man.net>.
that is using a dispatcher, however is it accomplishing what you want?

Ritesh Trivedi sent the following on 7/31/2008 11:28 AM:
> In Webtools I can see the transmitRequest service and I am able to call it
> thru the webtools runservice.
> 
> 
> 
> Ritesh Trivedi wrote:
>> Yes it is in the component-load.xml and I tried it in debug mode, it reads
>> the services.xml and ofbiz-component.xml files - How else can I make sure
>> the component is loaded?
>>
>>
>> Adrian Crum wrote:
>>> Are you sure the googleCheckout component is loaded? You might have to 
>>> add it to the component-load.xml file.
>>>
>>> -Adrian
>>>
>>> Ritesh Trivedi wrote:
>>>> For the sake of trying, I just tried calling the service transmitRequest
>>>> from
>>>> googleCheckout services using LocalDispatcher.runSync directly and I get
>>>> the
>>>> same exception as calling RequestHandler.runEvent
>>>>
>>>> 2008-07-31 10:59:52,058 (http-8443-2) [      
>>>> CheckoutPage.java:452:ERROR]
>>>> Error
>>>>  processing google checkout org.ofbiz.service.GenericServiceException:
>>>> Error
>>>> run
>>>> ning simple method [transmitRequest] in XML file
>>>> [org/ofbiz/googleCheckout/Prepa
>>>> reXMLTemplate.xml]:  (Could not find SimpleMethod XML document in
>>>> resource:
>>>> org/
>>>> ofbiz/googleCheckout/PrepareXMLTemplate.xml)
>>>> org.ofbiz.service.GenericServiceException: Error running simple method
>>>> [transmit
>>>> Request] in XML file [org/ofbiz/googleCheckout/PrepareXMLTemplate.xml]: 
>>>> (Could
>>>> not find SimpleMethod XML document in resource:
>>>> org/ofbiz/googleCheckout/Prepare
>>>> XMLTemplate.xml)
>>>>         at
>>>> org.ofbiz.minilang.SimpleServiceEngine.serviceInvoker(SimpleServiceEn
>>>> gine.java:81)
>>>>         at
>>>> org.ofbiz.minilang.SimpleServiceEngine.runSync(SimpleServiceEngine.ja
>>>> va:51)
>>>>         at
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:38
>>>> 4)
>>>>         at
>>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:21
>>>> 3)
>>>>         at
>>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:14
>>>> 9)
>>>>         at
>>>> com.neobits.web.pages.CheckoutPage.processGoogleCheckout(CheckoutPage
>>>> .java:438)
>>>>
>>>>
>>>>
>>>> Ritesh Trivedi wrote:
>>>>> Because service events are handled differently than calling service
>>>>> directly.
>>>>>
>>>>> ServiceEventHandler constructs the context out of the request params
>>>>> which
>>>>> wont happen if I call the service through the dispatcher directly.
>>>>>
>>>>>
>>>>> Adrian Crum wrote:
>>>>>> Why can't you use the dispatcher? Why do you require 
>>>>>> RequestHandler.runEvent?
>>>>>>
>>>>>> -Adrian
>>>>>>
>>>>>> Ritesh Trivedi wrote:
>>>>>>> Here is what I had in my post
>>>>>>>> my java code is
>>>>>>>> running in the same container (Tomcat) as the ofbiz infact its an
>>>>>>>> ofbiz
>>>>>>>> application vs the pointer you gave is standalone
>>>>>>> How do I not have the benefit of ofbiz container? Again as I
>>>>>>> mentioned,
>>>>>>> my
>>>>>>> application is running as ofbiz component - the only thing is I am
>>>>>>> trying to
>>>>>>> call the service EVENT directly.
>>>>>>>
>>>>>>>
>>>>>>> BJ Freeman wrote:
>>>>>>>> you can look at start.java to see about class paths.
>>>>>>>> once you outside ofbiz you don't have the benefit of the ofbiz
>>>>>>>> container.
>>>>>>>> also  googleCheckout calls ofbiz specific components,webapp,
>>>>>>>> widgets.
>>>>>>>>
>>>>>>>> so basically you would have to re-invent framework to use the
>>>>>>>> googleCheckout.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Ritesh Trivedi sent the following on 7/31/2008 10:18 AM:
>>>>>>>>> JLR thanks for the response.
>>>>>>>>>
>>>>>>>>> I looked at GenerateContainer.java which has geronimo and wasce
>>>>>>>>> specific
>>>>>>>>> things you mentioned. Problem is, if I understand correctly, my
>>>>>>>>> java
>>>>>>>>> code
>>>>>>>>> is
>>>>>>>>> running in the same container (Tomcat) as the ofbiz infact its an
>>>>>>>>> ofbiz
>>>>>>>>> application vs the pointer you gave is standalone - which makes it
>>>>>>>>> easier
>>>>>>>>> to
>>>>>>>>> find and load things. I need RequestHandler.runEvent and chain of
>>>>>>>>> calls
>>>>>>>>> need
>>>>>>>>> to be able load the correct classloader or have it "add" certain
>>>>>>>>> paths
>>>>>>>>> which
>>>>>>>>> I Can specify at runtime
>>>>>>>>> (ofbiz.home/specialpurpose/googleCheckout/scripts
>>>>>>>>> and ofbiz.home/specialpurpose/googleCheckout/config). Adding to the
>>>>>>>>> system
>>>>>>>>> classpath at runtime is not helping since  System classloader does
>>>>>>>>> not
>>>>>>>>> re-read the system class path it seems.
>>>>>>>>>
>>>>>>>>> What I fail to understand though is that I am calling 
>>>>>>>>> RequestHandler.runEvent() from my java code - which is similar to
>>>>>>>>> how
>>>>>>>>> requesthandler calls to handle events, not sure if some how webapp
>>>>>>>>> (ofbiz
>>>>>>>>> component) specific classloader gets loaded from somewhere which
>>>>>>>>> has
>>>>>>>>> the
>>>>>>>>> correct classpath corresponding to the classpath tags in the
>>>>>>>>> ofbiz-component.xml file while executing the simple service.
>>>>>>>>>
>>>>>>>>> The only option I can see at this point is to add
>>>>>>>>> googleCheckout/scripts
>>>>>>>>> and
>>>>>>>>> config directories to the system classpath by putting them in the
>>>>>>>>> server
>>>>>>>>> start up script. But I would like to avoid that if possible.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> jacques.le.roux wrote:
>>>>>>>>>> Having seen this post later, I answered on dev ML with an
>>>>>>>>>> explanation
>>>>>>>>>> why
>>>>>>>>>> such posts should only go here
>>>>>>>>>>
>>>>>>>>>> Jacques
>>>>>>>>>>
>>>>>>>>>> From: "Ritesh Trivedi" <ri...@gmail.com>
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> I am trying to call Ofbiz Service from java using
>>>>>>>>>>> RequestHandler.runEvent
>>>>>>>>>>> directly from the java code. While calling simple method based
>>>>>>>>>>> service,
>>>>>>>>>>> I
>>>>>>>>>>> get file not found exception for the xml file containing the
>>>>>>>>>>> simple
>>>>>>>>>>> method.
>>>>>>>>>>> Seems like the classloader being used does not have
>>>>>>>>>>> ofbiz-component.xml
>>>>>>>>>>> specific classpaths. Any idea on which classloader to use while
>>>>>>>>>>> calling
>>>>>>>>>>> services from java and/or how to add those classpaths to the
>>>>>>>>>>> current
>>>>>>>>>>> classloader and have that classloader passed so that service
>>>>>>>>>>> executes
>>>>>>>>>>> correctly?
>>>>>>>>>>> -- 
>>>>>>>>>>> View this message in context:
>>>>>>>>>>> http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18744345.html
>>>>>>>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>>>>>>>>
>>>
>>
> 


Re: ofbiz-component.xml classpath values - classloader

Posted by Ritesh Trivedi <ri...@gmail.com>.
In Webtools I can see the transmitRequest service and I am able to call it
thru the webtools runservice.



Ritesh Trivedi wrote:
> 
> Yes it is in the component-load.xml and I tried it in debug mode, it reads
> the services.xml and ofbiz-component.xml files - How else can I make sure
> the component is loaded?
> 
> 
> Adrian Crum wrote:
>> 
>> Are you sure the googleCheckout component is loaded? You might have to 
>> add it to the component-load.xml file.
>> 
>> -Adrian
>> 
>> Ritesh Trivedi wrote:
>>> For the sake of trying, I just tried calling the service transmitRequest
>>> from
>>> googleCheckout services using LocalDispatcher.runSync directly and I get
>>> the
>>> same exception as calling RequestHandler.runEvent
>>> 
>>> 2008-07-31 10:59:52,058 (http-8443-2) [      
>>> CheckoutPage.java:452:ERROR]
>>> Error
>>>  processing google checkout org.ofbiz.service.GenericServiceException:
>>> Error
>>> run
>>> ning simple method [transmitRequest] in XML file
>>> [org/ofbiz/googleCheckout/Prepa
>>> reXMLTemplate.xml]:  (Could not find SimpleMethod XML document in
>>> resource:
>>> org/
>>> ofbiz/googleCheckout/PrepareXMLTemplate.xml)
>>> org.ofbiz.service.GenericServiceException: Error running simple method
>>> [transmit
>>> Request] in XML file [org/ofbiz/googleCheckout/PrepareXMLTemplate.xml]: 
>>> (Could
>>> not find SimpleMethod XML document in resource:
>>> org/ofbiz/googleCheckout/Prepare
>>> XMLTemplate.xml)
>>>         at
>>> org.ofbiz.minilang.SimpleServiceEngine.serviceInvoker(SimpleServiceEn
>>> gine.java:81)
>>>         at
>>> org.ofbiz.minilang.SimpleServiceEngine.runSync(SimpleServiceEngine.ja
>>> va:51)
>>>         at
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:38
>>> 4)
>>>         at
>>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:21
>>> 3)
>>>         at
>>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:14
>>> 9)
>>>         at
>>> com.neobits.web.pages.CheckoutPage.processGoogleCheckout(CheckoutPage
>>> .java:438)
>>> 
>>> 
>>> 
>>> Ritesh Trivedi wrote:
>>>> Because service events are handled differently than calling service
>>>> directly.
>>>>
>>>> ServiceEventHandler constructs the context out of the request params
>>>> which
>>>> wont happen if I call the service through the dispatcher directly.
>>>>
>>>>
>>>> Adrian Crum wrote:
>>>>> Why can't you use the dispatcher? Why do you require 
>>>>> RequestHandler.runEvent?
>>>>>
>>>>> -Adrian
>>>>>
>>>>> Ritesh Trivedi wrote:
>>>>>> Here is what I had in my post
>>>>>>> my java code is
>>>>>>> running in the same container (Tomcat) as the ofbiz infact its an
>>>>>>> ofbiz
>>>>>>> application vs the pointer you gave is standalone
>>>>>> How do I not have the benefit of ofbiz container? Again as I
>>>>>> mentioned,
>>>>>> my
>>>>>> application is running as ofbiz component - the only thing is I am
>>>>>> trying to
>>>>>> call the service EVENT directly.
>>>>>>
>>>>>>
>>>>>> BJ Freeman wrote:
>>>>>>> you can look at start.java to see about class paths.
>>>>>>> once you outside ofbiz you don't have the benefit of the ofbiz
>>>>>>> container.
>>>>>>> also  googleCheckout calls ofbiz specific components,webapp,
>>>>>>> widgets.
>>>>>>>
>>>>>>> so basically you would have to re-invent framework to use the
>>>>>>> googleCheckout.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Ritesh Trivedi sent the following on 7/31/2008 10:18 AM:
>>>>>>>> JLR thanks for the response.
>>>>>>>>
>>>>>>>> I looked at GenerateContainer.java which has geronimo and wasce
>>>>>>>> specific
>>>>>>>> things you mentioned. Problem is, if I understand correctly, my
>>>>>>>> java
>>>>>>>> code
>>>>>>>> is
>>>>>>>> running in the same container (Tomcat) as the ofbiz infact its an
>>>>>>>> ofbiz
>>>>>>>> application vs the pointer you gave is standalone - which makes it
>>>>>>>> easier
>>>>>>>> to
>>>>>>>> find and load things. I need RequestHandler.runEvent and chain of
>>>>>>>> calls
>>>>>>>> need
>>>>>>>> to be able load the correct classloader or have it "add" certain
>>>>>>>> paths
>>>>>>>> which
>>>>>>>> I Can specify at runtime
>>>>>>>> (ofbiz.home/specialpurpose/googleCheckout/scripts
>>>>>>>> and ofbiz.home/specialpurpose/googleCheckout/config). Adding to the
>>>>>>>> system
>>>>>>>> classpath at runtime is not helping since  System classloader does
>>>>>>>> not
>>>>>>>> re-read the system class path it seems.
>>>>>>>>
>>>>>>>> What I fail to understand though is that I am calling 
>>>>>>>> RequestHandler.runEvent() from my java code - which is similar to
>>>>>>>> how
>>>>>>>> requesthandler calls to handle events, not sure if some how webapp
>>>>>>>> (ofbiz
>>>>>>>> component) specific classloader gets loaded from somewhere which
>>>>>>>> has
>>>>>>>> the
>> 
>>>>>>>> correct classpath corresponding to the classpath tags in the
>>>>>>>> ofbiz-component.xml file while executing the simple service.
>>>>>>>>
>>>>>>>> The only option I can see at this point is to add
>>>>>>>> googleCheckout/scripts
>>>>>>>> and
>>>>>>>> config directories to the system classpath by putting them in the
>>>>>>>> server
>>>>>>>> start up script. But I would like to avoid that if possible.
>>>>>>>>
>>>>>>>>
>>>>>>>> jacques.le.roux wrote:
>>>>>>>>> Having seen this post later, I answered on dev ML with an
>>>>>>>>> explanation
>>>>>>>>> why
>>>>>>>>> such posts should only go here
>>>>>>>>>
>>>>>>>>> Jacques
>>>>>>>>>
>>>>>>>>> From: "Ritesh Trivedi" <ri...@gmail.com>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> I am trying to call Ofbiz Service from java using
>>>>>>>>>> RequestHandler.runEvent
>>>>>>>>>> directly from the java code. While calling simple method based
>>>>>>>>>> service,
>>>>>>>>>> I
>>>>>>>>>> get file not found exception for the xml file containing the
>>>>>>>>>> simple
>>>>>>>>>> method.
>>>>>>>>>> Seems like the classloader being used does not have
>>>>>>>>>> ofbiz-component.xml
>>>>>>>>>> specific classpaths. Any idea on which classloader to use while
>>>>>>>>>> calling
>>>>>>>>>> services from java and/or how to add those classpaths to the
>>>>>>>>>> current
>>>>>>>>>> classloader and have that classloader passed so that service
>>>>>>>>>> executes
>>>>>>>>>> correctly?
>>>>>>>>>> -- 
>>>>>>>>>> View this message in context:
>>>>>>>>>> http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18744345.html
>>>>>>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>>>>>>>
>>>>>>>
>>>>>
>>>>
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18760671.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: ofbiz-component.xml classpath values - classloader

Posted by Ritesh Trivedi <ri...@gmail.com>.
Yes it is in the component-load.xml and I tried it in debug mode, it reads
the services.xml and ofbiz-component.xml files - How else can I make sure
the component is loaded?


Adrian Crum wrote:
> 
> Are you sure the googleCheckout component is loaded? You might have to 
> add it to the component-load.xml file.
> 
> -Adrian
> 
> Ritesh Trivedi wrote:
>> For the sake of trying, I just tried calling the service transmitRequest
>> from
>> googleCheckout services using LocalDispatcher.runSync directly and I get
>> the
>> same exception as calling RequestHandler.runEvent
>> 
>> 2008-07-31 10:59:52,058 (http-8443-2) [      
>> CheckoutPage.java:452:ERROR]
>> Error
>>  processing google checkout org.ofbiz.service.GenericServiceException:
>> Error
>> run
>> ning simple method [transmitRequest] in XML file
>> [org/ofbiz/googleCheckout/Prepa
>> reXMLTemplate.xml]:  (Could not find SimpleMethod XML document in
>> resource:
>> org/
>> ofbiz/googleCheckout/PrepareXMLTemplate.xml)
>> org.ofbiz.service.GenericServiceException: Error running simple method
>> [transmit
>> Request] in XML file [org/ofbiz/googleCheckout/PrepareXMLTemplate.xml]: 
>> (Could
>> not find SimpleMethod XML document in resource:
>> org/ofbiz/googleCheckout/Prepare
>> XMLTemplate.xml)
>>         at
>> org.ofbiz.minilang.SimpleServiceEngine.serviceInvoker(SimpleServiceEn
>> gine.java:81)
>>         at
>> org.ofbiz.minilang.SimpleServiceEngine.runSync(SimpleServiceEngine.ja
>> va:51)
>>         at
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:38
>> 4)
>>         at
>> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:21
>> 3)
>>         at
>> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:14
>> 9)
>>         at
>> com.neobits.web.pages.CheckoutPage.processGoogleCheckout(CheckoutPage
>> .java:438)
>> 
>> 
>> 
>> Ritesh Trivedi wrote:
>>> Because service events are handled differently than calling service
>>> directly.
>>>
>>> ServiceEventHandler constructs the context out of the request params
>>> which
>>> wont happen if I call the service through the dispatcher directly.
>>>
>>>
>>> Adrian Crum wrote:
>>>> Why can't you use the dispatcher? Why do you require 
>>>> RequestHandler.runEvent?
>>>>
>>>> -Adrian
>>>>
>>>> Ritesh Trivedi wrote:
>>>>> Here is what I had in my post
>>>>>> my java code is
>>>>>> running in the same container (Tomcat) as the ofbiz infact its an
>>>>>> ofbiz
>>>>>> application vs the pointer you gave is standalone
>>>>> How do I not have the benefit of ofbiz container? Again as I
>>>>> mentioned,
>>>>> my
>>>>> application is running as ofbiz component - the only thing is I am
>>>>> trying to
>>>>> call the service EVENT directly.
>>>>>
>>>>>
>>>>> BJ Freeman wrote:
>>>>>> you can look at start.java to see about class paths.
>>>>>> once you outside ofbiz you don't have the benefit of the ofbiz
>>>>>> container.
>>>>>> also  googleCheckout calls ofbiz specific components,webapp, widgets.
>>>>>>
>>>>>> so basically you would have to re-invent framework to use the
>>>>>> googleCheckout.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Ritesh Trivedi sent the following on 7/31/2008 10:18 AM:
>>>>>>> JLR thanks for the response.
>>>>>>>
>>>>>>> I looked at GenerateContainer.java which has geronimo and wasce
>>>>>>> specific
>>>>>>> things you mentioned. Problem is, if I understand correctly, my java
>>>>>>> code
>>>>>>> is
>>>>>>> running in the same container (Tomcat) as the ofbiz infact its an
>>>>>>> ofbiz
>>>>>>> application vs the pointer you gave is standalone - which makes it
>>>>>>> easier
>>>>>>> to
>>>>>>> find and load things. I need RequestHandler.runEvent and chain of
>>>>>>> calls
>>>>>>> need
>>>>>>> to be able load the correct classloader or have it "add" certain
>>>>>>> paths
>>>>>>> which
>>>>>>> I Can specify at runtime
>>>>>>> (ofbiz.home/specialpurpose/googleCheckout/scripts
>>>>>>> and ofbiz.home/specialpurpose/googleCheckout/config). Adding to the
>>>>>>> system
>>>>>>> classpath at runtime is not helping since  System classloader does
>>>>>>> not
>>>>>>> re-read the system class path it seems.
>>>>>>>
>>>>>>> What I fail to understand though is that I am calling 
>>>>>>> RequestHandler.runEvent() from my java code - which is similar to
>>>>>>> how
>>>>>>> requesthandler calls to handle events, not sure if some how webapp
>>>>>>> (ofbiz
>>>>>>> component) specific classloader gets loaded from somewhere which has
>>>>>>> the
> 
>>>>>>> correct classpath corresponding to the classpath tags in the
>>>>>>> ofbiz-component.xml file while executing the simple service.
>>>>>>>
>>>>>>> The only option I can see at this point is to add
>>>>>>> googleCheckout/scripts
>>>>>>> and
>>>>>>> config directories to the system classpath by putting them in the
>>>>>>> server
>>>>>>> start up script. But I would like to avoid that if possible.
>>>>>>>
>>>>>>>
>>>>>>> jacques.le.roux wrote:
>>>>>>>> Having seen this post later, I answered on dev ML with an
>>>>>>>> explanation
>>>>>>>> why
>>>>>>>> such posts should only go here
>>>>>>>>
>>>>>>>> Jacques
>>>>>>>>
>>>>>>>> From: "Ritesh Trivedi" <ri...@gmail.com>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> I am trying to call Ofbiz Service from java using
>>>>>>>>> RequestHandler.runEvent
>>>>>>>>> directly from the java code. While calling simple method based
>>>>>>>>> service,
>>>>>>>>> I
>>>>>>>>> get file not found exception for the xml file containing the
>>>>>>>>> simple
>>>>>>>>> method.
>>>>>>>>> Seems like the classloader being used does not have
>>>>>>>>> ofbiz-component.xml
>>>>>>>>> specific classpaths. Any idea on which classloader to use while
>>>>>>>>> calling
>>>>>>>>> services from java and/or how to add those classpaths to the
>>>>>>>>> current
>>>>>>>>> classloader and have that classloader passed so that service
>>>>>>>>> executes
>>>>>>>>> correctly?
>>>>>>>>> -- 
>>>>>>>>> View this message in context:
>>>>>>>>> http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18744345.html
>>>>>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>>>>>>
>>>>>>
>>>>
>>>
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18760602.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: ofbiz-component.xml classpath values - classloader

Posted by Adrian Crum <ad...@hlmksw.com>.
Are you sure the googleCheckout component is loaded? You might have to 
add it to the component-load.xml file.

-Adrian

Ritesh Trivedi wrote:
> For the sake of trying, I just tried calling the service transmitRequest from
> googleCheckout services using LocalDispatcher.runSync directly and I get the
> same exception as calling RequestHandler.runEvent
> 
> 2008-07-31 10:59:52,058 (http-8443-2) [       CheckoutPage.java:452:ERROR]
> Error
>  processing google checkout org.ofbiz.service.GenericServiceException: Error
> run
> ning simple method [transmitRequest] in XML file
> [org/ofbiz/googleCheckout/Prepa
> reXMLTemplate.xml]:  (Could not find SimpleMethod XML document in resource:
> org/
> ofbiz/googleCheckout/PrepareXMLTemplate.xml)
> org.ofbiz.service.GenericServiceException: Error running simple method
> [transmit
> Request] in XML file [org/ofbiz/googleCheckout/PrepareXMLTemplate.xml]: 
> (Could
> not find SimpleMethod XML document in resource:
> org/ofbiz/googleCheckout/Prepare
> XMLTemplate.xml)
>         at
> org.ofbiz.minilang.SimpleServiceEngine.serviceInvoker(SimpleServiceEn
> gine.java:81)
>         at
> org.ofbiz.minilang.SimpleServiceEngine.runSync(SimpleServiceEngine.ja
> va:51)
>         at
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:38
> 4)
>         at
> org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:21
> 3)
>         at
> org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:14
> 9)
>         at
> com.neobits.web.pages.CheckoutPage.processGoogleCheckout(CheckoutPage
> .java:438)
> 
> 
> 
> Ritesh Trivedi wrote:
>> Because service events are handled differently than calling service
>> directly.
>>
>> ServiceEventHandler constructs the context out of the request params which
>> wont happen if I call the service through the dispatcher directly.
>>
>>
>> Adrian Crum wrote:
>>> Why can't you use the dispatcher? Why do you require 
>>> RequestHandler.runEvent?
>>>
>>> -Adrian
>>>
>>> Ritesh Trivedi wrote:
>>>> Here is what I had in my post
>>>>> my java code is
>>>>> running in the same container (Tomcat) as the ofbiz infact its an ofbiz
>>>>> application vs the pointer you gave is standalone
>>>> How do I not have the benefit of ofbiz container? Again as I mentioned,
>>>> my
>>>> application is running as ofbiz component - the only thing is I am
>>>> trying to
>>>> call the service EVENT directly.
>>>>
>>>>
>>>> BJ Freeman wrote:
>>>>> you can look at start.java to see about class paths.
>>>>> once you outside ofbiz you don't have the benefit of the ofbiz
>>>>> container.
>>>>> also  googleCheckout calls ofbiz specific components,webapp, widgets.
>>>>>
>>>>> so basically you would have to re-invent framework to use the
>>>>> googleCheckout.
>>>>>
>>>>>
>>>>>
>>>>> Ritesh Trivedi sent the following on 7/31/2008 10:18 AM:
>>>>>> JLR thanks for the response.
>>>>>>
>>>>>> I looked at GenerateContainer.java which has geronimo and wasce
>>>>>> specific
>>>>>> things you mentioned. Problem is, if I understand correctly, my java
>>>>>> code
>>>>>> is
>>>>>> running in the same container (Tomcat) as the ofbiz infact its an
>>>>>> ofbiz
>>>>>> application vs the pointer you gave is standalone - which makes it
>>>>>> easier
>>>>>> to
>>>>>> find and load things. I need RequestHandler.runEvent and chain of
>>>>>> calls
>>>>>> need
>>>>>> to be able load the correct classloader or have it "add" certain paths
>>>>>> which
>>>>>> I Can specify at runtime
>>>>>> (ofbiz.home/specialpurpose/googleCheckout/scripts
>>>>>> and ofbiz.home/specialpurpose/googleCheckout/config). Adding to the
>>>>>> system
>>>>>> classpath at runtime is not helping since  System classloader does not
>>>>>> re-read the system class path it seems.
>>>>>>
>>>>>> What I fail to understand though is that I am calling 
>>>>>> RequestHandler.runEvent() from my java code - which is similar to how
>>>>>> requesthandler calls to handle events, not sure if some how webapp
>>>>>> (ofbiz
>>>>>> component) specific classloader gets loaded from somewhere which has
>>>>>> the
>>>>>> correct classpath corresponding to the classpath tags in the
>>>>>> ofbiz-component.xml file while executing the simple service.
>>>>>>
>>>>>> The only option I can see at this point is to add
>>>>>> googleCheckout/scripts
>>>>>> and
>>>>>> config directories to the system classpath by putting them in the
>>>>>> server
>>>>>> start up script. But I would like to avoid that if possible.
>>>>>>
>>>>>>
>>>>>> jacques.le.roux wrote:
>>>>>>> Having seen this post later, I answered on dev ML with an explanation
>>>>>>> why
>>>>>>> such posts should only go here
>>>>>>>
>>>>>>> Jacques
>>>>>>>
>>>>>>> From: "Ritesh Trivedi" <ri...@gmail.com>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I am trying to call Ofbiz Service from java using
>>>>>>>> RequestHandler.runEvent
>>>>>>>> directly from the java code. While calling simple method based
>>>>>>>> service,
>>>>>>>> I
>>>>>>>> get file not found exception for the xml file containing the simple
>>>>>>>> method.
>>>>>>>> Seems like the classloader being used does not have
>>>>>>>> ofbiz-component.xml
>>>>>>>> specific classpaths. Any idea on which classloader to use while
>>>>>>>> calling
>>>>>>>> services from java and/or how to add those classpaths to the current
>>>>>>>> classloader and have that classloader passed so that service
>>>>>>>> executes
>>>>>>>> correctly?
>>>>>>>> -- 
>>>>>>>> View this message in context:
>>>>>>>> http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18744345.html
>>>>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>>>>>
>>>>>
>>>
>>
> 

Re: ofbiz-component.xml classpath values - classloader

Posted by Ritesh Trivedi <ri...@gmail.com>.
For the sake of trying, I just tried calling the service transmitRequest from
googleCheckout services using LocalDispatcher.runSync directly and I get the
same exception as calling RequestHandler.runEvent

2008-07-31 10:59:52,058 (http-8443-2) [       CheckoutPage.java:452:ERROR]
Error
 processing google checkout org.ofbiz.service.GenericServiceException: Error
run
ning simple method [transmitRequest] in XML file
[org/ofbiz/googleCheckout/Prepa
reXMLTemplate.xml]:  (Could not find SimpleMethod XML document in resource:
org/
ofbiz/googleCheckout/PrepareXMLTemplate.xml)
org.ofbiz.service.GenericServiceException: Error running simple method
[transmit
Request] in XML file [org/ofbiz/googleCheckout/PrepareXMLTemplate.xml]: 
(Could
not find SimpleMethod XML document in resource:
org/ofbiz/googleCheckout/Prepare
XMLTemplate.xml)
        at
org.ofbiz.minilang.SimpleServiceEngine.serviceInvoker(SimpleServiceEn
gine.java:81)
        at
org.ofbiz.minilang.SimpleServiceEngine.runSync(SimpleServiceEngine.ja
va:51)
        at
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:38
4)
        at
org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:21
3)
        at
org.ofbiz.service.GenericDispatcher.runSync(GenericDispatcher.java:14
9)
        at
com.neobits.web.pages.CheckoutPage.processGoogleCheckout(CheckoutPage
.java:438)



Ritesh Trivedi wrote:
> 
> Because service events are handled differently than calling service
> directly.
> 
> ServiceEventHandler constructs the context out of the request params which
> wont happen if I call the service through the dispatcher directly.
> 
> 
> Adrian Crum wrote:
>> 
>> Why can't you use the dispatcher? Why do you require 
>> RequestHandler.runEvent?
>> 
>> -Adrian
>> 
>> Ritesh Trivedi wrote:
>>> Here is what I had in my post
>>>> my java code is
>>>> running in the same container (Tomcat) as the ofbiz infact its an ofbiz
>>>> application vs the pointer you gave is standalone
>>> 
>>> How do I not have the benefit of ofbiz container? Again as I mentioned,
>>> my
>>> application is running as ofbiz component - the only thing is I am
>>> trying to
>>> call the service EVENT directly.
>>> 
>>> 
>>> BJ Freeman wrote:
>>>> you can look at start.java to see about class paths.
>>>> once you outside ofbiz you don't have the benefit of the ofbiz
>>>> container.
>>>> also  googleCheckout calls ofbiz specific components,webapp, widgets.
>>>>
>>>> so basically you would have to re-invent framework to use the
>>>> googleCheckout.
>>>>
>>>>
>>>>
>>>> Ritesh Trivedi sent the following on 7/31/2008 10:18 AM:
>>>>> JLR thanks for the response.
>>>>>
>>>>> I looked at GenerateContainer.java which has geronimo and wasce
>>>>> specific
>>>>> things you mentioned. Problem is, if I understand correctly, my java
>>>>> code
>>>>> is
>>>>> running in the same container (Tomcat) as the ofbiz infact its an
>>>>> ofbiz
>>>>> application vs the pointer you gave is standalone - which makes it
>>>>> easier
>>>>> to
>>>>> find and load things. I need RequestHandler.runEvent and chain of
>>>>> calls
>>>>> need
>>>>> to be able load the correct classloader or have it "add" certain paths
>>>>> which
>>>>> I Can specify at runtime
>>>>> (ofbiz.home/specialpurpose/googleCheckout/scripts
>>>>> and ofbiz.home/specialpurpose/googleCheckout/config). Adding to the
>>>>> system
>>>>> classpath at runtime is not helping since  System classloader does not
>>>>> re-read the system class path it seems.
>>>>>
>>>>> What I fail to understand though is that I am calling 
>>>>> RequestHandler.runEvent() from my java code - which is similar to how
>>>>> requesthandler calls to handle events, not sure if some how webapp
>>>>> (ofbiz
>>>>> component) specific classloader gets loaded from somewhere which has
>>>>> the
>>>>> correct classpath corresponding to the classpath tags in the
>>>>> ofbiz-component.xml file while executing the simple service.
>>>>>
>>>>> The only option I can see at this point is to add
>>>>> googleCheckout/scripts
>>>>> and
>>>>> config directories to the system classpath by putting them in the
>>>>> server
>>>>> start up script. But I would like to avoid that if possible.
>>>>>
>>>>>
>>>>> jacques.le.roux wrote:
>>>>>> Having seen this post later, I answered on dev ML with an explanation
>>>>>> why
>>>>>> such posts should only go here
>>>>>>
>>>>>> Jacques
>>>>>>
>>>>>> From: "Ritesh Trivedi" <ri...@gmail.com>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I am trying to call Ofbiz Service from java using
>>>>>>> RequestHandler.runEvent
>>>>>>> directly from the java code. While calling simple method based
>>>>>>> service,
>>>>>>> I
>>>>>>> get file not found exception for the xml file containing the simple
>>>>>>> method.
>>>>>>> Seems like the classloader being used does not have
>>>>>>> ofbiz-component.xml
>>>>>>> specific classpaths. Any idea on which classloader to use while
>>>>>>> calling
>>>>>>> services from java and/or how to add those classpaths to the current
>>>>>>> classloader and have that classloader passed so that service
>>>>>>> executes
>>>>>>> correctly?
>>>>>>> -- 
>>>>>>> View this message in context:
>>>>>>> http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18744345.html
>>>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>>>>
>>>>
>>>>
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18760259.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: ofbiz-component.xml classpath values - classloader

Posted by Ritesh Trivedi <ri...@gmail.com>.
Because service events are handled differently than calling service directly.

ServiceEventHandler constructs the context out of the request params which
wont happen if I call the service though the dispatcher directly.


Adrian Crum wrote:
> 
> Why can't you use the dispatcher? Why do you require 
> RequestHandler.runEvent?
> 
> -Adrian
> 
> Ritesh Trivedi wrote:
>> Here is what I had in my post
>>> my java code is
>>> running in the same container (Tomcat) as the ofbiz infact its an ofbiz
>>> application vs the pointer you gave is standalone
>> 
>> How do I not have the benefit of ofbiz container? Again as I mentioned,
>> my
>> application is running as ofbiz component - the only thing is I am trying
>> to
>> call the service EVENT directly.
>> 
>> 
>> BJ Freeman wrote:
>>> you can look at start.java to see about class paths.
>>> once you outside ofbiz you don't have the benefit of the ofbiz
>>> container.
>>> also  googleCheckout calls ofbiz specific components,webapp, widgets.
>>>
>>> so basically you would have to re-invent framework to use the
>>> googleCheckout.
>>>
>>>
>>>
>>> Ritesh Trivedi sent the following on 7/31/2008 10:18 AM:
>>>> JLR thanks for the response.
>>>>
>>>> I looked at GenerateContainer.java which has geronimo and wasce
>>>> specific
>>>> things you mentioned. Problem is, if I understand correctly, my java
>>>> code
>>>> is
>>>> running in the same container (Tomcat) as the ofbiz infact its an ofbiz
>>>> application vs the pointer you gave is standalone - which makes it
>>>> easier
>>>> to
>>>> find and load things. I need RequestHandler.runEvent and chain of calls
>>>> need
>>>> to be able load the correct classloader or have it "add" certain paths
>>>> which
>>>> I Can specify at runtime
>>>> (ofbiz.home/specialpurpose/googleCheckout/scripts
>>>> and ofbiz.home/specialpurpose/googleCheckout/config). Adding to the
>>>> system
>>>> classpath at runtime is not helping since  System classloader does not
>>>> re-read the system class path it seems.
>>>>
>>>> What I fail to understand though is that I am calling 
>>>> RequestHandler.runEvent() from my java code - which is similar to how
>>>> requesthandler calls to handle events, not sure if some how webapp
>>>> (ofbiz
>>>> component) specific classloader gets loaded from somewhere which has
>>>> the
>>>> correct classpath corresponding to the classpath tags in the
>>>> ofbiz-component.xml file while executing the simple service.
>>>>
>>>> The only option I can see at this point is to add
>>>> googleCheckout/scripts
>>>> and
>>>> config directories to the system classpath by putting them in the
>>>> server
>>>> start up script. But I would like to avoid that if possible.
>>>>
>>>>
>>>> jacques.le.roux wrote:
>>>>> Having seen this post later, I answered on dev ML with an explanation
>>>>> why
>>>>> such posts should only go here
>>>>>
>>>>> Jacques
>>>>>
>>>>> From: "Ritesh Trivedi" <ri...@gmail.com>
>>>>>> Hi,
>>>>>>
>>>>>> I am trying to call Ofbiz Service from java using
>>>>>> RequestHandler.runEvent
>>>>>> directly from the java code. While calling simple method based
>>>>>> service,
>>>>>> I
>>>>>> get file not found exception for the xml file containing the simple
>>>>>> method.
>>>>>> Seems like the classloader being used does not have
>>>>>> ofbiz-component.xml
>>>>>> specific classpaths. Any idea on which classloader to use while
>>>>>> calling
>>>>>> services from java and/or how to add those classpaths to the current
>>>>>> classloader and have that classloader passed so that service executes
>>>>>> correctly?
>>>>>> -- 
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18744345.html
>>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>>>
>>>
>>>
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18759990.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: ofbiz-component.xml classpath values - classloader

Posted by Adrian Crum <ad...@hlmksw.com>.
Why can't you use the dispatcher? Why do you require 
RequestHandler.runEvent?

-Adrian

Ritesh Trivedi wrote:
> Here is what I had in my post
>> my java code is
>> running in the same container (Tomcat) as the ofbiz infact its an ofbiz
>> application vs the pointer you gave is standalone
> 
> How do I not have the benefit of ofbiz container? Again as I mentioned, my
> application is running as ofbiz component - the only thing is I am trying to
> call the service EVENT directly.
> 
> 
> BJ Freeman wrote:
>> you can look at start.java to see about class paths.
>> once you outside ofbiz you don't have the benefit of the ofbiz container.
>> also  googleCheckout calls ofbiz specific components,webapp, widgets.
>>
>> so basically you would have to re-invent framework to use the
>> googleCheckout.
>>
>>
>>
>> Ritesh Trivedi sent the following on 7/31/2008 10:18 AM:
>>> JLR thanks for the response.
>>>
>>> I looked at GenerateContainer.java which has geronimo and wasce specific
>>> things you mentioned. Problem is, if I understand correctly, my java code
>>> is
>>> running in the same container (Tomcat) as the ofbiz infact its an ofbiz
>>> application vs the pointer you gave is standalone - which makes it easier
>>> to
>>> find and load things. I need RequestHandler.runEvent and chain of calls
>>> need
>>> to be able load the correct classloader or have it "add" certain paths
>>> which
>>> I Can specify at runtime
>>> (ofbiz.home/specialpurpose/googleCheckout/scripts
>>> and ofbiz.home/specialpurpose/googleCheckout/config). Adding to the
>>> system
>>> classpath at runtime is not helping since  System classloader does not
>>> re-read the system class path it seems.
>>>
>>> What I fail to understand though is that I am calling 
>>> RequestHandler.runEvent() from my java code - which is similar to how
>>> requesthandler calls to handle events, not sure if some how webapp (ofbiz
>>> component) specific classloader gets loaded from somewhere which has the
>>> correct classpath corresponding to the classpath tags in the
>>> ofbiz-component.xml file while executing the simple service.
>>>
>>> The only option I can see at this point is to add googleCheckout/scripts
>>> and
>>> config directories to the system classpath by putting them in the server
>>> start up script. But I would like to avoid that if possible.
>>>
>>>
>>> jacques.le.roux wrote:
>>>> Having seen this post later, I answered on dev ML with an explanation
>>>> why
>>>> such posts should only go here
>>>>
>>>> Jacques
>>>>
>>>> From: "Ritesh Trivedi" <ri...@gmail.com>
>>>>> Hi,
>>>>>
>>>>> I am trying to call Ofbiz Service from java using
>>>>> RequestHandler.runEvent
>>>>> directly from the java code. While calling simple method based service,
>>>>> I
>>>>> get file not found exception for the xml file containing the simple
>>>>> method.
>>>>> Seems like the classloader being used does not have ofbiz-component.xml
>>>>> specific classpaths. Any idea on which classloader to use while calling
>>>>> services from java and/or how to add those classpaths to the current
>>>>> classloader and have that classloader passed so that service executes
>>>>> correctly?
>>>>> -- 
>>>>> View this message in context:
>>>>> http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18744345.html
>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>>
>>
>>
> 

Re: ofbiz-component.xml classpath values - classloader

Posted by BJ Freeman <bj...@free-man.net>.
apologized. did not recognize you were in the ofbiz container.
the best way to call and event is through the controller.
    <request-map uri="login">
        <security https="true" auth="false"/>
        <event type="java"
path="org.ofbiz.securityext.login.LoginEvents" invoke="storeLogin"/>
        <response name="success" type="view" value="main"/>
        <response name="requirePasswordChange" type="view"
value="requirePasswordChange"/>
        <response name="error" type="view" value="login"/>
    </request-map>


Ritesh Trivedi sent the following on 7/31/2008 10:39 AM:
> Here is what I had the post
>> my java code is
>> running in the same container (Tomcat) as the ofbiz infact its an ofbiz
>> application vs the pointer you gave is standalone
> 
> How do I not have the benefit of ofbiz container? Again as I mentioned, my
> application is running as ofbiz component - the only thing is I am trying to
> call the service EVENT directly.
> 
> 
> BJ Freeman wrote:
>> you can look at start.java to see about class paths.
>> once you outside ofbiz you don't have the benefit of the ofbiz container.
>> also  googleCheckout calls ofbiz specific components,webapp, widgets.
>>
>> so basically you would have to re-invent framework to use the
>> googleCheckout.
>>
>>
>>
>> Ritesh Trivedi sent the following on 7/31/2008 10:18 AM:
>>> JLR thanks for the response.
>>>
>>> I looked at GenerateContainer.java which has geronimo and wasce specific
>>> things you mentioned. Problem is, if I understand correctly, my java code
>>> is
>>> running in the same container (Tomcat) as the ofbiz infact its an ofbiz
>>> application vs the pointer you gave is standalone - which makes it easier
>>> to
>>> find and load things. I need RequestHandler.runEvent and chain of calls
>>> need
>>> to be able load the correct classloader or have it "add" certain paths
>>> which
>>> I Can specify at runtime
>>> (ofbiz.home/specialpurpose/googleCheckout/scripts
>>> and ofbiz.home/specialpurpose/googleCheckout/config). Adding to the
>>> system
>>> classpath at runtime is not helping since  System classloader does not
>>> re-read the system class path it seems.
>>>
>>> What I fail to understand though is that I am calling 
>>> RequestHandler.runEvent() from my java code - which is similar to how
>>> requesthandler calls to handle events, not sure if some how webapp (ofbiz
>>> component) specific classloader gets loaded from somewhere which has the
>>> correct classpath corresponding to the classpath tags in the
>>> ofbiz-component.xml file while executing the simple service.
>>>
>>> The only option I can see at this point is to add googleCheckout/scripts
>>> and
>>> config directories to the system classpath by putting them in the server
>>> start up script. But I would like to avoid that if possible.
>>>
>>>
>>> jacques.le.roux wrote:
>>>> Having seen this post later, I answered on dev ML with an explanation
>>>> why
>>>> such posts should only go here
>>>>
>>>> Jacques
>>>>
>>>> From: "Ritesh Trivedi" <ri...@gmail.com>
>>>>> Hi,
>>>>>
>>>>> I am trying to call Ofbiz Service from java using
>>>>> RequestHandler.runEvent
>>>>> directly from the java code. While calling simple method based service,
>>>>> I
>>>>> get file not found exception for the xml file containing the simple
>>>>> method.
>>>>> Seems like the classloader being used does not have ofbiz-component.xml
>>>>> specific classpaths. Any idea on which classloader to use while calling
>>>>> services from java and/or how to add those classpaths to the current
>>>>> classloader and have that classloader passed so that service executes
>>>>> correctly?
>>>>> -- 
>>>>> View this message in context:
>>>>> http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18744345.html
>>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>>
>>
>>
> 


Re: ofbiz-component.xml classpath values - classloader

Posted by Ritesh Trivedi <ri...@gmail.com>.
Here is what I had the post
> my java code is
> running in the same container (Tomcat) as the ofbiz infact its an ofbiz
> application vs the pointer you gave is standalone

How do I not have the benefit of ofbiz container? Again as I mentioned, my
application is running as ofbiz component - the only thing is I am trying to
call the service EVENT directly.


BJ Freeman wrote:
> 
> you can look at start.java to see about class paths.
> once you outside ofbiz you don't have the benefit of the ofbiz container.
> also  googleCheckout calls ofbiz specific components,webapp, widgets.
> 
> so basically you would have to re-invent framework to use the
> googleCheckout.
> 
> 
> 
> Ritesh Trivedi sent the following on 7/31/2008 10:18 AM:
>> JLR thanks for the response.
>> 
>> I looked at GenerateContainer.java which has geronimo and wasce specific
>> things you mentioned. Problem is, if I understand correctly, my java code
>> is
>> running in the same container (Tomcat) as the ofbiz infact its an ofbiz
>> application vs the pointer you gave is standalone - which makes it easier
>> to
>> find and load things. I need RequestHandler.runEvent and chain of calls
>> need
>> to be able load the correct classloader or have it "add" certain paths
>> which
>> I Can specify at runtime
>> (ofbiz.home/specialpurpose/googleCheckout/scripts
>> and ofbiz.home/specialpurpose/googleCheckout/config). Adding to the
>> system
>> classpath at runtime is not helping since  System classloader does not
>> re-read the system class path it seems.
>> 
>> What I fail to understand though is that I am calling 
>> RequestHandler.runEvent() from my java code - which is similar to how
>> requesthandler calls to handle events, not sure if some how webapp (ofbiz
>> component) specific classloader gets loaded from somewhere which has the
>> correct classpath corresponding to the classpath tags in the
>> ofbiz-component.xml file while executing the simple service.
>> 
>> The only option I can see at this point is to add googleCheckout/scripts
>> and
>> config directories to the system classpath by putting them in the server
>> start up script. But I would like to avoid that if possible.
>> 
>> 
>> jacques.le.roux wrote:
>>> Having seen this post later, I answered on dev ML with an explanation
>>> why
>>> such posts should only go here
>>>
>>> Jacques
>>>
>>> From: "Ritesh Trivedi" <ri...@gmail.com>
>>>> Hi,
>>>>
>>>> I am trying to call Ofbiz Service from java using
>>>> RequestHandler.runEvent
>>>> directly from the java code. While calling simple method based service,
>>>> I
>>>> get file not found exception for the xml file containing the simple
>>>> method.
>>>> Seems like the classloader being used does not have ofbiz-component.xml
>>>> specific classpaths. Any idea on which classloader to use while calling
>>>> services from java and/or how to add those classpaths to the current
>>>> classloader and have that classloader passed so that service executes
>>>> correctly?
>>>> -- 
>>>> View this message in context:
>>>> http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18744345.html
>>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>>
>>>
>> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18759776.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: ofbiz-component.xml classpath values - classloader

Posted by BJ Freeman <bj...@free-man.net>.
you can look at start.java to see about class paths.
once you outside ofbiz you don't have the benefit of the ofbiz container.
also  googleCheckout calls ofbiz specific components,webapp, widgets.

so basically you would have to re-invent framework to use the
googleCheckout.



Ritesh Trivedi sent the following on 7/31/2008 10:18 AM:
> JLR thanks for the response.
> 
> I looked at GenerateContainer.java which has geronimo and wasce specific
> things you mentioned. Problem is, if I understand correctly, my java code is
> running in the same container (Tomcat) as the ofbiz infact its an ofbiz
> application vs the pointer you gave is standalone - which makes it easier to
> find and load things. I need RequestHandler.runEvent and chain of calls need
> to be able load the correct classloader or have it "add" certain paths which
> I Can specify at runtime (ofbiz.home/specialpurpose/googleCheckout/scripts
> and ofbiz.home/specialpurpose/googleCheckout/config). Adding to the system
> classpath at runtime is not helping since  System classloader does not
> re-read the system class path it seems.
> 
> What I fail to understand though is that I am calling 
> RequestHandler.runEvent() from my java code - which is similar to how
> requesthandler calls to handle events, not sure if some how webapp (ofbiz
> component) specific classloader gets loaded from somewhere which has the
> correct classpath corresponding to the classpath tags in the
> ofbiz-component.xml file while executing the simple service.
> 
> The only option I can see at this point is to add googleCheckout/scripts and
> config directories to the system classpath by putting them in the server
> start up script. But I would like to avoid that if possible.
> 
> 
> jacques.le.roux wrote:
>> Having seen this post later, I answered on dev ML with an explanation why
>> such posts should only go here
>>
>> Jacques
>>
>> From: "Ritesh Trivedi" <ri...@gmail.com>
>>> Hi,
>>>
>>> I am trying to call Ofbiz Service from java using RequestHandler.runEvent
>>> directly from the java code. While calling simple method based service, I
>>> get file not found exception for the xml file containing the simple
>>> method.
>>> Seems like the classloader being used does not have ofbiz-component.xml
>>> specific classpaths. Any idea on which classloader to use while calling
>>> services from java and/or how to add those classpaths to the current
>>> classloader and have that classloader passed so that service executes
>>> correctly?
>>> -- 
>>> View this message in context:
>>> http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18744345.html
>>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>>
>>
> 


Re: ofbiz-component.xml classpath values - classloader

Posted by Ritesh Trivedi <ri...@gmail.com>.
JLR thanks for the response.

I looked at GenerateContainer.java which has geronimo and wasce specific
things you mentioned. Problem is, if I understand correctly, my java code is
running in the same container (Tomcat) as the ofbiz infact its an ofbiz
application vs the pointer you gave is standalone - which makes it easier to
find and load things. I need RequestHandler.runEvent and chain of calls need
to be able load the correct classloader or have it "add" certain paths which
I Can specify at runtime (ofbiz.home/specialpurpose/googleCheckout/scripts
and ofbiz.home/specialpurpose/googleCheckout/config). Adding to the system
classpath at runtime is not helping since  System classloader does not
re-read the system class path it seems.

What I fail to understand though is that I am calling 
RequestHandler.runEvent() from my java code - which is similar to how
requesthandler calls to handle events, not sure if some how webapp (ofbiz
component) specific classloader gets loaded from somewhere which has the
correct classpath corresponding to the classpath tags in the
ofbiz-component.xml file while executing the simple service.

The only option I can see at this point is to add googleCheckout/scripts and
config directories to the system classpath by putting them in the server
start up script. But I would like to avoid that if possible.


jacques.le.roux wrote:
> 
> Having seen this post later, I answered on dev ML with an explanation why
> such posts should only go here
> 
> Jacques
> 
> From: "Ritesh Trivedi" <ri...@gmail.com>
>> 
>> Hi,
>> 
>> I am trying to call Ofbiz Service from java using RequestHandler.runEvent
>> directly from the java code. While calling simple method based service, I
>> get file not found exception for the xml file containing the simple
>> method.
>> Seems like the classloader being used does not have ofbiz-component.xml
>> specific classpaths. Any idea on which classloader to use while calling
>> services from java and/or how to add those classpaths to the current
>> classloader and have that classloader passed so that service executes
>> correctly?
>> -- 
>> View this message in context:
>> http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18744345.html
>> Sent from the OFBiz - User mailing list archive at Nabble.com.
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18759337.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: ofbiz-component.xml classpath values - classloader

Posted by Jacques Le Roux <ja...@les7arts.com>.
Having seen this post later, I answered on dev ML with an explanation why such posts should only go here

Jacques

From: "Ritesh Trivedi" <ri...@gmail.com>
> 
> Hi,
> 
> I am trying to call Ofbiz Service from java using RequestHandler.runEvent
> directly from the java code. While calling simple method based service, I
> get file not found exception for the xml file containing the simple method.
> Seems like the classloader being used does not have ofbiz-component.xml
> specific classpaths. Any idea on which classloader to use while calling
> services from java and/or how to add those classpaths to the current
> classloader and have that classloader passed so that service executes
> correctly?
> -- 
> View this message in context: http://www.nabble.com/ofbiz-component.xml-classpath-values---classloader-tp18744345p18744345.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>