Possible bug when changing Locale in org.ofbiz.service.ModelService.makeValid

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

Possible bug when changing Locale in org.ofbiz.service.ModelService.makeValid

Cimballi-2
Hi,

I've just downloaded "opentaps-1.0.1a-all-platforms", and after some
manipulation I have a bug while changing a Locale. Here are some
informations :

org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen
[component://party/widget/partymgr/PartyScreens.xml#findparty]:
java.lang.ClassCastException: java.lang.String (java.lang.String)

2008-08-19 12:11:47,328 (http-0.0.0.0-8443-Processor8) [
ModelScreenWidget.java:363:INFO ] In the include-screen tag the screen
name was empty, ignoring include; in screen [GlobalDecorator]
2008-08-19 12:11:47,343 (http-0.0.0.0-8443-Processor8) [
ControlServlet.java:259:DEBUG] [[[main] Done rendering page, Servlet
Finished- total:0.328,since last([main] Setup done...):0.328]]
2008-08-19 12:11:55,828 (http-0.0.0.0-8443-Processor8) [
ControlServlet.java:93 :INFO ] The character encoding of the request
is: [null]. The character encoding we will use for the request and
response is: [UTF-8]
2008-08-19 12:11:55,828 (http-0.0.0.0-8443-Processor8) [
ControlServlet.java:129:DEBUG] [[[setSessionLocale] Servlet Starting,
doing setup- total:0.0,since last(Begin):0.0]]
2008-08-19 12:11:55,828 (http-0.0.0.0-8443-Processor8) [
ControlServlet.java:184:DEBUG] [[[setSessionLocale] Setup done, doing
Event(s) and View(s)- total:0.0,since last([setSessionLocale...):0.0]]
2008-08-19 12:11:55,828 (http-0.0.0.0-8443-Processor8) [
RequestHandler.java:239:INFO ] [Processing Request]: setSessionLocale
sessionId=F7CB302D89D378266AF0D874DC869D5D.jvm1
2008-08-19 12:11:55,843 (http-0.0.0.0-8443-Processor8) [
RequestHandler.java:427:INFO ] [RequestHandler.doRequest]: Response is
a view. sessionId=F7CB302D89D378266AF0D874DC869D5D.jvm1
2008-08-19 12:11:55,843 (http-0.0.0.0-8443-Processor8) [
RequestHandler.java:580:INFO ] servletName=control, view=main
sessionId=F7CB302D89D378266AF0D874DC869D5D.jvm1
2008-08-19 12:11:55,843 (http-0.0.0.0-8443-Processor8) [
ScreenRenderer.java:205:INFO ] Found session attribute that conflicts
with parameter name, leaving request parameter in place for name:
locale
2008-08-19 12:11:55,843 (http-0.0.0.0-8443-Processor8) [
ScreenRenderer.java:224:INFO ] Found servlet context (application)
attribute that conflicts with parameter name, leaving request
parameter in place for name: _REQUEST_HANDLER_

java.lang.ClassCastException: java.lang.String
org.ofbiz.service.ModelService.makeValid(ModelService.java:766)
org.ofbiz.service.ModelService.makeValid(ModelService.java:738)
org.ofbiz.service.ModelService.makeValid(ModelService.java:726)
org.ofbiz.service.DispatchContext.makeValidContext(DispatchContext.java:171)
org.ofbiz.service.DispatchContext.makeValidContext(DispatchContext.java:140)
org.ofbiz.widget.screen.ModelScreenAction$Service.runAction(ModelScreenAction.java:440)
org.ofbiz.widget.screen.ModelScreenAction.runSubActions(ModelScreenAction.java:120)
org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:240)
org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:136)
org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:108)
org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:93)
org.ofbiz.widget.screen.ScreenWidgetViewHandler.render(ScreenWidgetViewHandler.java:81)

The problem seem sto be here :

        if (locale == null) {
            // if statement here to avoid warning messages for Entity
ECA service input validation, even though less efficient that doing a
straight get
            if (source.containsKey("locale")) {
                locale = (Locale) source.get("locale");
            }
            if (locale == null) {
                locale = Locale.getDefault();
            }
        }

Because the locale parameter can be a Locale or a String.

HTH,

Cimballi
Reply | Threaded
Open this post in threaded view
|

Re: Possible bug when changing Locale in org.ofbiz.service.ModelService.makeValid

Adrian Crum
This type of message should be put on the user mailing list.

The log is telling you where the problem is:

2008-08-19 12:11:55,843 (http-0.0.0.0-8443-Processor8) [
ScreenRenderer.java:205:INFO ] Found session attribute that conflicts
with parameter name, leaving request parameter in place for name:
locale

You can't have a parameter name called "locale" because an object by
that name already exists.

-Adrian

Cimballi wrote:

> Hi,
>
> I've just downloaded "opentaps-1.0.1a-all-platforms", and after some
> manipulation I have a bug while changing a Locale. Here are some
> informations :
>
> org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen
> [component://party/widget/partymgr/PartyScreens.xml#findparty]:
> java.lang.ClassCastException: java.lang.String (java.lang.String)
>
> 2008-08-19 12:11:47,328 (http-0.0.0.0-8443-Processor8) [
> ModelScreenWidget.java:363:INFO ] In the include-screen tag the screen
> name was empty, ignoring include; in screen [GlobalDecorator]
> 2008-08-19 12:11:47,343 (http-0.0.0.0-8443-Processor8) [
> ControlServlet.java:259:DEBUG] [[[main] Done rendering page, Servlet
> Finished- total:0.328,since last([main] Setup done...):0.328]]
> 2008-08-19 12:11:55,828 (http-0.0.0.0-8443-Processor8) [
> ControlServlet.java:93 :INFO ] The character encoding of the request
> is: [null]. The character encoding we will use for the request and
> response is: [UTF-8]
> 2008-08-19 12:11:55,828 (http-0.0.0.0-8443-Processor8) [
> ControlServlet.java:129:DEBUG] [[[setSessionLocale] Servlet Starting,
> doing setup- total:0.0,since last(Begin):0.0]]
> 2008-08-19 12:11:55,828 (http-0.0.0.0-8443-Processor8) [
> ControlServlet.java:184:DEBUG] [[[setSessionLocale] Setup done, doing
> Event(s) and View(s)- total:0.0,since last([setSessionLocale...):0.0]]
> 2008-08-19 12:11:55,828 (http-0.0.0.0-8443-Processor8) [
> RequestHandler.java:239:INFO ] [Processing Request]: setSessionLocale
> sessionId=F7CB302D89D378266AF0D874DC869D5D.jvm1
> 2008-08-19 12:11:55,843 (http-0.0.0.0-8443-Processor8) [
> RequestHandler.java:427:INFO ] [RequestHandler.doRequest]: Response is
> a view. sessionId=F7CB302D89D378266AF0D874DC869D5D.jvm1
> 2008-08-19 12:11:55,843 (http-0.0.0.0-8443-Processor8) [
> RequestHandler.java:580:INFO ] servletName=control, view=main
> sessionId=F7CB302D89D378266AF0D874DC869D5D.jvm1
> 2008-08-19 12:11:55,843 (http-0.0.0.0-8443-Processor8) [
> ScreenRenderer.java:205:INFO ] Found session attribute that conflicts
> with parameter name, leaving request parameter in place for name:
> locale
> 2008-08-19 12:11:55,843 (http-0.0.0.0-8443-Processor8) [
> ScreenRenderer.java:224:INFO ] Found servlet context (application)
> attribute that conflicts with parameter name, leaving request
> parameter in place for name: _REQUEST_HANDLER_
>
> java.lang.ClassCastException: java.lang.String
> org.ofbiz.service.ModelService.makeValid(ModelService.java:766)
> org.ofbiz.service.ModelService.makeValid(ModelService.java:738)
> org.ofbiz.service.ModelService.makeValid(ModelService.java:726)
> org.ofbiz.service.DispatchContext.makeValidContext(DispatchContext.java:171)
> org.ofbiz.service.DispatchContext.makeValidContext(DispatchContext.java:140)
> org.ofbiz.widget.screen.ModelScreenAction$Service.runAction(ModelScreenAction.java:440)
> org.ofbiz.widget.screen.ModelScreenAction.runSubActions(ModelScreenAction.java:120)
> org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:240)
> org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:136)
> org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:108)
> org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:93)
> org.ofbiz.widget.screen.ScreenWidgetViewHandler.render(ScreenWidgetViewHandler.java:81)
>
> The problem seem sto be here :
>
>         if (locale == null) {
>             // if statement here to avoid warning messages for Entity
> ECA service input validation, even though less efficient that doing a
> straight get
>             if (source.containsKey("locale")) {
>                 locale = (Locale) source.get("locale");
>             }
>             if (locale == null) {
>                 locale = Locale.getDefault();
>             }
>         }
>
> Because the locale parameter can be a Locale or a String.
>
> HTH,
>
> Cimballi
>
Reply | Threaded
Open this post in threaded view
|

Re: Possible bug when changing Locale in org.ofbiz.service.ModelService.makeValid

Cimballi
Hi Adrian,

The fact is that I didn't change anything, I'm just using the package
from Opentap.
So maybe this is a bug from Opentap and I should send it to the
Opentap mailing list ?

Cimballi


On Tue, Aug 19, 2008 at 2:03 PM, Adrian Crum <[hidden email]> wrote:

> This type of message should be put on the user mailing list.
>
> The log is telling you where the problem is:
>
> 2008-08-19 12:11:55,843 (http-0.0.0.0-8443-Processor8) [
> ScreenRenderer.java:205:INFO ] Found session attribute that conflicts
> with parameter name, leaving request parameter in place for name:
> locale
>
> You can't have a parameter name called "locale" because an object by that
> name already exists.
>
> -Adrian
>
> Cimballi wrote:
>>
>> Hi,
>>
>> I've just downloaded "opentaps-1.0.1a-all-platforms", and after some
>> manipulation I have a bug while changing a Locale. Here are some
>> informations :
>>
>> org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen
>> [component://party/widget/partymgr/PartyScreens.xml#findparty]:
>> java.lang.ClassCastException: java.lang.String (java.lang.String)
>>
>> 2008-08-19 12:11:47,328 (http-0.0.0.0-8443-Processor8) [
>> ModelScreenWidget.java:363:INFO ] In the include-screen tag the screen
>> name was empty, ignoring include; in screen [GlobalDecorator]
>> 2008-08-19 12:11:47,343 (http-0.0.0.0-8443-Processor8) [
>> ControlServlet.java:259:DEBUG] [[[main] Done rendering page, Servlet
>> Finished- total:0.328,since last([main] Setup done...):0.328]]
>> 2008-08-19 12:11:55,828 (http-0.0.0.0-8443-Processor8) [
>> ControlServlet.java:93 :INFO ] The character encoding of the request
>> is: [null]. The character encoding we will use for the request and
>> response is: [UTF-8]
>> 2008-08-19 12:11:55,828 (http-0.0.0.0-8443-Processor8) [
>> ControlServlet.java:129:DEBUG] [[[setSessionLocale] Servlet Starting,
>> doing setup- total:0.0,since last(Begin):0.0]]
>> 2008-08-19 12:11:55,828 (http-0.0.0.0-8443-Processor8) [
>> ControlServlet.java:184:DEBUG] [[[setSessionLocale] Setup done, doing
>> Event(s) and View(s)- total:0.0,since last([setSessionLocale...):0.0]]
>> 2008-08-19 12:11:55,828 (http-0.0.0.0-8443-Processor8) [
>> RequestHandler.java:239:INFO ] [Processing Request]: setSessionLocale
>> sessionId=F7CB302D89D378266AF0D874DC869D5D.jvm1
>> 2008-08-19 12:11:55,843 (http-0.0.0.0-8443-Processor8) [
>> RequestHandler.java:427:INFO ] [RequestHandler.doRequest]: Response is
>> a view. sessionId=F7CB302D89D378266AF0D874DC869D5D.jvm1
>> 2008-08-19 12:11:55,843 (http-0.0.0.0-8443-Processor8) [
>> RequestHandler.java:580:INFO ] servletName=control, view=main
>> sessionId=F7CB302D89D378266AF0D874DC869D5D.jvm1
>> 2008-08-19 12:11:55,843 (http-0.0.0.0-8443-Processor8) [
>> ScreenRenderer.java:205:INFO ] Found session attribute that conflicts
>> with parameter name, leaving request parameter in place for name:
>> locale
>> 2008-08-19 12:11:55,843 (http-0.0.0.0-8443-Processor8) [
>> ScreenRenderer.java:224:INFO ] Found servlet context (application)
>> attribute that conflicts with parameter name, leaving request
>> parameter in place for name: _REQUEST_HANDLER_
>>
>> java.lang.ClassCastException: java.lang.String
>> org.ofbiz.service.ModelService.makeValid(ModelService.java:766)
>> org.ofbiz.service.ModelService.makeValid(ModelService.java:738)
>> org.ofbiz.service.ModelService.makeValid(ModelService.java:726)
>>
>> org.ofbiz.service.DispatchContext.makeValidContext(DispatchContext.java:171)
>>
>> org.ofbiz.service.DispatchContext.makeValidContext(DispatchContext.java:140)
>>
>> org.ofbiz.widget.screen.ModelScreenAction$Service.runAction(ModelScreenAction.java:440)
>>
>> org.ofbiz.widget.screen.ModelScreenAction.runSubActions(ModelScreenAction.java:120)
>>
>> org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:240)
>>
>> org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:136)
>> org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:108)
>> org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:93)
>>
>> org.ofbiz.widget.screen.ScreenWidgetViewHandler.render(ScreenWidgetViewHandler.java:81)
>>
>> The problem seem sto be here :
>>
>>        if (locale == null) {
>>            // if statement here to avoid warning messages for Entity
>> ECA service input validation, even though less efficient that doing a
>> straight get
>>            if (source.containsKey("locale")) {
>>                locale = (Locale) source.get("locale");
>>            }
>>            if (locale == null) {
>>                locale = Locale.getDefault();
>>            }
>>        }
>>
>> Because the locale parameter can be a Locale or a String.
>>
>> HTH,
>>
>> Cimballi
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: Possible bug when changing Locale in org.ofbiz.service.ModelService.makeValid

Jacques Le Roux
Administrator
In reply to this post by Cimballi-2
This is an OFBiz ML not an Opentaps forum http://sourceforge.net/forum/?group_id=145855

Jacques

From: "Cimballi" <[hidden email]>

> Hi,
>
> I've just downloaded "opentaps-1.0.1a-all-platforms", and after some
> manipulation I have a bug while changing a Locale. Here are some
> informations :
>
> org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen
> [component://party/widget/partymgr/PartyScreens.xml#findparty]:
> java.lang.ClassCastException: java.lang.String (java.lang.String)
>
> 2008-08-19 12:11:47,328 (http-0.0.0.0-8443-Processor8) [
> ModelScreenWidget.java:363:INFO ] In the include-screen tag the screen
> name was empty, ignoring include; in screen [GlobalDecorator]
> 2008-08-19 12:11:47,343 (http-0.0.0.0-8443-Processor8) [
> ControlServlet.java:259:DEBUG] [[[main] Done rendering page, Servlet
> Finished- total:0.328,since last([main] Setup done...):0.328]]
> 2008-08-19 12:11:55,828 (http-0.0.0.0-8443-Processor8) [
> ControlServlet.java:93 :INFO ] The character encoding of the request
> is: [null]. The character encoding we will use for the request and
> response is: [UTF-8]
> 2008-08-19 12:11:55,828 (http-0.0.0.0-8443-Processor8) [
> ControlServlet.java:129:DEBUG] [[[setSessionLocale] Servlet Starting,
> doing setup- total:0.0,since last(Begin):0.0]]
> 2008-08-19 12:11:55,828 (http-0.0.0.0-8443-Processor8) [
> ControlServlet.java:184:DEBUG] [[[setSessionLocale] Setup done, doing
> Event(s) and View(s)- total:0.0,since last([setSessionLocale...):0.0]]
> 2008-08-19 12:11:55,828 (http-0.0.0.0-8443-Processor8) [
> RequestHandler.java:239:INFO ] [Processing Request]: setSessionLocale
> sessionId=F7CB302D89D378266AF0D874DC869D5D.jvm1
> 2008-08-19 12:11:55,843 (http-0.0.0.0-8443-Processor8) [
> RequestHandler.java:427:INFO ] [RequestHandler.doRequest]: Response is
> a view. sessionId=F7CB302D89D378266AF0D874DC869D5D.jvm1
> 2008-08-19 12:11:55,843 (http-0.0.0.0-8443-Processor8) [
> RequestHandler.java:580:INFO ] servletName=control, view=main
> sessionId=F7CB302D89D378266AF0D874DC869D5D.jvm1
> 2008-08-19 12:11:55,843 (http-0.0.0.0-8443-Processor8) [
> ScreenRenderer.java:205:INFO ] Found session attribute that conflicts
> with parameter name, leaving request parameter in place for name:
> locale
> 2008-08-19 12:11:55,843 (http-0.0.0.0-8443-Processor8) [
> ScreenRenderer.java:224:INFO ] Found servlet context (application)
> attribute that conflicts with parameter name, leaving request
> parameter in place for name: _REQUEST_HANDLER_
>
> java.lang.ClassCastException: java.lang.String
> org.ofbiz.service.ModelService.makeValid(ModelService.java:766)
> org.ofbiz.service.ModelService.makeValid(ModelService.java:738)
> org.ofbiz.service.ModelService.makeValid(ModelService.java:726)
> org.ofbiz.service.DispatchContext.makeValidContext(DispatchContext.java:171)
> org.ofbiz.service.DispatchContext.makeValidContext(DispatchContext.java:140)
> org.ofbiz.widget.screen.ModelScreenAction$Service.runAction(ModelScreenAction.java:440)
> org.ofbiz.widget.screen.ModelScreenAction.runSubActions(ModelScreenAction.java:120)
> org.ofbiz.widget.screen.ModelScreenWidget$Section.renderWidgetString(ModelScreenWidget.java:240)
> org.ofbiz.widget.screen.ModelScreen.renderScreenString(ModelScreen.java:136)
> org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:108)
> org.ofbiz.widget.screen.ScreenRenderer.render(ScreenRenderer.java:93)
> org.ofbiz.widget.screen.ScreenWidgetViewHandler.render(ScreenWidgetViewHandler.java:81)
>
> The problem seem sto be here :
>
>        if (locale == null) {
>            // if statement here to avoid warning messages for Entity
> ECA service input validation, even though less efficient that doing a
> straight get
>            if (source.containsKey("locale")) {
>                locale = (Locale) source.get("locale");
>            }
>            if (locale == null) {
>                locale = Locale.getDefault();
>            }
>        }
>
> Because the locale parameter can be a Locale or a String.
>
> HTH,
>
> Cimballi
>