Bsh Error

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

Bsh Error

su2
I have saved bshcontainer.bsh file in C:\workspace\ofbiz
I am trying to run  
 
source("bshcontainer.bsh");
 
result = dispatcher.runSync("createHelloPerson", UtilMisc.toMap("firstName", "Si" , "lastName", "Chen", "comments", "Will it work this time?"));
 
I am getting following error.
 
Error:
Target exception: org.ofbiz.service.GenericSericeException: Cannot locate serivce by name (createHelloPerson)

services.xml
****************************
<?xml version="1.0" encoding="UTF-8" ?>
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/services.xsd">
    <description>Hello 3 Services</description>
   
   
    <service name="createHelloPerson" engine="java"
    location="org.ofbiz.hello3.Hello3Services" invoke="createHelloPerson">
    <description>Create a HelloPerson</description>
    <auto-attributes mode="IN" entity-name="HelloPerson" include="nonpk" optional="true"/>
    <attribute name="helloPersonId" mode="OUT" type="string" optional="false"/>
    </service>     
   
       
    <service name="createHelloPersonHobby" engine="simple"
    location="org/ofbiz/hello3/Hello3Services.xml" invoke="createHelloPersonHobby">
    <description>Create a HelloPersonHobby which links a person and a hobby. </description>
    <auto-attributes mode="IN" entity-name="HelloPersonHobby" include="pk" optional="false"/>
    </service>   
</services>   

****************************
Reply | Threaded
Open this post in threaded view
|

Re: Bsh Error

Scott Gray-2
Make sure the services.xml file is declared in the ofbiz-component.xml  
file of the application, look at other ofbiz-component.xml files for  
examples.

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 9/07/2009, at 1:13 PM, su2 wrote:

>
> I have saved bshcontainer.bsh file in C:\workspace\ofbiz
> I am trying to run
>
> source("bshcontainer.bsh");
>
> result = dispatcher.runSync("createHelloPerson",  
> UtilMisc.toMap("firstName",
> "Si" , "lastName", "Chen", "comments", "Will it work this time?"));
>
> I am getting following error.
>
> Error:
> Target exception: org.ofbiz.service.GenericSericeException: Cannot  
> locate
> serivce by name (createHelloPerson)
>
> services.xml
> ****************************
> <?xml version="1.0" encoding="UTF-8" ?>
> <services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/ 
> services.xsd">
>    <description>Hello 3 Services</description>
>
>    <!-- This will be implemented in JAVA -->
>    <service name="createHelloPerson" engine="java"
>     location="org.ofbiz.hello3.Hello3Services"  
> invoke="createHelloPerson">
>     <description>Create a HelloPerson</description>
>     <auto-attributes mode="IN" entity-name="HelloPerson"  
> include="nonpk"
> optional="true"/>
>     <attribute name="helloPersonId" mode="OUT" type="string"
> optional="false"/>
>    </service>
>
>    <!-- This will be implemented in OfBiz minilang -->
>    <service name="createHelloPersonHobby" engine="simple"
>     location="org/ofbiz/hello3/Hello3Services.xml"
> invoke="createHelloPersonHobby">
>     <description>Create a HelloPersonHobby which links a person and a
> hobby. </description>
>     <auto-attributes mode="IN" entity-name="HelloPersonHobby"  
> include="pk"
> optional="false"/>
>    </service>
> </services>
>
> ****************************
>
> --
> View this message in context: http://www.nabble.com/Bsh-Error-tp24402213p24402213.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Bsh Error

BJ Freeman
In reply to this post by su2
to keep consistency and to learn correctly
I suggest you put this in scripts folder.
you can follow other examples as to the full path.
then put it in the ofbiz-component.xml in the hot-deploy folder,
following the examples in other folders.

su2 sent the following on 7/8/2009 6:13 PM:

> I have saved bshcontainer.bsh file in C:\workspace\ofbiz
> I am trying to run  
>  
> source("bshcontainer.bsh");
>  
> result = dispatcher.runSync("createHelloPerson", UtilMisc.toMap("firstName",
> "Si" , "lastName", "Chen", "comments", "Will it work this time?"));
>  
> I am getting following error.
>  
> Error:
> Target exception: org.ofbiz.service.GenericSericeException: Cannot locate
> serivce by name (createHelloPerson)
>
> services.xml
> ****************************
> <?xml version="1.0" encoding="UTF-8" ?>
> <services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/services.xsd">
>     <description>Hello 3 Services</description>
>    
>     <!-- This will be implemented in JAVA -->
>     <service name="createHelloPerson" engine="java"
>     location="org.ofbiz.hello3.Hello3Services" invoke="createHelloPerson">
>     <description>Create a HelloPerson</description>
>     <auto-attributes mode="IN" entity-name="HelloPerson" include="nonpk"
> optional="true"/>
>     <attribute name="helloPersonId" mode="OUT" type="string"
> optional="false"/>
>     </service>      
>    
>     <!-- This will be implemented in OfBiz minilang -->  
>     <service name="createHelloPersonHobby" engine="simple"
>     location="org/ofbiz/hello3/Hello3Services.xml"
> invoke="createHelloPersonHobby">
>     <description>Create a HelloPersonHobby which links a person and a
> hobby. </description>
>     <auto-attributes mode="IN" entity-name="HelloPersonHobby" include="pk"
> optional="false"/>
>     </service>    
> </services>    
>
> ****************************
>

--
BJ Freeman
http://www.businessesnetwork.com/automation
http://bjfreeman.elance.com
http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
Systems Integrator.

su2
Reply | Threaded
Open this post in threaded view
|

Re: Bsh Error

su2
Hi BJ,

are you suggesting my to place bshcontainer.bsh file in hello3 > Script folder?

I am following party folder and I do not see any .bsh file under party > Script folder/subfolder.

I am following the directory structure of "party" component.



BJ Freeman wrote
to keep consistency and to learn correctly
I suggest you put this in scripts folder.
you can follow other examples as to the full path.
then put it in the ofbiz-component.xml in the hot-deploy folder,
following the examples in other folders.

su2 sent the following on 7/8/2009 6:13 PM:
> I have saved bshcontainer.bsh file in C:\workspace\ofbiz
> I am trying to run  
>  
> source("bshcontainer.bsh");
>  
> result = dispatcher.runSync("createHelloPerson", UtilMisc.toMap("firstName",
> "Si" , "lastName", "Chen", "comments", "Will it work this time?"));
>  
> I am getting following error.
>  
> Error:
> Target exception: org.ofbiz.service.GenericSericeException: Cannot locate
> serivce by name (createHelloPerson)
>
> services.xml
> ****************************
> <?xml version="1.0" encoding="UTF-8" ?>
> <services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>       
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/services.xsd">
>     <description>Hello 3 Services</description>
>    
>    
>     <service name="createHelloPerson" engine="java"
>      location="org.ofbiz.hello3.Hello3Services" invoke="createHelloPerson">
>     <description>Create a HelloPerson</description>
>     <auto-attributes mode="IN" entity-name="HelloPerson" include="nonpk"
> optional="true"/>
>     <attribute name="helloPersonId" mode="OUT" type="string"
> optional="false"/>
>     </service>     
>    
>        
>     <service name="createHelloPersonHobby" engine="simple"
>      location="org/ofbiz/hello3/Hello3Services.xml"
> invoke="createHelloPersonHobby">
>     <description>Create a HelloPersonHobby which links a person and a
> hobby. </description>
>     <auto-attributes mode="IN" entity-name="HelloPersonHobby" include="pk"
> optional="false"/>
>     </service>   
> </services>   
>
> ****************************
>

--
BJ Freeman
http://www.businessesnetwork.com/automation
http://bjfreeman.elance.com
http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
Systems Integrator.
su2
Reply | Threaded
Open this post in threaded view
|

Re: Bsh Error

su2
In reply to this post by Scott Gray-2
Hi Scott,

I do have mentioned services.xml in the ofbiz-component.xml  file.

Following is my ofbiz-component.xml  

************************************************
<?xml version="1.0" encoding="UTF-8"?>

<ofbiz-component name="hello3"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/ofbiz-component.xsd">
    <resource-loader name="main" type="component"/>
    <classpath type="jar" location="build/lib/*"/>
        <classpath type="dir" location="script"/>
    <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/>
        <entity-resource type="group" reader-name="main" loader="main" location="entitydef/entitygroup.xml"/>
    <entity-resource type="data" reader-name="seed" loader="main" location="data/HobbiesData.xml"/>
    <service-resource type="model" loader="main" location="servicedef/services.xml"/>
    <webapp name="hello3"
       title="My Third OFBiz Application"
       server="default-server"
       location="webapp/hello3"
       mount-point="/hello3"
       app-bar-display="false"/>     
</ofbiz-component>


************************************************
Scott Gray-2 wrote
Make sure the services.xml file is declared in the ofbiz-component.xml  
file of the application, look at other ofbiz-component.xml files for  
examples.

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 9/07/2009, at 1:13 PM, su2 wrote:

>
> I have saved bshcontainer.bsh file in C:\workspace\ofbiz
> I am trying to run
>
> source("bshcontainer.bsh");
>
> result = dispatcher.runSync("createHelloPerson",  
> UtilMisc.toMap("firstName",
> "Si" , "lastName", "Chen", "comments", "Will it work this time?"));
>
> I am getting following error.
>
> Error:
> Target exception: org.ofbiz.service.GenericSericeException: Cannot  
> locate
> serivce by name (createHelloPerson)
>
> services.xml
> ****************************
> <?xml version="1.0" encoding="UTF-8" ?>
> <services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/ 
> services.xsd">
>    <description>Hello 3 Services</description>
>
>    
>    <service name="createHelloPerson" engine="java"
>    location="org.ofbiz.hello3.Hello3Services"  
> invoke="createHelloPerson">
>     <description>Create a HelloPerson</description>
>     <auto-attributes mode="IN" entity-name="HelloPerson"  
> include="nonpk"
> optional="true"/>
>     <attribute name="helloPersonId" mode="OUT" type="string"
> optional="false"/>
>    </service>
>
>    
>    <service name="createHelloPersonHobby" engine="simple"
>    location="org/ofbiz/hello3/Hello3Services.xml"
> invoke="createHelloPersonHobby">
>     <description>Create a HelloPersonHobby which links a person and a
> hobby. </description>
>     <auto-attributes mode="IN" entity-name="HelloPersonHobby"  
> include="pk"
> optional="false"/>
>    </service>
> </services>
>
> ****************************
>
> --
> View this message in context: http://www.nabble.com/Bsh-Error-tp24402213p24402213.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>


 
Reply | Threaded
Open this post in threaded view
|

Re: Bsh Error

BJ Freeman
In reply to this post by BJ Freeman
Don't see any bsh files in the root of ofbiz, and if you following party
it would be in the webapp/componnet/web-inf/action.

Normally Bsh files have been used to marshall data for diplaying.
they are in the webapp/componnet/web-inf/action folders. They have the
same name as the ftl.
As bsh, now groovy files have been used in widgets this has not been
followed.
groovy files have been put in a lot of places. Script was a suggestion
since if seem you put in anywhere and was not related to a ftl file.

I don't know the hellowworld3 and don't want to put energy into it,
since it is not part of ofbiz.
I would put energy into the practice code
http://docs.ofbiz.org/display/OFBIZ/OFBiz+Beginners+Development+Guide+Using+Practice+Application+%28Hello+World...%29
if you were to use that, but you would need the trunk or 9.04.
bsh files are not used once you leave ver 4.0

su2 sent the following on 7/9/2009 6:11 AM:

> Hi BJ,
>
> are you suggesting my to place bshcontainer.bsh file in hello3 > Script
> folder?
>
> I am following party folder and I do not see any .bsh file under party >
> Script folder/subfolder.
>
> I am following the directory structure of "party" component.
>
>
>
>
> BJ Freeman wrote:
>> to keep consistency and to learn correctly
>> I suggest you put this in scripts folder.
>> you can follow other examples as to the full path.
>> then put it in the ofbiz-component.xml in the hot-deploy folder,
>> following the examples in other folders.
>>
>> su2 sent the following on 7/8/2009 6:13 PM:
>>> I have saved bshcontainer.bsh file in C:\workspace\ofbiz
>>> I am trying to run  
>>>  
>>> source("bshcontainer.bsh");
>>>  
>>> result = dispatcher.runSync("createHelloPerson",
>>> UtilMisc.toMap("firstName",
>>> "Si" , "lastName", "Chen", "comments", "Will it work this time?"));
>>>  
>>> I am getting following error.
>>>  
>>> Error:
>>> Target exception: org.ofbiz.service.GenericSericeException: Cannot locate
>>> serivce by name (createHelloPerson)
>>>
>>> services.xml
>>> ****************************
>>> <?xml version="1.0" encoding="UTF-8" ?>
>>> <services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>        
>>> xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/services.xsd">
>>>     <description>Hello 3 Services</description>
>>>    
>>>     <!-- This will be implemented in JAVA -->
>>>     <service name="createHelloPerson" engine="java"
>>>     location="org.ofbiz.hello3.Hello3Services"
>>> invoke="createHelloPerson">
>>>     <description>Create a HelloPerson</description>
>>>     <auto-attributes mode="IN" entity-name="HelloPerson"
>>> include="nonpk"
>>> optional="true"/>
>>>     <attribute name="helloPersonId" mode="OUT" type="string"
>>> optional="false"/>
>>>     </service>      
>>>    
>>>     <!-- This will be implemented in OfBiz minilang -->  
>>>     <service name="createHelloPersonHobby" engine="simple"
>>>     location="org/ofbiz/hello3/Hello3Services.xml"
>>> invoke="createHelloPersonHobby">
>>>     <description>Create a HelloPersonHobby which links a person and a
>>> hobby. </description>
>>>     <auto-attributes mode="IN" entity-name="HelloPersonHobby"
>>> include="pk"
>>> optional="false"/>
>>>     </service>    
>>> </services>    
>>>
>>> ****************************
>>>
>> --
>> BJ Freeman
>> http://www.businessesnetwork.com/automation
>> http://bjfreeman.elance.com
>> http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
>> Systems Integrator.
>>
>>
>>
>

--
BJ Freeman
http://www.businessesnetwork.com/automation
http://bjfreeman.elance.com
http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
Systems Integrator.