Where's the error?? Help....

Hi all,
well, i parse a file with the stream tokenizer and when find a number, i nedd to add it in an array. To verifiy if it works, i'd like to display by example array1[4][2]. But it doesn't work...
Could you please have a look at this code and tell me where the error is?? I'd be very grateful....
Here it is
public void accept() {
          int n;
          int i=0;
          int j=0;
          int l1 = 0;
          int m1 = 0;
try {FileReader fr = new FileReader("test2.dat");
        BufferedReader br = new BufferedReader(fr);
     StreamTokenizer stk = new StreamTokenizer(br);
     int [][] array1 = new int [9][3];
               do {
               n = stk.nextToken();
               while (n != stk.TT_NUMBER);
               do {
               n = stk.nextToken();
               if (n == stk.TT_NUMBER) {
                    double m = stk.nval;
                    m1 = (int) m;
                    n = stk.nextToken();
                    if (n == stk.TT_NUMBER){
                         do {
                         i++;     
                         double l = stk.nval;
                         l1 = (int) l;
                         array1 [m1] = l1;
                         n = stk.nextToken();
                         while (n!= stk.TT_EOL);
               while (n != stk.TT_WORD); //fin du fichier
               int r = array1 [4][2];
               System.out.println(r);
               br.close();
               fr.close();
               catch (IOException ioe1) {
                    System.out.println("io error");
Thanks very much.....

A few general advices for the forums:
- Use code tags when posting code.
- Be more specific than "it doesn't work". Tell what result you get! A compile error? Say so, and give the error. An exception during runtime? Say so, and give the stacktrace. It compiles and runs, but gives unexpected results? Say so, and tell both what results you expected and what you get.
I think your problem is that you try to use '==' for String comparison. That won't work, use String.equals() instead.

Similar Messages

  • Where is the Error? in JSP

    I have develpoed a small application in java. which contains on one servler and one jsp page.
    Here is the servlet code:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    public class Controller extends HttpServlet {
    private static final String CONTENT_TYPE = "text/html";
    //Initialize global variables
    public void init() throws ServletException {
    //Process the HTTP Get request
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    response.setContentType(CONTENT_TYPE);
    // PrintWriter out = response.getWriter();
    String teststring = "Good";
    request.setAttribute("Noman", teststring);
    RequestDispatcher reqdispatcher = this.getServletConfig().getServletContext().getRequestDispatcher("model1.jsp");
    reqdispatcher.forward(request,response);
    //Clean up resources
    public void destroy() {
    and here is the jsp page code:
    <html>
    <head>
    <title>
    model1
    </title>
    </head>
    <body bgcolor="#ffffff">
    <!--<form method="GET" action="Controller">
    JBuilder Generated JSP
    </form><-->
    <% String a = (String)request.getAttribute("Noman"); %>
    <%= a %>
    </body>
    </html>
    I want to pass a string drom servlet to jsp page.
    but when i run the jsp page. it displays null value in string.
    Where is the error.
    i tried it a lot but can not find error in code.
    plz help me.
    Thanks
    Nomi

    i have passed the URL of servlet to run then it shows that error
    Apache Tomcat/4.0.6 - HTTP Status 500 - Internal Server Errortype Exception reportmessage Internal Server Errordescription The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.exception java.lang.IllegalArgumentException: Path model1.jsp does not start with a "/" character
    at org.apache.catalina.core.ApplicationContext.getRequestDispatcher(ApplicationContext.java:572)
    at org.apache.catalina.core.ApplicationContextFacade.getRequestDispatcher(ApplicationContextFacade.java:174)
    at test.Controller.doGet(Controller.java:21)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
    at java.lang.Thread.run(Thread.java:534)
    i have not wrote any "/" character . i dont know what is that ?

  • When target DB is down in which table is the data from source is stored, also where are the error messages stored in ODI

    When target DB is down in which table is the data from source is stored, also where are the error messages stored in ODI( I am not getting any error message in E$_TARGET_ANI_TEST).
    When i am running the interface i am getting the below error against the errored step
    "ORA-01045: user ABC lacks CREATE SESSION privilege; logon denied."
    Only E$_TARGET_ANI_TEST  is created with no data. No such tables like C$_0TARGET_ANI_TEST, I$_TARGET_ANI_TEST are created and also data is not inserted in the target table TARGET_ANI_TEST.

    Hi,
    I have checked that only E$ table is created. C$ and I$ table are not created ( I have selected my target schema as the part for the staging table).
    All the parameters for dropping the tables are selected as "<default>:false".
    I am importing the following KMs with the following parameters:
    1) CKM Oracle
    DROP_ERROR_TABLE
    :false
    DROP_CHECK_TABLE
    :false
    CREATE_ERROR_INDEX
    :true
    COMPATIBLE
    :9
    VALIDATE
    :false
    ENABLE_EDITION_SUPPORT
    :false
    UPGRADE_ERROR_TABLE
    :false
    2) LKM SQL to SQL
    DELETE_TEMPORARY_OBJECTS
    :true
    3) IKM SQL Incremental Update
    INSERT
    :true
    UPDATE
    :true
    COMMIT
    :true
    SYNC_JRN_DELETE
    :true
    FLOW_CONTROL
    :true
    RECYCLE_ERRORS
    :false
    STATIC_CONTROL
    :false
    TRUNCATE
    :false
    DELETE_ALL
    :false
    CREATE_TARG_TABLE
    :false
    DELETE_TEMPORARY_OBJECTS
    :true 

  • Where is the Error-Handler config DB file?

    Where is the Error-Handler config DB file?
    <P>
    All the Config DB files are in the config directory under the
    postoffice directory. Each config file has the same name as the
    Module it's the config for (e.g. Error-Handler contains the configs
    for the Error-Handler.)

    Look in the database alert file - in the "bdump" directory
    Look in the trace files in the "udump" directory
    If still no wiser:
    ALTER system SET event = '31098 trace name context forever, level 2' scope=spfile
    Try again and look for the trace files starting with "s..." in the "udump" directory.

  • Wher's the error? BPPF-BLART IN TD_PROTOCOLLO AND SYST-TCODE NOT IN Z_ECCEZ

    Hi All,
    cuold anyone tell me wher's the error in this code I've used in validation rules of FI?
    BPPF-BLART IN TD_PROTOCOLLO AND SYST-TCODE NOT IN Z_ECCEZIONE
    Thanks

    Hi All,
    cuold anyone tell me wher's the error in this code I've used in validation rules of FI?
    BPPF-BLART IN TD_PROTOCOLLO AND SYST-TCODE NOT IN Z_ECCEZIONE
    Thanks

  • Where is the error ring constant in LV 8.2?

    Where is the Error Ring Constant in LabView 8.2?  It was in the block diagram numerics panel in 7.1.1.

    You might wish to have a look at this.
    Try to take over the world!

  • Where's the error

    hey all, plz if any one can tell me where is the error in this method, its giving me arrayOutOfBounds error:
              for(int i=0; i<arr.length; i++)
                   if(arr[i+1] == arr)
                   result += arr[i]+arr[i+1];
                   if(result > maxResult)
                   maxResult = result;
              System.out.println(maxResult);
    thanks alot
    Abed

    Stop the loop one iteration earlier.
    By the way, both the API description and the error message, as well as the stack trace of an AAIOBE are very obvious and straightforward in pointing out the error's cause.

  • Where is the technical help?

    where is the tech help ? dont get it when we phone

    we are central service in wickford and the website has had the firmware and some tech bulitins removed the main tech phone number is no more when we phone in we now get told off ,
    so i rang the customer tech phone number an was given mark garners phone number who did not divolge any tech help other than look at the forum of which he stated that the answer was there so we looked and no answers what so ever where do we find the document svi01b201207

  • Error in sending mail 2nd time, Where is the fault- Help Please

    Hi friends,
    I had written a program to send mail. Everything is fine, when i send first time. But if I try to send mail 2nd time, It gives the error:
    Exception in Connect: IOException while sending message
    Here is the complete code what i had written, It successfully connects using t.connect();
    the problem in t.send();
    output on JBoss Console is :
    Inside Action
    After Transport t = session.getTransport(protocol)
    before t.connect()
    after t.connect()
    Exception in Connect IOException while sending message
    import java.io.*;
    import java.util.*;
    import javax.activation.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.servlet.http.*;
    import org.apache.struts.action.*;
    public class MsgSend extends Action {
         @Override
         public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request
                   , HttpServletResponse response) throws Exception {
              response.setContentType("text/xml");
              PrintWriter out = response.getWriter();
              System.out.println("Inside Action");
                String to = request.getParameter("to");
             String bcc = request.getParameter("bcc");
             String cc = request.getParameter("cc");
             String subject = request.getParameter("sub");
             String user = request.getParameter("user");
             //String password = request.getParameter("pass");
             String message = request.getParameter("message");
             String from = user + "@domainname.com" ;
             /*Properties props = System.getProperties();
             props.put("mail.smtp.host", "smtp.vsginc.com");
              MailBean  bean = MailBean.getInstance();          
              Session session = bean.getSession();          
              String protocol = "smtp";
              Transport t = session.getTransport(protocol);
              System.out.println("After Transport t =              session.getTransport(protocol)");
             MimeMessage msg = new MimeMessage(session);
             msg.setFrom(new InternetAddress(from));
             InternetAddress[] address = {new InternetAddress(to)};
             msg.setRecipients(Message.RecipientType.TO, address);
             if(cc != null ){
                   InternetAddress ccAddr[]  = InternetAddress.parse(cc);
                   msg.setRecipients(Message.RecipientType.CC, ccAddr);
              if(bcc != null){
                   InternetAddress bccAddr[] = InternetAddress.parse(bcc);
                   msg.setRecipients(Message.RecipientType.BCC,bccAddr);
             msg.setSubject(subject);
             // create and fill the first message part
             MimeBodyPart messageBodyPart = new MimeBodyPart();
             messageBodyPart.setText(message);
             Multipart multipart = new MimeMultipart();
             multipart.addBodyPart(messageBodyPart);
             Attachment attachment = Attachment.getInstance();
             ArrayList<String> fileList = attachment.getFileNames();
             String parentFolder = null;
             for(String path:fileList){
                  File attachmentFile = new File(path);
                  messageBodyPart = new MimeBodyPart();
                  DataSource source = new FileDataSource(attachmentFile);
                  messageBodyPart.setDataHandler(new DataHandler(source));
                  messageBodyPart.setFileName(attachmentFile.getName());
                  multipart.addBodyPart(messageBodyPart);
                  parentFolder = attachmentFile.getParent();
             // add the Multipart to the message
             msg.setContent(multipart);
             // set the Date: header
             msg.setSentDate(new Date());        
             try {
                  System.out.println("before t.connect()");
                   t.connect(bean.getSmtpServer(),bean.getUsername() ,bean.getPassword());
                   System.out.println("after t.connect()");
                   //Error is coming here in this Line.
                   t.sendMessage(msg, msg.getAllRecipients());
                   * System.gc(); will relese the fileHandles, if some resource
                   * still holds it.               
                   System.out.println("before System.gc()");
                   System.gc();
                   * Deleting All the Files from Attachment Folders.
                  System.out.println("before attachmentFolder");
                  File attachmentFolder = new File(parentFolder);
                  System.out.println("Attachment Folder Name is : "+attachmentFolder.getAbsolutePath());
                  if(attachmentFolder.isDirectory()){
                       File[] files = attachmentFolder.listFiles();
                       System.out.println("No of Files For Attachments are: "+files.length);
                       boolean deleteResult = false;
                       for(int i=0; i<files.length; i++ ){
                            deleteResult = files.delete();
                        System.out.println(files[i].getName() + " Delete Staus is :"+ deleteResult);
              System.out.println("All attachments Deleted");
              out.print("<result>Mail has been sent successfully</result>");
              } catch (Exception e) {
                   out.print("<result>Mail sending failed</result>");
                   System.out.println("Exception in Connect "+e.getMessage());
              }finally{
                   t.close();               
              return null;
    Problem only comes, when i send 2nd time or more. What is the problem? Please help me out.
    Thanks for your response in advance. One more thing, Whether to send a mail & receive a mail, we need to create different sessions. one for sending & one for receiving mails.
    Message was edited by:
    Ashish.Mishra16

    I don't see anything obviously wrong in your code. Try adding
    session.setDebug(true);
    You can use the same Session for sending and for reading.
    A Session just encapsulates your configuration parameters,
    so as long as they're the same for both usages, one Session
    is fine.

  • Where is the error message for Debrief line stored?

    Hi,
    I'm writing an sql query to display all the debriefs (and lines) in error and need to display the detailed error message (the field labeled "Error" on the Material tab on Debrief form). Does anyone know where this is stored in tables? I am digging the form and have not found anything yet. Any help is appreciated.
    Sorry - I guess it is - CSF_DEBRIEF_LINES.error_text - But there have been some error records for which I could not find the error message in error_text field and I thought that it was stored somewhere else and that got me confused. - Please ignore the question.
    TIA
    Alka.
    Message was edited by:
    user498444
    Message was edited by:
    user498444

    when you set a picture to be a background of some folder that picture is not moved from its original location. instead a record is made in the .DS_Store file of that folder indicating that this picture is the one to be used for the background. in case of the DVD it is likely sitting in some hidden folder right on the DVD.
    run the following terminal command to enable showing hidden files in finder
    defaults write com.apple.finder AppleShowAllFiles 1; killall Finder
    then look on the dvd and the picture should be there somewhere. if you still can't find it open the .DS_store file of the folder in question using Text Editor. a lot of this file will be unreadable but the picture path will be present in plain text.
    when done rerun the above command after changing 1 to 0.

  • WLS 7 MDB JMSConnection Alive false - where is the error reported?

    I have a few MDBs subscribed to various destinations. One of them is
    subscribed to a queue called jms.queue.queue1 in JNDI. queue1 is a
    regular Queue (not distributed), lives in JMSServer1, which is
    deployed to WLS server1. An entry for it appears in JNDI on each
    server in the cluster (server1 + server2). The MDB lives in an
    ejb-jar which is deployed to the cluster containing server1 & server2.
    In the console, under deployments -> ejb -> myejb.jar -> monitoring ->
    Monitor all Message Driven EJBRuntimes, all the other MDBs have
    "JMSConnection Alive" appearing as "true", but the one subscribed to
    queue1 has "false". I cannot see any exceptions in the server logs.
    Is there any way to get at the reason for the "false"?
    I can use a command-line QueueSender and Receiver on queue1 without a
    problem, using the t3:// url of either of the WLS Servers.
    What's most important to me is where the error is reported - I've had
    this problem a couple of times and it seemed to go away on its own.
    I'm not getting any diagnositics right now.
    Many thanks,
    Jeremy.

    I guess you got the answer by this time.
    IF not the answer is:
    Use enable the TX flags in the JMSConnectionFactory. Goto console. Select
    the JMSConnectionFactory (what MDB is using). Click on the trnsactions tab.
    Check the boxes there.
    Cheers,
    ..maruthi
    "Jeremy Watson" <[email protected]> wrote in message
    news:[email protected]..
    >
    I "stumbled on" this - if you set these system properties:
    weblogic.ejb20.jms.connect.verbose=trueweblogic.ejb20.jms.connect.debug=true
    >
    ..then you get some informative error messages from the EJB runtime as ittries
    to connect to the JMS destination. In my case, I got the followingexception coming
    out:
    [JMSConnectionPoller] : ** FAILED TO CONNECT TO JMS WITH:weblogic.ejb20.WLDeploymentException:
    Message Driven Bean 'mdb3' is transacted but the provider defined in theejb is not
    transacted. Provider should be transacted if onMessage method in MDB istransacted.
    >
    >
    Apologies for double-posting. Thanks for the piece of direction Tom (inthe jms group),
    which helped me find the answer.
    Jeremy.

  • Q: Where is the "errors message" reference?

    Folks,
    I'm trying to startup an instance of iFS but I'm facing some problems. When I execute the command line "ifsstartdomain" and enter the values on the dialog window, the following errors occurs:
    "IFS-45002: Unable to start domain controller/domain
    oracle.ifs.common.IfsException: IFS-20101: Unable to determine whether service exists(null)
    oracle.ifs.common.IfsException: IFS-19001: Required parameter was null (service name)"
    Does anybody know what is happening? I didn't find this errors in any documentation.
    Thanks in advance,
    Bruno Moreno

    Luis,
    I have entered BMORENO-BRA(my machine) in Domain Controller field, 53140(default port) in port field and the password of the IFSSYS schema in the password field.
    The main question is where I can find the errors documentation so I won't disturb you when I meet some news problems.

  • Where is the "Photoshop Help Folder" located on the Mac?

    Hi all,
    I am trying to install Strata 3D tryout and it is asking for the location of the "Additional How To Content" folder, inside the "Photoshop Help Folder". I cannot find the "Photoshop Help Folder"... can someone tell me where it is located?
    Thanks a lot in advance for your assistance:)
    Christine

    If you are not online and choose help, you'll get a html-based and non-updated version that's being read from your Libraries' Application Support folder.
    If you want a help.pdf you can get it here:
    http://help.adobe.com/en_US/Photoshop/11.0/photoshop_cs4_help.pdf
    But by using the online version you're always up to date with Adobe, as probably is intended hence the help setup.
    Torben.

  • Where is the error support link now??

    There used to be very good knowledge base when esupport was there...
    http://primussupport.hyperion.com/esupport/esupport/consumer/esupport.asp?
    But now no esupport.... there is somesort of knowledge base in the new oracle metalink but i cannot find any support for even the common errors there..
    where is the esupport error msg support now???
    any idea???

    metalink 3?

  • Where is the error hiding

    CFC Code:
    <cffunction name="comp_extList"
    access="remote"
    returntype="query"
    description="Get a list of employees, phone extensions, and
    departments">
    <cfargument name="abbrCode" required="yes" />
    <cfargument name="searchBox" required="no" />
    <cfset searchBox = UCASE("#arguments.searchBox#") />
    <cfldap name="phoneList"
    server="#cfc.ldap.server#"
    username="[email protected]"
    password="#cfc.ldap.key#"
    action="query"
    filter="company=#arguments.abbrCode#"
    start="dc=bii, dc=corp"
    scope="subtree"
    attributes="sn,givenName,telephoneNumber,department"
    sort="sn ASC"
    port="389" />
    <cfif len(arguments.searchBox) GT 0>
    <cfquery name="phoneList" dbtype="query">
    SELECT *
    FROM phoneList
    WHERE (UPPER(givenName) LIKE '%#searchBox#%'
    OR UPPER(sn) LIKE '%#searchBox#%'
    OR telephoneNumber LIKE '%#searchBox#%')
    AND telephoneNumber <> ''
    </cfquery>
    <cfelse>
    <cfquery name="phoneList" dbtype="query">
    SELECT sn,givenName,telephoneNumber,department
    FROM phoneList
    WHERE telephoneNumber <> ''
    </cfquery>
    </cfif>
    <cfreturn phoneList>
    </cffunction>
    I need to pass entered information for a search, but I
    receive error message:
    element searchbox is undefined in arguments.

    The error is not hiding at all actually. First, I recommend
    scoping all your variables. Inside a <cffunction> you can use
    <cfset var myLocalVar = "" /> to keep the variables local.
    But I noticed that you have this line:
    <cfargument name="searchBox" required="no" />
    The searchBox argument is not required, but you're using it
    the very next line:
    <cfset searchBox = UCASE("#arguments.searchBox#") />
    Since the argument is not required, it may not be passed in
    and hence won't exist in the arguments scope. The way to fix this
    is giving it a default value like so:
    <cfargument name="searchBox" required="no" default=""
    type="string" />
    That way if nothing is passed, Arguments.searchBox will still
    have a value.

Maybe you are looking for

  • Purchase order and message details

    Hi gurus, We have a requirement of generating a report of how the purchase orders are being sent to vendor. Is there any table or tables that stores information of a purchase order number and how the message (output type) has been processed to vendor

  • Reg: Dashboard page Name not getting displayed.

    Hi I have created a dashboard Dashboard1 and it has 5 different pages pg1 thru pg5. I have 5 users USER1,USER2.USER3,USER4 and USER5. I have assigned each page to a user and all the users have access to Dashboard1 i.e USER1 pg1 of Dashboard1 USER2 pg

  • Flash URL open in same window

    Hello. I have a flash slide on my site. The slide has next and previous buttons to either move to the next slide or the previous slide. Each slide is only an image. When you click a particular image it takes you to the page specific to the image you

  • JAXB: Creating Java content tree from scratch - examples?

    I'm trying to create XML output by building the content tree from scratch (using a the DDI schema which is fairly complex). I don't have any existing XML instances. Sample application 3 in Sun's JAXB tutorial doesn't give enough info about how to rel

  • Auto hide video controls

    have not use flash in years, so I am wondering if anybody can help me with a basic questions. I want to make a mock-up kiosk presentation. What would be the best adobe product to use for this, i was thinking towards in design as what i have most expe