Learning servlet, unresolve error

This is my first servlet that ive done using apache tomcat as my servlet container, and my code is
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Demo1 extends HttpServlet{
public void doGet(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException{
PrintWriter pwOut = res.getWriter();
pwOut.println("Hello everybody!!!");
and my web.xml file code is
<?xml version="1.0"?>
<web-app>
<servlet>
<servlet-name>Demo1</servlet-name>
<servlet-class>Demo1</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Demo1</servlet-name>
<url-pattern>/demo</url-pattern>
</servlet-mapping>
</web-app>
Please can anyone help me to determine what causes this error.
exception
javax.servlet.ServletException: Error allocating a servlet instance
     org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
     org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
     org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
     org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
     org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
     org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
     org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
     java.lang.Thread.run(Thread.java:595)
root cause
java.lang.UnsupportedClassVersionError: Bad version number in .class file
     java.lang.ClassLoader.defineClass1(Native Method)
     java.lang.ClassLoader.defineClass(ClassLoader.java:620)
     java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
     org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1853)
     org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:875)
     org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1330)
     org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209)
     org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
     org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
     org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
     org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
     org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
     org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
     org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
     java.lang.Thread.run(Thread.java:595)

Yes I think so, I set my environment variable path to jdk1.5.0_10
C:\>java -version
java version "1.5.0_10"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03)
Java HotSpot(TM) Client VM (build 1.5.0_10-b03, mixed mode, sharing)
and my tomcat server information are: (I copy and paste from tomcat manager page)
Tomcat Version: Apache Tomcat/5.5.26
JVM Version: 1.5.0_10-b03
......others
and I used Texpad to compile my servlet

Similar Messages

  • Oracle XSQL Servlet Parse Error when anchoring a link to an image

    I have a database of document links that I wish to portray in a table as graphic images. In other words, each image is a hypertext link to the document.
    From my HTML 101 I used to do this as follows:
    <IMG SRC="image.gif">
    Note, no </IMG> end tag, but this produces an image that I can click to access that document. Lousy form, but it works.
    When I run my XSL with corresponding XSQL file to create the HTML file I get the following Servlet Parse Error:
    Oracle XSQL Servlet Page Processor 1.0.1.0 (Production)
    XSQL-006: XSLT stylesheet is not well-formed: ucmDatabase3.xsl
    XML parse error at line 66, char 15
    End tag does not match start tag 'img'
    I then added the </IMG> end tag,
    <IMG SRC="image.gif"> </IMG>
    which satisfies the parser, but now I get my graphic image AND the underlined linked text together in the same table cell, which SUCKS...
    Is there a way around this madness?
    Thanks for your comments..
    Jon Kotas
    Boeing
    Canoga Park, CA

    Remember that an XSLT stylesheet is, in particular, a well-formed XML document. In a well-formed XML document, you
    cannot have an unterminated element like:
      <foo>
        <bar>  <!-- This elemenent is not closed correctly -->
      </foo>So, in your example, you're running into the problem with
    your <IMG> tag, since you have:
      <A>
        <IMG src="...">  <!-- This elt is not closed correctly -->
      </A>You just need to close the IMG tag by changing the closing > to /> instead, like this:
      <A>
        <IMG src="..."/>  <!-- This elt *IS* closed correctly -->
      </A>When it's written out to the browser, you'll see that the
    trailing slash will be removed, so the browser will be
    happy, too.

  • Newbie wants to learn servlets + intermedia

    I'd like to use Intermedia in our web content management tool, and I'm trying to learn servlet-based image management and meta-data searching as quickly as possible.
    Outside of the standard documentation, what resources would be the best to help me minimize the learning curve?
    thanks for your help...

    One thing I would do is look at the samples, especially:
    http://otn.oracle.com/sample_code/products/intermedia/htdocs/intermedia_servlet_jsp_samples/imedia_servlet_jsp_readme.htm

  • Simple servlet shoed error in tomcat server sql error

    import java.sql.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class submit extends HttpServlet
         //Connection con;
         public void doGet(HttpServletRequest req,HttpServletResponse res) throws IOException,ServletException
         String str1,str2;
         str1=req.getParameter("emailid");
         str2=req.getParameter("comment");
         System.out.println(str1);
         System.out.println(str2);
         res.setContentType("text/html");
         PrintWriter out=res.getWriter();
            try {
             Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            //connection object created using DriverManager class
            //addtodatabase is the name of the database
            Connection connect =DriverManager.getConnection("jdbc:odbc:booksrc");
            //creating prepared statement object pstm so that query can be sent to database
            PreparedStatement pstm=connect.prepareStatement("insert into gbook(emailid, comment) values(?,?)");
            pstm.setString(1,str1);
            pstm.setString(2,str2);
            //execute method to execute the query
            pstm.executeUpdate();
            out.println("<html><h2>Guest Book is Successfully Updated</h2></html>");
             //closing the prepared statement  and connection object
             pstm.close();
             connect.close();
           catch(SQLException sqe)
             System.out.println("SQl error");
            catch(ClassNotFoundException cnf)
             System.out.println("Class not found error");
    public void doPost(HttpServletRequest req,HttpServletResponse res) throws
    ServletException,IOException{
    doGet(req,res);
    }

    How about a little effort and initiative on your part? Did you try Google[1]?
    [1] http://www.google.com/search?q=%5BMicrosoft%5D%5Bodbc+manager%5Ddata+source+name+not+found+and+no+default+driver+specified
    P.S. You've not specified your DB and I'm pretty sure you've not setup a system DSN
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    ----------------------------------------------------------------

  • While running servlets getting errors 404 or 505 resource not found

    Hi all,
    I'm novice to J2EE.
    I've encountered a problem while accessing the deployed module in weblogic 8.1 server.
    I'm sure that the webapplication module is deployed as i saw my module in administration console & also the status said that it is deployed.
    when i access my web application by specifying the proper server and port no and context root it is showing
    either 505 - resource not found error(http://localhost:7001/Suresh-2/Suresh) or 404 - not found error.( http://localhost:7001/Suresh-2/Suresh)
    Now let me elaborate what i've done till now.
    My webapplication folder structure is : C:\bea\user_projects\domains\mydomain\applications\Suresh\WEB-INF\classes\Sai\ServExamp.class
    My servlet is ServExamp.java
    I created a folder called "Suresh".  In that folder created another folder called "WEB-INF".  In WEB-INF created a folder called "Classes".
    Since my servlet is in package "Sai", the .class file reside in \Suresh\WEB-INF\Classes\Sai\ServExamp.class
    The source code is :
    package Sai;
    import javax.servlet.;*
    import javax.servlet.http.;*
    import java.io.;*
    public class ServExamp extends HttpServlet
    public void doPost(HttpServletRequest req,HttpServletResponse res)throws IOException
    PrintWriter out=res.getWriter();
    java.util.Date today=new java.util.Date();
    out.println("<html>"+"<body>"+
    *"<h1 align=center>HF\'s Chapter1 Servlet </h1>"*
    +"<br>"+today+"</body>"+"</html>");
    Now i'm almost done creating a web application.  Next, I constructed a simple web.xml descriptor that gives a web friendly name for my servlet, and points to the servlet. I constructed  web.xml descriptor file in the WEB-INF folder (C:\bea\user_projects\domains\mydomain\applications\Suresh\WEB-INF\).
    The web.xml file source is :
    *<!DOCTYPE web-app*
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    *"http://java.sun.com/dtd/web-app_2_3.dtd">*
    *<web-app>*
    *<display-name>Hello World Web Application</display-name>*
    *<description>Test Servlet</description>*
    *<servlet>*
    *<servlet-name>ServExamp</servlet-name>*
    *<servlet-class>Sai.ServExamp</servlet-class>*
    *</servlet>*
    *<servlet-mapping>*
    *<servlet-name>ServExamp</servlet-name>*
    *<url-pattern>/Suresh</url-pattern>*
    *</servlet-mapping>*
    *</web-app>*
    Now I have told Weblogic that the URI /Suresh corresponds to my servlet "Sai.ServExamp".
    My Web Application is ready to be deployed at this point. I logged onto Weblogic's admin console,
    *1) clicked on deployments, then navigated to "Web Application Modules" .*
    *2) Clicked "Deploy new Web Application Module"*
    *3) Navigated to the location of your web application folder (Suresh). There was a radio button next to it indicating that I can select that folder as a valid web application.*
    *4) I Clicked that radio button and clicked "Target Module".*
    *5) It informed that my web application "Suresh" will be deployed to myServer.It asked a name for my web application deployment. By default it was "Suresh"*
    I clicked Deploy.
    *6) After deployment, my web application "Suresh" appeared in the "Web Application Modules" tree on the left.*
    I Clicked on "Suresh"( my web application) then clicked the testing tab, then clicked the link shown there(http://localhost:7001/Suresh-2).
    It was not showing  my servlet (showed a 403 error)
    Error - 403
    This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.
    I think so it came b'coz I don't have an index.html or index.jsp page.
    *7)Instead,I added my servlet on to the URL it provided.*
    http://localhost:7001/Suresh-2/Suresh
    It is showing these error code: Http: 505 resource not allowed
    The page cannot be displayed
    The page you are looking for cannot be displayed because the address is incorrect.
    Please try the following:
    If you typed the page address in the Address bar, check that it is entered correctly.
    Open the localhost:7001 home page and then look for links to the information you want.
    Click  Search to look for information on the Internet.
    when i just type : http://localhost:7001/   -> Error 404 not found error
    it's showing
    Error 404--Not Found
    From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
    *10.4.5 404 Not Found*
    The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.
    If the server does not wish to make this information available to the client, the status code 403 (Forbidden) can be used instead. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address.
    I want to run my web application & any help would be appreciated.
    Thanks in advance.
    with regards,
    S.SayeeNarayanan.
    Note: I even deployed my war file, which i got by execution of (jar cv0f webapp.war . ) command from the root directory of my web application i.e. Suresh
    Then executed my webapplication it is showing
    error-505 resource not allowed.
    --------------------------------------------------------------------------------------------

    nammathamizhan wrote:
    Hi all,
    I'm novice to J2EE.
    You're also a novice to this forum.
    First, turn off the bold font.
    Second, post your question once and only once to a single forum. You only waited an hour before reposting your question. That's not the way this works. Asking your question multiple times will not increase the likelihood that you''ll get an answer. As a matter of fact, you're guaranteed nothing at all. Give it your best effort and hope for success. This isn't a paid consultancy - we're volunteers.
    I've encountered a problem while accessing the deployed module in weblogic 8.1 server.
    I'm sure that the webapplication module is deployed as i saw my module in administration console & also the status said that it is deployed.
    when i access my web application by specifying the proper server and port no and context root it is showing
    either 505 - resource not found error(http://localhost:7001/Suresh-2/Suresh) or 404 - not found error.( http://localhost:7001/Suresh-2/Suresh)
    If you're correct, and it's deployed, that would suggest that the URL you gave is incorrect.
    >
    Now let me elaborate what i've done till now.Good info - almost too much.
    %

  • XSLT Servlet with error..

    I have the following XSLT servlet code,,,,,
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    import java.net.*;
    import java.beans.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.Source;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.transform.stream.StreamResult;
    import com.allisontransmission.requestJB;
    import org.apache.xml.utils.XMLString;
    /*import org.xml.sax.SAXException;
    import org.apache.xalan.xslt.XSLTProcessorFactory;
    import org.apache.xalan.xslt.XSLTInputSource;
    import org.apache.xalan.xslt.XSLTResultTarget;
    import org.apache.xalan.xslt.XSLTProcessor;*/
    public class ViewPurchaseOrder extends HttpServlet {
    com.allisontransmission.requestJB requestBean = new com.allisontransmission.requestJB();
    public boolean isValid(HttpSession localSession) {
    if (localSession.getValue("VendorID") != null) {
    return true;
    } else {
    return false;
    public void renderXML(HttpServletRequest req, PrintWriter out) {
    try {
    TransformerFactory tFactory = TransformerFactory.newInstance();
    // tFactory.setAttribute("UseValidation", false);
    Source xmlSource = new StreamSource(new File(requestBean.getProperty("DataPath")+"purchaseorders/" + req.getParameter("FileToView")).toURL().toExternalForm());
    Source xslSource = new StreamSource(new File(requestBean.getProperty("ApplicationPath")+"purchaseorder/purchaseorders.xsl").toURL().toExternalForm());
    Transformer transformer = tFactory.newTransformer(xslSource);
    transformer.transform(xmlSource,new StreamResult(out));
    /*// Process Requested XML doc in Xalan
    XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
    // Added 01/04/01
    processor.getXMLProcessorLiaison().setUseValidation(false);
    processor.process(new XSLTInputSource("http://localhost/data/purchaseorders/" + req.getParameter("FileToView")),
    new XSLTInputSource("http://localhost/purchaseorder/purchaseorders.xsl"),
    new XSLTResultTarget(out));*/
    } catch (Exception e) {out.print(e);}
    and rest ........
    i am getting error in my jsp as;
    javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: org.apache.xml.utils.WrappedRuntimeException: Could not find variable with the name of lineItem
    Here the variable lineItem is in the xsl file.,,as
    <td id="table-bordered-li-inner" colspan="7">
    <xsl:apply-templates select="E1EDPT1"><xsl:with-param name="lineItem" select="POSEX"/></xsl:apply-templates>
    <table><xsl:apply-templates select="/ZORDCHG05/IDOC/E1EDK01/Z1CHANGEHIST"><xsl:with-param name="lineItem" select="POSEX"/></xsl:apply-templates></table>
    </td>
    Thanks for any help.......
    [email protected]

    Is lineitem param also declared in the E1EDPT1 element xsl:template?
    <xsl:template match="E1EDPT1">
    <xsl:param name="lineitem"/>
    </xsl:template>

  • SQL statement in servlet giving error

    Please let me know if I need to post this on a different forum, but I thought it was applicable to here.
    First, let me preface this post by saying I've inserted hardcoded values at the DB (Oracle) level and it worked just fine, so most of the statement is sound. All the values inserted properly when testing it that way. Also, I've printed the SQL statement to the console and all looks ok there, too.
    Out of this, I'm getting an error citing the following:
    java.lang.ArrayIndexOutOfBoundsException
    also occasionally getting the following error:
    java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state
    In my servlet, I'm attempting the following:
    prior to the insert statement, I'm retrieving the last row number to start the increment from as in:
    Statement stmt = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
    ResultSet rst = stmt.executeQuery("select CHANGE_CTRL_ID from CHANGE_CONTROL_USER order by CHANGE_CTRL_ID");
         rst.last();
         int lastRowNum = Integer.valueOf(rst.getString("CHANGE_CTRL_ID")).intValue();
         rst.close();
         stmt.close();
    ------------ then ------------------------------------------------
    String preparedQuery = "INSERT ALL " +
    "INTO CHANGE_CONTROL_USER " +
    "(CHANGE_CTRL_ID,REQUESTOR_NAME,REQUESTOR_EMAIL,BUS_CONTACT,DEPT,LOCATION,PHONE_NUM,DATE_REQ," +
    "BUSVP,VP_PHONE,VP_DATE,BRANCH,PRIORITY,OPS_MAN_CHG,OPS_MAN_PPCHAP,TRAIN_REQ," +
    "EXIST_SYS_FLD_CHG,BUS_RULES_CHG,NEW_CODING,NEW_BUS_RULE,NEW_SYS_FIELD,REQ_TYPE_OTHER,REQ_OTHER_SPECIFY,IMPACT_RE_COLL," +
    "IMPACT_DEF_LM,IMPACT_DEF_REC_NRE,IMPACT_AUDIT,IMPACT_PERS_COLL,IMPACT_DEF_FCL,IMPACT_BUS_TECH,IMPACT_LEGAL,IMPACT_PRIV_COLL," +
    "IMPACT_DEF_BKRUP_RE,IMPACT_DEC_SUPT,IMPACT_RISK_MGT,IMPACT_DEF_REO,IMPACT_DEF_BKRUP_NRE,IMPACT_QUALSVCS,IMPACT_INTERNAL_CTRL,IMPACT_DEF_WKFL," +
    "IMPACT_DEF_WKOUT,IMPACT_TRAIN_TPI,IMPACT_OTHER,IMPACT_DEF_MGT,IMPACT_DEF_TAX,IMPACT_VEND_MGT,IMPACT_DEF_CTRL,IMPACT_DEF_REC_RE," +
    "IMPACT_BUS_ADMIN,IMPACT_OTHER_SPECIFY,CHANGE_IN_KPMG,CHANGE_IN_OTS,CHANGE_IN_NFR,CHANGE_IN_ARR,CHANGE_IN_BRR, CHANGE_IN_PROC_IMP," +
    "CHANGE_IN_INT_CITI_POL,CHANGE_IN_OTHER,CHANGE_IN_OTHER_SPECIFY, CHANGE_INIT_DETAILS,REQ_INFO_DESCRIPT,REQ_INFO_EXPLAIN_CURRBUS,REQ_INFO_EXPLAIN_PROPOSED,REQ_BEN_PROP_BENEFIT,REQ_BEN_FIN_IMPLEMENT," +
    "REQ_BEN_OPS_IMPLEMENT,YES_FORM,VULN_ASSESS, CBA_CHG, RISK_ACCEPT,MARSITEM, GCCRFP, APP_COMPL_QUES,CAP_EXPEND)" +
    " VALUES (changecontrol_user_seq.nextval,?,?,?,?,?,?,to_date(?,'YYYY-MON-DD HH:MI:SS'),?,?,to_date(?,'YYYY-MON-DD HH:MI:SS'),?,?," + "?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,"
    + "?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
    + "INTO CHANGE_CONTROL_ADMIN "
    + "(AID,CHANGE_CTRL_ID,ADMNAME,CLOSEDATE,ACTIVE)"
    + "VALUES (changecontrol_admin_seq.nextval, changecontrol_user_seq.currval,NULL, NULL, -1)"
    + "SELECT object_name AS REQUESTOR_NAME FROM all_objects where rownum <= 1;";     
    also I've declared all the respective strings for the PreparedQuery statement.
    If you need to see those, here they are:
    PreparedStatement pstmt = connection.prepareStatement(preparedQuery);
                   // stmt = connection.stmt("INSERT INTO RMIS_USER VALUES (?,?,?,?,to_date(?,'YYYY-MON-DD HH:MI:SS'),?,?,?,?,to_date(?,'YYYY-MM-DD HH:MI:SS')");
              pstmt.setInt(1,++lastRowNum);
              pstmt.setString(2,reqName);
              pstmt.setString(3,reqemail);
              pstmt.setString(4,buscont);
              pstmt.setString(5,reqDept);
              pstmt.setString(6,reqLocale);
              pstmt.setString(7,phone_num);
              pstmt.setDate(8,dtreq);
              //pstmt.setCalendar(8,rtnow);
              pstmt.setString(9,busvp_email);
              pstmt.setString(10,vpphone);
              pstmt.setDate(11,dt);
              pstmt.setString(12,branch);
              pstmt.setString(13,priority);
              pstmt.setString(14,opsmanchg);
              pstmt.setString(15,opsmanppchap);
              pstmt.setString(16,train_req);
              pstmt.setString(17,reqexist_sys_fld_chg);
              pstmt.setString(18,reqbus_rules_chg);
              pstmt.setString(19,reqnew_coding);
              pstmt.setString(20,reqnewbus_rule );
              pstmt.setString(21,reqnew_sys_fld);
              pstmt.setString(22,reqother);
              pstmt.setString(23,req_other_specify);
              pstmt.setString(24,imp_recoll);
              pstmt.setString(25,imp_deflm);
              pstmt.setString(26,imp_defrecnre);
              pstmt.setString(27,imp_audit);
              pstmt.setString(28,imppers_coll);
              pstmt.setString(29,imp_deffcl);
              pstmt.setString(30,imp_bustech);
              pstmt.setString(31,imp_legal);
              pstmt.setString(32,imp_privcoll);
              pstmt.setString(33,imp_defbkre);
              pstmt.setString(34,imp_decsupt);
              pstmt.setString(35,imp_riskmgt);
              pstmt.setString(36,imp_defreo);
              pstmt.setString(37,imp_defbknre);
              pstmt.setString(38,imp_qualsvc);
              pstmt.setString(39,imp_intlctrl);
              pstmt.setString(40,imp_defwkfl);
              pstmt.setString(41,imp_defwkout);
              pstmt.setString(42,imp_trtpi);
              pstmt.setString(43,impact_other);
              pstmt.setString(44,imp_defmgt);
              pstmt.setString(45,imp_deftax);
              pstmt.setString(46,imp_vendmgt);
              pstmt.setString(47,imp_defctrl);
              pstmt.setString(48,imp_defrecre);
              pstmt.setString(49,imp_busadm);
              pstmt.setString(50,impact_other_specify);
              pstmt.setString(51,change_in_kpmg);
              pstmt.setString(52,change_in_ots);
              pstmt.setString(53,change_in_nfr);
              pstmt.setString(54,change_in_arr);
              pstmt.setString(55,change_in_brr);
              pstmt.setString(56,change_in_proc_imp);
              pstmt.setString(57,change_inter_citpol);
              pstmt.setString(58,change_in_other);
              pstmt.setString(59,change_in_other_specify);
              pstmt.setString(60,change_init_details);
              pstmt.setString(61,req_info_descript);
              pstmt.setString(62,req_info_explain_currbus);
              pstmt.setString63,req_info_explain_proposed);
              pstmt.setString(64,req_ben_prop_benefit);
              pstmt.setString(65,req_ben_fin_implement);
              pstmt.setString(66,req_ben_ops_implement);
              pstmt.setString(67,projyes);
              pstmt.setString(68,vulnass);
              pstmt.setString(69,cbachg);
              pstmt.setString(70,riskacc);
              pstmt.setString(71,marsitem);
              pstmt.setString(72,gccrfp);
              pstmt.setString(73,applcomp);
              pstmt.setString(74,capexpend);
              pstmt.executeUpdate();
    if anyone sees anything flawed here, please let me know!
    Thanks!
    Message was edited by:
    bpropes20
    Message was edited by:
    bpropes20
    Message was edited by:
    bpropes20

    What a mess. First off, the line pstmt.setInt(1,++lastRowNum); just needs to go away. You're already using a sequence to set the value for the primary keys, you don't need to add a mistake like this.
    I then count 73 question marks (you can verify, I'm not counting again.) That would mean that your indices are off by one, and the ArrayIndexOutOfBounds is probably coming from pstmt.setString(74,capexpend); Dump the ++lastRowNum line, change all of your indices (after verifying the bind count!) and try it again.
    You can see an inherent weakness in the PreparedStatement clauses - one change means manually rewriting all of the indices. A solution is dumping all of your bind values into a List, then loop through the list to do your setXXX statements. If all binds are not of the same type, you can bind the values to some object that identifies type and use those objects in the list instead of the values. A little more complex, but easier to maintain in my opinion.

  • Oreilly.servlet.MultipartRequest Error

    I'm trying to use the oreilly servlet to upload files to my server. I using BEA Weblogic and I'm compiling the servlet via classspath. I use the cos.jar and the servlet.jar to compile my servlet. Everything compiles fine. However, When I try to upload a file, I get this error:
    java.lang.NoClassDefFoundError: com/oreilly/servlet/MultipartRequest
    at com.jspservletcookbook.UploadServlet.doPost(UploadServlet.java:22)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    What I'm I doing wrong. Please help me.

    Put cos.jar into the WEB-INF/lib directory of your web app.
    It needs it at runtime as well as compile time.

  • Learning Map html error

    Hi, im having this problem with Learning maps, and cant figure out what is the problem, I keep having the same error message:
    "Logon Error Message"
    "http://sci.itsgroup.com.br:8000/sap/bc/solman/defaultUser/LearningMap/start.htm wurde abgebrochen, da der entsprechende Service nicht verfügbar ist."
    "    *  Der Abbruch trat auf dem System SCI und mit dem Fehlercode 404 und dem Grund No Extension Found auf.
    Der ausgewählte virtuelle Host war 0 . "
    But I belive ive already done everything for correct functioning of learning maps.
    All the following services are active:
    /sap/bc/bsp/sap/learning_map
    /default_host/sap/bc/bsp/sap
    /default_host/sap/bc/bsp/sap/system
    /default_host/sap/bc/bsp/sap/public/bc
    /def ault_host/sap/public/bc
    /default_host/sap/public/bc/ur
    /default_host/sap/public/bsp/sap/public
    /default_host/sap/public/bsp/sap/public/bc
    /defaul t_host/sap/public/bsp/sap/system
    /default_host/sap/public/bsp/sap/htmlb
    Ive also creates the External Alias:
    /default_host/sap/bc/bsp/sap/learning_map
    /default_host/sap/bc/solman
    The services also have the correct HTML user set in logon data. Im using the user "SOLARSERVICE" with the role SAP_SOL_LEARNING_MAP_DIS.
    And also my FQDN is correct, becose all my other html aplication as: workcenters, issue mgmt, test sequence are working fine.
    There is anything ive done wrong or missed?

    Hi Magus,
    This may be worth a try - at work here we have a proxy server defined in our browser settings so can you check your settings and disable any proxy server for IE or Firefox etc?
    This should bypass your error and connect to your SolMan as it seems you have correctly completed all other tasks.
    Thanks,
    -Rohan

  • Solution Manager Learning Map http error 403

    Hi,
    I created a new learning map in solution manager using solar_learning_map, when I attempted to display the learning map in the web browser i received the following error.
    <i><URL> call was terminated because the corresponding service is not available.
    The termination occurred in system ISD with error code 403 and for the reason Forbidden.
    The selected virtual host was 0 .</i>
    If anyone else has experienced this error before can you please give me some guidance on resolving this issue.

    The Note exists in service marketplace. (Topic is Inactive services in the Internet Comm Framework).Here is the solution as per the Note.
    Solution
    Listed below are some services that must be activated in the system
    depending on the operational scenario:
    Support for the Internet protocol (HTTP, HTTPS and SMTP) in the SAP Web Application Server
    /default_host/sap/public/icman
    Note: After you have installed SAP Web Application Server, you must ensure that this service is activated in transaction SICF. Through this the ICMan process can (for example) make decisions concerning the distribution of HTTP requests to the corresponding server.
    Using load distribution
    with the message server
    /default_host/sap/public/icf_info
    /default_host/sap/public/icf_info/logon_groups
    /default_host/sap/public/icf_info/urlprefix
    with the Web Dispatcher
    /default_host/sap/public/icf_info
    /default_host/sap/public/icf_info/icr_groups
    /default_host/sap/public/icf_info/icr_urlprefix
    Using Business Server Pages (BSP)
    /default_host/sap/bc/bsp/sap
    /default_host/sap/bc/bsp/sap/system
    /default_host/sap/bc/bsp/sap/public/bc
    /default_host/sap/public/bc (available for 620 with Support Package 34)
    /default_host/sap/public/bc/ur (available for 620 with Support Package34)
    /default_host/sap/public/bsp/sap/public
    /default_host/sap/public/bsp/sap/public/bc
    /default_host/sap/public/bsp/sap/system
    /default_host/sap/public/bsp/sap/htmlb (as of Release 620 Support Package SAPKB62026)
    Note: In addition to these general BSP services, you still have to activate the corresponding application services in the ICF tree. The service for the application is generally found under the ICF node /default_host/sap/bc/bsp/sap/<application>.
    Using the BSP logon procedure
    /default_host/sap/public/bsp/sap
    /default_host/sap/bc/bsp/sap/system
    /default_host/sap/public/bsp/sap/public
    /default_host/sap/public/bsp/sap/system
    BSP test applications for troubleshooting
    /default_host/sap/bc/bsp/sap/it00
    /default_host/sap/bc/bsp/sap/sbspext_htmlb
    /default_host/sap/bc/bsp/sap/sbspext_xhtmlb
    /default_host/sap/bc/bsp/sap/htmlb_samples
    As of Release 6.30:
    /default_host/sap/bc/bsp/sap/bsp_verificatio
    Using Business Information Warehouse (BW)
    /default_host/sap/bw
    Web Applications
    /default_host/sap/bw/BEx
    /default_host/sap/bw/Mime
    Reporting agent preliminary calculation
    /default_host/sap/bw/ps
    Drag and Relate in the portal
    /default_host/sap/bw/dr
    Data access using XMLA
    /default_host/sap/bw/xml and all subordinate subservices
    Document integration in the BEx Analyzer and Web Applications.
    /default_host/sap/bw/doc and all subordinate subservices
    Formatted reporting
    /default_host/sap/bw/ce_url
    Assignment of SAP icons
    /default_host/sap/public/bc
    /default_host/sap/public/bc/icons
    /default_host/sap/public/bc/icons_rtl
    /default_host/sap/public/bc/webicons
    /default_host/sap/public/bc/pictograms
    Assignment of Web Dynpro ABAP (WDA) applications
    /default_host/sap/bc/webdynpro
    /default_host/sap/public/bc
    /default_host/sap/public/bc/ur
    /default_host/sap/public/bc/icons
    /default_host/sap/public/bc/icons_rtl
    /default_host/sap/public/bc/webicons
    /default_host/sap/public/bc/pictograms
    /default_host/sap/public/bc/webdynpro/* (ssr, mimes, and so on)
    /default_host/sap/public/myssocntl
    Note: In addition to these general WDA services, the corresponding application services in the ICF tree also need to be activated. The service for the application is generally found under the ICF node /default_host/sap/bc/webdynpro/sap/<application>.
    Assignment of Web Dynpro ABAP (WDA) development environment
    /default_host/sap/bc/webdynpro/sap/public/bc/viewdesigner/
    /default_host/sap/bc/wdvd/
    /default_host/sap/bc/webdynpro/sap/configure_application
    /default_host/sap/bc/webdynpro/sap/configure_component
    /default_host/sap/bc/webdynpro/sap/wd_analyze_config_appl
    /default_host/sap/bc/webdynpro/sap/wd_analyze_config_comp
    /default_host/sap/bc/webdynpro/sap/wd_analyze_config_user
    Note: These ICF nodes are used for the WDA configuration editor ONLY. The nodes are only allowed to be active in a development system, and under no circumstances in a production system (due to a security risk).
    WDA test applications for troubleshooting
    /default_host/sap/bc/webdynpro/sap/wdr_test_events
    /default_host/sap/bc/webdynpro/sap/wdr_test_ui_elements
    /default_host/sap/bc/webdynpro/sap/wdr_test_table
    /default_host/sap/bc/webdynpro/sap/wdr_test_popups_rt
    ICF test applications:
    /default_host/sap/bc/echo
    Among other things, this service returns information about the registration procedure being used, the header and form fields, and the generated SSO cookie for the executed request. Therefore, this service should only be activated for troubleshooting purposes.
    /default_host/sap/bc/error
    This service generates some error situations in the system and should only be activated for troubleshooting purposes.
    /default_host/sap/bc/srt/xip/sap
    You want to fix the Web service error message "Could not determine WSDL address (ICF_ERROR), SRT_REG038" in connection with XI services.
    Using Support Package SAPKB62006, the following problems were solved in connection with inactive services:
    The "RAISE_EXCEPTION" ABAP runtime error no longer occurs for an inactive host.
    The error text "Forbidden" was replaced with "Service is not active" for an inactive service.
    Thanks
    Sudhan Shan

  • Applet in jsp from servlet, but error: ClassNotFoundExcep

    The problem that I'm having is already mentioned a couple of times in this forum, but unfortunately I haven't found a solution, in thread http://forum.java.sun.com/thread.jspa?forumID=33&threadID=239405 is proposed solution but it's not working for me.
    I'm developing a project in IBM's Websphere Developer Studio 5.1.1. and JRE that I'm using for this project is 1.4.2. I have created servlet "CompanyDocument.java" and applet "SimpleApplet.java". Applet was created as single project and then imported into this one, that means that it's contained in current project as "SimpleAppletPackage.jar". I have placed jar in folder "Applets", Websphere automatically creates folder "simpleAppletPackage" and in it's root complied "SimpleApplet.class".
    When I put following code in the jsp page applet works correctly when application is runed.
    <APPLET code="simpleAppletPackage/SimpleApplet.class" codebase="Applets" archive="SimpleAppletPackage.jar" width="250" height="250"></APPLET>
    But I wanted to create jsp from servlet. So I used this code within servlet:
    out.print("<APPLET code=\"simpleAppletPackage/SimpleApplet.class\" codebase=\"Applets\"");
    out.print("archive=\"SimpleAppletPackage.jar\" width=\"250\" height=\"250\"></APPLET>");
    But I get an error (when running, no error when compiling). The error is copied from Java console:
    load: class simpleAppletPackage/SimpleApplet.class not found.
    java.lang.ClassNotFoundException: simpleAppletPackage.SimpleApplet.class
    at sun.applet.AppletClassLoader.findClass AppletClassLoader.java:162)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:123)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:566)
    at sun.applet.AppletPanel.createApplet(AppletPanel.java:619)
    at sun.plugin.AppletViewer.createApplet(Unknown Source)
    at sun.applet.AppletPanel.runLoader(AppletPanel.java:548)
    at sun.applet.AppletPanel.run(AppletPanel.java:299)
    at java.lang.Thread.run(Thread.java:534)
    Caused by: java.io.IOException: open HTTP connection failed.
    at sun.applet.AppletClassLoader.getBytes(AppletClassLoader.java:265)
    at sun.applet.AppletClassLoader.access$100(AppletClassLoader.java:43)
    at sun.applet.AppletClassLoader$1.run(AppletClassLoader.java:152)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:149)
    ... 9 more
    In the same time I'm creating some more code from servlet and it works with no errors and is shown in browser properly (it consists of connection to Oracle, formatting table, and presenting data within that table).
    Any idea? I'm totally stuck.

    In your browser, look at the HTML code that gets sent to the browser and see if there is something wrong with it.
    Specifically, I would look at the code near the <APPLET ..></APPLET> tags, both before and after and look for stray quotes, brackets, or what not.
    Finally, I would look inside the <APPLET ...> tag. It appears to me that the output will probably be:
    <APPLET code="simpleAppletPackage/SimpleApplet.class" codebase="Applets"archive="SimpleAppletPackage.jar" width="250" height="250"></APPLET>See, you may be missing a space between the "Applets" and the archive=. Try making the second out.print look like this:
    out.print(" archive=\"SimpleAppletPackage.jar\" width=\"250\" height=\"250\"></APPLET>"); See the extra space at the start of the output?

  • Please help with SSL POST: Servlet returns Error 500

    I am struggling for many days to get a Java program to log in to an SSL page. The program is supposed to track ADSL usage statistics from https://secure.telkomsa.net/titracker/, but I never seem to get around Server returned Error 500.
    Could anyone please help me understand what I am doing wrong by looking at the method I used. (It seems on the server side it is a jsp servlet that handles authentication).
    Any help is deeply appreciated!
    I copy-paste the method directly from NetBeans:
    CODE>
    void connectHTTPS(String url){
    try {
    URL page = new URL(url); // login page necessary to get a jsp session cookie
    //------------ SET UP SSL - is it right?
    System.setProperty("java.protocol.handler.pkgs",
    "com.sun.net.ssl.internal.www.protocol");
    try {
    //if we have the JSSE provider available,
    //and it has not already been
    //set, add it as a new provide to the Security class.
    final Class clsFactory = Class.forName("com.sun.net.ssl.internal.ssl.Provider");
    if( (null != clsFactory) && (null == Security.getProvider("SunJSSE")) )
    Security.addProvider((Provider)clsFactory.newInstance());
    } catch( ClassNotFoundException cfe ) {
    throw new Exception("Unable to load the JSSE SSL stream handler." +
    "Check classpath." + cfe.toString());
    URLConnection urlc = page.openConnection();
    urlc.setDoInput(true);
    *Get the session id cookie set by the TelkomInternet java server
    String cookie = urlc.getHeaderField("Set-Cookie");
    //textpane.setText(totextpane);
    textpane.setText(cookie);
    //---------------- form an auth request and post it with the cookie
    String postdata =URLEncoder.encode("ID_Field","UTF-8")+"="+URLEncoder.encode("myusrname","UTF-8")+"&"+URLEncoder.encode("PW_Field","UTF-8")+"="+URLEncoder.encode("mypwd","UTF-8")+"&"+URLEncoder.encode("confirm","UTF-8")+"="+URLEncoder.encode("false","UTF-8");
    // set the servlet that handles authentication as target
    URL page2 = new URL("https://secure.telkomsa.net/titracker/servlet/LoginServlet");
    // cast to httpConn to enable setRequestMethod()
    HttpURLConnection urlc2 = (HttpURLConnection)page2.openConnection();
    // formulate request with POST data urlc2.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
    urlc2.setRequestMethod("POST"); // experimental
    urlc2.setRequestProperty("Content-Length",""+postdata.length());
    urlc2.setRequestProperty("User-Agent","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)");
    urlc2.setRequestProperty("Accept-Language","en-us");
    urlc2.setUseCaches(false);
    urlc2.setDoOutput(true);
    urlc2.setDoInput(true);
    urlc2.setFollowRedirects(true); // ??
    //send cookies
    urlc2.setRequestProperty("Set-Cookie", cookie); // or "Cookie" - doesn't work either
    //write other data
    PrintWriter out = new PrintWriter(urlc2.getOutputStream());
    out.print(postdata); // username and password here
    out.flush();
    out.close();
    //---------------- get the authenticated page with real ADSL statistics
    BufferedReader br = new BufferedReader(new InputStreamReader(urlc2.getInputStream()));
    String totextpane = "";
    String buffer = "";
    while (buffer != null) {
    try {
    totextpane = totextpane + "\n" + buffer;
    buffer = br.readLine();
    } catch (IOException ioe) {
    ioe.printStackTrace();
    break;
    textpane.setText(totextpane);
    } catch (Exception ex) {
    System.err.println(ex.getMessage());
    ---- END CODE---
    Thank you very much for any attempt at helping with this problem!

    I am struggling for many days to get a Java program to log in to an SSL page. The program is supposed to track ADSL usage statistics from https://secure.telkomsa.net/titracker/, but I never seem to get around Server returned Error 500.
    Could anyone please help me understand what I am doing wrong by looking at the method I used. (It seems on the server side it is a jsp servlet that handles authentication).
    Any help is deeply appreciated!
    I copy-paste the method directly from NetBeans:
    CODE>
    void connectHTTPS(String url){
    try {
    URL page = new URL(url); // login page necessary to get a jsp session cookie
    //------------ SET UP SSL - is it right?
    System.setProperty("java.protocol.handler.pkgs",
    "com.sun.net.ssl.internal.www.protocol");
    try {
    //if we have the JSSE provider available,
    //and it has not already been
    //set, add it as a new provide to the Security class.
    final Class clsFactory = Class.forName("com.sun.net.ssl.internal.ssl.Provider");
    if( (null != clsFactory) && (null == Security.getProvider("SunJSSE")) )
    Security.addProvider((Provider)clsFactory.newInstance());
    } catch( ClassNotFoundException cfe ) {
    throw new Exception("Unable to load the JSSE SSL stream handler." +
    "Check classpath." + cfe.toString());
    URLConnection urlc = page.openConnection();
    urlc.setDoInput(true);
    *Get the session id cookie set by the TelkomInternet java server
    String cookie = urlc.getHeaderField("Set-Cookie");
    //textpane.setText(totextpane);
    textpane.setText(cookie);
    //---------------- form an auth request and post it with the cookie
    String postdata =URLEncoder.encode("ID_Field","UTF-8")+"="+URLEncoder.encode("myusrname","UTF-8")+"&"+URLEncoder.encode("PW_Field","UTF-8")+"="+URLEncoder.encode("mypwd","UTF-8")+"&"+URLEncoder.encode("confirm","UTF-8")+"="+URLEncoder.encode("false","UTF-8");
    // set the servlet that handles authentication as target
    URL page2 = new URL("https://secure.telkomsa.net/titracker/servlet/LoginServlet");
    // cast to httpConn to enable setRequestMethod()
    HttpURLConnection urlc2 = (HttpURLConnection)page2.openConnection();
    // formulate request with POST data urlc2.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
    urlc2.setRequestMethod("POST"); // experimental
    urlc2.setRequestProperty("Content-Length",""+postdata.length());
    urlc2.setRequestProperty("User-Agent","Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)");
    urlc2.setRequestProperty("Accept-Language","en-us");
    urlc2.setUseCaches(false);
    urlc2.setDoOutput(true);
    urlc2.setDoInput(true);
    urlc2.setFollowRedirects(true); // ??
    //send cookies
    urlc2.setRequestProperty("Set-Cookie", cookie); // or "Cookie" - doesn't work either
    //write other data
    PrintWriter out = new PrintWriter(urlc2.getOutputStream());
    out.print(postdata); // username and password here
    out.flush();
    out.close();
    //---------------- get the authenticated page with real ADSL statistics
    BufferedReader br = new BufferedReader(new InputStreamReader(urlc2.getInputStream()));
    String totextpane = "";
    String buffer = "";
    while (buffer != null) {
    try {
    totextpane = totextpane + "\n" + buffer;
    buffer = br.readLine();
    } catch (IOException ioe) {
    ioe.printStackTrace();
    break;
    textpane.setText(totextpane);
    } catch (Exception ex) {
    System.err.println(ex.getMessage());
    ---- END CODE---
    Thank you very much for any attempt at helping with this problem!

  • SERVLET-put_nonserial error for non-Distributable WebApp

    iPlanet App Server 6.0 SP3 Test Drive
    I am trying to deploy a web app that is NOT "Distributable." The Deployment Descriptor (web.xml file) does not have a "distributable" element. Furthermore, I set the Mode to Local in the iAS Admin Tool, after I found that had assumed Distributed!
    This should work, according to the Servlet Spec v2.2, right?
    In spite of the above, the kjs log shows:
    [22/Jan/2002 23:34:05:3] error: SERVLET-put_nonserial: Putting non-serializable object when using NAS session
    This suggests that the NAS session logic does not pay any attention to the Distributable attribute of the servlet. Since the Admin Tool didn't pay attention to it, I'm not sure I should be surprised. Nevertheless, the problem remains that I have an application that I should be able to deploy, but which is not functioning properly! I look forward to any helpful suggestions.

    If you have to deal with none serializeable objects, add this to your ias-web.xml file:
    <session-info>
    <impl>lite</impl>
    </session-info>

  • Portal Release 1 (1.2.2.2) with servlet portlets Error

    Hi,
    Iam trying to get a servlet to work as portlet but I am getting the following error:
    Can anybody help me with this problem.
    [31/07/2003 13:29:38:484 CEST] sample/init
    [31/07/2003 13:29:41:171 CEST] vertis/Response status: 500 : java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest: method setAttribute(Ljava/lang/String;Ljava/lang/Object;)V not found
         at com.nl.vertis.pd.controller.PdController.doGet(PdController.java:56)
         at com.nl.vertis.pd.controller.PdController.doPost(PdController.java:68)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:521)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         at oracle.portal.provider.v1.http.Servlet20Renderer.renderBody(Servlet20Renderer.java:155)
         at oracle.portal.provider.v1.RenderManager.render(RenderManager.java:165)
         at oracle.portal.provider.v1.http.ServletProviderResponse.showPortlet(ServletProviderResponse.java:524)
         at oracle.portal.provider.v1.http.HttpProvider.dispatchProviderAction(HttpProvider.java:660)
         at oracle.portal.provider.v1.http.HttpProvider.service(HttpProvider.java:390)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
         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)Below is the provider config I use for this servlet-portlet
       <portlet class="oracle.portal.provider.v1.http.DefaultPortlet">
          <id>1</id>
          <name>LOIServletController</name>
          <title>LOI Servlet Controller</title>
          <description>LOI Servlet Controller description</description>
          <timeout>10</timeout>
          <timeoutMessage>LOI/PD controller timed out</timeoutMessage>
          <hasHelp>false</hasHelp>
          <hasAbout>false</hasAbout>
          <showDetails>false</showDetails>
          <showEdit>false</showEdit>
          <showEditDefault>false</showEditDefault>
          <acceptContentType>text/html</acceptContentType>
          <renderer class="oracle.portal.provider.v1.RenderManager">
             <appPath>&virtualRoot;</appPath>
             <appRoot>&physicalRoot;</appRoot>
             <contentType>text/html</contentType>
             <charSet>UTF-8</charSet>
             <renderContainer>true</renderContainer>
             <showPage class="oracle.portal.provider.v1.http.Servlet20Renderer">
                <servletClass>com.nl.vertis.pd.controller.PdController</servletClass>
             </showPage>
          </renderer>
          <personalizationManager class="oracle.portal.provider.v1.FilePersonalizationManager">
             <dataClass>oracle.portal.provider.v1.http.BaseCustomization</dataClass>
             <useHashing>true</useHashing>
          </personalizationManager>
       </portlet>

    Thanx,
    But how do I do that???
    Ive got the following servlet that functions as a controller. How do I recode it to work with jserv and pdk V2/1 or can u point me to some portal/servlet related examples?
    And then especially the get/setAttribute and dispatch functions.
    package com.nl.vertis.pd.controller;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.PrintWriter;
    import java.io.IOException;
    import java.util.Map;
    import java.util.Set;
    import java.util.Iterator;
    import java.util.Enumeration;
    import java.util.Vector;
    import oracle.portal.provider.v1.*;
    import oracle.portal.provider.v1.http.*;
    import com.nl.vertis.util.GenericConfigObject;
    import com.nl.vertis.pd.data.*;
    import com.nl.vertis.blueprint.model.Constants;
    import com.vertis.util.log.*;
    import com.vertis.util.log.handler.*;
    public class PdController  extends HttpServlet implements Constants {
      private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
      private String _firstAction = "Search.do";
      private Config _cnf = null;
      private AppModuleLOIImpl _app = new AppModuleLOIImpl();
      private GenericConfigObject _obj = null;
      private BasicLog _logger = null;
      public void init(ServletConfig config) throws ServletException {
        try {
          if (config.getInitParameter("cFirstAction") != null) {
            _firstAction = config.getInitParameter("cFirstAction");
          if (_logger == null) {
            _logger = new BasicLog();
            _logger.addHandler(new FileHandler(LOG_PATH,LOG_FILENAME));
          // Even de configuratie inlezen.
          if (_cnf == null) {
            _cnf = new Config();
        } catch(Exception e) {
          e.printStackTrace();
        super.init(config);
      public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        _logger.activate();
        _logger.info("PdController","doGet","Starting..");
        GenericConfigObject _action = getActionObject(request);
        _logger.info("PdController","doGet","the action name = "+_action.getString("action"));
         request.setAttribute("actionObject",_action);
        _logger.info("We zijn voorbij een setAttribute gekomen");
        HttpSession _session = request.getSession();
        if (_session.getAttribute("appModule") == null) {
          _session.setAttribute("appModule",_app);
        RequestDispatcher dispatcher = request.getRequestDispatcher(_action.getString("action"));
        dispatcher.forward(request,response);
      public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request,response);
      private GenericConfigObject getActionObject(HttpServletRequest request) {
        String _objnName = null;
        if (request.getParameter("path") != null) {
          _logger.info("request.getParameter(\"path\") != null");
          _objnName = (_cnf.getGlobalForward(request.getParameter("path"))).getString("name");
          _logger.info("global forward 2 action name = "+_objnName);
        } else {
          _logger.info("request.getParameter(\"path\") == null");
          _logger.info("first action name = "+_firstAction);
          _objnName = (_cnf.getGlobalForward(_firstAction)).getString("name");
          _logger.info("global forward 2 action name = "+_objnName);
        return _cnf.getAction(_objnName);
    }

  • Servlet.service() Error. java.lang.OutOfMemoryError: Java heap space

    Hi All,
    I would be very grateful if you would draw some light for this error I got from running a online database connected image viewer (applet).
    The application is quite simple, applet connect to servlet, servlet send 3 SQL statements to MySQL and retrieve image info (Strings) and 50 Files (- JPEG image) from a online database, and then pass all of data to applet from servlet. The size of total of images is around 3.5 MB, and I've increased JVM memory to 128 MB by using code "-xmx128m".
    ? Do I need send images from servlet to applet individually rather than push them in one go
    ? Is there memory leak in my codes
    Please see the codes below:
    private ExamViewerApplet.CaseInfo[] getCaseInfoArray(int examID, Connection conn) throws SQLException{...}   
    private ExamViewerApplet.ExamInfo getExamInfo(int examID, Connection conn) throws SQLException{...}
    private String processObject(Object object, ObjectOutputStream oos)    {
        Integer examID = (Integer) object;
        Connection conn  = null;    
        ExamViewerApplet.ExamInfo examInfo = null;
        ExamViewerApplet.CaseInfo caseInfoArray[] = null;
        int[][] imageIndexArray = new int[30][5];
        ImageIcon[] imageArray = null;
        try {
            conn = new DBConnection().getConnection();
            examInfo = this.getExamInfo(examID, conn);
            caseInfoArray = this.getCaseInfoArray(examID, conn);
            PreparedStatement ps = conn.prepareStatement(RETRIEVE_IMAGES);
            ps.setInt(1,examID);
            ResultSet rs = ps.executeQuery();
            rs.last();
            int size = rs.getRow();
            rs.beforeFirst();
            imageArray = new ImageIcon[size];
            int imageIndex = 0;
            while(rs.next()){
                int caseID = rs.getInt("CaseID");
                int imageID = rs.getInt("ImageID");
                InputStream stream = null;
                ByteArrayOutputStream output = null;
                try {
                    stream = rs.getBinaryStream("Image");
                    output = new ByteArrayOutputStream();
                    byte buf[] = new byte[1024];
                    int len;
                    while((len = stream.read(buf)) > 0){
                        output.write(buf, 0, len);
                    ImageIcon icon = new ImageIcon(output.toByteArray());
                    imageArray[imageIndex] = icon;
                    imageIndexArray[caseID][0] += 1;
                    imageIndexArray[caseID][imageID] = imageIndex;
                    ++imageIndex;
                } catch (IOException ex) {
                    log("Error, when reading byte array from image input stream from database");
                } finally{
                    try {
                        stream.close();
                        output.close();
                    } catch (IOException ex) {
                        log("Error, when tring to close image input stream from Database");
        } catch (ClassNotFoundException classNotFoundException) {//somecode...
        } catch (SQLException sQLException) {//somecode...
        }finally{
            try {
                conn.close();
            } catch (SQLException ex) {//somecode...
        String result;
        if(examInfo != null && caseInfoArray != null && imageIndexArray != null && imageArray != null ){
            result = "The transaction was successed!";
            try {
                oos.writeObject(examInfo);
                oos.writeObject(caseInfoArray);
                oos.writeObject(imageIndexArray);
                oos.writeObject(imageArray);
            } catch (IOException ex) {
                result = "The transaction was failed!";
        }else{
            result = "The transaction was failed!";
        return result;
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {      
        ObjectInputStream inputStreamFromApplet = null;
        Object object = null;
        try {
            inputStreamFromApplet = new ObjectInputStream(request.getInputStream());
            object = inputStreamFromApplet.readObject();
            ObjectOutputStream oos = new ObjectOutputStream(response.getOutputStream());
            String returnValue = this.processObject(object, oos);           
            oos.writeObject(returnValue);
            oos.flush();
            oos.close();       
        } catch (ClassNotFoundException classNotFoundException) {
            classNotFoundException.printStackTrace();
        } finally{            
            inputStreamFromApplet.close();
    } And the error messages I got here is:
    SEVERE: Servlet.service() for servlet ExamViewerServlet threw exception
    java.lang.OutOfMemoryError: Java heap space
            at javax.swing.ImageIcon.writeObject(ImageIcon.java:411)
            at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:592)
            at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917)
            at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339)
            at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
            at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1251)
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
            at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
            at ExamViewerServlet.processObject(ExamViewerServlet.java:147)
            at ExamViewerServlet.processRequest(ExamViewerServlet.java:176)
            at ExamViewerServlet.doPost(ExamViewerServlet.java:217)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
            at java.lang.Thread.run(Thread.java:595)Please help.
    Linqing
    Edited by: discovery_java on Feb 1, 2010 2:12 PM

    wire the code into a simple unit test, then run a profiler on it to see where the memory is going. You need the help of these kind of tools to track down memory issues, before that it is only guesswork what might be soaking it all up.

Maybe you are looking for

  • Centering and displaying 100% in browser won't work.

    I believe I followed the instructions that were posted previously and I did some reading about centering a page and displaying the page at 100% but I can't seem to make them work correctly. I might have a conflict or something can you help. I designe

  • Connecting computer and home theatre to insignia TV

    I just bought a denon home theatre surround sound.  I have my insignia TV connected to my XBOX, blu ray, and computer.  Is there some way I could connect all these things to my TV and have them play through my surround sound?  Basically can I use my

  • Can't copy anything in FB?

    Anyone else noticed that holding your fingers on a line of text in FB will not give you blue arrows to copy the text? I also had found in emails you can just use one finger and a pop up will appear with several options one being select text and upon

  • How SAP handles AFS Third Party Orders in ECC system?

    Hi All, There is a user exit EXIT_SAPLJ3AM_003 which exist in 4.6C version of SAP for AFS. This user exit is for Third Party order processes. This is called within the include LJ3AMFD1 of the main program SAPLJ3AM. But this User exit is missing in EC

  • Where can i download firmware for ipad 3 celullar   wifi ios 5.1.1 ?

    I was update my ipad from ios 5.1.1 to ios 6.0 but i think ios 6 is bad so i want downgrade to ios 5.1.1 again then i search in google there's no one firmware available for ios 5.1.1 celullar + wifi, please help me....