FileInputStream Error - Tomcat 5

I'm trying to read in a properties file and then use this properties file to do various things on my website.
(I'm using jsp)
When I run the code locallly it works perfectly, but when I deploy it on my server (tomcat 5)
I get the following error:
Error while loading properties file
java.io.FileNotFoundException: ..\config\AB.properties (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at properties.ABProperties.initialize(ABProperties.java:27)
at properties.ABProperties.<clinit>(ABProperties.java:14)
at properties.ConnectionPool.<clinit>(ConnectionPool.java:9)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Is there some default folder setting that I might be missing that is making it look elswhere?
I've only been using jsp's and tomcat for about a week so I'm no expert.
Here's the code that's causing the problem.
    private static final String propHome = "../config";
    private static final String propFile = "/AB.properties";
    private static Properties p;
    private static  void initialize()
        FileInputStream fis;
        p = new Properties();
        try
            fis = new FileInputStream(propHome + propFile); <---FAILS HERE!!    
            if (fis != null)
                p.load(fis);
                fis.close();
        catch (Exception e)
            System.out.println("Error while loading properties file");
            e.printStackTrace();
    }Thanks jG

Can you use FileInputStream also for a file that you get from a jsp with the multiaprt/form-data type?
I only see examples of static files. Is this right or not?
Henk

Similar Messages

  • How to see JSP compilation errors - Tomcat 4.1.18- JDK 1.4

    Hi There,
    I'm kind of new to JSP world, so once in while I forget to put a ; or I put a variable name wrong (I usualy use Eclipse to do my coding in JAVA, but the existing plugins for JSP development are still in their early stages, so there's isn't any plugin that indicates errors on JSP before deploying them).
    When I try to see a JSP, if it has an error (compilation-time error), I get this message:
    <--->
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: -1 in the jsp file: null
    Generated servlet error:
    [javac] Compiling 1 source file
    <--->
    This doesn't help me a lot to fix the problem, I would like to, at least, see from what line the error came from.
    Help anyone?
    Thank You
    Pinho

    This kind of errors often come from syntax error in
    the jsp page.
    Tomcat is not very friendly with this kind of errors.
    A trick is to open the java file under the 'work'
    directory and checkIsn't there any way to show the error on a page, just like a run-time error?
    Maybe changing some log setting?

  • JSF Error Tomcat NullPointer restart

    I have developed an application in Tomcat55 and JSF, everything goes well
    when I start for the first time Tomcat, the problem comes when a new update
    on unemployment Tomcat, I introduce a new war in the webapp and restarted
    the tomcat, reload does well but when I ask the web, I get this error.
    [http-81-Processor25] ERROR
    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[SitioWeb].[j
    sp]
    - Servlet.service() para servlet jsp lanz� excepci�n
    java.lang.NullPointerException
    at
    org.ajax4jsf.framework.ajax.AjaxViewHandler.createView(AjaxViewHandler.java:
    78)
    at
    org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:14
    4)
    at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
    FilterChain.java:269)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
    ain.java:188)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
    java:691)
    at
    org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDis
    patcher.java:469)
    at
    org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
    er.java:403)
    at
    org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
    java:301)
    at
    org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:686
    at
    org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:656)
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:48)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
    31)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
    FilterChain.java:269)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
    ain.java:188)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
    va:213)
    at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
    va:174)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127
    at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117
    at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
    :108)
    at
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
    at
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
    at
    org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processC
    onnection(Http11BaseProtocol.java:665)
    at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav
    a:528)
    at
    org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo
    rkerThread.java:81)
    at
    org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
    a:689)
    at java.lang.Thread.run(Thread.java:595)
    State and looking information and are no longer what might happen.
    Edited by: Scra on Dec 17, 2007 9:37 AM

    Doesn't look like a Sun JSF RI issue to me. Post this issue at the forum/mailinglist of Ajax4jsf.

  • Connection pooling error (Tomcat 5.5 Oracle 9i)

    Can someone please help,
    For the last 3 hours been search all past thread but no luck with my issue.
    I get error on line 4:
    == mytest.jsp
    Context initContext = new InitialContext();
    Context envContext = (Context)initContext.lookup("java:comp/env");
    OracleDataSource ds = (OracleDataSource)envContext.lookup("jdbc/nidev");
    ds.getConnection();
    ==
    Error:
    root cause
    javax.servlet.ServletException: invalid arguments in call
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
         org.apache.jsp.common.configurations_jsp._jspService(configurations_jsp.java:101)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    root cause
    java.sql.SQLException: invalid arguments in call
         oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
         oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
         oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:200)
         oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:347)
    My Context:
    <Context reloadable="true"
    path="/dbbuild/nidev"
    debug="1"
    docBase="/home/nazrul/nidev/webapps/jsp">
    <Resource name="jdbc/nidev"
    auth="Container"
    type="oracle.jdbc.pool.OracleDataSource"
    driverClassName="oracle.jdbc.OracleDriver"
    factory="oracle.jdbc.pool.OracleDataSourceFactory"
    url="jdbc:oracle:thin:@192.168.10.2:1521:NIDEV"
    username="nislam"
    password="nislam"
    removeAbandoned="true"
    removeAbandonedTimeout="30"
    maxActive="50"
    maxIdle="3"
    maxWait="10000" />
    </Context>

    Any idea anyone?

  • Tomcat error and temporarily stops working

    Can someone tell me why my Tomcat stops working when I startup w/following error:
    plication 2.3//EN --> http://java.sun.com/dtd/web-app_2_3.dtd "null"
    ERROR reading C:\jakarta-tomcat-3.2.2\webapps\bugrat\WEB-INF\web.xml
    At External entity not found: "http://java.sun.com/dtd/web-app_2_3.dtd".
    I checked the url reference for the dtd - it's completely valid.
    Afterwards, for a minute or so, Tomcat doesn't work(i.e., http://localhost returns error). But, finally spitting out the following error, tomcat comes back working.
    ERROR reading C:\jakarta-tomcat-3.2.2\webapps\bugrat\WEB-INF\web.xml
    java.net.ConnectException: Connection timed out: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:292)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:158)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:145)
    at java.net.Socket.connect(Socket.java:391)
    at java.net.Socket.connect(Socket.java:349)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:142)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:344)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:532)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:280)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:290)
    at sun.net.www.http.HttpClient.New(HttpClient.java:302)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection
    .java:397)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
    nection.java:490)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:237
    at org.apache.crimson.parser.Resolver.createInputSource(Resolver.java:28
    7)
    at org.apache.crimson.parser.ExternalEntity.getInputSource(ExternalEntit
    y.java:91)
    at org.apache.crimson.parser.Parser2.pushReader(Parser2.java:3003)
    at org.apache.crimson.parser.Parser2.externalParameterEntity(Parser2.jav
    a:2738)
    at org.apache.crimson.parser.Parser2.maybeDoctypeDecl(Parser2.java:1155)
    at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:489)
    at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
    at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
    at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:317)
    at javax.xml.parsers.SAXParser.parse(SAXParser.java:260)
    at org.apache.tomcat.util.xml.XmlMapper.readXml(XmlMapper.java:214)
    at org.apache.tomcat.context.WebXmlReader.processWebXmlFile(WebXmlReader
    .java:202)
    at org.apache.tomcat.context.WebXmlReader.contextInit(WebXmlReader.java:
    109)
    at org.apache.tomcat.core.ContextManager.initContext(ContextManager.java
    :491)
    at org.apache.tomcat.core.ContextManager.init(ContextManager.java:453)
    at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)
    at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)
    2001-07-17 11:39:52 - PoolTcpConnector: Starting HttpConnectionHandler on 80
    2001-07-17 11:39:53 - PoolTcpConnector: Starting Ajp12ConnectionHandler on 8007
    PH!

    What I meant was, can your Tomcat installation actually connect to it (is it possible that your internet connection isn't working properly all the time)?

  • Error Packaging Media!! HTTP request error

    Hi,
    I have followed all the steps given in FAXs_2_0_Quickstart.pdf.
    In Flash Access Manager, I have selected Single file from the local machine with ad-policy.pol,
    when I click Package Media, I am getting the following error message
    FAULT!
    Error Packaging Media!! HTTP request error
    Tomcat log file is showing following error
    org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet UICommunicator threw exception
    java.lang.NumberFormatException: For input string: ""
        at java.lang.NumberFormatException.forInputString(Unknown Source)
        at java.lang.Integer.parseInt(Unknown Source)
        at java.lang.Integer.valueOf(Unknown Source)
        at java.lang.Integer.decode(Unknown Source)
        at com.adobe.flashaccess.refimpl.util.ParamsReader.readPackagerParams(ParamsReader.java:812)
        at com.adobe.flashaccess.refimpl.userinterface.UICommunicator.packageSingleMediaFile(UICommu nicator.java:1438)
        at com.adobe.flashaccess.refimpl.userinterface.UICommunicator.doPost(UICommunicator.java:129 )
        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.j ava:290)
        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:286)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.ja va:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Unknown Source)
    Thanks for the help.

    Hi Eric,
    Pls find below snapshots of the Preferences, Package Media Tabs and error messages.  Other Tabs have been untouched.
    Thanks.

  • Init-params in web.xml are not loaded (Tomcat 4)

    Hello all...
    I register a servlet in webapps/<my-servlet>/WEB-INF/web.xml file, and pass 1 <init-param> tag. The file gets parsed (I know because when I made errors tomcat complained during initialization). However, when in the init method of the servlet I try to access this parameter, its not there. In fact, the servlet has NO init params at all.
    =================================================
    I have the following web.xml file
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!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>
    <servlet>
    <servlet-name>XServlet</servlet-name>
    <servlet-class>com.fxcm.xml.xengine.xdas.XServlet</servlet-class>
    <init-param>
    <param-name>xengine.configFile</param-name>
    <param-value>c:/projects/re/das.config/config.xng</param-value>
    </init-param>
    </servlet>
    <servlet-mapping>
         <servlet-name>XServlet</servlet-name>
         <url-pattern>/xservlet</url-pattern>
    </servlet-mapping>
    </web-app>
    =======================================================
    I have the following servlet
    * XServlet.java
    * Created on May 6, 2002, 1:17 PM
    package com.fxcm.xml.xengine.xdas;
    import javax.servlet.*;
    import javax.servlet.http.HttpServlet;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.ServletConfig;
    import java.util.Enumeration;
    import com.fxcm.xml.xengine.XEngine;
    public class XServlet extends HttpServlet{
    /** Initiates new XServlet */
    public void init(ServletConfig config)
    throws ServletException
              for (Enumeration e = config.getInitParameterNames(); e.hasMoreElements();){
    //This statement never gets printed because the loop never enters here since there are no init parameters
                   System.out.println(e.nextElement());
    super.init(config);
    String str = config.getInitParameter("xengine.configFile");
    System.out.println(str);
    XEngine.init(str.trim()); //This line throws NullPointer, because str is null since there are no initParameters.
    public void doPost(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException{
    // res.setContentType( );
              System.out.println("Got post request in XServlet");
    PrintWriter out = res.getWriter();
    out.println(XEngine.process(req.getInputStream()));
    out.flush();
    out.close();
    ================================================================
    I get the follwoing error in the browser:
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    java.lang.NullPointerException
         at com.fxcm.xml.xengine.xdas.XServlet.init(Unknown Source)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:918)
         at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:655)
         at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:400)
    Please help.
    Thank you,
    Elana

    I know what the problem is. If you call servlet with the default URL (http://host/app/servlet/package.Servlet) than Servlet DOES NOT read init parameters. I don't know why it was designed this way.
    To make servlet read init parameters, you have to assign it a name and then call it with that name, like this:
    <servlet>
    <servlet-name>ServletName</servlet-name>
    <servlet-class>package.ServletClass</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ServletName</servlet-name>
    <url-pattern>/app/path/ServletName</url-pattern>
    </servlet-mapping>
    You can then call servlet using path specified in url-pattern and read init parameters in the normal way.

  • Xml page can't display in the first time

    Hi everyone:
    I want to read data from MySQL to web page using JDOM.I read the data from database successful and insert them into a xml file.But I can't open the xml page property.It will display after I refresh the page more than ten times!
    I find that it become easy if I use JDOM to do this work.I write the logic in a servlet:
    /////////////////////////the servlet code is:////////////////////////////////////////////
         public void displayXml(){
              SAXBuilder build=new SAXBuilder();
              try{
              Document doc=build.build(new FileInputStream("C:\\tomcat\\webapps\\ROOT\\xmlbook\\mysql.xml"));
              Element root=doc.getRootElement();
              List books=root.getChildren();
              out.println("debug... ...");
              while(rs.next()){
              Element id=root.getChild("id");
              id.setText(rs.getString("id"));
              Element name=root.getChild("name");
              name.setText(rs.getString("name"));
              Element title=root.getChild("title");
              title.setText(rs.getString("title"));
              Element content=root.getChild("content");
              content.setText(rs.getString("content"));
              Element time=root.getChild("time");
              time.setText(rs.getString("time"));
              XMLOutputter xmlout=new XMLOutputter("",true,"GBK");
              xmlout.output(doc,new FileOutputStream("C:\\tomcat\\webapps\\ROOT\\xmlbook\\mysqlnew.xml"));
         }catch(Exception e){
              out.println(e.toString());
              System.out.println(e.toString());
    //////////////////////////////index.html/////////////////////////////////////////////////////
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
         <head>
              <title>Enter the title of your XHTML document here</title>
              <link style="html/css" href="style.css" rel="stylesheet"/>
         </head>
         <body>
              <h2>welcome to here</h2>
              <form action="mainpageurl" method="post">          
              <p><input type="submit" value="CliCk To EnTEr" /></p>
              </form>
         </body>
    </html>
    //////////////////////////mysql.xml////////////////////////////////////////////////////
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <?xml-stylesheet href='mysqlxsl.xsl' type='text/xsl'?>
    <rootpro>
         <id/>
         <name/>
         <title/>
         <content/>
         <time/>
    </rootpro>
    /////////////////////////////End code///////////////////////////////////////////////////
    I add a hyperlink to the xml in a web page.It will go to the xml page when user click the button.
    But there is a problem puzzle me.The xml page will not display when the user first to come this page.The browser report error:"Can't display this page.The xml file must have a top element".It can display after I refresh this xml page more than ten times.Why?But the xml page already have a top element!~.I means the client must refresh the xml page more than ten times for display it.someone know why? :(

    sorry,My xsl file is:
    ////////////////////////////mysqlxsl.xsl//////////////////////////////////////
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <xsl:output method="html"/>
    <xsl:template match="/">
    <html>
         <head>
              <title>WelcomE To thE MainPagE</title>
         </head>
         <body>
         <table border="1" bgcolor="#eecc00">
                   <tr>
                   <td>User Information</td>
                        <td><xsl:apply-templates select="result/entry"/></td>
                   </tr>
         </table>     
         </body>
    </html>
    </xsl:template>
    <xsl:template match="entry">
    <li><xsl:value-of select="ID"/></li>
    <li><xsl:value-of select="Name"/></li>
    <li><xsl:value-of select="Title"/></li>
    <li><xsl:value-of select="Content"/></li>
    <li><xsl:value-of select="Time"/></li>
    </xsl:template>
    </xsl:stylesheet>
    I want to transform the xml file using the xsl.

  • Re: [iPlanet-JATO] More on ComputedColumn issue

    Vladimir--
    I'm going to answer this question without doing my full homework on it;
    please let me know if I hit the mark or not. If I understand correctly, you
    have a problem using a model for both UPDATE and SELECT queries because of a
    computed column...correct?
    If so, this issue is solved in JATO 1.2. 1.2 has an attribute in the field
    descriptor to indicate in which type of queries a field should be used. You
    can use this attribute to indicate that a field should only be used for
    UPDATE queries, SELECT queries, or whatever combination of query types you
    require. You can then define synthetic fields for use only during one of
    the query types.
    Does this sound useful in fixing your issue? A way around this in JATO 1.1
    would be to create separate models for SELECT and UPDATE queries. The
    SELECT model could contain all the fields for the joined query, but the
    UPDATE model would contain info for only one table. The 1.2 feature simple
    allows you to do the same using one model.
    Todd
    ----- Original Message -----
    From: "vivanov4114" <vivanov@b...>
    Sent: Friday, January 11, 2002 8:12 AM
    Subject: [iPlanet-JATO] More on ComputedColumn issue
    We have a similar problem with do's ComputedColumn after the
    translation as Kostas described in his detailed message #439.
    We have JATO/iMT version 1.1. Is the resolution of this problem added
    to the version 1.2 (or 1.2.1)?
    I've tried to adjust the ModelImpl class based on the .sdo file
    (using ComputedColumn attributes) for these fields and failed.
    Whether I missed something else, or our situation is a little bit
    different.
    In our case the dataObject has one Computed Field from one table and
    another Computed Field from another table along with joint between
    these two tables and third one, and, finally, the whole stuff is
    under the repeatable (with static fields bindings to these two
    computed fields).
    The modelImpl class after the translation (as in the #439) has the
    same values "" and "." for ..._NAME and QUALIFIED_..._NAME strings
    respectively (for each computed do's field).
    I guess that we could meet extra problem with this (for manual
    adjustment) because of there is no TableName attribute in .sdo file
    for computed field (as well as there is no ColumnName attribute for
    computed field). If ComputedColumn attribute (computed field) could
    play a role of ColumnName attribute (regular case), what would be an
    analog of TableName attribute for computed field?
    The bottom line of this is as follows: we have a same
    SQLException "Invalid Column Name"
    from ResultSetModelBase.updateModel() as Kostas described. It causes
    the problem for
    RequestHandlingTiledViewBase.executeAutoRetrieving() method that
    can't bind the proper Model.
    Finally, beginDisplay() method from
    pgXXXXPriorityCountTiledView.class throws exception and
    jasper compiler brings run-time error (Tomcat 3.2).
    Kostas, if this problem still exists for translation of such cases,
    could you please post a fragment that fixed you original problem in
    addition to the message #439 (just to be sure, that I haven't missed
    something important).
    Thank you very much in advance.
    Vladimir Ivanov,
    P. S. I've enclosed the excerption from the .sdo file for this
    dataObject below.
    Class "SQLObject" ;
    Name "doPriorityCount" ;
    DataFields {
    0 { // first df is a computed column from the first
    //table
    Class "DataField" ;
    Name "dfPriorityDesc" ;
    ComputedColumn "MIN
    (MOS.PRIORITY.PDESCRIPTION)" ;
    1 { // second df is a computed column from the second
    // table
    Class "DataField" ;
    Name "dfPriorityCount" ;
    ComputedColumn "COUNT
    (ASSIGNEDTASKSWORKQUEUE.PRIORITYID)" ;
    2 { // third df is a regular df
    Class "DataField" ;
    Name "MOS_PRIORITY_PRIORITYID" ;
    TableName "MOS.PRIORITY" ; // this attribute
    // doesn't exist for ComputedColumn
    ColumnName "PRIORITYID" ; // this attribute
    // doesn't exist for ComputedColumn
    DataCachingEnabled "False" ;
    DataCachingDuration "0" ;
    DataCachingMaxRows "200" ;
    DataObjectType "Select" ;
    Tables "MOS.ASSIGNEDTASKSWORKQUEUE,MOS.PRIORITY,MOS.DEAL" ;
    SQLDistinct "False" ;
    SelectFilter {
    "MOS.DEAL.SCENARIORECOMMENDED" ;
    "=" ;
    "'Y'" ;
    "AND" ;
    "MOS.DEAL.COPYTYPE" ;
    "<>" ;
    "'T'" ;
    SelectOrder {
    "MOS.PRIORITY.PRIORITYID ASC" ;
    SelectGroup {
    "MOS.PRIORITY.PRIORITYID" ;
    EnableEntireTableDelete "False" ;
    EnableEntireTableUpdate "False" ;
    SQLTextOverrideSelect "Partial" ;
    SQLTextOverrideDelete "None" ;
    SQLTextSelectJoin "MOS.ASSIGNEDTASKSWORKQUEUE.DEALID =
    MOS.DEAL.DEALID
    AND MOS.PRIORITY.PRIORITYID <> 0
    AND MOS.PRIORITY.PRIORITYID =
    MOS.ASSIGNEDTASKSWORKQUEUE.PRIORITYID(+)
    AND MOS.ASSIGNEDTASKSWORKQUEUE.TASKSTATUSID
    (+) = 1 " ;
    For more information about JATO, including download information, pleasevisit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

    Todd,
    Sorry for the delay with the answer, I've tried to obtain JATO 1.2
    and repeat the project migration to verify whether version 1.2 solves
    my problem or not (actually, it is a pilot sub-project).
    Unfortunately, I still have no 1.2 version.
    Let me try to answer on your question without getting the results
    with JATO 1.2. Your explanation sounds like version 1.2 is very close
    to solve the problem. Actually, our situation is easier because we
    have SELECT object only, not SELECT and UPDATE. For data integrity
    the only 'Select' ND's do(s) have been used through the whole
    project. The backend communication (update, delete) is provided via
    EJB like (entity) Java classes.
    My question is: could I define synthetic field with 1.1.1 version. By
    the way, word synthetic reflects the possibility to construct the
    field under certain SQL circumstances (SELECT, UPDATE, e.g.) or the
    possibility to construct a `fake' field (for example,
    CountColumn of a do) as well. If the later is true, could you please
    give a brief idea how to create this synthetic field.
    After the translation in the doPriorityCountModelImpl class we've
    got:
    public static final String COLUMN_DFPRIORITYDESC="";
    public static final String QUALIFIED_COLUMN_DFPRIO
    RITYDESC=".";
    public static final String COLUMN_DFPRIORITYCOUNT="";
    public static final String QUALIFIED_COLUMN_DFPRIO
    RITYCOUNT=".";
    (see my original post please with details, as well).
    If this is not a problem for 1.2 please do not waste your time to fix
    it for 1.1.1. I need to repeat my results with the version 1.2 anyway.
    We have a number of similar idioms through the project. In this
    particular case, the CountColumn that counts the field from another
    table may bring problem for manual adjustment (see my original
    notes). The whole SQL query is as follows (for this case):
    SELECT MIN(MOS.PRIORITY.PDESCRIPTION),
    COUNT(ASSIGNEDTASKSWORKQUEUE.PRIORITYID),
    MOS.PRIORITY.PRIORITYID
    FROM MOS.ASSIGNEDTASKSWORKQUEUE, MOS.PRIORITY, MOS.DEAL
    WHERE MOS.DEAL.SCENARIORECOMMENDED = 'Y'
    AND MOS.DEAL.COPYTYPE <> 'T'
    GROUP BY MOS.PRIORITY.PRIORITYID
    ORDER BY MOS.PRIORITY.PRIORITYID ASC
    During the pre-handler activity (it is the part of our Object
    Framework on the top of Netdynamics Object Framework) system passes
    id (and mos.deal.dealid = XXX) to the do (select query). After the
    run-time execution of this do the results are displayed on the screen
    bind to the repeatable statics.
    Thank you very much,
    Vladimir
    --- In iPlanet-JATO@y..., "Todd Fast" <Todd.Fast@S...> wrote:
    Vladimir--
    I'm going to answer this question without doing my full homework on it;
    please let me know if I hit the mark or not. If I understand correctly, you
    have a problem using a model for both UPDATE and SELECT queries because of a
    computed column...correct?
    If so, this issue is solved in JATO 1.2. 1.2 has an attribute in the field
    descriptor to indicate in which type of queries a field should be used. You
    can use this attribute to indicate that a field should only be used for
    UPDATE queries, SELECT queries, or whatever combination of query types you
    require. You can then define synthetic fields for use only during one of
    the query types.
    Does this sound useful in fixing your issue? A way around this in JATO 1.1
    would be to create separate models for SELECT and UPDATE queries. The
    SELECT model could contain all the fields for the joined query, but the
    UPDATE model would contain info for only one table. The 1.2 feature simple
    allows you to do the same using one model.
    Todd
    ----- Original Message -----
    From: "vivanov4114" <vivanov@b...>
    Sent: Friday, January 11, 2002 8:12 AM
    Subject: [iPlanet-JATO] More on ComputedColumn issue
    We have a similar problem with do's ComputedColumn after the
    translation as Kostas described in his detailed message #439.
    We have JATO/iMT version 1.1. Is the resolution of this problem
    added
    to the version 1.2 (or 1.2.1)?
    I've tried to adjust the ModelImpl class based on the .sdo file
    (using ComputedColumn attributes) for these fields and failed.
    Whether I missed something else, or our situation is a little bit
    different.
    In our case the dataObject has one Computed Field from one table and
    another Computed Field from another table along with joint between
    these two tables and third one, and, finally, the whole stuff is
    under the repeatable (with static fields bindings to these two
    computed fields).
    The modelImpl class after the translation (as in the #439) has the
    same values "" and "." for ..._NAME and QUALIFIED_..._NAME strings
    respectively (for each computed do's field).
    I guess that we could meet extra problem with this (for manual
    adjustment) because of there is no TableName attribute in .sdo file
    for computed field (as well as there is no ColumnName attribute for
    computed field). If ComputedColumn attribute (computed field) could
    play a role of ColumnName attribute (regular case), what would be an
    analog of TableName attribute for computed field?
    The bottom line of this is as follows: we have a same
    SQLException "Invalid Column Name"
    from ResultSetModelBase.updateModel() as Kostas described. It causes
    the problem for
    RequestHandlingTiledViewBase.executeAutoRetrieving() method that
    can't bind the proper Model.
    Finally, beginDisplay() method from
    pgXXXXPriorityCountTiledView.class throws exception and
    jasper compiler brings run-time error (Tomcat 3.2).
    Kostas, if this problem still exists for translation of such cases,
    could you please post a fragment that fixed you original problem in
    addition to the message #439 (just to be sure, that I haven't missed
    something important).
    Thank you very much in advance.
    Vladimir Ivanov,
    P. S. I've enclosed the excerption from the .sdo file for this
    dataObject below.
    Class "SQLObject" ;
    Name "doPriorityCount" ;
    DataFields {
    0 { // first df is a computed column from the first
    //table
    Class "DataField" ;
    Name "dfPriorityDesc" ;...........................................
    ComputedColumn "MIN
    (MOS.PRIORITY.PDESCRIPTION)" ;............................................
    1 { // second df is a computed column from the second
    // table
    Class "DataField" ;
    Name "dfPriorityCount" ;
    ComputedColumn "COUNT
    (ASSIGNEDTASKSWORKQUEUE.PRIORITYID)" ;
    2 { // third df is a regular df
    Class "DataField" ;
    Name "MOS_PRIORITY_PRIORITYID" ;
    TableName "MOS.PRIORITY" ; // this attribute
    // doesn't exist for ComputedColumn
    ColumnName "PRIORITYID" ; // this attribute
    // doesn't exist for ComputedColumn
    DataCachingEnabled "False" ;
    DataCachingDuration "0" ;
    DataCachingMaxRows "200" ;
    DataObjectType "Select" ;
    Tables "MOS.ASSIGNEDTASKSWORKQUEUE,MOS.PRIORITY,MOS.DEAL" ;
    SQLDistinct "False" ;
    SelectFilter {
    "MOS.DEAL.SCENARIORECOMMENDED" ;
    "=" ;
    "'Y'" ;
    "AND" ;
    "MOS.DEAL.COPYTYPE" ;
    "<>" ;
    "'T'" ;
    SelectOrder {
    "MOS.PRIORITY.PRIORITYID ASC" ;
    SelectGroup {
    "MOS.PRIORITY.PRIORITYID" ;
    EnableEntireTableDelete "False" ;
    EnableEntireTableUpdate "False" ;
    SQLTextOverrideSelect "Partial" ;
    SQLTextOverrideDelete "None" ;
    SQLTextSelectJoin "MOS.ASSIGNEDTASKSWORKQUEUE.DEALID =
    MOS.DEAL.DEALID
    AND MOS.PRIORITY.PRIORITYID <> 0
    AND MOS.PRIORITY.PRIORITYID =
    MOS.ASSIGNEDTASKSWORKQUEUE.PRIORITYID(+)
    AND
    MOS.ASSIGNEDTASKSWORKQUEUE.TASKSTATUSID
    (+) = 1 " ;
    For more information about JATO, including download information, please
    visit:
    http://developer.iplanet.com/tech/appserver/framework/index.jsp

  • Java package class access

    Hi All,
    I have two packages in a webapplication. com.mycompany.myapp and com.mycompany.myapp.classbank.
    I set up the application so I have a package for re-usable classes(myapp.classbank) and the other for the backing beans for my pages and the session bean and application bean etc(myapp).
    I can get access to any objects methods from the classes in myapp but I cannot get access to the methods in say the sessionbean from the classbank classes.
    Code completion shows access to the sessionbeans methods but I always get a null pointer exception when the app is run / debugged.
    Any insight would be most helpful.
    Regards
    Jim

    Thanks All,
    I can access any of the sessionbeans variables through the public getters and setters from any other class in the same package. If I try to access any of the same member variables from any class in the second package I get the null pointer... I can see each time the line of code that throws the exception. Its always the first line of code to try to access a getter or setter in the session bean from the second package.
    An example error (Tomcat 5.5.17 NetBeans 5.5) from today below :
    Caused by: javax.faces.el.EvaluationException: java.lang.NullPointerException
    at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:150)
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
    ... 29 more
    Caused by: java.lang.NullPointerException
    at com.mycompany.imageshop.classbank.ShoppingBasket.setNumberOfPictures(ShoppingBasket.java:498)
    at com.mycompany.imageshop.viewBasket.incSmallQuantityButton_action(viewBasket.java:1094)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
    ... 30 more
    Oct 15, 2007 11:36:24 AM org.apache.catalina.core.ApplicationContext log
    SEVERE: #{viewBasket.incSmallQuantityButton_action}: javax.faces.el.EvaluationException: java.lang.NullPointerException
    javax.faces.FacesException: #{viewBasket.incSmallQuantityButton_action}: javax.faces.el.EvaluationException: java.lang.NullPointerException

  • Question about JSP, XSLT and JDOM

    hi, folks. Let's say within page1.jsp, i have <jsp:include page="page2.jsp" flush="true"> On the other hand, i have a servlet helper class which queries the database, then converts the ResultSet object into a JDOM Document object. My question is i want to make the transformed output of the JDOM Document and XSLT template to be a partial content of the page2.jsp page. How can i get this done properly? I have no problem of doing the transformation, but just dont know how to concatenate the output with the rest content of page2.jsp. Hope i clearly explained the question. Any advice is greatly appreciated.
    //code fragment on page2.jsp
    <td valign="top" width="788">
        <font size="3"><br>  
            <p>
           //i want put the transformed results here
           </p>
         </font>
    </td>

    this is a fragment of my testing program, which transform direct to response output stream. but i dont want put this bounch of java code within page2.jsp. do i some other way around to get it done?
    Document myDocument = createDocument();
                   TransformerFactory tFactory = TransformerFactory.newInstance();
                // Make the input sources for the XML and XSLT documents
                org.jdom.output.DOMOutputter outputter = new org.jdom.output.DOMOutputter();
                org.w3c.dom.Document domDocument = outputter.output(myDocument);
                javax.xml.transform.Source xmlSource = new javax.xml.transform.dom.DOMSource(domDocument);
                StreamSource xsltSource = new StreamSource(new FileInputStream("d:/tomcat/webapps/project/car.xsl"));
            //Make the output result for the finished document
                StreamResult xmlResult = new StreamResult(response.getOutputStream());
                //StreamResult xmlResult = new StreamResult(System.out);
            //Get a XSLT transformer
            Transformer transformer = tFactory.newTransformer(xsltSource);
            //do the transform
                transformer.transform(xmlSource, xmlResult);

  • Setting up JAVA_HOME env variable

    Hi,
    I am a linux user trying to kill my tomcat server. I try to run an .sh script and
    I get the following error
    tomcat/bin> ./shutdown.sh
    The JAVA_HOME environment variable is not defined correctly
    This environment variable is needed to run this program
    NB: JAVA_HOME should point to a JDK not a JRE
    How do I know where to point my environment variables to??

    tomcat/bin> ./shutdown.sh
    The JAVA_HOME environment variable is not defined
    correctly
    This environment variable is needed to run this
    program
    NB: JAVA_HOME should point to a JDK not a JREIf this means something to you...
    your environment should be set to a JDK directory [ [i]containing tools.jar in the lib sub-directory ] instead of a JRE.
    export JAVA_HOME=/usr/local/jdk50

  • Client Authentication - Received fatal alert: bad_certificate

    I am making a "secure" chat server that has some simple functionality.
    For the server cert, I sent off the CSR to Thawte and set up the trust chain. That keystore seems to be fine:
    Keystore type: jks
    Keystore provider: SUN
    Your keystore contains 2 entries
    Alias name: verisigntestroot
    Creation date: Nov 10, 2006
    Entry type: trustedCertEntry
    Owner: CN=Thawte Test CA Root, OU=TEST TEST TEST, O=Thawte Certification, ST=FOR TESTING PURPOSES ONLY, C=ZA
    Issuer: CN=Thawte Test CA Root, OU=TEST TEST TEST, O=Thawte Certification, ST=FOR TESTING PURPOSES ONLY, C=ZA
    Serial number: 0
    Valid from: Wed Jul 31 20:00:00 EDT 1996 until: Thu Dec 31 16:59:59 EST 2020
    Certificate fingerprints:
    MD5: 5E:E0:0E:1D:17:B7:CA:A5:7D:36:D6:02:DF:4D:26:A4
    SHA1: 39:C6:9D:27:AF:DC:EB:47:D6:33:36:6A:B2:05:F1:47:A9:B4:DA:EA
    Alias name: server
    Creation date: Nov 10, 2006
    Entry type: keyEntry
    Certificate chain length: 2
    Certificate[1]:
    Owner: CN=TestServer, OU=Thawte SSL123 certificate, OU=Go to https://www.thawte.com/repository/index.html, OU=Domain Validated, O=TestServer
    Issuer: CN=Thawte Test CA Root, OU=TEST TEST TEST, O=Thawte Certification, ST=FOR TESTING PURPOSES ONLY, C=ZA
    Serial number: 76369fba895ca9f8f5b44dd1f28307ad
    Valid from: Fri Nov 10 15:29:22 EST 2006 until: Fri Dec 01 15:29:22 EST 2006
    Certificate fingerprints:
    MD5: 5B:7D:EE:B3:0A:CC:7B:B8:A2:73:D3:96:FB:D3:43:ED
    SHA1: E2:FD:31:00:D7:9D:F5:93:4E:99:D9:8B:C3:70:87:D9:CF:83:EC:36
    Certificate[2]:
    Owner: CN=Thawte Test CA Root, OU=TEST TEST TEST, O=Thawte Certification, ST=FOR TESTING PURPOSES ONLY, C=ZA
    Issuer: CN=Thawte Test CA Root, OU=TEST TEST TEST, O=Thawte Certification, ST=FOR TESTING PURPOSES ONLY, C=ZA
    Serial number: 0
    Valid from: Wed Jul 31 20:00:00 EDT 1996 until: Thu Dec 31 16:59:59 EST 2020
    Certificate fingerprints:
    MD5: 5E:E0:0E:1D:17:B7:CA:A5:7D:36:D6:02:DF:4D:26:A4
    SHA1: 39:C6:9D:27:AF:DC:EB:47:D6:33:36:6A:B2:05:F1:47:A9:B4:DA:EA
    So next I want to set up my client. The professor said that it's fine to just give the clients all self-signed certs, so I ran:
    keytool -genkey -alias client1 -keyalg RSA -keystore c1keystore -storepass client1 -keypass client1 -dname "o=jhu, cn=Client 1"
    I assumed that I need to add the Thawte Root CA Cert to this keystore as well since I'm doing client authentication:
    keytool -import -v -file ../server/thawtecert.txt -trustcacerts -keystore c1keystore -storepass client1
    I start up the server, and then I attempt to connect with the client with these options:
    -Djavax.net.ssl.trustStore=server/serverstore
    -Djavax.net.ssl.keyStore=client/c1keystore
    -Djavax.net.ssl.keyStorePassword=client1
    Now when I attempt to connect to the server and write to the buffer, I get this error on the client side:
    javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate
    And this error on the server side:
    javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: null cert chain
    If I connect to the server with these options, I connect fine:
    -Djavax.net.ssl.trustStore=server/serverstore
    -Djavax.net.ssl.keyStore=server/serverstore
    -Djavax.net.ssl.keyStorePassword=server
    I assume this means that I have done something very wrong creating the client's keystore. Does anyone know how I'm supposed to create it?

    Hi ,
    Even i get the same error . Although ,I imported the contents of my self-signed certificate into the truststore of tomcat i.e.cacerts file of jre/lib/security (in tomcat) , I get the following error:-
    Tomcat does not seem to accept the client's certitficate.
    Also , Incase if i use a standalone Java application to connect to a tomcat application , I get the same error? Any idea as to how does tomcat server authenticate the client from a standalone Java application .
    javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate
         at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:150)
         at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:117)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1584)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:866)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1030)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:622)
         at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:59)
         at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
         at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
         at org.apache.commons.httpclient.HttpConnection.flushRequestOutputStream(HttpConnection.java:827)
         at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1975)
         at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993)
         at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397)
         at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)

  • Mm.mySQL JDBC problems

    Im completely at a loss.
    Im trying to build a JSP environment with mySQL interaction.
    My JDK works properly.
    Apache, Tomcat, mySQL all work fine.
    I have followed to instructions for installing the JDBC mm.mysql drivers.
    I have tried to connect to the database through a JSP script and throught a self made class with a main.
    Every tutorial ive read says it SHOULD work.
    But damnit, it just doesnt.
    Here are the errors Tomcat gives out. If I run the main class I recieve a similar error:
    java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
    I have no clue why it is not finding the classes.
    The driver comes in a file named mysql.jar and I created a CLASSPATH to point to that file.
    Im at a loss.

    Try appending it to the classpath when you run your application; because your enviorment variable is sometimes overridden by servers like weblogic and tomcat
    for the main class do
    java -classpath %classpath%;.;c:\directory\mysql.jar MyMainClass
    NOTE: under unix enviorment the ";" becomes a ":" in the classpath
    and for tomcat; edit the tomcat startup file to add the jar file to the classpath variable that its creating init
    Hope this helps
    Regards
    Omer

  • Help with error (apache tomcat + java )

    hi all ! Im having an issue with my program.
    Im using jasper report to generate some reports from the program... everything seems to work except for this (making the program unstable at some point). When the report is generated and loaded as a pdf I get this error in the log.
    java.lang.IllegalStateException
    at org.apache.coyote.Response.reset(Response.java:296)
    at org.apache.catalina.connector.Response.reset(Response.java:642)
    at org.apache.catalina.connector.Response.reset(Response.java:908)
    at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:355)
    at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:211)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:134)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:736)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:619)
    The code Im using to generate the pdf is this one.
    File file = new File("C:\\Reportes\\", reporte +""+ datNac +".pdf");
    String contentType = getServletContext().getMimeType(reporte+ "" +datNac+ ".pdf");
    System.out.println("antes BufferedOutputStream");
    BufferedOutputStream output = null;
    output = new BufferedOutputStream(response.getOutputStream());
    BufferedInputStream inputFile = null;
    inputFile = new BufferedInputStream(new FileInputStream(file));
    response.reset();
    response.setContentType(contentType);
    response.setContentLength((int) file.length());
    response.setHeader("Content-disposition",
    "attachment; filename=\"" +file.getName()+ "\"");
    System.out.println("BufferedOutputStream");
    byte[] buffer = new byte[10240];
    for (int length; (length = inputFile.read(buffer)) != -1;) {
    output.write(buffer, 0, length);
    inputFile.close();
    output.close();Any help is appreciated.
    Thanks!
    Edited by: juanmanuelsanchez on Aug 4, 2009 11:17 AM
    Edited by: juanmanuelsanchez on Aug 4, 2009 11:18 AM
    Edited by: juanmanuelsanchez on Aug 4, 2009 11:19 AM

    juanmanuelsanchez wrote:
    java.lang.IllegalStateException
    at org.apache.coyote.Response.reset(Response.java:296)The response is already committed and thus cannot be reset anymore.
    output = new BufferedOutputStream(response.getOutputStream());
    response.reset();At least you should obtain the outputstream AFTER the reset. If that doesn't fix, then check everything in the chain before this code.

Maybe you are looking for

  • Getting emails sent to iPhone

    My iPhone is getting emails even when all the notifications are turned to manual. Why is this?? Please help

  • Is it possible to call DLL develloped with LabView 7.0 in LabView 6.0.2 VIs?

    Hello, I would like to devellop DLLs in LabView 7.0 and use them in LabView 6.0.2. Is it possible??? I tried this operation. I generated an installer (with the LabView 7.0 runtime in) and tried to load the DLL in a LabView 6.0.2 VI. When I run the VI

  • DNG Timestamp from Android camera2 API

    Hey folks- I have a problem with erroneous timestamps on my DNG images coming from Android apps capable of capturing RAW images. I have been very excited that Android now allows RAW capture in the new camera2 API, in the form of DNG files.  I have a

  • Download and install java - help

    hi all, i am just entering into the world of java. i need some help in downloading and installing java. i found a lot of downloads like j2sdk and jdk6update7 and some more. i downloaded both and installed one and tried to run a sample program. in jdk

  • Serial Number conflict on CSS upgrade

    I just bought Dreamweaver CS3 mac upgrade. When the program asks for a serial number of a previous install, (because it can not find my Studio files for some reason) All I have is my previous Studio 8 SN: which the CS3 won't accept. What can I do?