You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Olivier Vanekem (JIRA)" <ji...@apache.org> on 2015/08/19 00:48:45 UTC
[jira] [Commented] (AXIS2-5716) In the admin console the
seiMethodHeaderParameter service parameter should not be modifiable
[ https://issues.apache.org/jira/browse/AXIS2-5716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14702131#comment-14702131 ]
Olivier Vanekem commented on AXIS2-5716:
----------------------------------------
I have found a workaround to this bug and maybe it would be worth including this patch in a future release of Axis/2.
I changed the admin console and patched the ServiceParaEdit.jsp file the following way:
{code:java}
<%
ArrayList service_para = axisService.getParameters();
for (int i = 0; i < service_para.size(); i++) {
Parameter parameter = (Parameter) service_para.get(i);
if (parameter.getParameterType()==Parameter.OM_PARAMETER) {
continue;
}
%>
<tr>
<td><%=parameter.getName()%></td>
<%if (!parameter.getName().equals("seiMethodHeaderParameter")) {%>
<td><input type="text" value="<%=parameter.getValue()%>"
name="<%=(servicName + "_" + parameter.getName())%>" size="50">
</td>
</tr>
<%}
}
{code}
By checking the parameter name and deciding for seiMethodHeaderParameter not to generate the input field, the value is therefore not sent anymore when changing a service parameter and the resulting ClassCastException does not occur.
I attach a screenshot of the admin console after the code modification as well as the modified ServiceParaEdit.jsp patched file.
> In the admin console the seiMethodHeaderParameter service parameter should not be modifiable
> --------------------------------------------------------------------------------------------
>
> Key: AXIS2-5716
> URL: https://issues.apache.org/jira/browse/AXIS2-5716
> Project: Axis2
> Issue Type: Bug
> Components: admin console
> Affects Versions: 1.6.2
> Reporter: Olivier Vanekem
> Attachments: Axis2____Administration_Page-seiMethodHeaderParameter.jpg
>
>
> In the admin console, some services are automatically tagged with the seiMethodHeaderParameter service parameter.
> This parameter takes an array as value instead of a String.
> Because it appears in the parameters in the console, changing any other parameter for the service will also send a value to this seiMethodHeaderParameter parameter. This issue is that the admin console sends all parameter values as String and therefore the seiMethodHeaderParameter now contains a String value instead of an array.
> This will result in an exception of the service at runtime with a ClassCastException cannot cast a String into an array.
> See such an exception below:
> {noformat}
> [ERROR] java.lang.String cannot be cast to java.util.ArrayList
> java.lang.ClassCastException: java.lang.String cannot be cast to java.util.ArrayList
> at org.apache.axis2.jaxws.dispatchers.MustUnderstandUtils.getHeaderParamaterList(MustUnderstandUtils.java:105)
> at org.apache.axis2.jaxws.dispatchers.MustUnderstandUtils.markUnderstoodHeaderParameters(MustUnderstandUtils.java:64)
> at org.apache.axis2.jaxws.dispatchers.MustUnderstandChecker.doInvoke(MustUnderstandChecker.java:49)
> at org.apache.axis2.handlers.AbstractTemplatedHandler.invoke(AbstractTemplatedHandler.java:44)
> at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
> at org.apache.axis2.engine.Phase.invoke(Phase.java:313)
> at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:262)
> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:168)
> at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
> at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:751)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
> {noformat}
> Looking at the code of MustUnderstandUtils, we see indeed that it tries to retrieve the value of the seiMethodHeaderParameter service parameter as in:
> {code:java}
> ArrayList seiMethodHeaders = (ArrayList)axisService.getParameterValue("seiMethodHeaderParameter");
> {code}
> And this generates the exception because we changed (another) service parameter but the admin console updated also seiMethodHeaderParameter with a string value.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org