darshakshah1988 / gmaps4jsf

Automatically exported from code.google.com/p/gmaps4jsf
0 stars 1 forks source link

java.lang.ArrayIndexOutOfBoundsException: 1 at com.googlecode.gmaps4jsf.component.map.MapRenderer.decode(MapRenderer.java:87) #173

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Refresh the map
2.
3.

What is the expected output? 

Refresk ok.

What do you see instead?

2011-08-12 11:37:02,341 WARNING 
[javax.enterprise.resource.webcontainer.jsf.lifecycle] 
(http-localhost%2F127.0.0.1-8080-4) 1
java.lang.ArrayIndexOutOfBoundsException: 1
    at com.googlecode.gmaps4jsf.component.map.MapRenderer.decode(MapRenderer.java:87)
    at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:789)
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1031)
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1026)
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1026)
    at javax.faces.component.UIForm.processDecodes(UIForm.java:209)
    at org.ajax4jsf.component.AjaxViewRoot$1.invokeContextCallback(AjaxViewRoot.java:392)
    at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:238)
    at org.ajax4jsf.component.AjaxViewRoot.processDecodes(AjaxViewRoot.java:409)
    at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
    at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
    at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
    at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
    at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
    at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
    at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
    at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
    at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
    at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
    at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
    at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
    at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
    at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:619)
2011-08-12 11:37:02,341 SEVERE 
[javax.enterprise.resource.webcontainer.jsf.lifecycle] 
(http-localhost%2F127.0.0.1-8080-4) JSF1054: (Phase ID: APPLY_REQUEST_VALUES 2, 
View ID: /page/maps/GeoMapEdit.xhtml) Exception thrown during phase execution: 
javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@16a2b2
d]

What version of the product are you using? On what operating system?
1.1.4
windows xp

Please provide any additional information below.

class: MapRenderer
method: decode(FacesContext context, UIComponent component)

The var mapStateValue, have value UNDEFINED when i get this error, and
[] when not get this error.

    public void decode(FacesContext context, UIComponent component) {
        Map map = (Map) component;
        String markersStateValue = (String) context.getExternalContext().getRequestParameterMap().get(ComponentUtils.getMapMarkersStateHiddenFieldId(map));

        ComponentUtils.setRequestAttribute(context, ComponentUtils.getMapMarkersStateHiddenFieldId(map), markersStateValue);

        String mapStateValue = (String) context.getExternalContext().getRequestParameterMap().get(ComponentUtils.getMapStateHiddenFieldId(map));

        if (mapStateValue != null && !mapStateValue.trim().equals("")) {

            // pass updated values to the client.
            String latitude =(mapStateValue.split(",")[0].substring(1).trim());
            String longitude = (mapStateValue.split(",")[1].substring(0, mapStateValue.split(",")[1].length() - 1).trim());

            map.setValue(new MarkerValue(longitude, latitude));

            ActionEvent actionEvent = new ActionEvent(map);

            map.queueEvent(actionEvent);
        }
    }

The snip source:
---------------

<rich:panel>        
            <a:outputPanel id="refreshMap">

            <m:map width="1100px" height="700px" latitude="#{geoMapAction.coordinateY}" longitude="#{geoMapAction.coordinateX}" jsVariable="map1" zoom="#{geoMapAction.zoomLevel}" rendered="true" partiallyTriggered="#{geoMapAction.refreshMap}" >

               <a:repeat var="bp" value="#{searchFactory.peopleList}">
                  <m:marker latitude="#{(bp.coordinateY == null or bp.coordinateY == '') ? '-90' : bp.coordinateY}" longitude="#{(bp.coordinateX == null or bp.coordinateX == '') ? '-180' : bp.coordinateX}" > 
                  <m:icon shadowImageURL="http://www.google.com/mapfiles/shadow50.png" imageURL="http://www.google.com/mapfiles/marker_green.png"/>
                        <m:htmlInformationWindow htmlText="people: #{bp.id}" />     
                  </m:marker>
               </a:repeat>  

               <m:mapControl name="GLargeMapControl" position="G_ANCHOR_BOTTOM_RIGHT"/>
               <m:mapControl name="GMapTypeControl"/>  

            </m:map>
            </a:outputPanel>                                         
  </rich:panel>

Original issue reported on code.google.com by henry.va...@gmail.com on 12 Aug 2011 at 9:32

GoogleCodeExporter commented 8 years ago
This scenario occurs on Tomcat?

Original comment by Hazem.sa...@gmail.com on 25 Aug 2011 at 2:40

GoogleCodeExporter commented 8 years ago
Hi,

I have the same problem, when I change tab on panelTabSet,
I'm using Jboss 4.2

thank you for yor help

java.lang.ArrayIndexOutOfBoundsException: 1
    at com.googlecode.gmaps4jsf.component.map.MapRenderer.decode(MapRenderer.java:87)
    at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:764)
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1006)
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1001)
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1001)
    at com.icesoft.faces.component.paneltabset.PanelTabSet.applyPhase(PanelTabSet.java:168)
    at com.icesoft.faces.component.paneltabset.PanelTabSet.applyPhase(PanelTabSet.java:149)
    at com.icesoft.faces.component.paneltabset.PanelTabSet.processDecodes(PanelTabSet.java:190)
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1001)
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1001)
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1001)
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1001)
    at com.icesoft.faces.component.panelcollapsible.PanelCollapsible.processDecodes(PanelCollapsible.java:219)
    at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1001)
    at javax.faces.component.UIForm.processDecodes(UIForm.java:203).......

Original comment by julian.k...@gmail.com on 20 Sep 2011 at 4:36

GoogleCodeExporter commented 8 years ago
this happens when I open a <m:htmlInformationWindow> tag and then try to change 
tab

this is the code from jspx...

<m:map width="850px" height="600px" jsVariable="map"
address="#{simReporteRutaView.address}" zoom="12"
partiallyTriggered="true" autoReshape="true" >
  <m:mapControl name="GLargeMapControl"
    position="G_ANCHOR_TOP_LEFT"
    rendered="#{simReporteRutaView.showControls}" />
  <m:mapControl name="GMapTypeControl"
    position="G_ANCHOR_TOP_RIGHT"
    rendered="#{simReporteRutaView.showControls}" />
<m:marker address="#{simReporteRutaView.address}">
                                                                    <m:icon
                                                                        imageURL="http://google-maps-icons.googlecode.com/files/sun.png"
                                                                        width="32" height="32" />
                                                                </m:marker>
                                                                <ui:repeat var="marker" value="#{simReporteRutaView.points}">
                                                                    <m:marker latitude="#{marker.latitud}" jsVariable="marker"
                                                                        longitude="#{marker.longitud}">
                                                                        <m:htmlInformationWindow
                                                                            htmlText="#{marker.info}" />
                                                                        <m:icon
                                                                                imageURL="#{facesContext.externalContext.request.scheme}://#{facesContext.externalContext.request.serverName}:#{facesContext.externalContext.request.serverPort}#{facesContext.externalContext.request.contextPath}/images/#{marker.aplNombre}" />
                                                                    </m:marker>
                                                                </ui:repeat>
                                                            </m:map>

Original comment by julian.k...@geniar.net on 20 Sep 2011 at 4:57

GoogleCodeExporter commented 8 years ago
I will investigate...

Original comment by Hazem.sa...@gmail.com on 21 Sep 2011 at 6:08

GoogleCodeExporter commented 8 years ago
Something new about this issue??
i get same error on this situation: In a panelTabSet (icefaces) show the map 
with a m:polyline (empty) .With a button it enables the enableDrawing method 
from de google api. If the user lets the polyline open, it runs perfectly, but 
if the user ends the line (clicking again on last point or closing the line, 
when trying to change the tab  the system shows same error at MapRenderer.decode

Thanks.

Original comment by jlmond...@gmail.com on 30 Nov 2011 at 9:35

GoogleCodeExporter commented 8 years ago
HI all. I have same problem. I'm using JSF 2.1 and rich faces.

Original comment by ei08...@gmail.com on 13 Dec 2011 at 12:37

GoogleCodeExporter commented 8 years ago
I had the same problem using JSF 2.1 and Richfaces 4. I solved it by placing 
the map in a sub-form (h:form). 

Original comment by erik.van...@mailbox.org on 4 Jan 2012 at 9:24

GoogleCodeExporter commented 8 years ago
I have same problem as julian (Sep 20, 2011).

When I have clicked the htmlInformationWindow and then close the panelPopup the 
map is rendered on the error occurs.

I'm using:
icefaces-2.0.2
jsf-2.1.3
gmaps4jsf-core-1.1.4

Would be nice if a fix was created for this.

Thanks and Regards,

Mark

Original comment by mark.kle...@gmail.com on 13 Feb 2012 at 5:16

GoogleCodeExporter commented 8 years ago
Any suggestions on how to solve this??

I have the same problem asl Mark when the htmlInformationWindow is open.

Thanks.

Javier

Original comment by hjavierc...@gmail.com on 16 Feb 2012 at 11:49

GoogleCodeExporter commented 8 years ago
hi Henry
What do you mean with refresh the map? Do you mean the reload of the page?
I'm using icefaces 1.8.2
I'm trying to manage the click event on a html button in the 
htmlinformationWindow; I create hidden ice button and in the javascript 
function connected to the html button I execute this code:
  document.getElementById("mainForm:hiddenBtn").click();
But doing so I obtain the same your error!
When I load my page, if I NOT click on the marker map (so the info window is 
NOT showen) but I click directly on the ice button all works. If I click on the 
marker and then I click on the html button I obtain the exception; and after 
the html info is shown, also the click on the ice button brings me to the 
exception.

The code of the ice button is:
<ice:commandButton id="hiddenBtn" value="hiddendBtn" 
action="#{mainContent.showReportDetail}" visible="true" partialSubmit="true"/>

The method showReportDetail do something in the backing bean before the page is 
reloaded

More: if I refresh the page using the browser button I obtain no error

Do you have any news about this problem?

Original comment by davide.b...@gmail.com on 18 Feb 2012 at 7:08

GoogleCodeExporter commented 8 years ago
I have solved the problem by checking out the tag from the svn for version 
1.1.4 and changed line 83 of MapRenderer.java to:
if (mapStateValue != null && !mapStateValue.trim().equals("") && 
!mapStateValue.trim().equals("undefined")) {

I then compiled the jar myself and added this to my project. I am no longer 
getting the java.lang.ArrayIndexOutOfBoundsException. At this moment I am not 
sure what other implications this change might have but for now it is working 
just fine :).

I still hope this issue will be solved in future versions though but at least 
there is a work around for this issue now.

I'll keep you guys posted as soon as any issues arise regarding this change.

Regards,

Mark

Original comment by mark.kle...@gmail.com on 29 Feb 2012 at 12:19

GoogleCodeExporter commented 8 years ago
I have got same problem in scenario:
After click marker on map, I display richfaces popup , I close popup, and when 
I try to change tab above bug occurs.

Workaround which I used in my case, is: During closing popup I refresh map. 
After that I am able to change tab (bug does not occur).

Original comment by Miodusze...@gmail.com on 28 Apr 2012 at 11:11