All things needed are documented in ExampleRemoteClient.java
(cache.properties, other propertie, jars etc).

However the problem was about how to access the fields of
a GenericValue object, i.e. how to 'get inside' a GenericValue.
It was obvious that we have the information available on the client
side (printing out the object showed all), just had problems
about accessing the fields.

Zoltan found out that on the remote client side using the get
method leads you to nowhere, because it would drag way too many ofbiz
things (works with local) to the client side. He also found that the proper
way of getting these is by using the getAllFields, getFields etc. methods
instead.


Regards,
  András


Saturday, February 17, 2007, 6:48:24 PM, you wrote:


> When using certain objects, like the GenericValue object, from OFBiz
> there are a few resources you need. This error message says it can't
> find the cache.properties file, so you need to add that to you  
> application classpath.

> -David


> On Feb 17, 2007, at 10:33 AM, Zoltan Vereczi wrote:

>> Hi,
>>
>> I'm new to Ofbiz...
>> I have a very simple client application based on the
>> org.ofbiz.service.rmi.ExampleRemoteClient, talking to a remote  
>> Offbiz instance.
>> I exported the userLogin service and the service call from the  
>> client app
>> returns successfully.
>> I get the userLogin object from the result map as a GenericValue fine.
>> Next I try to get some fields from the GenericValue which
>> fails with an Exception.
>> As I debugged the client side code I realized that getting a field
>> from the
>> GenericValue involves GenericEntity and GenericDelegator from the  
>> included
>> Ofbiz jars and my call fails as it tries to create a new  
>> GenericDelegator with
>> the name "default" and tries to log this action with  
>> org.ofbiz.base.util.Debug.
>> I get a MissingResourceException: Can't find bundle for base name  
>> cache,
>> locale hu_HU.
>> I guess it's because I don't have a configured Ofbiz instance on  
>> the client
>> side, no configuration files, propertiy files there, only the jars,
>> and I guess I don't have a delegator at all there...
>> Can someone help me what do I have to do to fetch the fields of a  
>> GenericValue
>> returned by a service on the client side?
>> Do I have to setup my client app to use the remote delegator maybe?
>>
>> my code:
>>
>> // call the login service
>> Map result = dispatcher.runSync("userLogin", UtilMisc.toMap 
>> ("login.username",
>>              username, "login.password", password));
>> GenericValue userLogin = (GenericValue) result.get("userLogin");
>> String userLoginId = userLogin.getString("userLoginId");
>>
>>
>> the Exception:
>>
>> Exception in thread "main" java.lang.ExceptionInInitializerError
>>  at org.ofbiz.base.util.Debug.<clinit>(Debug.java:92)
>>  at org.ofbiz.entity.GenericDelegator.getGenericDelegator(
>>   GenericDelegator.java:113)
>>  at
>> org.ofbiz.entity.GenericEntity.getDelegator(GenericEntity.java: 
>> 271)
>>  at org.ofbiz.entity.GenericEntity.getModelEntity 
>> (GenericEntity.java:257)
>>  at org.ofbiz.entity.GenericEntity.get(GenericEntity.java:287)
>>  at
>> org.ofbiz.entity.GenericEntity.getString(GenericEntity.java:543)
>>  at
>> CallCenterAgentSession.checkLogin(CallCenterAgentSession.java:117)
>>  at CallCenterAgentSession.login(CallCenterAgentSession.java:98)
>>  at CallCenterAgent.main(CallCenterAgent.java:27)
>> Caused by: java.util.MissingResourceException:
>>  Can't find bundle for base name cache, locale hu_HU
>>  at
>> java.util.ResourceBundle.throwMissingResourceException(Unknown  
>> Source)
>>  at java.util.ResourceBundle.getBundleImpl(Unknown Source)
>>  at java.util.ResourceBundle.getBundle(Unknown Source)
>>  at org.ofbiz.base.util.cache.UtilCache.setPropertiesParams(
>>   UtilCache.java:217)
>>  at org.ofbiz.base.util.cache.UtilCache.setPropertiesParams(
>>   UtilCache.java:213)
>>  at org.ofbiz.base.util.cache.UtilCache.<init>(UtilCache.java:172)
>>  at
>> org.ofbiz.base.util.UtilProperties.<clinit>(UtilProperties.java: 
>> 53)
>>  ... 9 more
>>
>> Thanks for your help in advance, Zoltan
>>


Reply via email to