<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Minor issue with ESB 4.10 and HttpGateway
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/chuaky">Chua Khoon Yong</a> in <i>JBoss ESB Development</i> - <a href="http://community.jboss.org/message/619020#619020">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I was porting my project from ESB 4.9 to 4.10, and encountered the following minor issue. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>To simulate the issue, in the "http_gateway" sample code, i did this change to the "build.xml" file:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>*** original</p><p>&lt;project name="Quickstart_http_gateway" default="run" basedir="."&gt;</p><p>*** new</p><p>&lt;project name="abc" default="run" basedir="."&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>After i built and deploy this project, and i saw this error message in the jboss 4.2.3 AS</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>2011-08-03 17:01:51,075 WARN&#160; [org.jboss.system.ServiceController] Problem creating service jboss.esb:deployment=abc.esb</p><p>java.lang.StringIndexOutOfBoundsException: String index out of range: -1</p><p>&#160;&#160;&#160; at java.lang.String.substring(String.java:1937)</p><p>&#160;&#160;&#160; at org.jboss.internal.soa.esb.listeners.war.HttpGatewayDeploymentFactory.addEndpointAddress(HttpGatewayDeploymentFactory.java:89)</p><p>&#160;&#160;&#160; at org.jboss.internal.soa.esb.listeners.war.HttpGatewayDeploymentFactory.updateWebModel(HttpGatewayDeploymentFactory.java:75)</p><p>&#160;&#160;&#160; at org.jboss.soa.esb.listeners.config.ModelUtil.updateWebModel(ModelUtil.java:97)</p><p>&#160;&#160;&#160; at org.jboss.soa.esb.listeners.config.WebGatewayBuilder.build(WebGatewayBuilder.java:115)</p><p>&#160;&#160;&#160; at org.jboss.soa.esb.listeners.config.JBoss4ESBDeployment.createService(JBoss4ESBDeployment.java:196)</p><p>:</p><p>:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>It seems that the cause is because i changed the project name to a 3 letter word "abc".&#160; It so happens that my project name is just 3 letter words <span> :( </span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The line of code that cause the issue is at </p><table><tbody><tr><td style=";"></td><td style=";">at org.jboss.internal.soa.esb.listeners.war.HttpGatewayDeploymentFactory.addEndpointAddress(HttpGatewayDeploymentFactory.java:89)</td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><table><tbody><tr><td style=";">&#160;&#160;&#160; </td><td style=";">path = path.substring(0, path.length() - 4) + urlMapping; // remove ".war" and add urlMapping</td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>So, for temporary workaround, i change my project name to 4 letter word.</p><p>Hope you could fix it, because the project name is also part of the http url that invoke this service.</p><p>Thank you.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/619020#619020">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss ESB Development at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2032">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>