DownloadServlet

I am using JDeveloper 10.1.3.3
SDK 1.4
I am way past my deadline :^(
I am trying to download files from a BLOB table. I have tried an assortment of techniques to do so however I keep falling short. Currently, I am attempting to use the HttpDownload tag, below is what I have done so far (via a JSP):
<database:dbOpen commitOnClose="false" connId="archivestor"
dataSource="jdbc/archivestorDS" password="storealot"
scope="page" user="archivestor">
<fileaccess:httpDownload servletPath="/servlet/download/"
source="arch" dataColumn="upload_doc_ord"
fileNameColumn="upload_doc_name"
fileType="binary"
prefixColumn="upload_doc_prefix"
recurse="false" sourceType="database"
table="archive_doc_stor_bin"/>
</database:dbOpen>
<database:dbQuery connId="archivestor" output="jdbc" queryId="pkgstor_id">
select upload_doc_name, upload_doc_ord from archive_doc_stor_bin where pkgstor_id >0
</database:dbQuery>
<database:dbNextRow queryId="pkgstor_id"/>
<database:dbCloseQuery queryId="pkgstor_id"/>
<database:dbClose connId="archivestor" scope="page"/>
It will compile and run however no data will render. I am thinking the servletpath is wrong but I dont know how to verify that. I went to the web.xml page, managed libraries etc. There are no errors or warnings to show. If someone could PLEASE tell me how to implement the Download Servlet or provide steps to see if it is already there it will be greatly appreciated.
Thanks in advance
Markus Gillis

Maybe this can help:
http://download.oracle.com/docs/cd/B10501_01/java.920/a96654/oralob.htm

Similar Messages

  • DownloadServlet or alternative method for file download

    I have searched the forums for this topic and have seen one other posting from someone having the same problem (with no response). I can not get the oracle.jsp.webutil.fileaccess.DownloadServlet to fully function. Using the file access example code that is installed with iAS and following the instructions in the manual "Oracle Application Server Containers for J2EE JSP Tag Libraries and Utilities Reference 10g (9.0.4)" I can get the file upload to work just fine (both to a file and to the database). However with the file download it stops short of working. It will access the DownloadServlet and list the files that have been uploaded, but when you try to follow the link that it creates you get a "400 Bad Request"
    If you look at the URL it creates I see what I think is a problem
    Here is a clip of code from dbBeanDownloadExample.jsp that creates the URL
    The following files were found:
    <% Enumeration fileNames = dbean.getFileNames();
    while (fileNames.hasMoreElements()) {
    String name = (String)fileNames.nextElement();
    %>
    <br><a href="<%= servletPath + name +
        ?"+FileAccessUtil.SRCTYPE_PARAM + "=" + dbean.getSourceType() +
    "&"+FileAccessUtil.TABLE_PARAM + "=" + dbean.getTable() +
    "&"+FileAccessUtil.PREFIX_COL_PARAM + "=" + dbean.getPrefixColumn() +
    "&"+FileAccessUtil.DATA_COL_PARAM + "=" + dbean.getDataColumn() +
    "&"+FileAccessUtil.FNAME_COL_PARAM + "=" + dbean.getFileNameColumn() +
    "&"+FileAccessUtil.FILETYPE_PARAM + "=" + dbean.getFileType() %> ">
    <%= name %></a>
    <% } %>
    and here is one of the URLs
    http://iasserver.here.com:7779/ojspdemos/servlet/download/beanexample\fields.txt?srcType=database&fileType=binary&table=fileaccess&prefixCol=fileprefix&fileNameCol=filename&dataCol=data
    The problem I see is the fileprefix (from the upload) "beanexample" and the filename "fields.txt" is appended to the end of the servlet "download", while the rest of the parameters to the DownloadServlet are passed in the proper manner "srcType=database". I have been unable to find any documentation on the DownloadServlet so I don't know if there are setters for the fileprefix or the filename.
    This example code has been out for sometime, I know it was with iAS 9.0.2. Has any one been successful implementing the download of a file from the database using the oracle.jsp.webutil.fileaccess.HttpDownloadBean or the tag?
    Certainly Oracle must test this stuff before they release it. At some point I think this must have work.

    Larry, the DownloadServlet certainly worked at some point of time as ensured by the automated tests. It should work all the time, I believe, unless......
    The problem I see is the fileprefix (from the upload)
    "beanexample" and the filename "fields.txt" is appended to > the end of the servlet "download", while the rest of the
    parameters to the DownloadServlet are passed in the proper > manner "srcType=database". I have been unable to find any
    documentation on the DownloadServlet so I don't know if
    there are setters for the fileprefix or the filename.A nice observation. That is the root cause of the problem, I believe. Actually, the documentation is right there in the example dbBeanDownloadExample.jsp. You should use
      String name = (String)fileNames.nextElement()).replace('\\','/');
    as in the example instead of
      String name = (String)fileNames.nextElement();
    Well, I will check if this point of changing '\' to '/' have been made explicitly in the documentation. That kind s of tiny point is sometimes really a killer.
    Hope this helps.

  • HTTP Status 404 ****DownloadServlet/FileDloadServlet*****

    hi guys
    i hava program to download file but is not work can you help me pls
    i get this error message
    message /DownloadServlet/FileDloadServlet
    description The requested resource (/DownloadServlet/FileDloadServlet) is not available.
    package servlets;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class FileDloadServlet extends HttpServlet
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException
    String parentDirectory = getInitParameter("download_directory");
    String file = request.getParameter("file");
    if (file != null)
    File f = new File(file);
    if (f.isDirectory())
    //Do something that identifies the file as a directory...
    } else
    //otherwise, open a stram, and begin the download...
    InputStream input = new FileInputStream(f);
    response.setContentType("application/octet-stream");
    response.setBufferSize(8192);
    response.setHeader("Content-Disposition","attachment; filename=\"" + f.getName() + "\"");
    OutputStream output = response.getOutputStream();
    int count = -1;
    byte[] buffer = new byte[8192];
    while((count=input.read(buffer))!= -1)
    output.write(buffer, 0, count-1);
    output.close();
    input.close();
    main.html
    <form name="frm" method="get" action="servlets.FileDloadServlet" >
    Download
    </form>
    web.xml
    <servlet>
    <servlet-name>FileDloadServlet</servlet-name>
    <servlet-class>servlets.FileDloadServlet</servlet-class>
    <init-param>
    <param-name>download_directory</param-name>
    <param-value>C:\Documents and Settings\bbicer\Netbeans\FileUploadJsp\web\Gelen</param-value>
    </init-param>
    <init-param>
    <param-name>FileDloadServlet</param-name>
    <param-value>/FileDloadServlet</param-value>
    </init-param>
    </servlet>

    1. go inside web.xml file (inside WEB-INF) directory and add the following lines (let's assume your servlet name is
                        MyServlet):
                        <servlet>
         <servlet-name>MyServlet</servlet-name>
         <servlet-class>MyServlet</servlet-class>
              </servlet>
                        <servlet-mapping>
         <servlet-name>MyServlet</servlet-name>
         <url-pattern>/servlet/MyServlet</url-pattern>
              </servlet-mapping>
    2. restart Tomcat.
    3. go to the browser and type: http://localhost:8080/servlets-examples/servlet/MyServlet and you should see your
                   servlet.

  • Securing file download with standard web security and ssl

    Hi,
    I want to put some files for download in my webapp. At the same time, I want to protect these files using standard servlet security and ssl. So I added <security-constraint> in my web.xml and configured tomcat to allow SSL connection. Now I got the files protected as I expected. When I try to access the file directly from browser, tomcat shows me the login page. However, after correct login, I.E. pops up an error saying something like "Internet Explorer cannot download XXX from XXX. The file could not be written to the cache.". The log file showed the following exception:
    javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: java.net.SocketException: Connection reset by peer: socket write error
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEOF(SSLSocketImpl.java:1154)
         at com.sun.net.ssl.internal.ssl.AppInputStream.available(AppInputStream.java:40)
         at org.apache.tomcat.util.net.TcpConnection.shutdownInput(TcpConnection.java:90)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:752)
         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:595)
    Caused by: javax.net.ssl.SSLException: java.net.SocketException: Connection reset by peer: socket write error
         at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:166)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1476)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1443)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1407)
         at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:64)
         at org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:747)
         at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:403)
         at org.apache.coyote.http11.InternalOutputBuffer.endRequest(InternalOutputBuffer.java:400)
         at org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:961)
         at org.apache.coyote.Response.action(Response.java:182)
         at org.apache.coyote.Response.finish(Response.java:304)
         at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:281)
         at org.apache.catalina.connector.Response.finishResponse(Response.java:473)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
         ... 4 more
    Caused by: java.net.SocketException: Connection reset by peer: socket write error
         at java.net.SocketOutputStream.socketWrite0(Native Method)
         at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
         at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
         at com.sun.net.ssl.internal.ssl.OutputRecord.writeBuffer(OutputRecord.java:283)
         at com.sun.net.ssl.internal.ssl.OutputRecord.write(OutputRecord.java:272)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:663)
         at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:59)
         ... 15 more
    I've tried separating concerns, for example protect files but not require SSL, and enable SSL but do not protect files. Both works respectively but not together. I also tried using a download4j's DownloadServlet. Still doesn't work.
    Have any of you encouter the same situation? If so, could you enlight me what I did wrong? It maybe just a simple SSL configuration or something. Thanks in advance!
    Jack

    My environment setup is:
    JDK 1.5.01
    Tomcat 5.5.7
    For downloading files, I just use plain old <a href> method. I simply right-click the link and choose "save target as...".
    Thanks,
    Jack

  • Has Anyone got HttpDownloadBean to work?

    Hi,
    using JDev 9.0.2.822 (part of 9iDS install) I have created a workspace and project. I run the filedownloadmain.jsp file, it runs OK within the IDE and I can see the contents of my "download_dir" directory but when I attempt to initiate the download it fails as it doesn't find the page specified by the built-up URL. The generated URL http://myhost:8988/servlet/download/download_dir/afile.txt which brings up a Page Not Found error in Internet Explorer. This suggests that my mapping in web.xml may be incorrect or my servletpath and userdir variables are incorrectly set in my processdownload.jsp file.
    Q:Has anyone managed to get this going?
    If so, can you please review my code snippets below and advise where I have gone wrong.
    All and any help appreciated ....
    Details of My Java Files and Environment
    I have created fileaccess.properties in my
    C:\ora9iDS\jdev\mywork\ABC\DownloadBean\public_html\WEB-INF direcotry - which contains the following line;
    fileaccess.basedir=c:\\mydir
    I have created a directory c:\mydir and have the following subdirectories
    c:\mydir\upload
    c:\myload\download_dir - which contains afile.txt
    Within my java project I have the following files;
    web.xml - which contains the servlet mapping
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
    <description>Empty web.xml file for Web Application</description>
    <servlet-mapping>
    <servlet-name>oracle.jsp.webutil.fileaccess.DownloadServlet.class</servlet-name>
    <url-pattern>/servlet/download/</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>30</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.html</welcome-file>
    </welcome-file-list>
    </web-app>
    filedownloadmain.jsp - which seems to work fine and contains;
    <%@ page contentType="text/html;charset=windows-1252"%>
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
    <TITLE> File Download Utility Home </TITLE>
    </HEAD>
    <BODY>
    <H1 align="center"> File Download Utility Home </H1>
    <P align="center">
    <FORM align="center" action="processdownload.jsp" method=POST>
    <P align="center">
    <TABLE border="1" >
    <TR>
    <TD ALIGN="RIGHT">Please click on the appropriate type to download</TD>
    <TD ALIGN="LEFT">
    <INPUT TYPE="RADIO" NAME="FILETYPE" VALUE="REPORTS" CHECKED>REPORTS
    <INPUT TYPE="RADIO" NAME="FILETYPE" VALUE="LOG">LOG FILES
    </TD>
    </TR>
    </TABLE>
    </P>
    <P align="center">
    <INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Choose File">
    <INPUT TYPE="RESET" NAME="Reset" VALUE="Clear">
    </P>
    <P align="center">Log me out !</P>
    </FORM>
    </P>
    </BODY>
    </HTML>
    processdownload.jsp - which contains
    <%@ page language="java" import="javax.servlet.*, javax.servlet.http.*,java.util.*, oracle.jsp.webutil.fileaccess.*"%>
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
    <body>
    <%
    String servletPath = "/servlet/download/"; // path to the download servlet
    String userDir = "/download_dir"; // user part of download directory
    %>
    <jsp:useBean id="dbean" class="oracle.jsp.webutil.fileaccess.HttpDownloadBean" >
    <jsp:setProperty name="dbean" property="source" value='<%=userDir %>' />
    </jsp:useBean>
    <%
    dbean.setBaseDir(application, request);
    dbean.listFiles(request);
    %>
    The following files were found:
    <%
    Enumeration fileNames = dbean.getFileNames();
    while (fileNames.hasMoreElements()) {
    String name = (String)fileNames.nextElement();
    %>
    <br><a href="<%= servletPath + name %> "><%= name %></a>
    <% } %>
    <br>Done!
    </body>
    </html>
    exit.jsp - which contains the following
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
    <TITLE>Exit File Download Utility</TITLE>
    </HEAD>
    <BODY>
    <H2>
    Thank you for using File Download Utility </H2>
    <H4>The time now is :</H4>
    <P><% out.println((new java.util.Date()).toString()); %></P>
    </BODY>
    </HTML>

    In order to get this running from within Jdeveloper try the following:
    1- modify your web.xml file that resides in your Project/public_html//Web-inf directory
    remove the
    <servlet-mapping>
    <servlet-name>oracle.jsp.webutil.fileaccess.DownloadServlet.class</servlet-name>
    <url-pattern>/servlet/download/</url-pattern>
    </servlet-mapping>
    and add the following instead:
    <servlet>
    <servlet-name>download</servlet-name>
    <servlet-class>oracle.jsp.webutil.fileaccess.DownloadServlet</servlet-class>
    </servlet>
    2-ensure you have ojsputil.jar and ojsp.jar under your Project/public_html//Web-inf/lib directoy
    you can copy them from your oc4j home/lib directory.
    3- double check your download directory and make sure that it resides under c:\mydir
    from your code above it looks like your download_dir is under c:\myload not c:\mydir
    Also your fileaccess.basedir=c:\\mydir note the double \\
    4- in this line of code
    String servletPath = "/servlet/download/"; // path to the download servlet
    remove the leading forward slash in the servletpath so that you end up with:
    String servletPath = "servlet/download/"; // path to the download servlet
    I have this working with the following code, using the httpdownload tag
    <%@ taglib uri="fileaccess.tld" prefix="fileaccess" %>
    <%@ page contentType="text/html;charset=windows-1252"%>
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
    <TITLE>
    test download
    </TITLE>
    </HEAD>
    <BODY>
    <fileaccess:httpDownload source="/temp" servletPath="servlet/download/"></fileaccess:httpDownload>
    </BODY>
    </HTML>
    The URL that you should get when you click on the link that for your file should include the web context root
    for your project.

  • Error after using a servlet in ADF  - unable to select another row in table

    Hello,
    I have a go button and when I select a row in a table it call a download servlet. After I open or save the document I'm unable to make other selection in the table or make another action.
    The table has single row selection active.
    The servlet make part from a task-flow.
    Here is the code for the sevlet and my jdev version is 11.1.1.2.0
    public class DownloadServlet extends HttpServlet {
    @Override
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    public void doGet(HttpServletRequest request,
    HttpServletResponse response) throws ServletException,
    IOException {
    String id= null;
    String den= null;
    InitialContext ic;
    try {
    ic = new InitialContext();
    } catch (NamingException e) {
    DataSource ds = null;
    Connection conn = null;
    PreparedStatement cStmt = null;
    ResultSet rset= null;
    byte[] bdata = null;
    String rezult_null = "";
    id_fisier_lcl = request.getParameter("id");
    den_fisier_lcl = request.getParameter("fileName");
    rezult_null = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
    "<Body>Fisierul a fost arhivat</Body>";
    try {
    ic = new InitialContext();
    ds = (DataSource)ic.lookup("jdbc/ConnDS");
    conn = ds.getConnection();
    cStmt = conn.prepareStatement("commit");
    cStmt.execute();
    conn.commit();
    cStmt= conn.prepareStatement("SELECT a.item FROM table a WHERE a.id = " + id);
    rset = cStmt.executeQuery();
    if (rset.next()) {
    weblogic.jdbc.wrapper.Clob clob =
    (weblogic.jdbc.wrapper.Clob)rset.getClob("content");
    oracle.sql.CLOB oclob = (oracle.sql.CLOB)clob.getVendorObj();
    bdata = new byte[(int)oclob.length()];
    InputStream is = oclob.getAsciiStream();
    is.read(bdata);
    rset.close();
    cStmt.close();
    } else {
    bdata = new byte[(int)rezult_null.length()];
    bdata = rezult_null.getBytes();
    rset.close();
    cStmt.close();
    } catch (NamingException e) {
    } catch (SQLException e) {
    String username_lcl = null;
    username_lcl =
    ADFContext.getCurrent().getSecurityContext().getUserName();
    OutputStream outputStream =response.getOutputStream();
    String mimetype = "";
    FacesContext facesContext =FacesContext.getCurrentInstance();
    response.setContentType( (mimetype != null) ? mimetype : "application/x-download" );
    response.setHeader( "Content-Disposition", "attachment; filename=\"" + den_fisier_lcl + ".xml\"" );
    try {
    outputStream.write(bdata);
    outputStream.flush();
    outputStream.close();
    catch (Exception e) {
    e.printStackTrace();
    FacesMessage msg =
    new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(),
    facesContext.addMessage(null, msg);
    How can I fix it?
    Thank you.

    Hi,
    have you seen this ?
    http://download.oracle.com/docs/cd/E21764_01/apirefs.1111/e12419/tagdoc/af_fileDownloadActionListener.html
    If you want to continue with your approach, then a way out of your problem could be to add an af:clientListener onto the command button. The JavaScript function would be
    function onDownload(evt){
      evt.noResponseExpected();
    }Frank

  • How to skip(do not wnat to get display) save dialogue box for file download

    I am having servlet for downlading a file from server. When I call this servelt I am able to get the file from server but I get a save dialog box which I do not want. I want that this file should be stored at a specific location given by me in a servlet.
    So haoe I can avoid that save dialog box and where I should specify the specific location?
    Thanks in advance
    package com.txcs.sms.server.servlet;
    import java.io.*;
    import java.util.zip.GZIPOutputStream;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class DownloadServlet extends HttpServlet
        public DownloadServlet()
            separator = "/";
            root = ".";
        public void init(ServletConfig servletconfig)
            throws ServletException
            super.init(servletconfig);
            context = servletconfig.getServletContext();
            String s;
            if((s = getInitParameter("dir")) == null)
                s = root;
            separator = System.getProperty("file.separator");
            if(!s.endsWith(separator) && !s.endsWith("/"))
                s = s + separator;
            root = s;
        public void doGet(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
            throws ServletException, IOException
            doPost(httpservletrequest, httpservletresponse);
        public void doPost(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
            throws ServletException, IOException
            Object obj = null;
            String s = "";
            s = HttpUtils.getRequestURL(httpservletrequest).toString();
            int i;
            if((i = s.indexOf("?")) > 0)
                s = s.substring(0, i);
            String s1;
            if((s1 = httpservletrequest.getQueryString()) == null)
                s1 = "";
            else
                s1 = decode(s1);
            if(s1.length() == 0)
                httpservletresponse.setContentType("text/html");
                PrintWriter printwriter = httpservletresponse.getWriter();
                printwriter.println("<html>");
                printwriter.println("<br><br><br>Could not get file name ");
                printwriter.println("</html>");
                printwriter.flush();
                printwriter.close();
                return;
            if(s1.indexOf(".." + separator) >= 0 || s1.indexOf("../") >= 0)
                httpservletresponse.setContentType("text/html");
                PrintWriter printwriter1 = httpservletresponse.getWriter();
                printwriter1.println("<html>");
                printwriter1.println("<br><br><br>Could not use this file name by the security restrictions ");
                printwriter1.println("</html>");
                printwriter1.flush();
                printwriter1.close();
                return;
            File file = lookupFile(root + s1);
            if(file == null)
                httpservletresponse.setContentType("text/html");
                PrintWriter printwriter2 = httpservletresponse.getWriter();
                printwriter2.println("<html>");
                printwriter2.println("<br><br><br>Could not read file " + s1);
                printwriter2.println("</html>");
                printwriter2.flush();
                printwriter2.close();
                return;
            if(!file.exists() || !file.canRead())
                httpservletresponse.setContentType("text/html");
                PrintWriter printwriter3 = httpservletresponse.getWriter();
                printwriter3.println("<html><font face=\"Arial\">");
                printwriter3.println("<br><br><br>Could not read file " + s1);
                printwriter3.print("<br>Reasons are: ");
                if(!file.exists())
                    printwriter3.println("file does not exist");
                else
                    printwriter3.println("file is not readable at this moment");
                printwriter3.println("</font></html>");
                printwriter3.flush();
                printwriter3.close();
                return;
            String s2 = httpservletrequest.getHeader("Accept-Encoding");
            boolean flag = false;
            if(s2 != null && s2.indexOf("gzip") >= 0 && "true".equalsIgnoreCase(getInitParameter("gzip")))
                flag = true;
            if(flag)
                httpservletresponse.setHeader("Content-Encoding", "gzip");
                httpservletresponse.setHeader("Content-Disposition", "attachment;filename=\"" + s1 + "\"");
                javax.servlet.ServletOutputStream servletoutputstream = httpservletresponse.getOutputStream();
                GZIPOutputStream gzipoutputstream = new GZIPOutputStream(servletoutputstream);
                dumpFile(root + s1, gzipoutputstream);
                gzipoutputstream.close();
                servletoutputstream.close();
            } else
                httpservletresponse.setContentType("application/octet-stream");
                httpservletresponse.setHeader("Content-Disposition", "attachment;filename=\"" + s1 + "\"");
                javax.servlet.ServletOutputStream servletoutputstream1 = httpservletresponse.getOutputStream();
                dumpFile(root + s1, servletoutputstream1);
                servletoutputstream1.flush();
                servletoutputstream1.close();
        private String getFromQuery(String s, String s1)
            if(s == null)
                return "";
            int i = s.indexOf(s1);
            if(i < 0)
                return "";
            String s2 = s.substring(i + s1.length());
            if((i = s2.indexOf("&")) < 0)
                return s2;
            else
                return s2.substring(0, i);
        private void dumpFile(String s, OutputStream outputstream)
            String s1 = s;
            byte abyte0[] = new byte[4096];
            try
                BufferedInputStream bufferedinputstream = new BufferedInputStream(new FileInputStream(lookupFile(s1)));
                int i;
                while((i = bufferedinputstream.read(abyte0, 0, 4096)) != -1)
                    outputstream.write(abyte0, 0, i);
                bufferedinputstream.close();
            catch(Exception exception) { }
        private String decode(String s)
            StringBuffer stringbuffer = new StringBuffer(0);
            for(int i = 0; i < s.length(); i++)
                char c = s.charAt(i);
                if(c == '+')
                    stringbuffer.append(' ');
                else
                if(c == '%')
                    char c1 = '\0';
                    for(int j = 0; j < 2; j++)
                        c1 *= '\020';
                        c = s.charAt(++i);
                        if(c >= '0' && c <= '9')
                            c1 += c - 48;
                            continue;
                        if((c < 'A' || c > 'F') && (c < 'a' || c > 'f'))
                            break;
                        switch(c)
                        case 65: // 'A'
                        case 97: // 'a'
                            c1 += '\n';
                            break;
                        case 66: // 'B'
                        case 98: // 'b'
                            c1 += '\013';
                            break;
                        case 67: // 'C'
                        case 99: // 'c'
                            c1 += '\f';
                            break;
                        case 68: // 'D'
                        case 100: // 'd'
                            c1 += '\r';
                            break;
                        case 69: // 'E'
                        case 101: // 'e'
                            c1 += '\016';
                            break;
                        case 70: // 'F'
                        case 102: // 'f'
                            c1 += '\017';
                            break;
                    stringbuffer.append(c1);
                } else
                    stringbuffer.append(c);
            return stringbuffer.toString();
        public String getServletInfo()
            return "A DownloadServlet servlet ";
        private File lookupFile(String s)
            File file = new File(s);
            return file.isAbsolute() ? file : new File(context.getRealPath("/"), s);
        private static final String DIR = "dir";
        private static final String GZIP = "gzip";
        private ServletContext context;
        private String separator;
        private String root;
        private static final String VERSION = "ver. 1.6";
        private static final String CPR = "A DownloadServlet servlet ";
    }

    Can't be done, for obvious security reasons.
    Would you want someone downloading something into your windows\system directory when you navigate to their webpage?

  • Need urgent help on file download servlet problem in Internet Explore

    I have trouble to make my download servlet work in Internet Explore. I have gone through all the previous postings and done some research on the internet, but still can't figure out the solution. <br>
    I have a jsp page called "download.jsp" which contains a URL to download a file from the server, and I wrote a servlet (called DownloadServlet) to look up the corresponding file from the database based on the URL and write the file to the HTTP output to send it back to the browser. <br>
    the URL in download.jsp is coded like <a href="/download/<%= currentDoc.doc_id %>/<%= currentDoc.name %>">on the browser, it will be sth like , the number 87 is my internal unique number for a file, and "myfile.doc" is the real document name. <br>
    in my web.xml, "/download/" is mapped to DownloadServlet <br>
    the downloadServlet.java looks like
    tem_name = ... //read DB for file name
    // set content type
    if ( tmp_name.endsWith(".doc")) {
    response.setContentType("application/msword");
    else if ( tmp_name.endsWith(".pdf")){
    response.setContentType("application/pdf");
    else if ( tmp_name.endsWith(".ppt")){
    response.setContentType("application/vnd.ms-powerpoint");
    else if ( tmp_name.endsWith(".xls")){
    response.setContentType("application/vnd.ms-excel");
    else {
    response.setContentType("application/download");
    // set HTTP header
    response.setHeader("Content-Disposition",
    "attachment; filename=\""+tmp_name+"\"");
    OutputStream os = response.getOutputStream();
    //read local file and write back to browser
    int i;
    while ((i = is.read()) != -1) {
    os.write (i);
    os.flush();
    Everything works fine in Netscape 7.0, when I click on the link, Netscape prompts me to choose "open using Word" or "save this file to disk". That's exactly the behavior I want. <br>
    However in IE 5.50, the behavior is VERY STRANGE.
    First, when I click on the URL, the popup window asks me to "open the file from its current location" or "save the file to disk". It also says "You have chosen to download a file from this location, ...(some url).. from localhost"
    (1) If I choose "save the file to disk", it will save the rendered "download.jsp" (ie, the currect page with URL I just clicked, which isn't what I want).
    (2)But if I choose "open the file from its current location", the 2nd popup window replaces the 1st, which also has the "Open ..." and "Save.." options, but it says "You have chosen to download a file from this location, MYFILE.doc from localhost". (notice it shows the correct file name now)
    (3) If I choose "Save..." on the 2nd window, IE will save the correct file which is "myfile.doc"; if I choose "Open ...", a 3rd replaces the 2nd window, and they look the same, and when I choose "Open..." on the 3rd window, IE will use Word to open it.
    any ideas?
    </a>

    Did you find a solution to this problem? I've been wrestling with the same issues for the past six months. Nothing I try seems to work. I've tried setting the contentLength(), inline vs. attachments, different write algorythms, etc. I don't get the suggestion to rename the servlet to a pdf file.

  • Facing problem with posting Excel file for download - Content in browser

    I am trying to post an Excel file to download from a servlet to a JSP. The content is written properly but to the IE browser and not in an Excel. I even tried giving the ContentType as Word/CSV etc. But nothing works, the content gets displayed only in the browser.
    PLEASE HELP.
    Code snippet in calling JSP:
    DownloadServlet downServlet = new DownloadServlet();
    downServlet.download(response);
    Code in Servlet:
    public class DownloadServlet extends HttpServlet{
    public void download(HttpServletResponse response) throws IOException {
              /*PrintWriter out = response.getWriter( );
              response.setContentType("text/html");
              out.println("<H1>Hello from a Servlet</h2>"); */
         /*HSSFWorkbook wb = new HSSFWorkbook();
    HSSFSheet sheet = wb.createSheet("Sheet1");*/
    String strData = "This is a Test for Download";
    byte[] b = strData.getBytes();
    //response.reset();
    response.setHeader("Content-disposition", "attachment; filename=" + "Download.xls");
    response.setContentType( "application/msword" );
    //response.addHeader( "Content-Description", "Download Excel file" );
    ServletOutputStream out = response.getOutputStream();
    out.write(b);
    //out.flush();
    out.close();          
    }

    Hi Naresh,
    My thoughts on a possible solution, convert the last character value to a HEX value and check if it falls within the ASCII/Unicode CP range, Obviously this becomes easier if you are just looking at a single language character set.
    The below FM and code helps you check if the character falls within the ASCII char set.
    DATA: l_in_char TYPE string,
          l_out     TYPE xstring.
    CALL FUNCTION 'NLS_STRING_CONVERT_FROM_SYS'
      EXPORTING
        lang_used                   = sy-langu
        SOURCE                      = l_in_char
      TO_FE                       = 'MS '
    IMPORTING
       RESULT                      = l_out
      SUBSTED                     =
    EXCEPTIONS
       illegal_syst_codepage       = 1
       no_fe_codepage_found        = 2
       could_not_convert           = 3
       OTHERS                      = 4.
    IF l_out LT '0' OR l_out GT '7F'.
      WRITE: 'error'.
    ENDIF.
    Links: http://www.asciitable.com/
              http://www.utf8-chartable.de/unicode-utf8-table.pl
    Regards,
    Chen
    Edited by: Chen K V on Apr 21, 2011 11:25 AM

  • Tamahawk Tag giving error

    HI
    I am using the jsf 1.1.2 and Seam and jboss portal.
    when i try to use the Tomahawk in the jsf pag. it gives me error,
    ExtensionsFilter not correctly configured. JSF mapping missing. JSF pages not covered. Please see: http://myfaces.apache.org/tomahawk/extensionsFilter.html
    this is my web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
         <listener>
              <listener-class>
                   org.jboss.seam.servlet.SeamListener
              </listener-class>
         </listener>
         <listener>
              <listener-class>
                   org.apache.myfaces.webapp.StartupServletContextListener
              </listener-class>
         </listener>
         <filter>
              <filter-name>extensionsFilter</filter-name>
              <filter-class>
                   org.apache.myfaces.webapp.filter.ExtensionsFilter
              </filter-class>
         </filter>
         <!-- Filter Mappings -->
         <filter-mapping>
              <filter-name>extensionsFilter</filter-name>
              <url-pattern>*.jsf</url-pattern>
         </filter-mapping>
         <filter-mapping>
              <filter-name>extensionsFilter</filter-name>
              <url-pattern>/*</url-pattern>
         </filter-mapping>
         <servlet>
              <servlet-name>SeamResourceServlet</servlet-name>
              <servlet-class>
                   org.jboss.seam.servlet.ResourceServlet
              </servlet-class>
         </servlet>
         <servlet>
              <servlet-name>Faces Servlet</servlet-name>
              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
              <load-on-startup>1</load-on-startup>
         </servlet>
         <servlet>
              <servlet-name>DownloadServlet</servlet-name>
              <servlet-class>
                   com.intermoco.emdba.console.util.DownloadServlet
              </servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>DownloadServlet</servlet-name>
              <url-pattern>/download/*</url-pattern>
         </servlet-mapping>
    </web-app>
    and faces-config.xml is as bellow
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config
    PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
    <faces-config>
         <lifecycle>
              <phase-listener>
                   org.jboss.seam.jsf.TransactionalSeamPortletPhaseListener
              </phase-listener>
              <!--phase-listener>
              com.intermoco.emdba.console.listener.admin.PhaseListenerTest
              </phase-listener-->
         </lifecycle>
         <converter>
         <converter-id>EmdbaConverter</converter-id>
         <converter-class>com.intermoco.emdba.util.converter.EmdbaConverter</converter-class>
         </converter>
    </faces-config>
    please suggest me wht to do?

    Maybe the second filter-mapping is missing:
    <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.)  -->
    <filter-mapping>
         <filter-name>extensionsFilter</filter-name>
         <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
    </filter-mapping>
    {code}
    See http://myfaces.apache.org/tomahawk/extensionsFilter.html
    Regards
    Edited by: Nicolas.Baer on Sep 27, 2007 12:19 PM
    Edited by: Nicolas.Baer on Sep 27, 2007 12:20 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Reg :File upload and download from client machine

    hi..
    anyone help me the way that how to upload and download word
    document file from client machine.. i am using j2eeserver1.4 in linux..
    i want upload file from client machine(windows) to server(linux.) please
    help me . tell me idea regarding..
    i have tried this coding.. but i can transfer txt file. only. when i upload mirosoft word file.. it will open with some ascii values with actual content.
    <!-- upload.jsp -->
    <%@ page import="java.io.*" %>
    <%String contentType = request.getContentType();
    String file = "";
    String saveFile = "";
    FileOutputStream fileOut = null;
    if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0))
    DataInputStream in = new DataInputStream(request.getInputStream());
    int formDataLength = request.getContentLength();
    byte dataBytes[] = new byte[formDataLength];
    int byteRead = 0;
    int totalBytesRead = 0;
    while (totalBytesRead < formDataLength)
    byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
    totalBytesRead += byteRead;
    try { 
    file = new String(dataBytes);
    saveFile = file.substring(file.indexOf("filename=\"") + 10);
    saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
    saveFile = saveFile.substring(saveFile.lastIndexOf("/") + 1,saveFile.indexOf("\""));
    int lastIndex = contentType.lastIndexOf("=");
    String boundary = contentType.substring(lastIndex + 1,contentType.length());
    int pos;
    pos = file.indexOf("filename=/" + 1);
    pos = file.indexOf("\n", pos) + 1;
    pos = file.indexOf("\n", pos) + 1;
    pos = file.indexOf("\n", pos) + 1;
    int boundaryLocation = file.indexOf(boundary, pos) - 4;
    int startPos = ((file.substring(0, pos)).getBytes()).length;
    int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;
    String folder = "/tmp/uploads/";
    fileOut = new FileOutputStream(folder + saveFile);
    fileOut.write(dataBytes);
    fileOut.write(dataBytes, startPos, (endPos - startPos));
    fileOut.flush(); } catch(Exception e) {  out.print(e);
    } finally
    {  try
    {fileOut.close();
    }catch(Exception err)
    %>
    please which package will help me to upload word document file with no errror. send me how can use in ftp.. send me some sample program..
    Regards..
    New User M.Senthil..

    Hi,
    Well,i don't know whether if this helps people here are not.
    It is always a good practise to do it via Servlet and then download content.
    The adavantage of doing this is
    1). You may not need to pack the downloadable with the .war which you ultimately genrate which ceratinly help us in terms of faster deployment.
    3). You may update the new content just by moving a file to the backup folder.
    2).One may definately download the content irrespective to the content/file.
    Hope example below helps..
    Configurations:
    In the above example we are assuming that we placing all downlodable file in D:/webapp/downlodables/ and you have configured the same path as a init param with the name "filePath" in your web.xml.
    something like the one below.
    <servlet>
        <servlet-name>DownloadServlet</servlet-name>
        <servlet-class>com.DownloadServlet</servlet-class>
        <init-param>
           <param-name>filePath</param-name>
           <param-value>D:/webapp/downlodables/</param-name>
           <!--Could use any backup folder Available on your Server-->
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>DownloadServlet</servlet-name>
        <url-pattern>/downloadFile</url-pattern>
    </servlet-mapping>DownloadServlet.java:
    ==================
    package com;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.BufferedOutputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import javax.activation.MimetypesFileTypeMap;
    *@Author RaHuL
    /**Download Servlet
    *  which could be accessed downloadFile?fid=fileName
    *  or
    *  http://HOST_NAME:APPLN_PORT/ApplnContext/downloadFile?fid=fileName
    public class DownloadServlet extends HttpServlet{
      private static String filePath = new String();
      private static boolean dirExists = false;
      public void init(ServletConfig config){
          // Acquiring Backup Folder Part
          filePath = config.getInitParameter("filePath");
          dirExists = new File(filePath).exists();      
      private void processAction(HttpServletRequest request,HttpServletResponse response) throws Exception{
           // Some Authentication Checks depending upon requirements.
           // getting fileName which user is requesting for
           String fileName = request.getParameter("fid");
           //Building the filePath
           StringBuffer  tFile = new StringBuffer();
           tFile.append(filePath);    
           tFile.append("fileName"); 
           boolean exists = new File(tFile.toString()).exists();
           // Checking whether the file Exists or not      
           if(exists){
            FileInputStream input = null;
            BufferedOutputStream output = null; 
            int contentLength = 0;
            try{
                // Getting the Mime-Type
                String contentType = new MimetypesFileTypeMap().getContentType(tFile.toString());          
                input = new FileInputStream(tFile.toString());
                contentLength = input.available();
                response.setContentType(contentType);
                response.setContentLength(contentLength);
                response.setHeader("Content-Disposition","attachment;filename="+fileName);
                output = new BufferedOutputStream(response.getOutputStream());
                while ( contentLength-- > 0 ) {
                   output.write(input.read());
                 output.flush();
              }catch(IOException e) {
                     System.err.println("Exception Occured:"+e.getMessage());
                 System.err.println("Exception Localized Message:"+e.getLocalizedMessage());
              } finally {
                   if (output != null) {
                       try {
                          output.close();
                      } catch (IOException ie) {
                          System.err.println("Exception Occured:"+e.getMessage());
                             System.err.println("Exception Localized Message:"+e.getLocalizedMessage());                      
           }else{
             response.sendRedirect("/errorPage.html");
      public void doPost(HttpServletRequest request,HttpServletResponse response) throws Exception{       
            processAction(request,response); 
      public void doGet(HttpServletRequest request,HttpServletResponse response) throws Exception{
            processAction(request,response); 
    NOTE: Make sure You include activations.jar in your CLASSPATH b4 trying the code.
    therefore,if you have something like above set as your application enviroment in the above disccussed
    can be done by just giving a simple hyper link like
    <a href="downloadFile?fid=fileName.qxd" target="_blank">Download File</a>REGARDS,
    RaHuL

  • Linguistics Studio - russian language support

    Adding russian language support fails:
    Run Linguistics Studio v1.23.
    Import als-ru.zip from ALS_esp53_Russian_1_1_all with parameters: Lemmatize by document expansion, Noun + Adjective + Verb (checked), Deploy changes to ESP atfer import (checked).
    Linguistics Studio message: "The Russian ALS package has been successfully imported into [project name]".
    Click "Deploy and Execute Required Operations".
    (Very long deploying - day or somethig.)
    Linguistics Studio error (Could not deploy [project name]: java.lang.RuntimeException: dj exiited with value 1):
    Log error (full):
    C:\esp\bin>dictman.cmd --debug
    11:41:08,725 DEBUG ESPClientContainer
      Appender org.apache.log4j.ConsoleAppender@11e1e67 added to root logger
    11:41:08,726 DEBUG ESPClientContainer
      Transferring options from command line to DictMan[properties:null file:null local:false execute:null properties:null]
    11:41:09,000 DEBUG OptionsFacade
      Setting debug=true (class java.lang.Boolean) in DictMan[properties:null file:null local:false execute:null properties:null]
    11:41:09,006 DEBUG ESPClientContainer
      ESPClientContainer[app:'esp4jtool-dictman' hosting main:DictMan[properties:null file:null local:false execute:null properties:null] ctx:ContextHelper[Not loaded:[esp4j-core-context.xml, esp4j-remote-client-context.xml, esp4j-remote-
    admin-context.xml, esp4jtool-dictman-context.xml]]
    adminserver@null:0] will continue to boot...
    11:41:09,006 DEBUG ContextHelper
      ContextHelper[Not loaded:[esp4j-core-context.xml, esp4j-remote-client-context.xml, esp4j-remote-admin-context.xml, esp4jtool-dictman-context.xml]] now loading contexts ...
    11:41:09,231 INFO  XmlBeanDefinitionReader
      Loading XML bean definitions from class path resource [esp4j-core-context.xml]
    11:41:09,381 INFO  XmlBeanDefinitionReader
      Loading XML bean definitions from class path resource [esp4j-remote-client-context.xml]
    11:41:09,401 INFO  XmlBeanDefinitionReader
      Loading XML bean definitions from class path resource [esp4j-remote-admin-context.xml]
    11:41:09,631 INFO  XmlBeanDefinitionReader
      Loading XML bean definitions from class path resource [esp4jtool-dictman-context.xml]
    11:41:09,644 INFO  ClassPathXmlApplicationContext
      Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext;hashCode=18248114]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans
    [resourceLoader,propertiesLoader,configurationService,esp4jProperties,exceptionSentry,stateStorage,executor,login,remoteAuthenticationService,managedQueriesService,boostsAndBlocksService,dictionaryService,spelltuningService,collectionSer
    vice,indexerControlService,indexProfileService,blissService,viewService,searchDispatcherService,deploymentManagerService,queryStatisticsService,watchedQueriesService,rankProfileService,presentationService,userManagementService,searchProf
    ileService,statusService,productInfoService,mailSenderService,nodeService,echoService,usageReportingService,documentStatusService,dictMan]; root of BeanFactory hierarchy
    11:41:09,671 INFO  ClassPathXmlApplicationContext
      34 beans defined in application context [org.springframework.context.support.ClassPathXmlApplicationContext;hashCode=18248114]
    11:41:09,674 INFO  DefaultListableBeanFactory
      Creating shared instance of singleton bean 'esp4jProperties'
    11:41:09,758 INFO  DefaultListableBeanFactory
      Creating shared instance of singleton bean 'resourceLoader'
    11:41:09,762 DEBUG Platform
      Determined platform: com.fastsearch.esp.admin.util.Platform:[name=Windows, arch=null]
    11:41:09,763 DEBUG DefaultResourceLoader
      com.fastsearch.esp.admin.util.ESPAwareResourceLoader[[]] adds path
    file:///c:/esp
    11:41:09,763 DEBUG DefaultResourceLoader
      com.fastsearch.esp.admin.util.ESPAwareResourceLoader[[file:///c:/esp]] adds path
    file:///c:/esp/etc
    11:41:09,763 DEBUG DefaultResourceLoader
      com.fastsearch.esp.admin.util.ESPAwareResourceLoader[[file:///c:/esp,
    file:///c:/esp/etc]] adds path file:///c:/esp/etc/dtd
    11:41:09,763 DEBUG DefaultResourceLoader
      com.fastsearch.esp.admin.util.ESPAwareResourceLoader[[file:///c:/esp/etc/dtd,
    file:///c:/esp, file:///c:/esp/etc]] adds path
    file:///c:/esp/index-profiles
    11:41:09,776 INFO  DefaultListableBeanFactory
      Creating shared instance of singleton bean 'configurationService'
    11:41:09,786 INFO  DefaultListableBeanFactory
      Creating shared instance of singleton bean 'propertiesLoader'
    11:41:09,804 DEBUG DefaultResourceLoader
      File exists: file:///c:/esp/etc/esp4j.properties
    11:41:09,804 DEBUG DefaultResourceLoader
      com.fastsearch.esp.admin.util.ESPAwareResourceLoader[[file:///c:/esp/etc/dtd,
    file:///c:/esp/index-profiles,
    file:///c:/esp, file:///c:/esp/etc],
    applicationContext:org.springframework.context.support.ClassPathXmlApplicationContext;hashCode=18248114] found resource file:/c:/esp/etc/esp4j.properties for reference 'etc/esp4j.properties'
    11:41:09,806 DEBUG ConfigurationServiceImpl
      ConfigurationServiceImpl[web context:false, 30 properties <= [] + esp4j.main.properties.url:etc/esp4j.properties, esp4j.app.properties.url:, using com.fastsearch.esp.admin.util.ESPAwareResourceLoader[[file:///c:/esp/etc/dtd,
    file:///c:/esp/index-profiles,
    file:///c:/esp, file:///c:/esp/etc], applicationContext:org.springframework.context.support.ClassPathXmlApplicationContext;hashCode=18248114]] read 30 properties from etc/esp4j.properties
    11:41:09,806 DEBUG ConfigurationServiceImpl
      got empty value for property 'esp4j.app.properties.url'
    11:41:09,806 DEBUG PropertiesLoader
      PropertiesLoader[resourceLoader:com.fastsearch.esp.admin.util.ESPAwareResourceLoader[[file:///c:/esp/etc/dtd,
    file:///c:/esp/index-profiles,
    file:///c:/esp, file:///c:/esp/etc],
    applicationContext:org.springframework.context.support.ClassPathXmlApplicationContext;hashCode=18248114]] found System property esp.port set to '13000', not overwriting it with '13000'
    11:41:09,806 DEBUG PropertiesLoader
      PropertiesLoader[resourceLoader:com.fastsearch.esp.admin.util.ESPAwareResourceLoader[[file:///c:/esp/etc/dtd,
    file:///c:/esp/index-profiles,
    file:///c:/esp, file:///c:/esp/etc],
    applicationContext:org.springframework.context.support.ClassPathXmlApplicationContext;hashCode=18248114]] found System property esp.host set to '[servername]', not overwriting it with '[servername]'
    11:41:09,807 DEBUG PropertiesLoader
      PropertiesLoader[resourceLoader:com.fastsearch.esp.admin.util.ESPAwareResourceLoader[[file:///c:/esp/etc/dtd,
    file:///c:/esp/index-profiles,
    file:///c:/esp, file:///c:/esp/etc],
    applicationContext:org.springframework.context.support.ClassPathXmlApplicationContext;hashCode=18248114]] found System property esp.home set to 'c:\esp', not overwriting it with 'c:/esp'
    11:41:09,807 DEBUG ConfigurationServiceImpl
      ConfigurationServiceImpl[web context:false, 30 properties <= [] + esp4j.main.properties.url:etc/esp4j.properties, esp4j.app.properties.url:, using com.fastsearch.esp.admin.util.ESPAwareResourceLoader[[file:///c:/esp/etc/dtd,
    file:///c:/esp/index-profiles,
    file:///c:/esp, file:///c:/esp/etc], applicationContext:org.springframework.context.support.ClassPathXmlApplicationContext;hashCode=18248114]]: Properties printout:
    11:41:09,808 DEBUG ConfigurationServiceImpl
        esp.port='13000'
    11:41:09,808 DEBUG ConfigurationServiceImpl
        esp.adminserver.sso-key='00000131A84B346F'
    11:41:09,808 DEBUG ConfigurationServiceImpl
        esp.adminserver.downloadservlet='download'
    11:41:09,808 DEBUG ConfigurationServiceImpl
    esp.adminserver.deployment.didyoumeanconfigfiles='wordsplitting,etc/qrserver/didyoumean/wordsplitting.xml,propernames,etc/qrserver/didyoumean/propername.xml,en,etc/qrserver/didyoumean/spellcheck.english.xml,de,etc/qrserver/didyoumean/spe
    llcheck.german.xml,fr,etc/qrserver/didyoumean/spellcheck.french.xml,es,etc/qrserver/didyoumean/spellcheck.spanish.xml,it,etc/qrserver/didyoumean/spellcheck.italian.xml,pt,etc/qrserver/didyoumean/spellcheck.portuguese.xml,no,etc/qrserver/
    didyoumean/spellcheck.norwegian.xml,pl,etc/qrserver/didyoumean/spellcheck.polish.xml,ru,etc/qrserver/didyoumean/spellcheck.russian.xml,hu,etc/qrserver/didyoumean/spellcheck.hungarian.xml,nl,etc/qrserver/didyoumean/spellcheck.dutch.xml,ko
    ,etc/qrserver/didyoumean/spellcheck.korean.xml,antiphrasing,etc/qrserver/didyoumean/antiphrasing.xml'
    11:41:09,809 DEBUG ConfigurationServiceImpl
        esp.adminserver.password='****'
    11:41:09,809 DEBUG ConfigurationServiceImpl
        esp.host='[servername]'
    11:41:09,809 DEBUG ConfigurationServiceImpl
        esp.adminserver.downloadarea='downloads'
    11:41:09,809 DEBUG ConfigurationServiceImpl
        esp.adminserver.deployment.clearCollectionTimeout='10800000'
    11:41:09,809 DEBUG ConfigurationServiceImpl
        postgresql.user='fast'
    11:41:09,809 DEBUG ConfigurationServiceImpl
        esp.adminserver.context='adminserver'
    11:41:09,810 DEBUG ConfigurationServiceImpl
        postgresql.pass='fast'
    11:41:09,810 DEBUG ConfigurationServiceImpl
        esp.adminserver.deployment.subsystems='indexing'
    11:41:09,810 DEBUG ConfigurationServiceImpl
        esp.home='c:/esp' (overridden by System property: 'c:\esp')
    11:41:09,810 DEBUG ConfigurationServiceImpl
        crawlerservice.postgresql.port='16070'
    11:41:09,810 DEBUG ConfigurationServiceImpl
        esp.adminserver.deployment.waitforcompleted='true'
    11:41:09,811 DEBUG ConfigurationServiceImpl
        sfe.qrservers='[servername]:15100'
    11:41:09,812 DEBUG ConfigurationServiceImpl
        crawlerservice.postgresql.host='[servername]'
    11:41:09,812 DEBUG ConfigurationServiceImpl
        esp.adminserver.deployment.blisspath='bin\bliss-core.exe'
    11:41:09,812 DEBUG ConfigurationServiceImpl
        esp.adminserver.username='admin'
    11:41:09,813 DEBUG ConfigurationServiceImpl
        nameservice.port='16099'
    11:41:09,813 DEBUG ConfigurationServiceImpl
        sfe.relative.resource.path=''
    11:41:09,813 DEBUG ConfigurationServiceImpl
        postgresql.port='16070'
    11:41:09,814 DEBUG ConfigurationServiceImpl
        esp.adminserver.port='16089'
    11:41:09,814 DEBUG ConfigurationServiceImpl
        esp.mailserver.port='25'
    11:41:09,814 DEBUG ConfigurationServiceImpl
        nameservice.host='[servername]'
    11:41:09,814 DEBUG ConfigurationServiceImpl
        esp.adminserver.deployment.defaultpipeline='scopesearch'
    11:41:09,814 DEBUG ConfigurationServiceImpl
        esp.adminserver.dictonary.compile.internal.limit='0'
    11:41:09,815 DEBUG ConfigurationServiceImpl
        postgresql.host='[servername]'
    11:41:09,816 DEBUG ConfigurationServiceImpl
        esp.adminserver.host='[servername]'
    11:41:09,816 DEBUG ConfigurationServiceImpl
        esp.mailserver.host=''
    11:41:09,816 DEBUG ConfigurationServiceImpl
      ConfigurationServiceImpl[web context:false, 30 properties <= [] + esp4j.main.properties.url:etc/esp4j.properties, esp4j.app.properties.url:, using com.fastsearch.esp.admin.util.ESPAwareResourceLoader[[file:///c:/esp/etc/dtd,
    file:///c:/esp/index-profiles,
    file:///c:/esp, file:///c:/esp/etc], applicationContext:org.springframework.context.support.ClassPathXmlApplicationContext;hashCode=18248114]]: Properties printout done.
    11:41:09,894 INFO  CollectionFactory
      Commons Collections 3.x available
    11:41:09,918 INFO  ClassPathXmlApplicationContext
      Unable to locate MessageSource with name 'messageSource': using default [[email protected]0c]
    11:41:09,922 INFO  ClassPathXmlApplicationContext
      Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@ba5bdb]
    11:41:09,926 INFO  DefaultListableBeanFactory
      Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans
    [resourceLoader,propertiesLoader,configurationService,esp4jProperties,exceptionSentry,stateStorage,executor,login,remoteAuthenticationService,managedQueriesService,boostsAndBlocksService,dictionaryService,spelltuningService,collectionSer
    vice,indexerControlService,indexProfileService,blissService,viewService,searchDispatcherService,deploymentManagerService,queryStatisticsService,watchedQueriesService,rankProfileService,presentationService,userManagementService,searchProf
    ileService,statusService,productInfoService,mailSenderService,nodeService,echoService,usageReportingService,documentStatusService,dictMan]; root of BeanFactory hierarchy]
    11:41:09,927 INFO  DefaultListableBeanFactory
      Creating shared instance of singleton bean 'exceptionSentry'
    11:41:09,935 INFO  DefaultListableBeanFactory
      Creating shared instance of singleton bean 'stateStorage'
    11:41:09,944 INFO  DefaultListableBeanFactory
      Creating shared instance of singleton bean 'executor'
    11:41:10,084 INFO  DefaultListableBeanFactory
      Creating shared instance of singleton bean 'login'
    11:41:10,092 INFO  DefaultListableBeanFactory
      Creating shared instance of singleton bean 'remoteAuthenticationService'
    11:41:10,409 INFO  DefaultAopProxyFactory
      CGLIB2 available: proxyTargetClass feature enabled
    11:41:10,452 INFO  DefaultListableBeanFactory
      Creating shared instance of singleton bean 'dictMan'
    11:41:10,453 INFO  DefaultListableBeanFactory
      Creating shared instance of singleton bean 'dictionaryService'
    11:41:10,636 DEBUG DictMan
      Setting dictionary service HTTP invoker proxy for service URL [http://[servername]:16089/adminserver/dictionaryService.esp]
    11:41:10,650 DEBUG ContextHelper
      ContextHelper[[esp4j-core-context.xml, esp4j-remote-client-context.xml, esp4j-remote-admin-context.xml, esp4jtool-dictman-context.xml] -> 34 beans] goes looking for requiredclass interface
    com.fastsearch.esp.admin.RemoteAuthenticationService, default value = null
    11:41:10,651 DEBUG ContextHelper
      ContextHelper[[esp4j-core-context.xml, esp4j-remote-client-context.xml, esp4j-remote-admin-context.xml, esp4jtool-dictman-context.xml] -> 34 beans] found single bean named 'remoteAuthenticationService' of class interface
    com.fastsearch.esp.admin.RemoteAuthenticationService: HTTP invoker proxy for service URL [http://[servername]:16089/adminserver/remoteAuthenticationService.esp]
    11:41:10,655 DEBUG OptionsFacade
      Parsing command line
      [esp4jtool-dictman, --debug]
     against options:
      [password, baseport, port, debug, hostname, version, help, verbose, user name]
    11:41:10,655 DEBUG OptionsFacade
      Parsed 1 options
    11:41:10,659 DEBUG ContextHelper
      ContextHelper[[esp4j-core-context.xml, esp4j-remote-client-context.xml, esp4j-remote-admin-context.xml, esp4jtool-dictman-context.xml] -> 34 beans] goes looking for requiredclass interface
    com.fastsearch.esp.admin.engine.auth.ClientAuthenticationMechanism, default value = ConsoleAuthentication[user:null]
    11:41:10,660 DEBUG ContextHelper
      Bean 'null' of type 'interface com.fastsearch.esp.admin.engine.auth.ClientAuthenticationMechanism' not found. Using default bean 'ConsoleAuthentication[user:null]
    11:41:10,660 DEBUG ContextHelper
      ContextHelper[[esp4j-core-context.xml, esp4j-remote-client-context.xml, esp4j-remote-admin-context.xml, esp4jtool-dictman-context.xml] -> 34 beans] found single bean named 'null' of class interface
    com.fastsearch.esp.admin.engine.auth.ClientAuthenticationMechanism: ConsoleAuthentication[user:null]
    11:41:10,660 DEBUG ESPClientAuthenticationHelper
      ClientAuthenticationMechanism ProgrammaticAuthentication[Last authenticated:null] failed
    11:41:10,660 DEBUG CommandLineArgumentsAuthentication
      CommandLineArgumentsAuthentication[null] found no username in
    org.apache.commons.cli.CommandLine@1860038
    11:41:10,661 DEBUG ESPClientAuthenticationHelper
      ClientAuthenticationMechanism CommandLineArgumentsAuthentication[null] failed
    11:41:10,661 DEBUG ESPClientAuthenticationHelper
      ClientAuthenticationMechanism ProgrammaticAuthentication[Last authenticated:admin] succeeded.
    11:41:10,661 DEBUG ContextHelper
      ContextHelper[[esp4j-core-context.xml, esp4j-remote-client-context.xml, esp4j-remote-admin-context.xml, esp4jtool-dictman-context.xml] -> 34 beans] goes looking for class interface com.fastsearch.esp.admin.engine.auth.Login, default
    value = null
    11:41:10,666 DEBUG ContextHelper
      ContextHelper[[esp4j-core-context.xml, esp4j-remote-client-context.xml, esp4j-remote-admin-context.xml, esp4jtool-dictman-context.xml] -> 34 beans] found single bean named 'null' of class interface
    com.fastsearch.esp.admin.engine.auth.Login: AcegiTokenLogin[Last logged in:null]
    11:41:10,719 DEBUG ESPHttpInvokerRequestExecutor
      Sending HTTP invoker request for service at [http://[servername]:16089/adminserver/remoteAuthenticationService.esp], with size 270
    11:41:10,818 DEBUG ESPHttpInvokerRequestExecutor
      HttpInvocation now presenting via BASIC authentication ContextHolder-derived:
    net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken@105691e: Username: admin; Password: [PROTECTED]; Authenticated: false; Details: null; Not
    granted any authorities
    11:41:11,088 DEBUG Rewirer
      Invoking public void no.fast.esp.tools.dictman.DictMan.setDictionaryService(com.fastsearch.esp.admin.DictionaryService) on DictMan[properties:null file:null local:false execute:null properties:null] with args [HTTP invoker proxy for
    service URL [http://[servername]:16089/adminserver/dictionaryService.esp]]
    11:41:11,088 DEBUG DictMan
      Setting dictionary service HTTP invoker proxy for service URL [http://[servername]:16089/adminserver/dictionaryService.esp]
    11:41:11,088 DEBUG Rewirer
      Injected service HTTP invoker proxy for service URL [http://[servername]:16089/adminserver/dictionaryService.esp] into object DictMan[properties:null file:null local:false execute:null properties:null]
    11:41:11,088 INFO  DefaultListableBeanFactory
      Creating shared instance of singleton bean 'spelltuningService'
    11:41:11,093 DEBUG Rewirer
      Invoking public void no.fast.esp.tools.dictman.DictMan.setSpelltuningService(com.fastsearch.esp.admin.SpelltuningService) on DictMan[properties:null file:null local:false execute:null properties:null] with args [HTTP invoker proxy for
    service URL [http://[servername]:16089/adminserver/spelltuningService.esp]]
    11:41:11,093 DEBUG Rewirer
      Injected service HTTP invoker proxy for service URL [http://[servername]:16089/adminserver/spelltuningService.esp] into object DictMan[properties:null file:null local:false execute:null properties:null]
    11:41:11,093 DEBUG ESPClientContainer
      About to run main DictMan[properties:null file:null local:false execute:null properties:null] in host mode, passing arguments [esp4jtool-dictman]
    command (? for help)> with ld ru
                    command = 'with ld ru' ... execute 'with ld ru'
    using <name>=ru, <type>=LEMMATIZATION(LD)
    command (? for help)> compileblocking
                    command = 'compileblocking' ... execute 'compileblocking'
    11:41:32,850 DEBUG ESPHttpInvokerRequestExecutor
      Sending HTTP invoker request for service at [http://[servername]:16089/adminserver/dictionaryService.esp], with size 559
    starting compilation of '[LEMMATIZATION(LD),ru]' . Can take a while ...
    11:41:36,146 DEBUG ESPHttpInvokerRequestExecutor
      Sending HTTP invoker request for service at [http://[servername]:16089/adminserver/dictionaryService.esp], with size 2202
    java.lang.reflect.InvocationTargetExceptionERROR: java.lang.RuntimeException: java.lang.RuntimeException: dj exited with value: 1
    Restart dictMan with --debug option to find out more about details
            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:597)
            at com.fastsearch.esp.tools.dictman.io.CLICommand.execute(CLICommand.java:83)
            at no.fast.esp.tools.dictman.DictManCommandHandler.executeCommand(DictManCommandHandler.java:517)
            at no.fast.esp.tools.dictman.DictMan.cliCommand(DictMan.java:309)
            at no.fast.esp.tools.dictman.DictMan.main(DictMan.java:225)
            at com.fastsearch.esp.admin.engine.ESPClientContainer.runMain(ESPClientContainer.java:622)
            at com.fastsearch.esp.admin.engine.ESPClientContainer.run(ESPClientContainer.java:575)
            at com.fastsearch.esp.admin.engine.ESPClientContainer.open(ESPClientContainer.java:439)
            at com.fastsearch.esp.admin.engine.ESPHost.host(ESPHost.java:89)
            at com.fastsearch.esp.admin.engine.ESPHost.host(ESPHost.java:73)
            at com.fastsearch.esp.admin.engine.ESPHost.main(ESPHost.java:105)
            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:597)
            at org.apache.commons.launcher.ChildMain.run(ChildMain.java:228)
    Caused by: java.lang.RuntimeException: java.lang.RuntimeException: dj exited with value: 1
            at no.fast.vespa.services.DictionaryServiceImpl.compileWithDj(DictionaryServiceImpl.java:843)
            at no.fast.vespa.services.DictionaryServiceImpl.syncompileExternal(DictionaryServiceImpl.java:852)
            at no.fast.vespa.services.DictionaryServiceImpl.syncompile(DictionaryServiceImpl.java:791)
            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:597)
            at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:288)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
            at org.springframework.aop.framework.adapter.AfterReturningAdviceInterceptor.invoke(AfterReturningAdviceInterceptor.java:51)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
            at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:53)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
            at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
            at com.fastsearch.esp.admin.engine.monitoring.ScopeInterceptor.invoke(ScopeInterceptor.java:29)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
            at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:53)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
            at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
            at $Proxy31.syncompile(Unknown Source)
            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:597)
            at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:288)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
            at org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:68)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
            at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
            at $Proxy31.syncompile(Unknown Source)
            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:597)
            at org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:179)
            at org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:33)
            at org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:71)
            at org.springframework.remoting.support.RemoteInvocationBasedExporter.invokeAndCreateResult(RemoteInvocationBasedExporter.java:107)
            at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.handleRequest(HttpInvokerServiceExporter.java:80)
            at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
            at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)
            at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
            at org.springframework.web.servlet.FrameworkServlet.serviceWrapper(FrameworkServlet.java:386)
            at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:355)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:292)
            at net.sf.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:84)
            at net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter(SecurityEnforcementFilter.java:182)
            at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
            at net.sf.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:206)
            at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
            at net.sf.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:225)
            at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
            at net.sf.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:173)
            at net.sf.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:125)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:75)
            at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            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:856)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    command (? for help)>
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
            at java.lang.Thread.run(Thread.java:662)
    Caused by: java.lang.RuntimeException: dj exited with value: 1
            at no.fast.vespa.services.DictionaryServiceImpl.compileWithDj(DictionaryServiceImpl.java:830)
            ... 78 more
                    command = '' ... execute ''
    command (? for help)>
    How to resolve this error? How to add Russian language support? Is there a bugfix for Linguistics studio?

    Hi Edgars,
    The cause of this issue is that the Russian lemmatization dictionary is too large for ESP to actually handle and deploy.
    In your output below is the following:
    java.lang.reflect.InvocationTargetExceptionERROR: java.lang.RuntimeException: java.lang.RuntimeException: dj exited with value: 1
    We are aware of this issue, and have discussed this with our R&D team.  There is a work around for all customers that do not customize tokenization/normalization or the content of the lemmatization dictionary in installing the ESP 5.0 dictionaries
    that are shipped as compiled automata files.
    To work around this issue, the ALS package, ALS_esp53_Russian_1_1_all, was created and released.  However, this workaround will not allow you to edit the contents of the lemmatization dictionary.  The workaround steps are as follows:
    1. Uncheck all forms of speech for lemmatization.
    2. Let Linguistics Studio deploy the dictionaries. 
    3. Note the error indicating the dictionaries were not properly applied. 
    4. Clicked the project in Linguistics Studio again and clicked the "deploy to ESP".  This will run through the deployment, placed the spellcheck and antiphrase dictionaries on the ESP system.
    5. Manually copy the lemmatization .aut files to the %FASTSEARCH$\resources\dictionaries\lemmatization\ directory. 
    These steps will allow you to edit all of the dictionaries, except for the lemmatization dictionaries. 
    We realize this is an important issue.  Unfortunately, the workaround is the only way to address this issue.  When considering the options around fixing the issue, it was found that this would entail a complete re-working the automaton compilation
    process, and could introduce a high risk of regressions for all search environments.
    Thanks!
    Rob Vazzana | Sr Support Escalation Engineer | US Customer Service & Support
    Customer Service & Support                        
    Microsoft|
    Services

  • Download servlet from external server

    I write a download file servlet. It should download files from external ftp and make the save as dialog window save it with proper extension.
    It gets 3 parametes:
    http://10.60.1.1:8080/sd-sp45/DownloadServlet?fileName=55555.doc&filePath=000/000/000/000/000/000/010/002/8c8/f07/57/00000000-0000-0000-0001-00028c8f076e&fileType=doc
    fileName - original file name;
    filePath - path and file name on ftp server;
    fileType - file type;
    I get an error IOException : java.oi.FileNotFoundException :
    ftp:\sdattach:[email protected]\sdftp\Servicecall\000\000\000/000\000/000/010\002\8c8\f07\57\00000000-0000-0000-0001-00028c8f076e (The file name, diroctory name, or volume label syntax is incorrect)
    I'm not sure if I can use here File class (maybe some network stuff)
    Besides, what shoud I change here :
    response.setContentType("application/octet-stream");
    response.setContentLength((int)F.length());
    response.setHeader("Content-Disposition","attachment;filename="+file);
    to save file with the extension i need?
    Thank you for help
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.net.*;
    public class DownloadServlet extends HttpServlet {
        File F;
        BufferedInputStream fif;
        ServletOutputStream stream;
        public void init(){
            F=null;
            fif=null;
            stream =null;
        public void doGet(HttpServletRequest request ,HttpServletResponse response) {
            try{
                try{
                // Setting Buffer size
                response.setBufferSize(50000);
                int buffersize;
                String filePath="";
                String fileName="";
                String fileType="";
                //Receiving variables
                fileName=request.getParameter("fileName");
                filePath = request.getParameter("filePath");
                fileType = request.getParameter("fileType");
                System.out.println("========New compile==");
                System.out.println(fileName);
                System.out.println(filePath);
                System.out.println(fileType);
                String downloadFile = "ftp://sdattach:[email protected]/sdftp/Servicecall/" + filePath;
                F=new File(downloadFile);
                String file=F.getName();
                buffersize= 10248;
                byte b[]=new byte[buffersize];
                // Setting Content Type
                response.setContentType("application/octet-stream");
                response.setContentLength((int)F.length());
                response.setHeader("Content-Disposition","attachment;filename="+file);
                stream = response.getOutputStream();
                fif = new BufferedInputStream(new FileInputStream(F));
                //writing data to output stream
                int count=fif.read(b,0,buffersize);
                while(count!=-1){
                stream.write(b,0,count);
                count=fif.read(b,0,buffersize);
                //closing objects
                fif.close();
                stream.flush();
                stream.close();
                F.delete();
                }catch(SocketException se){
                System.out.println("SocketException " +se);
                catch(IOException io){
                System.out.println("IOException " + io);
                catch(Exception e){
                System.out.println("Exception " +e);
            }catch(Exception e){ System.out.println("Exception " +e); }
    }

    assuming the filepath is absolutely correct, try doing this:
    String downloadFile = "ftp://sdattach:[email protected]/sdftp/Servicecall/" + filePath;
    response.setHeader("Content-Disposition","attachment;filename=\""+downloadFile+ "\"");

  • How to get the share name

    Hi,
    In my application user selects the file path using html file select and saves it. Other users should be able to open that file by just clicking that saved file path (i display it as a link). Now the problem is user maps the shared folder in network as x: or Z: etc. so when he choose the file path it will be saved as Z:\folder1\filename.txt . But i need to replace that Z: with the share name. Is it possible to do this? If so is there any method in jsp or javascrip?
    Thanks,
    Thanuja.

    ya Baluc. I have used only servlets to download the file. the link which u provided for DownloadServlet was really useful.
    Here the scenario is this.
    User will just select the path where the file resides.
    Say for eg: z:/folder/file
    where the share name for z: is project.
    Once the user selects the file path and submits, then the path alone is saved in DB and a message will be generated to Customer support department stating that the project has been completed and the file is in the path z:/foldfer/file
    Now CSR opens the specified path and take the files (they do it manually). For them z: makes no meaning. If i save the path like projects:/folder/file then it will be easy for them to identify .
    some user may map projects share to z: and some may map to h:
    for this purpose only i asked and not for downloading the files. iam sorry its my very old post and i did not mention it clearly.
    Thanks,
    Thanuja

  • Error 10 Could not locate resource

    I tried to auto download the JRE using the JREInstaller and the DownloadServlet (sample in jdk 1.5) from a local server. I got the error 10 Could not locate resource.
    <j2se version="1.5.0*"  href="http://127.0.0.1:8080/Web-Test2/install/javaws-1_0_1-j2re-1_5_0-windows-i586.jnlp"/>If I only take <j2se version="1.5.0*"  href="http://127.0.0.1:8080/Web-Test2/install"/>, I will get an error: "Missing version field in response from server when accessing resource"
    Any idea?

    The request made by java web start to download the jre is a using the extension protocol (version protocol) see the jnlp spec at:
    http://jcp.org/aboutJava/communityprocess/mrel/jsr056/index.html
    basically what this means is that you need to be running a servlet or jsp page on the target that implements the version protocol. see:
    http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/downloadservletguide.html
    I don''t know what you have at the target address of the jre:
    javaws-1_0_1-j2re-1_5_0-windows-i586.jnlp
    but you need servlet running at http://127.0.0.1:8080/Web-Test2/install to implement the version protocol.
    /Andy

Maybe you are looking for