Additional dir(s) for .jar,htm files in forms.conf file....

Hi ,
Is it possible and how to define additional directories for .jar , htm files in Dev Forms10g...????
For instance , in my forms.conf file.... there are :
# Virtual path mapping for Forms Java jar and class files (codebase)
AliasMatch ^/forms/java/(..*) "C:\oracle\product\DevSuite10g/forms/java/$1"
  # Virtual path for JInitiator downloadable executable and download page
AliasMatch ^/forms/jinitiator/(..*) "C:\oracle\product\DevSuite10g/jinit/$1"
  # Virtual path for runform.htm (used to run a form for testing purposes)
AliasMatch ^/forms/html/(..*) "C:\oracle\product\DevSuite10g/tools/web/html/$1"
......Thanks a lot
Simon

In this orion-web.xml file... there are entries like...:
<virtual-directory virtual-path="/html"
real-path="C:\oracle\product\DevSuite10g/tools/web/html" />
<virtual-directory virtual-path="/java"
real-path="C:\oracle\product\DevSuite10g/forms/java" />
Where should i put the alternative dir .....(such as the ones i have written in bold below....)
<virtual-directory virtual-path="/html"
real-path="C:\oracle\product\DevSuite10g/tools/web/html" , real-path="C:\oracle\product\DevSuite10g/tools/web/html_2"/>
<virtual-directory virtual-path="/java"
real-path="C:\oracle\product\DevSuite10g/forms/java" , real-path="C:\oracle\product\DevSuite10g/forms/java_2"/>
or
<virtual-directory virtual-path="/html" real-path="C:\oracle\product\DevSuite10g/tools/web/html" />
<virtual-directory virtual-path="/html" real-path="C:\oracle\product\DevSuite10g/tools/web/html_2" />
<virtual-directory virtual-path="/java" real-path="C:\oracle\product\DevSuite10g/forms/java" />
<virtual-directory virtual-path="/java" real-path="C:\oracle\product\DevSuite10g/forms/java_2" />
or where can i find a relative doc.... ????
Many Thanks,
Simon
Message was edited by:
sgalaxy

Similar Messages

  • J2EE .class file compiling for jar, ear files.

    I know that using the former Sun/present Oracle .class java source code compiler,
    I create a platform independet class file which can be used by the java language
    on any OS environment with the appropriate Java Runtime Environment installed.
    I know that there are obfuscation tools available to prevent the .class file decompilation
    related issues.
    I have also been using the GNU gcj compiler with great success. However,
    I havn't been able to find a non-commercial purchase compiler that can create
    .class files, with the same platform independence, but that can't be easily decompiled
    based on the simple content in .class files. Can someone point me to someone on the net
    for a free for commercial development java compiler, past about 1.5.X ?

    If it were possible, don't you think Oracle would have built the compiler like that themselves?

  • Nokia 6280 how to enable read/edit for jar to file...

    how do I allow jar files to acces/edit/read files on my nokia 6280? when I try to allow it, its doesn't let me, please give me a guide on how to allow the jar files to acces/edit/read the files on my nookia 6280 thank you.
    sorry if its the wrong topic.
    Message Edited by vasilevich on 07-May-2008 10:46 PM

    Dats simple
    select ur application click option
    select application access menu
    after dat select add edit data select allow access to ask always or ask once or always allow(allowed only apps is download frm a secured source)

  • Browse files and dirs in the JAR-file

    Hi! I'm stuck with a problem concerning browsing a JAR file to find all images, fonts and sound clips. I think this is a pretty straight-forward task, except when I consider that the file I want to browse, is the same file the browser is stored in and running from. I have searched for hours on the internet now, and I still haven't figured out a way to be able to browse my JAR file.
    Here is the code I use when I'm not running my project in a JAR-file:
         * Load and cache all files (*.ttf, *.png and *.wav) from the resource-directory
        public void loadResources() throws FileNotFoundException {
            // log available VRAM
            log.println("Available VRAM before loading resources: " + graphicsDevice.getAvailableAcceleratedMemory() + " bytes", Log.INIT);
            // determine whether or not we are dealing with the contents of a jar-file
            jar = getClass().getResource("").getProtocol().startsWith("jar");
            // browse all directories
            long start, end;
            int loadTime = -1;
            start = System.nanoTime();
            browseDirectory(".." + separator + "resources");
            end = System.nanoTime();
            loadTime = Math.abs((int)(end - start) / 1000000);
            resourcesLoaded = true;
            // log
            log.println("Resources loaded in " + loadTime + " ms", Log.INIT);
            // log available VRAM
            log.println("Available VRAM after loading resources: " + graphicsDevice.getAvailableAcceleratedMemory() + " bytes", Log.INIT);
         * Browse a directory and load and cache all it's files
         * @param path The directory to browse
        private void browseDirectory(String path) {
            // log
            log.println("Browsing directory: " + path.replaceFirst("\\W*", ""), Log.INIT);
            try {
                if (jar) {
                    // TODO: enable JAR-browsing by getting the input stream from the JAR-file, then browse through all entries
                    throw new RuntimeException("Cannot browse JAR-files yet!");
                else {
                    File dir = new File(getClass().getResource(path).toURI());
                    // browse through the directory
                    String[] files = dir.list();
                    File file;
                    for (String name: files) {
                        file = new File(dir.getAbsolutePath() + separator + name);
                        // if this is a new sub-directory, browse it
                        if (file.isDirectory()) browseDirectory(path + separator + file.getName());
                        // otherwise, add the file
                        else addFile(path, name);
            catch (Exception e) { e.printStackTrace(); }
        } But, as you may see, I need a similar code to browse the JAR-file....please help me!
    lhk

    I worked it out by trying and failing:
          * Browse the JAR-file and load all it's relevant files
         private void browseJar() {
              try {
                   // convert the resource directory path to a JAR-compatible path
                   String jarDir = dir.replaceAll("\\" + separator, String.valueOf(jarSeparator));
                   // get the jar-file and it's entries
                   Enumeration<JarEntry> entries = new JarFile(new File(getClass().getProtectionDomain().getCodeSource().getLocation().toURI())).entries();
                   // browse the contents of the file
                   JarEntry entry;
                   int nameIndex;
                   String name = null;
                   String path = null;
                   while (entries.hasMoreElements()) {
                        // get the entry
                        entry = entries.nextElement();
                        // we only process relevant entries
                        if (entry.getName().startsWith(jarDir)) {
                             nameIndex = entry.getName().lastIndexOf(jarSeparator);
                             name = entry.getName().substring(nameIndex + 1);
                             // if we find a new directory, we get it's path
                             if (entry.isDirectory()) {
                                  path = entry.getName().substring(jarDir.length(), nameIndex);
                                  if (path.startsWith(String.valueOf(jarSeparator))) path = path.substring(1) + jarSeparator;
                                  // log (the system-compatible path)
                                  log.println("Browsing directory: " + dir + separator + path.replaceAll(String.valueOf(jarSeparator), "\\" + separator), Log.INIT);
                             // otherwise, we add the resource
                             else addFile(path, name);
              catch (Exception e) { e.printStackTrace(); }
         }As may be seen in the code, I discovered that the regular file separator could not be used in jar paths, which I found strange. I tried a lot to make the regular separator work, but couldn't manage it. Anyway, this code works for me.

  • Classpath for jar files?

    Hi all,
    i am trying to run a standalone java program using JRC through command promt.
    my problem is i am importing few classes from jar files into my java class. but its not getting imported.
    how to resolve it?

    Hi Saravana
    You can use batch file to run your standalone java program.
    The contents of the batch file would be as follows:
    @echo off
    if "%OS%" == "Windows_NT" setlocal
    rem
    rem Sets the CLASSPATH environment variable to include all JAR files
    rem required for the JRC then compiles and jars Java file(s).
    rem
    rem Edit the environment variable BOBJ_JAVA_LIB to point to the
    rem location where you have the JRC jar files.
    rem
    rem Make sure to define any other required libraries in the environment
    rem variable CLASSPATH.
    rem
    rem Make sure you have defined the environment variable JAVA_HOME
    rem
    set BOBJ_JAVA_LIB=c:\Program Files\Business Objects\Common\3.5\java\lib
    set CURRENT_DIR=%cd%
    echo Using JAVA_HOME: %JAVA_HOME%
    echo Using CURRENT_DIR: %CURRENT_DIR%
    set RUNJAVA="%JAVAHOME%/bin/java"
    set RUNJAVAC="%JAVAHOME%/bin/javac"
    set RUNJAR="%JAVAHOME%/bin/jar"
    set CLASSPATH=%BOBJ_JAVA_LIB%\ReportViewer.jar;%BOBJ_JAVA_LIB%\ReportPrinter.jar;%BOBJ_JAVA_LIB%\CrystalCommon.jar;%BOBJ_JAVA_LIB%\CrystalDatabaseConnectors.jar;%BOBJ_JAVA_LIB%\CrystalReportingCommon.jar;%BOBJ_JAVA_LIB%\CrystalFormulas.jar;%BOBJ_JAVA_LIB%\CrystalQueryEngine.jar;%BOBJ_JAVA_LIB%\CrystalReportEngine.jar;%BOBJ_JAVA_LIB%\keycodeDecoder.jar;%BOBJ_JAVA_LIB%\MetafileRenderer.jar;%BOBJ_JAVA_LIB%\rpoifs.jar;%BOBJ_JAVA_LIB%\jrcerom.jar;%BOBJ_JAVA_LIB%\jrcadapter.jar;%BOBJ_JAVA_LIB%\rascore.jar;%BOBJ_JAVA_LIB%\rasapp.jar;%BOBJ_JAVA_LIB%\Serialization.jar;%BOBJ_JAVA_LIB%\external\log4j.jar;%BOBJ_JAVA_LIB%\external\icu4j.jar;%BOBJ_JAVA_LIB%\external\Concurrent.jar;%BOBJ_JAVA_LIB%\external\xercesImpl.jar;%BOBJ_JAVA_LIB%\external\xml-apis.jar;%BOBJ_JAVA_LIB%\CrystalCharting.jar;%BOBJ_JAVA_LIB%\CrystalContentModels.jar;%BOBJ_JAVA_LIB%\CrystalExporters.jar;%BOBJ_JAVA_LIB%\CrystalExportingBase.jar;%CURRENT_DIR%;%CLASSPATH%
    %_RUNJAVAC% -classpath "%CLASSPATH%" *.java
    %_RUNJAVA% -classpath "%CLASSPATH%" HelloWorldSwing
    // HelloWorldSwing is the name of your .java file
    Make sure you have all the jar files in the lib directory.
    Hope this helps you.
    Thanks
    Soni

  • Custom certificates for JAR file signing

    Hi,
    Can anyone please let me know how to check that we have custom certificates for JAR file signing set up in our instance
    Thanks,
    Praveen

    It depends on the version of your $ADJVAPRG. See the referenced note.
    How to use,create and /or update Digital Certificates for Jinitiator in 11i Applications
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=365735.1

  • Need some information for jar files upload in Oracle

    Hi,
    I am developing some java stored procedures which requires uploading about 10-15 jar files or may be more, to the oracle database. One way is to use loadjava and oracle stores classes in those jar files as separate java classes. Is there a way that I can put these jar files somewhere in the file systems, configure some oracle parameter, restart the database and still I am able to use them from my java stored procedures. This will be some kind of a dropin folder for jars. Any information on this will be helpfule.
    Thanks

    The forum on the JVM in Oracle at Java in the Oracle Database might be a better one to answer your question.
    Melli

  • How to generate cacerts file for jar

    how can i generate the cacerts for jar file to secure the applet?
    how can i do it myself?
    is it provided that function from Versign?
    can you all give my step by step guildance

    Even though JDK1.4 is not officially shipping the
    Java Plugin 1.4 documents on Security are fairly
    good. Check out :
    http://java.sun.com:80/j2se/1.4/docs/guide/plugin/developer_guide/contents.html
    http://java.sun.com:80/j2se/1.4/docs/guide/plugin/developer_guide/rsa_how.html
    regards,
    atsSun
    Sun Microsystems

  • How to make htm-file for simple toolbar command?

    Hi
    I am actually tryin to make my own toolbar with commands for Adobe Contribute CS5. A very nice companion for DW sites for endusers to edit the site.
    Creatin toolbars for Contribute and Dreamweaver is the same thats why writig here.
    I have managed to make a toolbar and managed to copy existing commands, like browsing backward and browsing forward, in it, but I have not been able to make my own commands  because I have not been able to figure out how to write the correct javascript into the header of the htm-file.
    I have a set of small predefined html-tables, 15 of them, that user can copypaste into his template generated page, when editing, in order to have some layout order without knowing much of editing with Contribute editor.
    Now, I desperately want to have 15 descriptive buttons in my own toolbar appear when in editing mode. User can choose and click the one he needs, a title1-unit, a title2 unit, a 1-column text unit, 2-column text unit etc. The correctly formatted table enhanced with css-properties appear there where the cursor was positioned. No more copying from one page and pasting to another - much much better this way!
    All I need is htm-file for each of those 15 units. I have not been able to find an example that I could modify.
    Can anyone help. A button (a command) klicked on a toolbar should position the htmltable there where the cursor is - nothing else.
    Htm-files should be positioned here, I think:
    C:\Program Files\Adobe\Adobe Contribute CS5\App\Configuration\Toolbars\MM
    Or is C:\Program Files\Adobe\Adobe Contribute CS5\App\Configuration\Objects\ better?
    Eagerly waiting an answer,
    Kari
    Here is an example of a 1-column unit. All 15 of my units are like this.
    <table border="0" cellpadding="0" cellspacing="0" class="unit1 spacebelow" name="text_1col">
         <tr>
              <td class="txttd unit_pad1_left unit_pad1_right bkgr_check3">
                   <p>Text here</p>
              </td>
              </tr>
    </table>

    This Script works here. Get you the error, when you save or checks the syntax?
    When you use in AppleScript the entry with administrator privileges, is sudo optional. This says only, if everyone can use the sudo command inside of the 5 minutes limit without to write the password again or not.
    The Syntax do shell script "sudo chmod 755 "private/var/spool/cups" password "***" doesn´t work, because you need the entry with administrator privileges for the execution as privileged user.

  • Tools for generating weblogic-cmp-rdbms-jar.xml files

    Hi All:
    I am using Weblogic 8.1 sp6 and MyEclipse 5.1.
    Does anybody knows if weblogic 8.1 provides a wizard or tool or some product that will help you generate the
    weblogic-cmp-rdbms-jar.xml and webloigc-ejb-jar.xml files if given the ejb-jar.xml, the home, remote and bean classes and the database server information.
    The reason, I am asking this is because if you're using Hibernate, there is a hibernate tool that will generate the hbm.xml and persistence classes given a particular database information.
    I was wondering if there is the same thing in ejb development with weblogic 8.1 sp6?
    Yours,
    Desperate

    I think u r some confusion with productID and SuppliedID . primary key of one column( productId ) can be a foreign key of other table colum( SuppliedID). but foreign key( SuppliedID) can not be a primary key of second table .u declared SuppliedId as primary key . so ur mapping is incorrect.

  • Script to Create databases with params to support dir location for data or log files

    Script to Create databases with params to support dir location for data or log files

    DECLARE @Query VARCHAR(MAX)=''
    DECLARE @DbName VARCHAR(400) = '<DBNAME>'
    DECLARE @DbFilePath VARCHAR(400) = '<Valid DataFilePath>'
    DECLARE @DBLogFilePath VARCHAR(400)='<Valid LogFile Path>'
    SET @Query = @Query + 'CREATE DATABASE '+@DbName +' ON PRIMARY '
    SET @Query = @Query + '( NAME = '''+@DbName +''', FILENAME = '''+@DbFilePath+@DbName +'.mdf'' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) '
    SET @Query = @Query + ' LOG ON '
    SET @Query = @Query + '( NAME = '''+@DbName +'_log'', FILENAME = '''+@DblogFilePath+@DbName +'_log.ldf'' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)'
    print @query
    exec(@query)
    --Prashanth

  • How to display the source code for this friggin' file.

    Below is a rather lengthy bit of code that provides the behavior and attributes of a web server for OpenCyc. I need to know if I can enter some java to have the HTML source code displayed in a separate text file whenever this class returns some resulting webpage. If you have any ideas it will be greatly appreciated.
    -"Will code for foo."
    package org.opencyc.webserver;
    * Class WebServer is simple multithreaded HTTP server
    * with CGI limited to a Cyc connection on default port 3600.
    * <p>
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.util.jar.*;
    import java.text.*;
    import org.opencyc.util.*;
    public class WebServer extends Thread {
         * Singleton WebServer instance.
        public static WebServer current;
         * Default HTTP port.
        protected static int DEFAULT_PORT = 80;
         * Default Cyc base port.
        protected static int DEFAULT_CYC_PORT = 3600;
         * Default directory to serve files from on non-Windows OS.
        protected static String DEFAULT_DIR = "/";
         * Default directory to serve files from on Windows.
        //protected static String DEFAULT_WIN_DIR = "C:\\";
        protected static String DEFAULT_WIN_DIR = "k:\\opencyc\\run\\httpd\\htdocs";
         * File cache capacity.
        protected static final int CACHE_CAPACITY = 100;
         * File cache to improve file serving performance.
        protected static Hashtable fileCache = new Hashtable(CACHE_CAPACITY);
         * Number of files served from this web server.
        protected static long nbrFilesServed = 0;
         * Number of files served from this web server that were found in the cache.
        protected static long nbrCacheHits = 0;
         * Server socket for accepting connections.
        protected ServerSocket server;
         * Directories to serve files from.
        protected ArrayList dirs;
         * Map from String (jar root) to JarFile[] (jar class path).
        protected HashMap map;
         * Webserver HTTP port.
        protected int port;
         * Cyc HTML host.
        protected String cycHost = "localhost";
         * Cyc HTML port.
        protected int cycPort;
         * Expand jar tress.
        protected boolean trees;
         * Requests flag.
        protected boolean traceRequests;
         * Constructs a WebServer object.
         * @param port the port to use
         * @param directories the directory to serve files from
         * @param trees true if files within jar files should be served up
         * @param traceRequests true if client's request text should be logged.
         * @exception IOException if the listening socket cannot be opened, or problem opening jar files.
        public WebServer() throws IOException {
            getProperties();
            server = new ServerSocket(port);
            processDirectories();
         * Class Task processes a single HTTP request.
        protected class Task extends Thread {
             * Socket for the incoming request.
            protected Socket sock;
             * Client socket to the Cyc KB HTML server.
            protected Socket cycHtmlSocket;
             * Output tcp stream.
            protected DataOutputStream out;
             * Contains the file request path for a not-found error message.
            protected String notFoundPath;
             * Contains the first line of a request message.
            protected String methodLine;
             * Contains the body of a POST method.
            protected String bodyLine;
             * Constructs a Task object.
             * @param sock the socket assigned for this request.
            public Task(Socket sock) {
                this.sock = sock;
             * Processes the HTTP request.
            public void run() {
                if (traceRequests)
                    Log.current.println("connection accepted from " + sock.getInetAddress());
                notFoundPath = "";
                try {
                    out = new DataOutputStream(sock.getOutputStream());
                    try {
                        getBytes();
                    catch (Exception e) {
                        Log.current.println("file not found: " + notFoundPath);
                        try {
                            out.writeBytes("HTTP/1.1 404 Not Found\r\n");
                            out.writeBytes("Server: Cyc WebServer\r\n");
                            out.writeBytes("Connection: close\r\n");
                            out.writeBytes("Content-Type: text/html\r\n\r\n");
                            out.writeBytes("<HTML><HEAD>\n");
                            out.writeBytes("<TITLE>404 Not Found</TITLE>\n");
                            out.writeBytes("</HEAD><BODY>\n");
                            out.writeBytes("<H1>404 - Not Found</H1>\n");
                            out.writeBytes("</BODY></HTML>");
                            out.flush();
                        catch (SocketException se) {
                catch (Exception e) {
                    Log.current.printStackTrace(e);
                finally {
                    try {
                        sock.close();
                    catch (IOException e) {
             * Reads the HTTP request and obtains the response.
             * @exception IOException when HTTP request has an invalid format.
            private void getBytes() throws IOException {
                // Below logic is complex because web browsers do not close the
                // socket after sending the request, so must parse message to find
                // the end.
                BufferedReader in = new BufferedReader(new InputStreamReader(sock.getInputStream()));
                ArrayList inBytes = new ArrayList(200);
                int ch = 0;
                boolean postMethod;
                methodLine = in.readLine();
                //if (traceRequests)
                //    Log.current.println("methodLine=" + methodLine);
                bodyLine = "";
                if (methodLine.startsWith("POST /"))
                    postMethod = true;
                else
                    postMethod = false;
                //if (traceRequests)
                //    Log.current.println("postMethod=" + postMethod);
                int ch1 = -1;
                int ch2 = -1;
                int ch3 = -1;
                int ch4 = -1;
                // Read the HTTP request headers.
                while (true) {
                    ch = in.read();
                    inBytes.add(new Integer(ch));
                    ch1 = ch2;
                    ch2 = ch3;
                    ch3 = ch4;
                    ch4 = ch;
                    if (ch1 == '\r' && ch2 == '\n' && ch3 == '\r' && ch4 == '\n')
                        break;
                    if ((! postMethod) &&
                        (! in.ready()) &&
                        ch1 == -1 &&
                        ch2 == -1 &&
                        ch3 == '\r' &&
                        ch4 == '\n') {
                        inBytes.add(new Integer('\r'));
                        inBytes.add(new Integer('\n'));
                        break;
                byte[] byteArray = new byte[inBytes.size()];
                for (int i = 0; i < inBytes.size(); i++) {
                    Integer ich = (Integer) inBytes.get(i);
                    byteArray[i] = ich.byteValue();
                String headers = new String(byteArray);
                if (postMethod) {
                    String lcHeaders = headers.toLowerCase();
                    int i = lcHeaders.indexOf("content-length: ");
                    String contentLength = lcHeaders.substring(i + 16);
                    int j = contentLength.indexOf("\r\n");
                    contentLength = contentLength.substring(0, j);
                    int bodyLen = (new Integer(contentLength)).intValue();
                    for (int k = 0; k < bodyLen; k++) {
                        bodyLine = bodyLine + (new Character((char) in.read())).toString();
                String line = methodLine + "\r\n" + headers + bodyLine;
                if (traceRequests)
                    Log.current.println(line);
                if (postMethod)
                    processHttpPost();
                else
                    if (line.startsWith("GET /"))
                        processHttpGet(line.substring(4));
                    else {
                        Log.current.println("Invalid request = " + line);
                        throw new IOException();
             * Processes an HTTP GET method.
             * @param httpGetPath the path of the file to get.
             * @exception IOException if the file is not found.
            private void processHttpGet(String httpGetPath) throws IOException {
                int i = httpGetPath.indexOf(' ');
                if (i > 0)
                    httpGetPath = httpGetPath.substring(0, i);
                Log.current.println(methodLine + " from " + sock.getInetAddress().getHostName());
                i = httpGetPath.indexOf("cg?");
                if (i > 0) {
                    cycHtmlRequest(httpGetPath.substring(i + 3));
                    return;
                notFoundPath = httpGetPath;
                i = httpGetPath.indexOf('/');
                if (i < 0 || map == null) {
                    if (map == null || httpGetPath.endsWith(".jar")) {
                        for (int j = 0; j < dirs.size(); j++) {
                            String dir = (String) dirs.get(j);
                            String nativePath = dir + httpGetPath;
                            nativePath = nativePath.replace('/', File.separatorChar);
                            if (fileCache.containsKey(nativePath)) {
                                writeDataBytes((byte[]) fileCache.get(nativePath));
                                Log.current.println("...cached");
                                nbrCacheHits++;
                                nbrFilesServed++;
                                return;
                            try {
                                File f = new File(nativePath);
                                byte[] fileBytes = getBytes(new FileInputStream(f), f.length());
                                writeDataBytes(fileBytes);
                                if (fileCache.size() >= CACHE_CAPACITY)
                                    fileCache.clear();
                                fileCache.put(nativePath, fileBytes);
                                Log.current.println("...from " + nativePath);
                                nbrFilesServed++;
                                return;
                            catch (IOException e) {
                    throw new IOException();
                String jar = httpGetPath.substring(0, i);
                httpGetPath = httpGetPath.substring(i + 1);
                JarFile[] jfs = (JarFile[]) map.get(jar);
                if (jfs == null)
                    throw new IOException();
                for (i = 0; i < jfs.length; i++) {
                    JarEntry je = jfs.getJarEntry(httpGetPath);
    if (je == null)
    continue;
    writeDataBytes(getBytes(jfs[i].getInputStream(je), je.getSize()));
    nbrFilesServed++;
    return;
    throw new IOException();
    * Processes an HTTP POST method.
    * @exception IOException if the file is not found.
    private void processHttpPost() throws IOException {
    Log.current.println("POST " + bodyLine + " from " + sock.getInetAddress().getHostName());
    cycHtmlRequest(bodyLine);
    * Reads the specified number of bytes and always close the stream.
    * @param in the file to be read for subsequent downloading.
    * @param length the number of bytes to read from the file.
    * @return An array of bytes from the file.
    * @exception IOException if an error occurs when processing the file.
    private byte[] getBytes(InputStream in, long length) throws IOException {
    DataInputStream din = new DataInputStream(in);
    byte[] bytes = new byte[ (int) length];
    try {
    din.readFully(bytes);
    finally {
    din.close();
    return bytes;
    * Sends the HTML request to Cyc.
    * @param cycPath the portion of the URL which is given to the Cyc HTML server.
    private void cycHtmlRequest(String cycPath) {
    String request = sock.getInetAddress().getHostName() + "&" + cycPath + "#";
    System.out.println("request=" + request);
    ArrayList bytes = new ArrayList(10000);
    try {
    cycHtmlSocket = new Socket(cycHost, cycPort);
    System.out.println("cycHost=" + cycHost + " cycPort=" + cycPort);
    BufferedReader cycIn = new BufferedReader(new InputStreamReader(cycHtmlSocket.getInputStream()));
    PrintWriter cycOut = new PrintWriter(cycHtmlSocket.getOutputStream(), true);
    cycOut.println(request);
    cycOut.flush();
    int ch = 0;
    while (ch >= 0) {
    ch = cycIn.read();
    bytes.add(new Integer(ch));
    catch (Exception e) {
    Log.current.printStackTrace(e);
    byte[] byteArray = new byte[bytes.size()];
    for (int i = 0; i < bytes.size() - 1; i++) {
    Integer ich = (Integer) bytes.get(i);
    byteArray[i] = ich.byteValue();
    try {
    writeTextBytes(byteArray);
    catch (Exception e) {
    Log.current.println(e.getMessage());
    * Responds to the HTTP client with data content from the requested URL.
    * @param bytes the array of bytes from the URL.
    * @exception IOException if there is an error writing to the HTTP client.
    public void writeDataBytes(byte[] bytes) throws IOException {
    out.writeBytes("HTTP/1.1 200 OK\r\n");
    out.writeBytes("Server: Cyc WebServer\r\n");
    out.writeBytes("Connection: close\r\n");
    out.writeBytes("Content-Length: " + bytes.length + "\r\n");
    String prefix = (new String(bytes)).toLowerCase();
    if (prefix.indexOf("<html>") > -1)
    out.writeBytes("Content-Type: text/html\r\n\r\n");
    else
    out.writeBytes("Content-Type: application/java\r\n\r\n");
    out.write(bytes);
    out.flush();
    * Respond to the HTTP client with text content from the requested URL.
    * @param bytes the array of bytes from the URL.
    * @exception IOException if there is an error writing to the HTTP client.
    public void writeTextBytes(byte[] bytes) throws IOException {
    out.writeBytes("HTTP/1.1 200 OK\r\n");
    out.writeBytes("Server: Cyc WebServer\r\n");
    out.writeBytes("Connection: close\r\n");
    out.writeBytes("Content-Length: " + bytes.length + "\r\n");
    out.writeBytes("Content-Type: text/html\r\n\r\n");
    out.write(bytes);
    out.flush();
    * Gets properties governing the web server's behavior.
    private void getProperties() {
    port = DEFAULT_PORT;
    String portProperty = System.getProperty("org.opencyc.webserver.port", "");
    if (! portProperty.equalsIgnoreCase(""))
    port = (new Integer(portProperty)).intValue();
    Log.current.println("Listening on port " + port);
    cycPort = DEFAULT_CYC_PORT;
    String cycPortProperty = System.getProperty("org.opencyc.webserver.cycPort", "");
    if (! cycPortProperty.equalsIgnoreCase(""))
    cycPort = (new Integer(cycPortProperty)).intValue();
    Log.current.println("Cyc connections directed to port " + cycPort);
    String dirsProperty = System.getProperty("org.opencyc.webserver.dirs", "");
    dirs = new ArrayList(3);
    StringTokenizer st = new StringTokenizer(dirsProperty, ";", false);
    while (st.hasMoreTokens()) {
    String dir = st.nextToken();
    dirs.add(dir);
    trees = false;
    String treesProperty = System.getProperty("org.opencyc.webserver.trees", "");
    if (! treesProperty.equalsIgnoreCase(""))
    trees = true;
    traceRequests = false;
    String traceRequestsProperty = System.getProperty("org.opencyc.webserver.traceRequests", "");
    if (! traceRequestsProperty.equalsIgnoreCase("")) {
    traceRequests = true;
    Log.current.println("tracing requests");
    * Adds transitive Class-Path jars to jfs.
    * @param jar the jar file
    * @param jfs the list of jar files to serve.
    * @param dir the jar file directory.
    * @exception IOException if an I/O error has occurred with the jar file.
    private void addJar(String jar, ArrayList jfs, String dir) throws IOException {
    Log.current.println("Serving jar files from: " + dir + jar);
    JarFile jf = new JarFile(dir + jar);
    jfs.add(jf);
    Manifest man = jf.getManifest();
    if (man == null)
    return;
    Attributes attrs = man.getMainAttributes();
    if (attrs == null)
    return;
    String val = attrs.getValue(Attributes.Name.CLASS_PATH);
    if (val == null)
    return;
    dir = dir + jar.substring(0, jar.lastIndexOf(File.separatorChar) + 1);
    StringTokenizer st = new StringTokenizer(val);
    while (st.hasMoreTokens()) {
    addJar(st.nextToken().replace('/', File.separatorChar), jfs, dir);
    * Administrative accessor method that obtains list of directories from which files are served.
    public ArrayList getDirs() {
    return dirs;
    * Administrative method that updates the list of directories from which files are served.
    public synchronized void setDirs(ArrayList dirs) throws IOException {
    this.dirs = dirs;
    fileCache.clear();
    processDirectories();
    * Administrative accessor method that obtains number of files served.
    * @return The number of files served.
    public long getNbrFilesServed() {
    return nbrFilesServed;
    * Administrative accessor method that obtains number of files served from cache.
    * @return The number of files served from the cache.
    public long getNbrCacheHits() {
    return nbrCacheHits;
    * Administrative method that clears the file cache.
    public synchronized void clearFileCache() {
    Log.current.println("Clearing file cache");
    fileCache.clear();
    nbrFilesServed = 0;
    nbrCacheHits = 0;
    * Processes the directories from which files are served, expanding jar trees if
    * directed.
    * @exception IOException if problem occurs while processing the jar files.
    private void processDirectories() throws IOException {
    if (dirs.size() == 0)
    if (File.separatorChar == '\\')
    dirs.add(DEFAULT_WIN_DIR);
    else
    dirs.add(DEFAULT_DIR);
    Iterator directories = dirs.iterator();
    while (directories.hasNext())
    Log.current.println("Serving from " + directories.next());
    if (trees) {
    map = new HashMap();
    for (int j = 0; j < dirs.size(); j++) {
    String dir = (String) dirs.get(j);
    String[] files = new File(dir).list();
    for (int i = 0; i < files.length; i++) {
    String jar = files[i];
    if (!jar.endsWith(".jar"))
    continue;
    ArrayList jfs = new ArrayList(1);
    addJar(jar, jfs, dir);
    map.put(jar.substring(0, jar.length() - 4), jfs.toArray(new JarFile[jfs.size()]));
    * Provides the command line interface for creating an HTTP server.
    * The properties are:
    * <pre>
    * org.opencyc.webserver.port=<HTTP listening port>
    * </pre>
    * which defaults to 80.
    * <pre>
    * org.opencyc.webserver.cycPort=<Cyc connection port>
    * </pre>
    * which defaults to 3600.
    * <pre>
    * org.opencyc.webserver.dirs=<path>;<path> ... ;<path>
    * </pre>
    * with the argument enclosed in quotes if any path contains an
    * embedded space.
    * The default directory on Windows is C:
    * and the default on other systems is / the default
    * can be overridden with this property. By default, all files
    * under this directory (including all subdirectories) are served
    * up via HTTP. If the pathname of a file is <var>path</var> relative
    * to the top-level directory, then the file can be downloaded using
    * the URL
    * <pre>
    * http://<var>host</var>:<var>port</var>/<var>path</var>
    * </pre>
    * Caching of file contents is performed.
    * <pre>
    * org.opencyc.util.log=all
    * </pre>
    * If the all value is given, then all attempts to download files
    * are output.
    * <pre>
    * org.opencyc.webserver.traceRequests
    * </pre>
    * If this property has any value, then the client HTTP requests are
    * output.<p>
    * <pre>
    * org.opencyc.webserver.trees
    * </pre>
    * This property can be used to serve up individual files stored
    * within jar files in addition to the files that are served up by
    * default. If the property has any value, the server finds all jar files
    * in the top-level directory (not in subdirectories). For each
    * jar file, if the name of the jar file is <var>name</var>.jar, then any
    * individual file named <var>file</var> within that jar file (or within
    * the jar or zip files referenced transitively in the Class-Path manifest
    * attribute, can be downloaded using a URL of the form:
    * <pre>
    * http://<var>host</var>:<var>port</var>/<var>name</var>/<var>file</var>
    * </pre>
    * When this property has any value, an open file descriptor and cached
    * information are held for each jar file, for the life of the process.
    * @param args an unused array of command line arguments.
    public static void main(String[] args) {
    Log.makeLog();
    System.out.println("OpenCyc Web Server");
    try {
    // Launch thread to accept HTTP connections.
    current = new WebServer();
    current.start();
    catch (IOException e) {
    e.printStackTrace();
    * Just keep looping, spawning a new thread for each incoming request.
    public void run() {
    try {
    while (true) {
    // Launch thread to process one HTTP request.
    new Task(server.accept()).start();
    catch (IOException e) {
    e.printStackTrace();

    JLundan,
    I want to thank you for responding to the thread I started on the forum at java.sun.com. Your solution to my problem of needing to print the code of the html pages that the file I included generates was just what I was looking for. However, I have some further questions to ask, if you don't mind. To clarify my task I should say that your rephrasing of the problem is accurate: "You wan't to display the contents of the HTML file that the web server produces in response of client's request?"
    Yes, this is what I need to do, but also it needs to display the source code of that html file that the server produces in response to the client's request. Also, in this case, I am the client requesting that the server return some html file, and I'm not sure where the server is. But the webserver.java file that I shared on the forum is on my local machine. I was wondering if I could modify this webserver.java file at my home so that any html file the server returns to me would automatically display the source code. This is a school project of mine and I am stuck on this one thing here.
    Further, where would I put the "foo.html" file so it can be written to?
    FileOuputStream fos = new FileOutputStream("foo.html");
    fos.write(bytes);
    fos.close();
    Thanks so much for your help. I look forward to your response, at your convenience.
    Regards

  • Adobe Ant peculiarity -- "Waiting for history.htm"

    Hi,
    I'm using the Ant tasks from Adobe labs, and when I run Ant
    via Flex Builder 2, it generates our output .swf differently
    compared to running the Ant task from a shell. We noticed this
    because it is causing a user-noticeable issue on our webapp.
    I'm hoping someone might have some insight into why this
    happens, and/or ideas on how to get the Ant execution working
    consistently.
    First off, let me explain my setup. I am using a separate
    bundle of Ant 1.7 (all the members of my team are using the same
    Ant version from a well-defined location). I copied flexTasks.jar
    and flexTasks.tasks to the ant\lib directory. I have Flex Builder
    use this bundle of Ant (Run menu -> External Tools ->
    External Tools, choose the Ant configuration, go to Classpath tab,
    set Ant home).
    Here is my "flexc" target:
    <!--=================================================================================
    Compile Flex sources into tds_flex.swf, and generates the
    html wrappers too
    -->
    <target name="flexc" description="Builds the flex
    front-end">
    <taskdef resource="flexTasks.tasks"
    classpath="flexTasks.jar"/>
    <mxmlc file="${dir.war}\tds_flex.mxml"/>
    <html-wrapper title="product name here"
    application="tds_flex" swf="tds_flex"
    version-major="9" version-minor="0" version-revision="0"
    history="true" template="express-installation"/>
    </target>
    When we execute this target within Flex Builder, the
    resulting application works. When we execute the target from a
    shell, the resulting application does not "work". (The definition
    of "work" in this context is that a user can get to our webapp and
    have it load completely. When it doesn't work, the browser shows a
    message "Waiting for history.htm" in the status bar.) The cause of
    this issue has been traced to the generated history.swf file; if we
    save a copy of this file from a good build, and copy it over the
    resulting history.swf from a bad build, then the webapp works.
    I've also found that executing my Ant flexc target within
    Eclipse will also generate a working webapp (which isn't too
    surprising considering Flex Builder is based on Eclipse), and
    executing the target from within IntelliJ will not make a good
    build.
    The only thing I could think of is that Eclipse/Flex Builder
    is invoking Ant differently. Does anyone have any insight into
    finding out how it is doing this?
    Thanks,
    KaJun

    I have no guesses as to what might be causing the difference,
    but when I'm debugging ant issues, I often use the -verbose flag.
    One option for dealing with the difference is to rebuild the Flex
    Ant tasks using the history.swf that works for you. The Flex Ant
    tasks include all the source, templates, and a build.xml for
    rebuilding.
    Another option is to get the Ant tasks that now ship with the
    Flex 3 SDK and try them out. The new templates no longer use
    history.swf. You can get the Flex 3 SDK beta here:
    http://labs.adobe.com/technologies/flex/sdk/

  • Why did my index.htm file generate blank? and other weirdness.

    Here's the story. Maybe someone can tell me where I made my mistake, or what happened. I'm numbering the steps for convenience in discussing this.
    1) I started a new project, a WebHelp project.
    2) I imported content in Word.
    3) I created an index, glossary, and TOC. I used wizards for some of this.
    4) I created a style sheet and applied it to all the topics.
    5) I added a skin from the gallery.
    6) I generated output.
    Then I sent that output to the UI developer on my project. He plugged it in to the web app, and it seemed to work fine. So then:
    7) I opened the project, edited the text, and removed glossary links (because I didn't like how they were working) individually.
    8) I generated a new TOC to match the changed topic structure (minor changes).
    9) I generated another output.
    I sent that output to the UI developer and he said it was blank. I opened index.htm and sure enough, it was indeed blank. In fact, it was Zero KB. I also noticed that four other files were blank: whfform.htm, whform.js, whskin_plist.htm, and whtbar.js.
    So then I decided to start over. I created a new project, imported just the html topic files from the old project, redid the index (in a  hasty and less thorough manner), decided to bail on the glossary for now, did a TOC and sent that to the developer.
    Now the Search pane is totally wonky, showing a list of characters and terms.
    So I am getting frustrated. The developer has tried monkeying around with stuff on his end, but it's not working. So he says, why don't you send me a build with everything?
    The problem is, I have two broken builds. The first one, which for whatever reason has the blank index.htm file (and other blank files), and the second one, which has no glossary, a messy index, and a screwed up search.
    I can't seem to find anyone else having this problem. :-/  Can someone help? 
    Thanks so much,
    Tamarleigh

    I am having the exact same problem, and I think I've figured out what is happening here. There is an issue when mapping Word styles into RH. The person who setup our Word template included a sidehead with conditional text to hide instructor notes when printing participant training manuals. I removed the conditional text, and everything is working fine. You may want to double check to make sure you don't have conditional text in your Word docs. I've uploaded an image with the code below to show how the conditional text looked when the document was linked and generated.
    Check out the code below:
    <table cellspacing="0">
              <tr>
                        <td style="vertical-align: top; padding-left: 0px; padding-top: 0px;
                                   padding-right: 0px; padding-bottom: 0px;" height="800" width="114"><table
                                   cellspacing="0" width="100%">
                                  <tr>
                                            <td style="padding-left: 0px; padding-top: 0px; padding-right: 0px;
                                                       padding-bottom: 0px;"><div v:shape="Text_x0020_Box_x0020_146"
                                                                                                                             class="shape" style="padding: 3.6pt 7.2pt 3.6pt 7.2pt;">
                                                      <p class="WD_InstructorNotesHeading"><span style="background: #ffff00;">Instructor
                                                       Notes:</span></p>
                                                      <p class="WD_InstructorNotesText"><span style="background: #ffff00;">Add
                                                       any additional instructor information into this text
                                                       box.&#160;&#160;It will only appear when hidden text
                                                       is turned on.</span></p>
                                                      <p class="WD_InstructorNotesText">&#160;</p>
                                            </div></td>
                                  </tr>
                        </table>
                        &#160;</td>
              </tr>
    </table>
    Cheers.

  • Jar files downloaded from SkyDrive are being renamed to jar.zip files

    I have cut and pasted the following series of exchanges from when I posted the problem onto SkyDrive's support forum. I hope that someone might be able to propose a better solution to the problem that I have. Thanks for your help.
    MDSms asked on
    Uploaded jar files convert to jar.zip files when downloaded from SkyDrive
    I have uploaded an executable jar file to SkyDrive. (I will call this FILE.jar). The file is intact and indicates that it is a jar file type when the file is viewed by Properties within Skydrive. However, when I download (or others download through a share link) the file, it is being saved onto the local computer's download file with .zip appended to the file name (FILE.jar.zip). The downloaded file can be renamed to remove the .zip appendage and subsequently run successfully. However the folder options for the folder where the downloaded file resides must be changed for disable "Hide known file extensions" prior to being able to remove the .zip appendage. While I have figured out the workaround for this problem, this manual renaming procedure is entirely too cumbersome as a solution for sharing this file with others. How can I prevent or disable the FILE.jar file from being renamed to FILE.jar.zip when it is downloaded from SkyDrive?
    All Replies (5)
    Audrey_P. replied on
    Forum Moderator
    Hi,
    Thank you for posting. Let me try to assist you with your issue with your files.
    In order for us to reproduce the issue on our end. Please provide us with the exact steps that you did when you uploaded the files as well as the steps when you are downloading it.
    We will be needing the steps to help us figure put what is causing you this issue.
    We look forward to your response.
    Thank you.
    Audrey P.
    MDSms replied on
    Reply
    The file was uploaded by first logging onto my SkyDrive account using Windows 7 Pro and Firefox browser, then a new folder in my account was created without sharing privileges, then the folder was opened and the FILE.jar was uploaded into the folder using the "Upload" option on skydrive account menu. Sharing privileges for FILE.jar were then created (view only), and the shortened url link was sent to the individuals that I was trying to share the file with. was then turned on. When these people use the link to download the file, it is being saved as FILE.jar.zip.
    When I try to download the file through the skydrive account download option, it is being saved onto my computer as FILE.jar.zip and this occurs when I try to download the file while signed into my skydrive account as well as when I am not signed into my skydrive account (using the shared file link).
    This PNG shows the information provided by clicking on the download icon (down arrow) within the Firefox browser; note that the file was downloaded as FILE.jar.zip and that the source was live.com. When I use Windows Explorer to look at the same file within the Download folder itself, examining the file's properties details also shows that it is being saved as FILE.jar.zip and is of the file type compressed zip folder.
    This PNG shows the information displayed to me from my skydrive account when I view the originally uploaded file's properties; note that the information shows that the file is a jar file type.
    When I utilize Internet Explorer 9 to access the file, FILE.jar is being downloaded onto my computer as a jar file type. This PNG shows the information provided by Tools/View Downloads within the IE9 browser. Note that in this instance, the information indicates that the file is being downloaded from yzudea.blu.livefilestore.com.
    It appears to me that the problem (the FILE.jar file being renamed to FILE.jar.zip) arises from the fact that a jar file downloaded from skydrive using firefox, is being sent from live.com whereas a jar file downloaded from skydrive using IE9 is being sent from yzudea.blu.livefilestore.com.
    I want to make sure that a person receiving a share link from me for FILE.jar is able to download it without modification to the file name regardless of which browser is being using to access the link. How can I make sure that this occurs?
    Any help is appreciated. Thanks.
    Michelle Anne D. replied on
    Forum Moderator Community Star Community Star
    Reply
    Hi MDSms,
    I appreciate you for providing as much information as you can about the issue, as well as for uploading screenshots on what you see from the downloaded file. About your initial concern wherein the file gets renamed with .zip after the original file extension, this is solely dependent on the browser that you are using since they have a different safety/security measure that needs to be implemented.
    Moreover, you may see the file servers live.com and yzudea.blu.livefilestore.com to be different with one another, but they actually are sent from the same SkyDrive server. This in turn, depends on the web browser where the file is being downloaded as well. The live.com file where it was downloaded from Firefox simply masks its original server yzudea.blu.livefilestore.com.
    As for your last query about your recipients downloading the file without the hassle of renaming it from a .zip file, you can simply tell them to download it through Internet Explorer.
    Should you have other queries or additional information that might help in our investigation, I highly encourage you to post them here.
    Regards,
    Michelle
    MDSms replied on
    Michelle,
    Thanks for your reply. Yes, I could simply tell them to download the file through Internet Explorer, but is there another solution or workaround to the problem I have described here? Am I being punished with the curse of this problem simply because I (or the individuals with which I wish to share FILE.jar with) choose to use Firefox instead of IE? Will the use of any other browser instead of IE (Chrome, Safari, etc., etc.) still result in the same problem?
    You stated that it is "solely dependent on the browser that you are using since they have a different safety/security measure that needs to be implemented"........could the problem be overcome by designating one or both of the file server addresses as Trusted Sites within the browser options setting?
    I look forward to your response. Thanks in advance.
    Joy V. replied on
    Forum Moderator Community Star Community Star
    Reply
    Hi MDSms,
    We understand your concern. Since the issue does not occur in Internet Explorer, it has something to do with Firefox's security feature. You might want to verify this concern by contacting Firefox support.
    Hope this helps. Let us know if we can further assist you with SkyDrive.
    Thanks,
    Melanie Joy

    Try to delete the mimeTypes.rdf file in the Firefox profile folder to reset all file actions.
    *http://kb.mozillazine.org/mimeTypes.rdf
    *http://kb.mozillazine.org/File_types_and_download_actions#Resetting_download_actions

Maybe you are looking for