Error in Customize AddItem (java.lang.StringIndexOutOfBoundsException)

the code
htp.formOpen(curl => 'cntsample.upload', cmethod => 'POST', cenctype => 'multipart/form-data');
htp.p('<INPUT TYPE="FILE" NAME="name">');
htp.formSubmit;
htp.formClose;
Produce this error
Error: The servlet produced the following error stack. java.lang.StringIndexOutOfBoundsException: String index out of range: -303
     at java.lang.String.substring(String.java, Compiled Code)
     at oracle.webdb.page.PageBuilder.parseQuery(PageBuilder.java, Compiled Code)
     at oracle.webdb.page.PageBuilder.getMetaData(PageBuilder.java, Compiled Code)
     at oracle.webdb.page.PageBuilder.process(PageBuilder.java, Compiled Code)
     at oracle.webdb.page.ParallelServlet.doGet(ParallelServlet.java, Compiled Code)
     at oracle.webdb.page.ParallelServlet.doPost(ParallelServlet.java:140)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code)
     at org.apache.jserv.JServConnection.processRequest(JServConnection.java, Compiled Code)
     at org.apache.jserv.JServConnection.run(JServConnection.java, Compiled Code)
     at java.lang.Thread.run(Thread.java, Compiled Code)
or is posible this error too
An Unhandled Exception has occurred. ORA-01403: no data found
HELP, please
Version Portal 3.0.9.8.0

Was this working before? What changes have you done recently?
Please run AutoConfig on the apps tier, and make sure it complete successfully.

Similar Messages

  • FTP Sender Channel error " java.lang.StringIndexOutOfBoundsException""

    Dear All,
    Scenario:File to IDOC
    File Type: Fixed Length
    I am getting below error in Sender Channel.
    Error "Conversion of file content to XML failed at position 0: java.lang.Exception: ERROR converting document line no. 2 according to structure 'Item':java.lang.StringIndexOutOfBoundsException"
    Note:We are using header and Item.Header is not repating and Item should repeate N times.we are using the KeyField Name for both header and Item.
    Kindly suggest me the Parameter to use for the sender channel.
    Edited by: manikandansit on Jan 17, 2011 12:53 PM

    Dear All,
    Thanks for your suggestions.
    the issues has been resolved.
    there are so many spaces between the each field data in the source file and i was using the value as SPACE for the parameter Name.fieldSeparator and it taken each space as a data or something else. finally i had removed this parameter and Interfaces works fine now.
    Thanks

  • Getting error java.lang.StringIndexOutOfBoundsException: String index out of range:

    Hi,
    I have a project in jdev 3.2 and i have migrated to jdev 9i.
    Once i run the project,in some of the pages i am getting the below error..The application runs fine in jdev 3.2 without any errors..
    Where can be the problem..
    Any help will be appreciated..
    500 Internal Server Error
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
         java.lang.String java.lang.String.substring(int, int)
         int oracle.jbo.html.jsp.datatags.ApplicationModuleTag.doStartTag()
         void jspautomate_html._TkeyautomateView__Edit._jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
         [JSPAutomate_html/TkeyautomateView_Edit.jsp]
         void com.orionserver[Oracle9iAS (9.0.2.0.0) Containers for J2EE].http.OrionHttpJspPage.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
         void oracle.jsp.runtimev2.JspPageTable.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String)
         void oracle.jsp.runtimev2.JspServlet.internalService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
         void oracle.jsp.runtimev2.JspServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
         void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
         void com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
         void com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(javax.servlet.ServletRequest, javax.servlet.http.HttpServletResponse)
         boolean com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.ApplicationServerThread, com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.EvermindHttpServletRequest, com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.EvermindHttpServletResponse, java.io.InputStream, java.io.OutputStream, boolean)
         void com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(java.lang.Thread)
         void com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].util.ThreadPoolThread.run()

    Sorry for the late reply.
    It is problably a problem with the configname attribute of the ApplicationModule tag which is wrong.
    Can you try to open the JSP file with the problem and look at the ApplicationModule tag setting.
    If you create a new ApplicationModule tag under it using the Component Palette, it will give you a clue to what setting is espected for the configname. Make sure to keep the same value for the "id" property.
    Charles.

  • Loading Excel Error - java.lang.StringIndexOutOfBoundsException

    All,
    I want to load an excel(target) from two excel sheets(source).
    I have my staging as Oracle.
    But loading the Excel(target) ODI throws an exception java.lang.StringIndexOutOfBoundsException: String index out of range: 59
    Any help is much appreciated.
    Thanks

    I have resolved the problem.
    The problem was due to the special characters '(' ')' in the column name of the excel sheet.

  • Receiver FTP adapter java.lang.StringIndexOutOfBoundsException

    Hi,
    i'm getting the following error trying to reach an FTP server using a Receiver CC:
    Attempt to process file failed with Error occurred while connecting to the FTP server "xxxxxx:21": java.lang.StringIndexOutOfBoundsException
    Any help would be really appreciated
    Thanks
    Simona Milione

    Hi
    check the fixedFieldLength parameter for all the fields in you File COntent COnversion
    there is some field whose length is greater than what you specified in FCC
    regards
    krishna

  • Java.lang.StringIndexOutOfBoundsException when executing query on Oracle 9i

    SQL Deverloper Build 1467
    Windows XP
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    I have the following query being executed in SQL Worksheet.
    select * from address
    where address_id in (1, 2, 3, .... 1000, 1001);
    If I have <= 1000 expressions, it executes but if it has > 1000, the query does not return this error "ORA-01795: maximum number of expressions in a list is 1000". When I ran this it in console, it gave me this error. In oracle 10G it works fine.
    java.lang.StringIndexOutOfBoundsException: String index out of range: 16058
    at java.lang.String.substring(String.java:1765)
    at oracle.dbtools.raptor.scriptrunner.SQL.run(SQL.java:73)
    at oracle.dbtools.raptor.scriptrunner.ScriptRunner.run(ScriptRunner.java:116)
    at oracle.dbtools.raptor.scriptrunner.ScriptRunner.run(ScriptRunner.java:186)
    I think this is a bug in the 9i module.
    -Nags

    Anil kumar wrote:
    Hi,
    Thanks for your reply. Could you please explain your solution in detail?Hi,
    I just have a try...
    create table t (id int,my_lob clob)
    begin
    insert into t values(101,'Oracle redwood shores USA');
    insert into t values (102,'HP palo alto USA');
    insert into t values(103,'Capgemini  FRANCE');;
    end;
    create index my_idx on t(my_lob) indextype is ctxsys.context
    select *
    from t
    where contains(my_lob,'USA',1)>0
    Output
    ID      MY_LOB
    101     Oracle redwood shores USA
    102     HP palo alto USA Hope it helps,
    CKLP

  • File processing failed with java.lang.StringIndexOutOfBoundsException:

    Hi
    I´m reading and sending files to an FTP server using SAP PI. I use file content conversion.
    Everything has been working fine for months - but now the server was changes to a new host. The only thing changed was the host/user and pass.
    But sending too the server fails with this error:
    File processing failed with java.lang.StringIndexOutOfBoundsException: String index out of range: -27
    Any body who has a clue??
    Reading files works ok. And i can transfer files to the FTP server with FileZilla without problems.

    In the file transfer by ftp:
    2011-10-03 17:27:08     Information     Transfer: "BIN" mode, size 737 bytes, encoding -.
    2011-10-03 17:27:08     Error     File processing failed with java.lang.StringIndexOutOfBoundsException: String index out of range: -27
    2011-10-03 17:27:08     Error     Adapter Framework caught exception: String index out of range: -27
    2011-10-03 17:27:08     Error     Delivering the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error occurred while connecting to the FTP server "nnn.nn.nnn.nnn:21": java.lang.StringIndexOutOfBoundsException: String index out of range: -27.
    Its on the adapter level. All mappings etc are fine. And as i write has been for months. The only thing changed are the FTP server

  • Java.lang.StringIndexOutOfBoundsException: String index out of range: -1

    hi am having this error when running my application am in jdeveloper 11.1.1.6.0
    java.lang.StringIndexOutOfBoundsException: String index out of range: -1
         at java.lang.String.substring(String.java:1931)
         at car.deDeedandeSurvey.view.frameworkExt.CustomErrorHandler.displayProperly(CustomErrorHandler.java:66)
         at car.eDeedandeSurvey.view.frameworkExt.CustomErrorHandler.reportException(CustomErrorHandler.java:32)
         at oracle.adf.model.binding.DCBindingContainer.reportException(DCBindingContainer.java:423)
         at oracle.adf.model.binding.DCBindingContainer.reportException(DCBindingContainer.java:471)
         at oracle.adf.model.binding.DCIteratorBinding.getDataControl(DCIteratorBinding.java:2438)
         at oracle.adf.model.binding.DCBindingContainer.internalRefreshControl(DCBindingContainer.java:3069)
         at oracle.adf.model.binding.DCBindingContainer.refreshControl(DCBindingContainer.java:2908)
         at oracle.adf.model.binding.DCBindingContainer.refresh(DCBindingContainer.java:2894)
         at oracle.adfinternal.controller.util.model.DataBindingActivityImpl.beforeExecute(DataBindingActivityImpl.java:109)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.executeActivity(ControlFlowEngine.java:1015)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:921)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:820)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.invokeTaskFlow(ControlFlowEngine.java:243)
         at oracle.adfinternal.controller.state.ChildViewPortContextImpl.invokeTaskFlow(ChildViewPortContextImpl.java:104)
         at oracle.adfinternal.controller.state.ControllerState.createChildViewPort(ControllerState.java:1387)
         at oracle.adfinternal.controller.ControllerContextImpl.createChildViewPort(ControllerContextImpl.java:78)
         at oracle.adf.controller.internal.binding.DCTaskFlowBinding.createRegionViewPortContext(DCTaskFlowBinding.java:474)
         at oracle.adf.controller.internal.binding.DCTaskFlowBinding.getViewPort(DCTaskFlowBinding.java:392)
         at oracle.adf.controller.internal.binding.TaskFlowRegionModel.doProcessBeginRegion(TaskFlowRegionModel.java:164)
         at oracle.adf.controller.internal.binding.TaskFlowRegionModel.processBeginRegion(TaskFlowRegionModel.java:112)
         at oracle.adf.controller.internal.binding.TaskFlowRegionController.doRegionRefresh(TaskFlowRegionController.java:241)
         at oracle.adf.controller.internal.binding.TaskFlowRegionController.refreshRegion(TaskFlowRegionController.java:119)
         at oracle.adf.model.binding.DCBindingContainer.internalRefreshControl(DCBindingContainer.java:3204)
         at oracle.adf.model.binding.DCBindingContainer.refresh(DCBindingContainer.java:2876)
         at oracle.adf.model.binding.DCBindingContainer.internalRefreshControl(DCBindingContainer.java:3195)
         at oracle.adf.model.binding.DCBindingContainer.refresh(DCBindingContainer.java:2876)
         at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.prepareModel(PageLifecycleImpl.java:115)
         at oracle.adf.controller.faces.lifecycle.FacesPageLifecycle.prepareModel(FacesPageLifecycle.java:359)
         at car.eDeedandeSurvey.view.frameworkExt.CustomLifeCycle.prepareModel(CustomLifeCycle.java:15)
         at oracle.adf.controller.v2.lifecycle.Lifecycle$2.execute(Lifecycle.java:137)
         at oracle.adfinternal.controller.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:197)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.access$400(ADFPhaseListener.java:23)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$PhaseInvokerImpl.startPageLifecycle(ADFPhaseListener.java:238)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$1.after(ADFPhaseListener.java:274)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.afterPhase(ADFPhaseListener.java:75)
         at oracle.adfinternal.controller.faces.lifecycle.ADFLifecyclePhaseListener.afterPhase(ADFLifecyclePhaseListener.java:53)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:472)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.portlet.client.adapter.adf.ADFPortletFilter.doFilter(ADFPortletFilter.java:32)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.webcenter.framework.events.dispatcher.EventDispatcherFilter.doFilter(EventDispatcherFilter.java:44)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.wcps.client.PersonalizationFilter.doFilter(PersonalizationFilter.java:75)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.webcenter.content.integration.servlets.ContentServletFilter.doFilter(ContentServletFilter.java:168)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.webcenter.lifecycle.filter.LifecycleLockFilter.doFilter(LifecycleLockFilter.java:151)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:179)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

    The problem occurs at line 66 in class car.deDeedandeSurvey.view.frameworkExt.CustomErrorHandler, which is a non-ADF class, most probably it is a class of your own. Go to line 66 in this class and look at the source code. If it is not clear what happens there, set a breakpoint within the method car.deDeedandeSurvey.view.frameworkExt.CustomErrorHandler.displayProperly and debug it. If you do not have the original source code, then decompile this class and look at the source code. You can set a breakpoint at this line even if you do not have the source code.
    Dimitar

  • Java.lang.StringIndexOutOfBoundsException while deploying webapp

    Hi all,
    I'm trying to deploy an expanded webapp on WebLogic 6.0sp1. It's a
    migration from 5.1, some hundred JSPs, some servlets and custom tags in
    WEB-INF/classes and a few static pages. I placed the web-application
    folder in the applications folder and the server begins the deployment.
    During deployment I get a StringIndexOutOfBoundsException and the
    deployment stops (see log extract below). By the time when this happens,
    there is a new .ear file and a war file (seem to be the same) containing
    my web application. This is a real show-stopper for me, so I'd be glad
    for any recommendations.
    Thanks,
    Daniel
    [java] <14.03.2001 18:28:11 GMT+01:00> <Info> <Management>
    <MBean=(fbsdomain:Name=futuna,Type=Application) Attribute=(LastModified)
    modified from (0) to (984590891366).>
    [java] <14.03.2001 18:28:11 GMT+01:00> <Info> <Management>
    <MBean=(fbsdomain:Name=futuna,Type=WebAppComponent,Application=futuna)
    Attribute=(Application) modified from (null) to (fbsdomain:Name=f
    utuna,Type=Application).>
    [java] <14.03.2001 18:28:11 GMT+01:00> <Info> <Management>
    <MBean=(fbsdomain:Name=futuna,Type=WebAppComponent,Application=futuna)
    Attribute=(Application) modified from (fbsdomain:Name=futuna,Type
    =Application) to (fbsdomain:Name=futuna,Type=Application).>
    [java] <14.03.2001 18:28:11 GMT+01:00> <Info> <Management>
    <MBean=(fbsdomain:Name=futuna,Type=WebAppComponent,Application=futuna)
    Attribute=(URI) modified from (null) to (futuna).>
    [java] <14.03.2001 18:28:11 GMT+01:00> <Info> <Management>
    <MBean=(fbsdomain:Name=futuna,Type=WebAppComponent,Application=futuna)
    Attribute=(ContextPath) modified from (null) to (futuna).>
    [java] <14.03.2001 18:28:11 GMT+01:00> <Info> <Management>
    <MBean=(fbsdomain:Name=futuna,Type=Application) Attribute=(LoadError)
    modified from (null) to (null).>
    [java] <14.03.2001 18:28:16 GMT+01:00> <Info> <HTTP> <[HTTP
    fbsserver] Loading web app: futuna>
    [java] <14.03.2001 18:28:16 GMT+01:00> <Info> <HTTP> <[HTTP
    fbsserver] Loading futuna from WAR file:
    c:\dev\fbs\application\config\fbsdomain\applications\.wl_temp_do_not_del
    ete\wl_local_comp19242
    .war>
    [java] <14.03.2001 18:28:16 GMT+01:00> <Info> <HTTP> <[Default
    WebApp] extracting classfiles to
    c:\dev\fbs\application\config\fbsdomain\applications\.wl_temp_do_not_del
    ete\WEB-INF\_tmp_war_fbsser
    ver_fbsserver_futuna:>
    [java] <14.03.2001 18:28:17 GMT+01:00> <Info> <HTTP> <[Default
    WebApp] extracted classfiles successfully...>
    [java] <14.03.2001 18:28:17 GMT+01:00> <Debug> <HTTP> <Exception
    thrown while loading futuna: java.lang.StringIndexOutOfBoundsException:
    String index out of range: -1>
    [java] <14.03.2001 18:28:17 GMT+01:00> <Error> <J2EE> <Error
    deploying application futuna: Could not load futuna>
    [java] <14.03.2001 18:28:17 GMT+01:00> <Info> <Management>
    <MBean=(fbsdomain:Name=futuna,Type=Application) Attribute=(Deployed)
    modified from (true) to (true).>
    [java] <14.03.2001 18:28:36 GMT+01:00> <Error> <HTTP>
    <HttpServer(4062427,null default ctx,fbsserver) found no context for
    "GET /futuna HTTP/1.1". This should not happen unless the default contex
    t failed to deploy.>
    [java] <14.03.2001 18:28:45 GMT+01:00> <Error> <HTTP>
    <HttpServer(4062427,null default ctx,fbsserver) found no context for
    "GET /futuna/ HTTP/1.1". This should not happen unless the default conte
    xt failed to deploy.>
    [java] <14.03.2001 18:30:27 GMT+01:00> <Info> <HTTP>
    <[WebAppServletContext(4114264,console)] *.html: init>
    [java] <14.03.2001 18:30:27 GMT+01:00> <Info> <HTTP>
    <[WebAppServletContext(4114264,console)] *.html: Using standard I/O>

    Hi Kumar,
    thanks for the hint, but that did not solve the problem. I reworked
    web.xml and weblogic.xml (some 5.1 things inside) and now it works.
    Daniel
    -----Ursprüngliche Nachricht-----
    Von: Kumar Allamraju [mailto:[email protected]]
    Bereitgestellt: Mittwoch, 14. März 2001 22:35
    Bereitgestellt in: install
    Unterhaltung: java.lang.StringIndexOutOfBoundsException while deploying
    webapp
    Betreff: Re: java.lang.StringIndexOutOfBoundsException while deploying
    webapp
    It appears your default webapp failed to deploy.
    Add the following entry (red ink) in your config.xml (carefully) and see
    if you are able to deploy default webapp
    <Application
    Deployed="true"
    Name="DefaultWebApp_myserver"
    Path="./config/myserver/applications"
    >
    <WebAppComponent
    Name="DefaultWebApp_myserver"
    Targets="myserver"
    WebServers="myserver"
    URI="DefaultWebApp_myserver"
    />
    </Application>
    Daniel Hoppe wrote:
    Hi all,
    I'm trying to deploy an expanded webapp on WebLogic 6.0sp1. It's a
    migration from 5.1, some hundred JSPs, some servlets and custom tags in
    WEB-INF/classes and a few static pages. I placed the web-application
    folder in the applications folder and the server begins the deployment.
    During deployment I get a StringIndexOutOfBoundsException and the
    deployment stops (see log extract below). By the time when this happens,
    there is a new .ear file and a war file (seem to be the same) containing
    my web application. This is a real show-stopper for me, so I'd be glad
    for any recommendations.
    Thanks,
    Daniel
    [java] <14.03.2001 18:28:11 GMT+01:00> <Info> <Management>
    <MBean=(fbsdomain:Name=futuna,Type=Application) Attribute=(LastModified)
    modified from (0) to (984590891366).>
    [java] <14.03.2001 18:28:11 GMT+01:00> <Info> <Management>
    <MBean=(fbsdomain:Name=futuna,Type=WebAppComponent,Application=futuna)
    Attribute=(Application) modified from (null) to (fbsdomain:Name=f
    utuna,Type=Application).>
    [java] <14.03.2001 18:28:11 GMT+01:00> <Info> <Management>
    <MBean=(fbsdomain:Name=futuna,Type=WebAppComponent,Application=futuna)
    Attribute=(Application) modified from (fbsdomain:Name=futuna,Type
    =Application) to (fbsdomain:Name=futuna,Type=Application).>
    [java] <14.03.2001 18:28:11 GMT+01:00> <Info> <Management>
    <MBean=(fbsdomain:Name=futuna,Type=WebAppComponent,Application=futuna)
    Attribute=(URI) modified from (null) to (futuna).>
    [java] <14.03.2001 18:28:11 GMT+01:00> <Info> <Management>
    <MBean=(fbsdomain:Name=futuna,Type=WebAppComponent,Application=futuna)
    Attribute=(ContextPath) modified from (null) to (futuna).>
    [java] <14.03.2001 18:28:11 GMT+01:00> <Info> <Management>
    <MBean=(fbsdomain:Name=futuna,Type=Application) Attribute=(LoadError)
    modified from (null) to (null).>
    [java] <14.03.2001 18:28:16 GMT+01:00> <Info> <HTTP> <[HTTP
    fbsserver] Loading web app: futuna>
    [java] <14.03.2001 18:28:16 GMT+01:00> <Info> <HTTP> <[HTTP
    fbsserver] Loading futuna from WAR file:
    c:\dev\fbs\application\config\fbsdomain\applications\.wl_temp_do_not_del
    ete\wl_local_comp19242
    .war>
    [java] <14.03.2001 18:28:16 GMT+01:00> <Info> <HTTP> <[Default
    WebApp] extracting classfiles to
    c:\dev\fbs\application\config\fbsdomain\applications\.wl_temp_do_not_del
    ete\WEB-INF\_tmp_war_fbsser
    ver_fbsserver_futuna:>
    [java] <14.03.2001 18:28:17 GMT+01:00> <Info> <HTTP> <[Default
    WebApp] extracted classfiles successfully...>
    [java] <14.03.2001 18:28:17 GMT+01:00> <Debug> <HTTP> <Exception
    thrown while loading futuna: java.lang.StringIndexOutOfBoundsException:
    String index out of range: -1>
    [java] <14.03.2001 18:28:17 GMT+01:00> <Error> <J2EE> <Error
    deploying application futuna: Could not load futuna>
    [java] <14.03.2001 18:28:17 GMT+01:00> <Info> <Management>
    <MBean=(fbsdomain:Name=futuna,Type=Application) Attribute=(Deployed)
    modified from (true) to (true).>
    [java] <14.03.2001 18:28:36 GMT+01:00> <Error> <HTTP>
    <HttpServer(4062427,null default ctx,fbsserver) found no context for
    "GET /futuna HTTP/1.1". This should not happen unless the default contex
    t failed to deploy.>
    [java] <14.03.2001 18:28:45 GMT+01:00> <Error> <HTTP>
    <HttpServer(4062427,null default ctx,fbsserver) found no context for
    "GET /futuna/ HTTP/1.1". This should not happen unless the default conte
    xt failed to deploy.>
    [java] <14.03.2001 18:30:27 GMT+01:00> <Info> <HTTP>
    <[WebAppServletContext(4114264,console)] *.html: init>
    [java] <14.03.2001 18:30:27 GMT+01:00> <Info> <HTTP>
    <[WebAppServletContext(4114264,console)] *.html: Using standard I/O>

  • Java.lang.StringIndexOutOfBoundsException: String index out of range: -99

    Hi.
    We are having a problem with the jstudio IDE Enterprise Edition.
    We are trying to create an CMP Bean using the IDE.
    The database table has 69 columns of various datatatypes. BUT as soon as i write the create method the following error is logged after all the 69 parameters are added in the create method
    PS : I have tried it on both Standard and Enterprise Edition .......They both give the same error.
    (Note this ocured when i had written all the 69 paramenters for the Database Table !)
    *********** Exception occurred ************ at Wed Sep 22 16:49:05 GMT+05:30 2004
    Annotation: Parser error
    java.lang.StringIndexOutOfBoundsException: String index out of range: -99
         at java.lang.String.<init>(String.java:192)
         at java.lang.String.copyValueOf(String.java:2185)
         at org.netbeans.modules.java.parser.DocumentModelBuilder.setBodyBounds(DocumentModelBuilder.java:105)
         at org.netbeans.modules.java.gj.V8TreeTranslator._case(V8TreeTranslator.java:437)
         at org.netbeans.lib.javac.v8.tree.Tree$MethodDef.visit(Tree.java:460)
         at org.netbeans.modules.java.gj.V8TreeTranslator._case(V8TreeTranslator.java:303)
         at org.netbeans.lib.javac.v8.tree.Tree$ClassDef.visit(Tree.java:407)
         at org.netbeans.modules.java.gj.V8TreeTranslator._case(V8TreeTranslator.java:188)
         at org.netbeans.lib.javac.v8.tree.Tree$TopLevel.visit(Tree.java:344)
         at org.netbeans.modules.java.gj.V8TreeTranslator.process(V8TreeTranslator.java:94)
         at org.netbeans.modules.java.gj.ParserEngine.completeRequest(ParserEngine.java:360)
         at org.netbeans.modules.java.gj.ParserEngine.parseObject(ParserEngine.java:176)
         at org.netbeans.modules.java.gj.JavaParserEngine.process(JavaParserEngine.java:72)
         at org.netbeans.modules.java.parser.ParsingSupport$Processor.process(ParsingSupport.java:711)
         at org.netbeans.modules.java.parser.ParsingSupport$Processor.parseLockModel(ParsingSupport.java:662)
    [catch] at org.netbeans.modules.java.parser.ParsingSupport$Processor.run(ParsingSupport.java:593)
         at org.openide.util.Task.run(Task.java:136)
         at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:328)
         at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:670)
    ==>
    WARNING - ErrorManager detected cyclic exception nesting:
         java.lang.StringIndexOutOfBoundsException: String index out of range: -99
    Be sure not to annotate an exception with itself, directly or indirectly.

    Hi
    Can you send me yoursample to me. I will check the code and let you know whats going wrong. mail your sample to [email protected]
    Thanks
    Vasu

  • Java.lang.StringIndexOutOfBoundsException

    Hello, why does the following program generate a java.lang.StringIndexOutOfBoundsException error when a file is opened:
    Cryptogram.java (main program)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import java.io.*;
    public class Cryptogram extends JFrame
      private static final Enigma codeMachine = new Enigma();
      private static final String letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
      private static final String frequentLetters = "JQXZKBVWFUYMPGCLSDHROANITE";
      private static final int numLetters = letters.length();
      private JFrame thisWindow;
      private JMenuItem openItem, saveItem, exitItem;
      private String pathName = "";
      private JTextField subFields[] = new JTextField[numLetters];
      private JLabel hintLabels[] = new JLabel[numLetters];
      private JTextArea textAreaIn, textAreaOut;
      public Cryptogram()
        super("Cryptogram Solver");
        thisWindow = this;
        JMenuBar menuBar = new JMenuBar();
        JMenu fileMenu = new JMenu("File");
        fileMenu.setMnemonic('F');
        FileAction fileAction = new FileAction();
        openItem = new JMenuItem("Open...");
        openItem.setMnemonic('O');
        openItem.addActionListener(fileAction);
        saveItem = new JMenuItem("Save...");
        saveItem.setMnemonic('S');
        saveItem.addActionListener(fileAction);
        saveItem.setEnabled(false);
        exitItem = new JMenuItem("Exit");
        exitItem.setMnemonic('x');
        exitItem.addActionListener(fileAction);
        fileMenu.add(openItem);
        fileMenu.add(saveItem);
        fileMenu.addSeparator();
        fileMenu.add(exitItem);
        JMenu decodeMenu = new JMenu("Decode");
        decodeMenu.setMnemonic('D');
        DecodeAction decodeAction = new DecodeAction();
        JMenuItem decodeItem = new JMenuItem("Decode");
        decodeItem.setMnemonic('D');
        decodeItem.addActionListener(decodeAction);
        JMenuItem clearItem = new JMenuItem("Clear");
        clearItem.setMnemonic('C');
        clearItem.addActionListener(decodeAction);
        JMenuItem encodeItem = new JMenuItem("Encode");
        encodeItem.setMnemonic('R');
        encodeItem.addActionListener(decodeAction);
        decodeMenu.add(decodeItem);
        decodeMenu.add(clearItem);
        decodeMenu.add(encodeItem);
        menuBar.add(fileMenu);
        menuBar.add(decodeMenu);
        setJMenuBar(menuBar);
        JPanel p1 = new JPanel();
        p1.setPreferredSize(new Dimension(100, 81));
        p1.setLayout(new GridLayout(3, 1, 3, 3));
        p1.add(new JLabel("Code letter:", JLabel.RIGHT));
        p1.add(new JLabel("Stands for:", JLabel.RIGHT));
        p1.add(new JLabel("Computer hints:", JLabel.RIGHT));
        int k;
        JPanel p2 = new JPanel();
        p2.setPreferredSize(new Dimension(569, 81));
        p2.setLayout(new GridLayout(3, 26, 3, 3));
        for (k = 0; k < numLetters; k++)
          p2.add(new JLabel(letters.substring(k, k+1), JLabel.CENTER));
        for (k = 0; k < numLetters; k++)
          JTextField tf = new JTextField();
          tf.setBackground(Color.yellow);
          tf.setHorizontalAlignment(JTextField.CENTER);
          p2.add(tf);
          subFields[k] = tf;
        clearSubs();
        for (k = 0; k < numLetters; k++)
          hintLabels[k] = new JLabel(" ", JLabel.CENTER);
          p2.add(hintLabels[k]);
        JPanel p3 = new JPanel();
        p3.setPreferredSize(new Dimension(80, 81));
        p3.setLayout(new GridLayout(3, 1, 3, 3));
        p3.add(new JPanel());   // filler
        JButton refresh = new JButton("Refresh");
        refresh.addActionListener(decodeAction);
        p3.add(refresh);
        Box b1 = Box.createHorizontalBox();
        b1.add(p1);
        b1.add(Box.createHorizontalStrut(10));
        b1.add(p2);
        b1.add(Box.createHorizontalStrut(10));
        b1.add(p3);
        JPanel p123 = new JPanel();
        p123.add(b1);
        Font font = new Font("Monospaced", Font.PLAIN, 16);
        textAreaIn = new JTextArea(20, 30);
        textAreaIn.setFont(font);
        textAreaIn.setLineWrap(true);
        textAreaIn.setWrapStyleWord(true);
        JScrollPane areaScrollPaneIn = new JScrollPane(textAreaIn);
        areaScrollPaneIn.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        textAreaOut = new JTextArea(20, 30);
        textAreaOut.setFont(font);
        textAreaOut.setLineWrap(true);
        textAreaOut.setWrapStyleWord(true);
        textAreaOut.setEditable(false);
        JScrollPane areaScrollPaneOut = new JScrollPane(textAreaOut);
        areaScrollPaneOut.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
        Box b2 = Box.createHorizontalBox();
        b2.add(areaScrollPaneIn);
        b2.add(Box.createHorizontalStrut(10));
        b2.add(areaScrollPaneOut);
        Container c = getContentPane();
        c.add(p123, BorderLayout.NORTH);
        c.add(b2, BorderLayout.CENTER);
      private void clearSubs()
        StringBuffer subs = new StringBuffer(numLetters);
        for (int k = 0; k < numLetters; k++)
          subFields[k].setText("-");
          subs.append("-");
        codeMachine.setSubstitutions(subs.toString());
      private void normalSubs()
        StringBuffer subs = new StringBuffer(numLetters);
        for (int k = 0; k < numLetters; k++)
          JTextField tf = subFields[k];
          String s = tf.getText();
          if (s.length() < 1)
            s = "-";
          else
            s = s.substring(0,1).toUpperCase();
            if (!Character.isLetter(s.charAt(0)))
              s = "-";
          tf.setText(s);
          subs.append(s);
        codeMachine.setSubstitutions(subs.toString());
      private void randomSubs()
        StringBuffer subs = new StringBuffer(letters);
        int k, n;
        char ch1, ch2;
        for (n = numLetters; n > 1; n--)
          k = (int)(n * Math.random());
          ch1 = subs.charAt(k);
          ch2 = subs.charAt(n-1);
          subs.setCharAt(k, ch2);
          subs.setCharAt(n-1, ch1);
        String s = subs.toString();
        for (k = 0; k < numLetters; k++)
          subFields[k].setText(s.substring(k, k + 1));
        codeMachine.setSubstitutions(s);
      public void setHints(String text)
        int k;
        codeMachine.countLetters(text);
        for (k = 0; k < numLetters; k++)
          int pos = codeMachine.getFrequencyPos(k);
          hintLabels[k].setText(frequentLetters.substring(pos, pos+1));
      /***************          Action Listeners         ****************/
      private class FileAction implements ActionListener
        public void actionPerformed(ActionEvent e)
          int result;
          String text;
          JMenuItem m = (JMenuItem)e.getSource();
          if (m == openItem)
            JFileChooser fileChooser = new JFileChooser(pathName);
            fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
            result = fileChooser.showOpenDialog(thisWindow);
            if (result == JFileChooser.CANCEL_OPTION)
              return;
            File file = fileChooser.getSelectedFile();
            if (file != null)
              pathName = file.getAbsolutePath();
            EasyReader fileIn = new EasyReader(pathName);
            if (fileIn.bad())
              JOptionPane.showMessageDialog(thisWindow, "Invalid File Name",
                          "Cannot open " + pathName, JOptionPane.ERROR_MESSAGE);
            StringBuffer buffer = new StringBuffer((int)file.length());
            char ch;
            while ((ch = fileIn.readChar()) != '\0')
              buffer.append(ch);
            fileIn.close();
            saveItem.setEnabled(true);
            text = buffer.toString();
            textAreaIn.setText(text);
            setHints(text);
            textAreaOut.setText(codeMachine.decode(text));
          else if (m == saveItem)
            JFileChooser fileChooser = new JFileChooser(pathName);
            fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
            result = fileChooser.showSaveDialog(thisWindow);
            if (result == JFileChooser.CANCEL_OPTION)
              return;
            File file = fileChooser.getSelectedFile();
            if (file != null)
              pathName = file.getAbsolutePath();
            EasyWriter fileOut = new EasyWriter(pathName);
            if (fileOut.bad())
              JOptionPane.showMessageDialog(thisWindow, "Invalid File Name",
                          "Cannot create " + pathName, JOptionPane.ERROR_MESSAGE);
            text = textAreaOut.getText();
            fileOut.print(text);
            fileOut.close();
          else if (m == exitItem)
            System.exit(0);
      private class DecodeAction implements ActionListener
        public void actionPerformed(ActionEvent e)
          String cmd = ((AbstractButton)e.getSource()).getActionCommand();
          if ("Refresh".equals(cmd) || "Decode".equals(cmd))
            normalSubs();
          else if ("Clear".equals(cmd))
            clearSubs();
          else if ("Encode".equals(cmd))
            randomSubs();
          textAreaOut.setText(codeMachine.decode(textAreaIn.getText()));
      /***************                  main             ****************/
      public static void main(String[] args)
        Cryptogram window = new Cryptogram();
        window.addWindowListener(new WindowAdapter()
          { public void windowClosing(WindowEvent e) { System.exit(0); }});
        window.setBounds(30, 30, 800, 600);
        window.show();
    Enigma.java
    import java.util.*;
    public class Enigma
         private String lookupTable;
         private int[] letterCount;
         private static String frequentLetters="JQXZKBVWFUYMPGCLSDHROANITE";
         public Enigma()
              lookupTable="--------------------------";
              letterCount=new int[26];
         public void setSubstitutions(String lookupTable) {
              this.lookupTable = lookupTable;
         public String decode(String text)
              String decoded="";
              for(int i=0;i<text.length();i++)
                   if(Character.isLetter(text.charAt(i)))
                        decoded+=lookupTable.charAt((int)text.toLowerCase().charAt(i)-97);
                        if(Character.isUpperCase(text.charAt(i)))
                             Character.toUpperCase(decoded.charAt(decoded.length()-1));
                   else
                        decoded+=text.charAt(i);
              return decoded;
         public void countLetters(String text)
              Arrays.fill(letterCount, 0);
              for(int i=0;i<text.length();i++)
                   if(Character.isLetter(text.charAt(i)))
                   letterCount[((int)Character.toLowerCase(text.charAt(i)))-97]++;
         public int getFrequencyPos(int k)
              char letter=(char)(k+97-1);
              return frequentLetters.indexOf(letter);
    }The specific error:
    Exception in thread "AWT-EventQueue-0" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
         at java.lang.String.substring(Unknown Source)
         at Cryptogram.setHints(Cryptogram.java:214)
         at Cryptogram$FileAction.actionPerformed(Cryptogram.java:254)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.AbstractButton.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)and a text file known to generate this issue:
    Okjcwkn Wusln yox ckbogcnwi gs fvffcwx, oki nbws opp yzrnw ck bsizovpcjx. Nbws pctwi ck nbw Xozob Iwxxwzn oki nzotwpwi gs Jofwprn. Nbw jpcfonw re nbw Xozob cx xvjb nbon nbw ckbogcnoknx botw nr pctw wpxwybwzw, xr jwznock ozwox re nbw iwxxwzn ozw jvpnctonwi gs czzcnoncrk. Nbw lszofcix ozw o zokuw re frvknockx gwnywwk Ezokjw oki Xlock. Nbw Wuslncokx gvcpn nbw lszofcix ck nbw xbolw re bvuw nzcokuvpoz jvgw.
    Nbw Uzwwdx ywzw o bcubps xjvplnvzwi lwrlpw, oki ycnbrvn nbwf yw yrvpik'n botw bcxnrzs. Nbw Uzwwdx opxr boi fsnbx. O fsnb cx o ewfopw frnb. Rkw fsnb xosx nbon nbw frnbwz re Ojbcppwx icllwi bcf ck nbw zctwz Xnska vkncp bw gwjofw cknrppwzogpw. Ojbcppwx ollwozx ck Nbw Cpcoi, gs Brfwz. Brfwz opxr yzrnw Nbw Riicns, ck ybcjb Lwkwprlw yox nbw poxn bozixbcl nbon Vpsxxwx wkivzwi rk bcx mrvzkws. Ojnvopps, Brfwz yox krn yzcnnwk gs Brfwz, gvn gs okrnbwz fok re nbon kofw.
    Xrjzonwx yox o eofrvx uzwwd nwojbwz ybr ywkn ozrvki uctcku lwrlpw oitcjw. Nbws dcppwi bcf. Xrjzonwx icwi ezrf ok rtwzirxw re ywiprjd. Oenwz bcx iwonb, bcx jozwwz xveewzwi o izofoncj iwjpckw.
    Ck nbw Rpsflcj Uofwx, Uzwwdx zok zojwx, mvflwi, bvzpwi nbw gcxjvcnx, oki nbzwy moto. Nbw zwyozi nr nbw tcjnrz yox o jrzop yzwonb.
             Ezrf "Okuvcxbwi Wkupcxb" gs Zcjbozi Pwiwzwz.Thanks! :)
    Edited by: John_Musbach on Feb 27, 2008 11:55 AM

    I fixed the funfunction like so:cti
    public int getFrequencyPos(int k)
              //char letter=(char)(k+97-1);
              //return frequentLetters.indexOf(letter);
              int countOfK=letterCount[k];
              Arrays.sort(letterCount);
              for(int i=0;i<letterCount.length;i++)
                   if(countOfK==letterCount)
                        return i;
              return 0;

  • Java.lang.StringIndexOutOfBoundsException: String index out of range: -2

    Hello,
    I have a question about this error:
    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -2
    I am doing my java development in IBM Rationale eclipse. I am compiling and running everything just fine. When I try to run my application on a command line I get this error. I don't know why this is happening since it is working perfectly in eclipse. I am running a .bat file and here is the .bat file:
    @echo on
    rem ---------------------------------------------------------------------------
    rem Script for launching Translation Application
    rem
    rem Environment Variable Prequisites
    rem
    rem
    rem ---------------------------------------------------------------------------
    cls
    SET DERBY_INSTALL=C:\Translation\Cloudscape_10.1
    SET TRANSLATION=C:\Translation
    set CLASSPATH=%DERBY_INSTALL%\lib\derby.jar;%DERBY_INS TALL%\lib\derbytools.jar;%TRANSLATION%\lib\Transla tion.jar;
    echo %CLASSPATH%
    C:\Translation\jdk\jre\bin\java -classpath %CLASSPATH%;C:\Translation\Conversions src.utilities.DataConversionUtilityDaily
    pause
    Here is the code that is erroring out:
    sqlStatement.append(text.deleteCharAt(text.length( )-2));
    this code is compiling and executing just fine in eclipse but when i try to run it on a command line it gives me the above error.
    Can someone help me find out why my program is not running?

    I am running this same java statement in eclipse and
    I am not getting this error and it runs just fine.
    so i am trying to find out what the difference. Well obviously the difference is that in eclispe the length isn't zero.
    I
    am running the same code with the same data and I am
    getting to different things. No you aren't.
    Because if you were you would be getting the same result.
    You are assuming that it is the same, when in fact it isn't.
    Something is different.

  • Java.lang.StringIndexOutOfBoundsException when trying to create a JDBC pool connection.

    Hi, I get a java.lang.StringIndexOutOfBoundsException when making a JDBC
    pool connection via the console of WLS 7.0. I use SQL Server 2000 in Win2K
    SP2 environment. Exactly the same configuration works perfectly in WinXP
    Pro. Can anyone advise me what might cause this problem? Thanks a lot.
    Log message
    ####<May 13, 2002 5:15:52 PM CEST> <Error> <JDBC> <abcdefgh> <vtsserver>
    <ExecuteThread: '1' for queue: '__weblogic_admin_html_queue'> <kernel
    identity> <> <001060> <Cannot startup connection pool
    "ejbTestConnectionPool" java.lang.StringIndexOutOfBoundsException: String
    index out of range: -1>
    Exception
    java.lang.NullPointerException
    at
    weblogic.management.console.utils.MBeans.getMBeanClassNameFor(MBeans.java:11
    53)
    at
    weblogic.management.console.actions.mbean.EditMBeanAction.getMBeanClass(Edit
    MBeanAction.java:210)
    at
    weblogic.management.console.actions.mbean.EditMBeanAction.getDialogTypeKey(E
    ditMBeanAction.java:188)
    at
    weblogic.management.console.actions.internal.InternalActionContext.setAction
    (InternalActionContext.java:158)
    at
    weblogic.management.console.actions.internal.ActionServlet.doAction(ActionSe
    rvlet.java:170)
    at
    weblogic.management.console.actions.internal.ActionServlet.doPost(ActionServ
    let.java:85)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
    tStubImpl.java:945)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :332)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :242)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
    ebAppServletContext.java:5363)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:721)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
    ntext.java:3043)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
    :2466)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
    --------------- nested within: ------------------
    weblogic.utils.NestedRuntimeException - with nested exception:
    [java.lang.NullPointerException]
    at
    weblogic.management.console.utils.MBeans.getMBeanClassNameFor(MBeans.java:11
    56)
    at
    weblogic.management.console.actions.mbean.EditMBeanAction.getMBeanClass(Edit
    MBeanAction.java:210)
    at
    weblogic.management.console.actions.mbean.EditMBeanAction.getDialogTypeKey(E
    ditMBeanAction.java:188)
    at
    weblogic.management.console.actions.internal.InternalActionContext.setAction
    (InternalActionContext.java:158)
    at
    weblogic.management.console.actions.internal.ActionServlet.doAction(ActionSe
    rvlet.java:170)
    at
    weblogic.management.console.actions.internal.ActionServlet.doPost(ActionServ
    let.java:85)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
    tStubImpl.java:945)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :332)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :242)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
    ebAppServletContext.java:5363)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:721)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
    ntext.java:3043)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
    :2466)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
    --------------- nested within: ------------------
    weblogic.management.console.actions.ActionException - with nested exception:
    [weblogic.utils.NestedRuntimeException - with nested exception:
    [java.lang.NullPointerException]]
    at weblogic.management.console.actions.ErrorAction.(ErrorAction.java:38)
    at
    weblogic.management.console.actions.internal.ActionServlet.doAction(ActionSe
    rvlet.java:190)
    at
    weblogic.management.console.actions.internal.ActionServlet.doPost(ActionServ
    let.java:85)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
    tStubImpl.java:945)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :332)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :242)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
    ebAppServletContext.java:5363)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:721)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
    ntext.java:3043)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
    :2466)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
    Current Date
    Mon May 13 17:15:52 CEST 2002
    Console Release Build
    null
    Console Build
    null
    Server Release Build
    7.0.0.0
    Server Build
    WebLogic Server 7.0 Thu Apr 25 17:16:22 PDT 2002 180709
    All Server Product Versions
    WebLogic Server 7.0 Thu Apr 25 17:16:22 PDT 2002 180709
    WebLogic XMLX Module 7.0 Thu Apr 25 17:26:07 PDT 2002 180709
    Request Info
    Protocol: HTTP/1.1
    ServerName: localhost
    ServerPort: 7001
    Secure: false
    ContextPath: /console
    ServletPath: /common/error.jsp
    QueryString:
    MBean=vtsdomain%3AName%3DejbTestConnectionPool%2CType%3DJDBCConnectionPool
    PathInfo: null
    PathTranslated: null
    RequestURI: /console/common/error.jsp
    AuthType: null
    ContentType: application/x-www-form-urlencoded
    CharacterEncoding: null
    Locale: en_US
    Method: POST
    Session:
    weblogic.servlet.internal.session.MemorySessionData@1926bd
    RequestedSessionId:
    8fMghRfnkcOls1wsW0vIRS8PuQKquWoYcnt6ciUG5uznDJiLr1ZA!-37849198!1021299872710
    RequestedSessionIdFromCookie: true
    RequestedSessionIdFromURL: false
    UserPrincipal: vts
    RemoteUser: vts
    RemoteAddr: 127.0.0.1
    RemoteHost: 127.0.0.1
    Parameters
    MBean = vtsdomain:Name=ejbTestConnectionPool,Type=JDBCConnectionPool
    chosen_wl_control_weblogic.management.configuration.JDBCConnectionPoolMBean.
    Targets-Server = vtsdomain:Name=vtsserver,Type=Server
    weblogic.console.submit_form = dataposted
    wl_control_weblogic.management.configuration.JDBCConnectionPoolMBean.Targets
    -Server = vtsdomain:Name=vtsserver,Type=Server
    Attributes
    wlinternalaction =
    weblogic.management.console.actions.internal.InternalActionContext@4372d8
    java.util.Locale = en_US weblogic.management.console.catalog.Catalog =
    weblogic.management.console.catalog.XmlCatalog@3ca759
    weblogic.management.console.helpers.BrowserHelper = User-Agent: Mozilla/4.0
    (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705) IE: true Netscape:
    false Supported: true JavscriptHrefs: false TableCellClick: true
    DocumentReloadedOnResize: false DropdownStretchable: true CellSpacingBlank:
    false EmptyCellBlank: false ImgOnclickSupported: true TableBorderFancy: true
    PartialToWideTables: false DisabledControlSupported: true
    weblogic.management.console.helpers.DebugHelper =
    weblogic.management.console.helpers.DebugHelper@16ed83
    weblogic.management.console.helpers.UnitsHelper =
    weblogic.management.console.helpers.UnitsHelper@ae2d9
    weblogic.management.console.helpers.UrlHelper =
    weblogic.management.console.helpers.UrlHelper@28fd41
    Headers
    Accept = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
    application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword,
    */* Accept-Encoding = gzip, deflate Accept-Language = en-us Cache-Control =
    no-cache Connection = Keep-Alive Content-Length = 304 Content-Type =
    application/x-www-form-urlencoded Cookie =
    ADMINCONSOLESESSION=8fMghRfnkcOls1wsW0vIRS8PuQKquWoYcnt6ciUG5uznDJiLr1ZA!-37
    849198 Host = localhost:7001 Referer =
    http://localhost:7001/console/actions/mbean/DoEditMBeanAction?MBean=vtsdomai
    n%3AName%3DejbTestConnectionPool%2CType%3DJDBCConnectionPool User-Agent =
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)
    BrowserInfo
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0;
    .NET CLR 1.0.3705)
    IE: true
    Netscape: false
    Supported: true
    JavscriptHrefs: false
    TableCellClick: true
    DocumentReloadedOnResize: false
    DropdownStretchable: true
    CellSpacingBlank: false
    EmptyCellBlank: false
    ImgOnclickSupported: true
    TableBorderFancy: true
    PartialToWideTables: false
    DisabledControlSupported: true

    Thanks, Joe. It works now!
    "Joseph Weinstein" <[email protected]> wrote in message
    news:[email protected]...
    >
    Vladimir wrote:
    Here are the definitions of the two pools - both encounter the same
    problem:
    <JDBCConnectionPool DriverName="weblogic.jdbc.mssqlserver4.Driver"
    Name="ejbTestConPool"
    Properties="db=ejbTest;user=sa;port=1433;password=test;server=localhost"
    TestConnectionsOnRelease="true" TestConnectionsOnReserve="true"
    TestTableName="accounts" URL="weblogic:jdbc:mssqlserver4"/>yep, as I thought. A JDBC URL always starts with 'jdbc'. It should be
    'jdbc:weblogic:mssqlserver4'. Also, make TestConnectionsOnRelease="false"
    (it's a waste of cycles).
    Joe
    <JDBCConnectionPool DriverName="weblogic.jdbc.mssqlserver4.Driver"
    Name="ejbTestConnectionPool" Password="{3DES}sCmdDszi61I="
    Properties="user=sa;db=ejbTest;port=1433;password=test;server=localhost"
    Targets="vtsserver" TestTableName="accounts"
    URL="weblogic:jdbc:mssqlserver4"
    XAPassword="{3DES}sCmdDszi61I="/>
    >>
    Vladimir
    "Joseph Weinstein" <[email protected]> wrote in message
    news:[email protected]...
    show us your pool definitions from the config.xml file. There's
    probably a
    problem
    with the URL or properties.
    Joe
    Vladimir wrote:
    Hi, I get a java.lang.StringIndexOutOfBoundsException when making a
    JDBC
    pool connection via the console of WLS 7.0. I use SQL Server 2000in
    Win2K
    SP2 environment. Exactly the same configuration works perfectly in
    WinXP
    Pro. Can anyone advise me what might cause this problem? Thanks alot.
    >>>>
    Log message
    ####<May 13, 2002 5:15:52 PM CEST> <Error> <JDBC> <abcdefgh><vtsserver>
    <ExecuteThread: '1' for queue: '__weblogic_admin_html_queue'><kernel
    identity> <> <001060> <Cannot startup connection pool
    "ejbTestConnectionPool" java.lang.StringIndexOutOfBoundsException:String
    index out of range: -1>
    Exception
    java.lang.NullPointerException
    at
    weblogic.management.console.utils.MBeans.getMBeanClassNameFor(MBeans.java:11
    53)
    at
    weblogic.management.console.actions.mbean.EditMBeanAction.getMBeanClass(Edit
    MBeanAction.java:210)
    at
    weblogic.management.console.actions.mbean.EditMBeanAction.getDialogTypeKey(E
    ditMBeanAction.java:188)
    at
    weblogic.management.console.actions.internal.InternalActionContext.setAction
    (InternalActionContext.java:158)
    at
    weblogic.management.console.actions.internal.ActionServlet.doAction(ActionSe
    rvlet.java:170)
    at
    weblogic.management.console.actions.internal.ActionServlet.doPost(ActionServ
    let.java:85)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
    tStubImpl.java:945)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :332)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :242)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
    ebAppServletContext.java:5363)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:721)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
    ntext.java:3043)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
    :2466)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
    --------------- nested within: ------------------
    weblogic.utils.NestedRuntimeException - with nested exception:
    [java.lang.NullPointerException]
    at
    weblogic.management.console.utils.MBeans.getMBeanClassNameFor(MBeans.java:11
    56)
    at
    weblogic.management.console.actions.mbean.EditMBeanAction.getMBeanClass(Edit
    MBeanAction.java:210)
    at
    weblogic.management.console.actions.mbean.EditMBeanAction.getDialogTypeKey(E
    ditMBeanAction.java:188)
    at
    weblogic.management.console.actions.internal.InternalActionContext.setAction
    (InternalActionContext.java:158)
    at
    weblogic.management.console.actions.internal.ActionServlet.doAction(ActionSe
    rvlet.java:170)
    at
    weblogic.management.console.actions.internal.ActionServlet.doPost(ActionServ
    let.java:85)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
    tStubImpl.java:945)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :332)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :242)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
    ebAppServletContext.java:5363)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:721)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
    ntext.java:3043)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
    :2466)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
    --------------- nested within: ------------------
    weblogic.management.console.actions.ActionException - with nestedexception:
    [weblogic.utils.NestedRuntimeException - with nested exception:
    [java.lang.NullPointerException]]
    atweblogic.management.console.actions.ErrorAction.(ErrorAction.java:38)
    at
    weblogic.management.console.actions.internal.ActionServlet.doAction(ActionSe
    rvlet.java:190)
    at
    weblogic.management.console.actions.internal.ActionServlet.doPost(ActionServ
    let.java:85)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
    tStubImpl.java:945)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :332)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :242)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
    ebAppServletContext.java:5363)
    at
    weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
    r.java:721)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
    ntext.java:3043)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
    :2466)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
    Current Date
    Mon May 13 17:15:52 CEST 2002
    Console Release Build
    null
    Console Build
    null
    Server Release Build
    7.0.0.0
    Server Build
    WebLogic Server 7.0 Thu Apr 25 17:16:22 PDT 2002 180709
    All Server Product Versions
    WebLogic Server 7.0 Thu Apr 25 17:16:22 PDT 2002 180709
    WebLogic XMLX Module 7.0 Thu Apr 25 17:26:07 PDT 2002 180709
    Request Info
    Protocol: HTTP/1.1
    ServerName: localhost
    ServerPort: 7001
    Secure: false
    ContextPath: /console
    ServletPath: /common/error.jsp
    QueryString:
    MBean=vtsdomain%3AName%3DejbTestConnectionPool%2CType%3DJDBCConnectionPool
    PathInfo: null
    PathTranslated: null
    RequestURI: /console/common/error.jsp
    AuthType: null
    ContentType: application/x-www-form-urlencoded
    CharacterEncoding: null
    Locale: en_US
    Method: POST
    Session:
    weblogic.servlet.internal.session.MemorySessionData@1926bd
    RequestedSessionId:
    8fMghRfnkcOls1wsW0vIRS8PuQKquWoYcnt6ciUG5uznDJiLr1ZA!-37849198!1021299872710
    RequestedSessionIdFromCookie: true
    RequestedSessionIdFromURL: false
    UserPrincipal: vts
    RemoteUser: vts
    RemoteAddr: 127.0.0.1
    RemoteHost: 127.0.0.1
    Parameters
    MBean = vtsdomain:Name=ejbTestConnectionPool,Type=JDBCConnectionPool
    chosen_wl_control_weblogic.management.configuration.JDBCConnectionPoolMBean.
    Targets-Server = vtsdomain:Name=vtsserver,Type=Server
    weblogic.console.submit_form = dataposted
    wl_control_weblogic.management.configuration.JDBCConnectionPoolMBean.Targets
    -Server = vtsdomain:Name=vtsserver,Type=Server
    Attributes
    wlinternalaction =
    weblogic.management.console.actions.internal.InternalActionContext@4372d8
    java.util.Locale = en_US weblogic.management.console.catalog.Catalog=
    weblogic.management.console.catalog.XmlCatalog@3ca759
    weblogic.management.console.helpers.BrowserHelper = User-Agent:Mozilla/4.0
    (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705) IE: trueNetscape:
    false Supported: true JavscriptHrefs: false TableCellClick: true
    DocumentReloadedOnResize: false DropdownStretchable: trueCellSpacingBlank:
    false EmptyCellBlank: false ImgOnclickSupported: true
    TableBorderFancy:
    true
    PartialToWideTables: false DisabledControlSupported: true
    weblogic.management.console.helpers.DebugHelper =
    weblogic.management.console.helpers.DebugHelper@16ed83
    weblogic.management.console.helpers.UnitsHelper =
    weblogic.management.console.helpers.UnitsHelper@ae2d9
    weblogic.management.console.helpers.UrlHelper =
    weblogic.management.console.helpers.UrlHelper@28fd41
    Headers
    Accept = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
    application/vnd.ms-excel, application/vnd.ms-powerpoint,application/msword,
    */* Accept-Encoding = gzip, deflate Accept-Language = en-usCache-Control =
    no-cache Connection = Keep-Alive Content-Length = 304 Content-Type =
    application/x-www-form-urlencoded Cookie =
    ADMINCONSOLESESSION=8fMghRfnkcOls1wsW0vIRS8PuQKquWoYcnt6ciUG5uznDJiLr1ZA!-37
    849198 Host = localhost:7001 Referer =
    http://localhost:7001/console/actions/mbean/DoEditMBeanAction?MBean=vtsdomai
    n%3AName%3DejbTestConnectionPool%2CType%3DJDBCConnectionPoolUser-Agent
    =
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR
    1.0.3705)
    BrowserInfo
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; WindowsNT
    5.0;
    .NET CLR 1.0.3705)
    IE: true
    Netscape: false
    Supported: true
    JavscriptHrefs: false
    TableCellClick: true
    DocumentReloadedOnResize: false
    DropdownStretchable: true
    CellSpacingBlank: false
    EmptyCellBlank: false
    ImgOnclickSupported: true
    TableBorderFancy: true
    PartialToWideTables: false
    DisabledControlSupported: true

  • Java.lang.StringIndexOutOfBoundsException: String index out of range: -9

    working on a project and came across this exception during runtime.
    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -9
         at java.lang.String.substring(Unknown Source)
         at SomethingIsWrong.main(SomethingIsWrong.java:17)
    I'm a bit confused. could anyone shed some light on what im doing wrong? i know it deals with my testingStrings method.
    import java.io.*;
    import java.util.*;
    public class SomethingIsWrong
         static Scanner console = new Scanner(System.in);
         public static void main(String[] args)
              Rectangle method = new Rectangle();
              method.width = 40;
              method.height = 50;
              System.out.println("myRect's area is " + method.area());
              System.out.println("Was it a car or a cat i saw?".substring(-9, 12)); // error here
              testingStrings();
              grades();
         public static void cat(File file)
                                       throws FileNotFoundException
              String line = null;
              Scanner inFile = new Scanner(new FileReader("myFile.txt"));
              try
                   while ((line = inFile.nextLine())!= null)
                        System.out.println(line);
                   return;
              }     finally
                        if (inFile != null)
                             inFile.close();
         public static void grades()
              char grade;
              int testScore = console.next().charAt(0);
              if (testScore < 90)
                   grade = 'A';
              else if (testScore < 80)
                   grade = 'B';
                   else if (testScore < 70)
                        grade = 'C';
                   else if (testScore < 60)
                        grade = 'D';
                   else grade = 'F';
              System.out.println("Grade = " + grade);
         public static void testingStrings()
              String original = new String();
              StringBuilder result = new StringBuilder("hi");
              int index = original.indexOf('a');
              result.setCharAt(0, original.charAt(0));
              result.setCharAt( 1, original.charAt(original.length()-1));
              result.insert(1, original.charAt(4));
              result.append(original.substring(1,4));
              result.insert(3, (original.substring(index, index+2) + " "));
              System.out.println(result);
    final class Rectangle
         public int width;
         public int height;
         public int area()
              int area = width * height;
              return area;
    }

    jtan wrote:
    working on a project and came across this exception during runtime.
    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -9
         at java.lang.String.substring(Unknown Source)
         at SomethingIsWrong.main(SomethingIsWrong.java:17)The error message is telling you exactly what's wrong.
    At line 17 of SomethingIsWring.java, you are calling substring() and passing -9 as one of the parameters. If you read the docs for String and for that method, and if you understand the fundamentals of Java Strings, you'll know why that is a no-no.

  • Error message when  trying to connect Classic 120GB to iTunes    An internal error occurred during: "FindSonarTrackJob". java.lang.NullPointerException

    When trying to connect to iTunes I get this message  
    An internal error occurred during: "FindSonarTrackJob".
    java.lang.NullPointerException

    I too am having this problem and have had, for about a week now.
    I've found that by logging off itunes (if I can), closing it down, and then restarting it, sometimes allows it to work for one transaction (say downloading an updated app). After that it's back to the same error.
    Really annoying.

Maybe you are looking for