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? |
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? |
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? > > > > |
Administrator
|
In reply to this post by Ritesh Trivedi
Having seen this post later, I answered on dev ML with an explanation why such posts should only go here
Jacques From: "Ritesh Trivedi" <[hidden email]> > > 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. > |
In reply to this post by BJ Freeman
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.
|
In reply to this post by Jacques Le Roux
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 in this case googleCheckout) 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.
|
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" <[hidden email]> >>> 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. >>> >> > |
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.
|
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" <[hidden email]> >>>>> 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. >>>>> >> >> > |
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.
|
In reply to this post by Ritesh Trivedi
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" <[hidden email]> >>>>> 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. >>>>> >> >> > |
In reply to this post by Ritesh Trivedi
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)
|
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" <[hidden email]> >>>>>>>> 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. >>>>>>>> >>>>> >>> >> > |
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?
|
In Webtools I can see the transmitRequest service and I am able to call it thru the webtools runservice.
|
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" <[hidden email]> >>>>>>>>>>> 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. >>>>>>>>>>> >>> >> > |
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.
|
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" <[hidden email]> >>>>>>>>>>>>> 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. >>>>>>>>>>>>> >> >> > |
Free forum by Nabble | Edit this page |