title: Type mismatch: cannot convert from Integer to int
body: <p>Thank you for the replies so far. </p>
  
  <p>The exception stack trace is below. As for the java compiler being used, it is whatever is running in Websphere Application Server v6.1 within this version of the tool. And adding _b resolved the error on some of the lines but not all of them. I'm not sure that that would be the correct logic to use here. But I won't know that until I actually get it running again. set.Attribute("rowcount",rowcount); also has the first error before and after changing it to set.Attribute("rowcount",rowcount_b);  So for this variable your solution had no effect. Strange. The whole problem is just strange to me.</p>
  
  <pre><code>Integer rowcount_b = (Integer) session.getAttribute("rowcount");  
  if (rowcount_b == null) {
      session.setAttribute("rowcount",rowcount_b);
  }
  // else {
  //   rowcount = rowcount_b;
  // }
  </code></pre>
  
  <p>I had to do the commenting out of these three lines with all of the if statements of this flavor when attempting to apply your suggestion. But it did not matter with rowcount.</p>
  
  <pre><code> at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.translateJsp(AbstractJSPExtensionServletWrapper.java:571)
      at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper._checkForTranslation(AbstractJSPExtensionServletWrapper.java:444)
      at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.checkForTranslation(AbstractJSPExtensionServletWrapper.java:306)
      at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:148)
      at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:295)
      at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3673)
      at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:269)
      at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:831)
      at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
      at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:133)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:457)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:300)
      at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
      at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
      at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
      at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
      at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
      at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
      at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
      at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1593)
  </code></pre>
  
  <p>I am using ...</p>
  
  <p>IBM Rational® Application Developer™ for WebSphere® Software</p>
  
  <p>Version: 7.5.5.5 iFix1
     Build ID: RADO7555iFix1-I20120913_1613</p>
  
  <p>The errors I receive are:</p>
  
  <p>The method setAttribute(String, Object) in the type HttpSession is not applicable for the arguments (String, int)</p>
  
  <blockquote>
    <p>Type mismatch: cannot convert from Integer to int</p>
  </blockquote>
  
  <p>They occur on these lines:</p>
  
  <pre><code> session.setAttribute("rowsremaining",rowsremaining);
   rowsremaining = rowsremaining_b;
   session.setAttribute("pos",pos);
   pos = pos_b;
  </code></pre>
  
  <p>Of the following code (snippet):</p>
  
  <pre><code>if (session.getAttribute("searchresults") != null) {   // Tests to make sure the session information was created and passed back from the servlet.
                                                          // If yes, press on, otherwise, display error msg
  
        ArrayList resultsArray = (ArrayList) session.getAttribute("searchresults");
  
        if (resultsArray.size()&gt;0) {
           int totaldata = resultsArray.size();  
           int totalrows = totaldata / 10;
  
           int remainingdata = resultsArray.size(); 
           int rowsremaining = remainingdata/10; 
  
       // The starting position within the list of returned information
  
          int pos = 0; 
  
       // The starting row count - decremented for each row displayed
  
          int rowcount = 10;  
  
       // Get the previously stored values of rowsremaining and pos, 
       //if this is the same search, otherwise, they will be as defined above
  
          Integer rowsremaining_b = (Integer) session.getAttribute("rowsremaining");  
          if (rowsremaining_b == null) {
             session.setAttribute("rowsremaining",rowsremaining);
          }
          else {
            rowsremaining = rowsremaining_b;
          }
  
          Integer pos_b = (Integer) session.getAttribute("pos");  
          if (pos_b == null) {
             session.setAttribute("pos",pos);
          }
          else {
            pos = pos_b;
          }
  </code></pre>
  
  <p>This was working before, ie., no runtime errors, so I'm not sure what I messed with just
     yet to suddenly gain these errors upon clicking "Run on Server1". After noticing the errors </p>
  
  <p>I set </p>
  
  <p><code>Windows --&gt; Preferences --&gt; Java --&gt; Compiler --&gt; Error/Warnings --&gt; Potential Programming Problems --&gt; Boxing and Unboxing conversions</code> </p>
  
  <p>from its default value of Ignore to Error so that I could see the above lines which were the ones in error. Because traveling to the java file via </p>
  
  <p><code>Program Files --&gt; IBM --&gt; SDP --&gt; runtimes --&gt; base_v61 --&gt; profiles --&gt; was61profile1 --&gt; temp --&gt; node ...</code> </p>
  
  <p>all the way to the war directory was a bit of a pain :-) (after opening with an editor that shows me the line numbers that were mentioned). </p>