Question about Java Applet Jar file signing.

These questions pertain to Java 6 Standard Edition 1.6.0_22-b04 and later.
I have gone through the Oracle Java Tutorial for generate public and private key information
to sign a jar file, and how to sign the jar itself, all at
[http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html|http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html]
, and seek some clarification on the following related questions:
-In order to "escape" the java applet sandbox that exists around the client's
copy of the applet running in their web browser, ie.
(something forbidden by default), is verification of the signed applet enough, or is a policy file required
to stipulate these details?
-using the policytool policy file generator, what do I need to add under "Principals"
(if anything) when dealing with a Java applet? Are Codebase and SignedBy simply author information?
-If I choose to use a java.security.Permission subclass object set up in equivalent fashion within the Applet,
which class within the Applet jar do I instantiate that object in? Does it need to be mentioned
in the applet's jar Manifest.MF file?
-Is the "keystore database" a java language service/process which runs in
the Server's memory and is simply accessed and started by default
by the client verifier program (appletview/web browser)?
-The public key certificate file (*.cer) is put in the webserver directory holding
the Applet jar file (ie. Apache Tomcat, for example).
-Presumably, the web browser detects the signed jar
and certificate file, and provides the browser pop up menu asking the user
about a new, non recognised certificate (initially).
Is this so?
-With this being the case, can the applet now escape
the sandbox, be it with or without the stipulated
policy permissions?

848439 wrote:
-In order to "escape" the java applet sandbox that exists around the client's
copy of the applet running in their web browser, ie.
(something forbidden by default), is verification of the signed applet enough, or is a policy file required
to stipulate these details?Just sign the applet, the policy file is not necessary.
-Is the "keystore database" a java language service/process which runs in
the Server's memory and is simply accessed and started by default
by the client verifier program (appletview/web browser)?No.
-The public key certificate file (*.cer) is put in the webserver directory holding
the Applet jar file (ie. Apache Tomcat, for example).No. For a signed Jar, all the information is contained inside the Jar.
-Presumably, the web browser detects the signed jar
and certificate file, and provides the browser pop up menu asking the user
about a new, non recognised certificate (initially).
Is this so?No. It is the JVM that determines when to pop the confirmation dialog.
-With this being the case, can the applet now escape
the sandbox, ..Assuming the end-user OK's the trust prompt, yes.
..be it with or without the stipulated
policy permissions?Huh?

Similar Messages

  • Question about classpath and jar file

    I have a jar file (actually jhall.jar, the java help jar file). How do I uses its classes if I don't want to add it to the classpath. Currently, I have the jar file in the same directory as all my other classes.

    it simply adds secondjar.jar into firstjar.jar, rather
    than extracting secondjar.jar's files and put it into
    firstjar.jar. How would I be able to do that?Don't do either of them. Distribute the two jar files separately, and in the manifest of the one which is meant to be your executable jar file, put a Class-Path: entry that refers to the other one. Look at the latter parts of the tutorial about jar files:
    http://java.sun.com/docs/books/tutorial/jar/basics/
    PC²

  • Help with a question about making/running .jar files.

    First i have a question, can i make a .jar file that can run on a computer without JRE installed. And if i can, how do i make it. I have tried to make it on my computer, that has JRE but i keep getting the error when i run it: Exception in thread "main" java.lang.NoClassDefFoundError: Sample\FileSearchAnd im using the command:
    jar cvfm jarname.jar directory\manifest.txt directory\FileSearch.class directory\FileNode.classIt says it creates the .jar but is unable to run it.

    dford425 wrote:
    First i have a question, can i make a .jar file that can run on a computer without JRE installed. No, not unless you package the JRE with your dist. Hence the name JRE (Java Runtime Environment).
    And if i can, how do i make it. I have tried to make it on my computer, that has JRE but i keep getting the error when i run it: Exception in thread "main" java.lang.NoClassDefFoundError: Sample\FileSearch
    That simply means your not pointing the runtime to the classes. Set your CLASSPATH environment variable correctly and it will run (given you have a JRE which it appears you do).
    And im using the command:
    jar cvfm jarname.jar directory\manifest.txt directory\FileSearch.class directory\FileNode.classIt says it creates the .jar but is unable to run it.

  • Question about Java applets being blocked.

    -I have succeeded in getting the 32 bit Java 8 applet plugin for Windows 7 Firefox v34 running.
    However, I have a situation where the applet loader itself has started blocking my applets.
    I have allowed the applet through in an unwiedly fashion.
    I can't find a way to generally lower the java plugin security applet blocker to allow
    unsigned applets. The only option I have is adding
    that webpage file reference to the exceptions list, closing the web browser
    and restarting it.
    The Java control panel Security Level radio buttons
    only exist for Very High and High; I do believe I want lower.
    However there isn't an auto selection for one.
    -How can I just click one button within Firefox to allow
    an applet through, and begin to run, if I want?

    -I have succeeded in getting the 32 bit Java 8 applet plugin for Windows 7 Firefox v34 running.
    However, I have a situation where the applet loader itself has started blocking my applets.
    I have allowed the applet through in an unwiedly fashion.
    I can't find a way to generally lower the java plugin security applet blocker to allow
    unsigned applets. The only option I have is adding
    that webpage file reference to the exceptions list, closing the web browser
    and restarting it.
    The Java control panel Security Level radio buttons
    only exist for Very High and High; I do believe I want lower.
    However there isn't an auto selection for one.
    -How can I just click one button within Firefox to allow
    an applet through, and begin to run, if I want?

  • Including helper classes in java proxy jar file

    I must not be using the right header search criteria because I'm sure this question
    has been asked before. In a Web Service File (.jws) I've imported a couple of
    helper classes that function as data transfer objects. I did this to maintain
    consistency with other portions of the application. The Java Proxy jar file generated
    by Workshop does not include these files. Is there a way of including these dependencies
    or do I need to distribute another jar file with my helper classes?

    Hi Naichen,
    I was able to successfully run both the autotype and clientgen Ant task, on the
    WSDL you provided. The code behind those Ant tasks are pretty much what the WebLogic
    Web Services test page run. Are you using WLS 8.1 SP2? If not, you might want
    to try with that version.
    Regards,
    Mike Wooten
    "Naichen Liu" <[email protected]> wrote:
    >
    >
    >
    Hi,
    I am having a warning message when trying to generate java proxy jar
    file on weblogic8.1
    webservice test web app, the message is as follows:
    "Warning Failed to generate client proxy from WSDL definition for this
    service.
    Prescription Please verify the <types> section of the WSDL."
    in the mean time, on weblogic starting terminal, I saw the following
    exceptions,
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\AlphaLength4Deserializer.java:36: cannot resolve symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkLengthFacet(__typed_obj,4L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\OSIFieldAnonTypeDeserializer.java:36: cannot resolve
    symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkMaxLengthFacet(__typed_obj,69L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\AlphaLength2Deserializer.java:36: cannot resolve symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkLengthFacet(__typed_obj,2L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\FreeFormAnonTypeDeserializer.java:36: cannot resolve
    symbol
    symbol : class FacetUtils"
    Can anybody help me about this issue? I attached WSDL file, also United
    Airlines
    got an enterprise weblogic license deal with BEA, any help will be highly
    appreciated.
    Thanks!!!
    Naichen

  • How to load an applet jar file?

    Hello everyone,
    I have an applet that uses my own jar file and approximately 6 third party jar files. I set up jar indexing (jar -i) which will download the jar files when they are needed. All seems to work well, but now I want to manually load the jar files which I cannot get working.
    When the applet starts, about 1/2 of the jar files are downloaded (because they are needed at startup). I then want to load the additional jar files in the background, after the gui is initialized. I have tried this using the below thread which is executed from within the applet's start method:
    // Try to load additional jar files in background by loading a class from each jar file.
    Thread loadClass = new Thread() {
      public void run() {
        System.out.println("Loading classes...");
        try {
          // Tried loading classes this way, doesn't work.
          getClass().getClassLoader().loadClass("pkg1.Class1");
          getClass().getClassLoader().loadClass("pkg2.Class2");
          getClass().getClassLoader().loadClass("pkg3.Class4");
          getClass().getClassLoader().loadClass("pkg4.Class4");
          /* Loading classes this way doesn't work either.
          Class.forName("pkg1.Class1");
          Class.forName("pkg2.Class2");
          Class.forName("pkg3.Class3");
          Class.forName("pkg4.Class4");
        catch(ClassNotFoundException e) {
          // First attempt to load a class (pkg1.Class1) throws exception.
          System.out.println("Can't find class: " + e.getMessage());
    loadClass.start();As you can see from above I am trying to load a class from each of the jar files so that the jar files would load into memory/cache. Unfortunately, it cannot find the classes. These are the errors from the java console:
    Loading classes...
    Loading: pkg1.Class1
    Connecting http://my.server.com/my_dir/pkg1/Class1.class with no proxy
    Connecting http://my.server.com/my_dir/pkg1/Class1.class with cookie "JSESSIONID=some_big_long_char_list"
    Can't find class: pkg1.Class1
    So it appears the jar file is not being downloaded. When I take away the dynamic jar loading (removing the "jar -i" & adding them all to the applet archive list) the thread executes correctly. So I know the class names, etc, are correct. How does one load an applet jar file?
    Any help/suggestions are appreciated.

    The above error I posted was because I forgot to index the jar files. That is why it couldn't find the jar file. I thought I was getting farther along with my problem, but I apparently just forgot to index the jars. I am now getting the problem that I got yesterday...
    The applet freezes/hangs when it hits the thread. The GUI never opens (even though I'm running this thread right after the gui shows). The java console quits responding and the applet just stays the grey screen. I also tried the invoke later that you suggested.
    public void start() {
      // ...initialize gui...
      // Applet freezes and remains grey, also the java console freezes.
      javax.swing.SwingUtilities.invokeLater(new Runnable() {
        public void run() {
          System.out.println("Loading classes...");
          try {
            // When I comment out the below forName calls, the thread will still run evidenced through the done print statement.
            Class.forName("pkg1.Class1");
         Class.forName("pkg2.Class2");
         Class.forName("pkg3.Class3");
         Class.forName("pkg4.Class4");
            System.out.println("...Done loading classes");
          catch(Exception e)     {
            System.out.println("Can't find class: " + e.getMessage());
    }

  • Cipher.getInstance closes Applet JAR file.

    I am trying to use a Cipher in a signed Applet in java plugin-1.4 under I.E. Once I execute a Cipher.getInstance the applet jar file is closed and I cannot create any new classes that havent been previously loaded from it. The classloader ends up returning an "IlleagleStateException: Zip file closed".
    Is this a known bug? Is there a workaround? Perhaps a way to re-open the JAR file.
    I have been combing the FAQ's without finding any other refrences to the problem.

    I haven't found a solution to the original problem but for someone else that is looking for a workaround for this. I found that if I use two JAR with my Cipher in the second one, I can still load class files out of the first. I.E. <PARAM NAME = java_archive VALUE = "supportClasses.jar,mainApplet.jar"> where mainApplet.jar contains the code that uses the Cipher.

  • Multiple repeat downloads of applet jar file

    We have an applet that is downloaded from a Weblogic server. The applet is packaged as a jar file. Some of the testers have been complaining that the applet is extremely slow to start up.
    The applet start-up involves three phases. In a first phase, it fetches data from the server. This phase seems to execute in pretty much constant time. During the second and third phases, it constructs a UI using Swing objects. The UI includes some JPEG files, which are extracted from the applet's own jar file.
    Testers report that the slow part of start-up is actually the UI setup. This should theoretically not be network-bound at all. But packet tracing reveals that during this phase, there's a large amount of network traffic going on. It turns out that there are multiple GET requests for the applet jar file being issued. Typically, 29 requests are issued in all; just for reference, the applet is required to extract 28 images from its jar file, so it looks as if the additional requests correspond to image requests.
    One further detail: this does not occur where there is a fast connection to the server. In these cases, the applet is downloaded once. It looks as if the problem only occurs on slower network connections, and the speculation here is that the applet jar is somehow being downloaded only partially, so that requests for images somehow trigger a re-request of the jar file.
    Has anyone seen anything similar and, more to the point, is there a fix or workaround?
    Technical details: Internet Explorer 5.5 or 6.0, JRE version 1.4.2_01 Java HotSpot(TM) Client VM (on the client), WebLogic 8.1 (on the server)
    Thanks in advance for any help.

    Ok.
    I have been trying hard and found the solution. One of the ablove posting says that it works under java 1.4.1 plug-in. That's infact absolutely true. It also says that how to run client using JRE 1.4.2 or higher. That can be solved two. This is definitely a bug with the 1.4.2 plug-in.
    Follow this procedure that will solve the mystry.
    ----------------------start ---------------------------------
    Problem
    Download of applet is very slow
    Why?
    This was happening because of the repeated download of the applet jars by the applet plug in controller. It is quite clear that the Java 1.4.2 plug in controller has a bug that causes the plug in to download same jar files multiple times irrespective of Jar cache in the client side (configurable from client side using the Java plug in control panel) is enabled or disabled. Therefore, we have moved from 1.4.2 plug in to 1.4.1 (controlled from our client (JSP) code) that works fine.
    What the client (applet client) should do?
    You must do the following in the client side in order to avoid the long download time for applet when running from a browser. We have also found that the browser actually do not matter in slow applet downloads. It is only the plug in that does control the applet download.
    Irrespective of what JVM you have already installed (or not yet installed) please do the following:
    1. Download the JRE 1.4.2 from http://java.sun.com/products/archive/index.html
    -At the time of its installation if it shows that the "JRE is already installed do you uninstall it?" Go ahead and uninstall the JRE 1.4.2. After the un-installation again install the JRE 1.4.2
    -If it does not have the JRE 1.4.2 already installed, then you will see any warning window and you will be able to install the 1.4.2 JRE successfully.
    2. Now, go to the same link and install JRE 1.4.1.
    -If this JRE already installed, uninstall first like the step 1 above. then reinstall it.
    3. Now, after successful installation of the JRE 1.4.1, open the Plug-In control panel.
    -You will find the list of control panel(s) in the Start->Control Panel window. Use the control panel that shows the version number 1.4.1. If no version number shown then use the one that do not show any version number at its end.
    4. Do the following on the Plug-In control panel.
    -Verify if this is the 1.4.1 plug in control panel? Go to the "About" tab to see if it shows 1.4.1.
    If it does not show the 1.4.1 (or 1.4.1_x) then plug in was not installed correctly. Reinstall the 1.4.1 JRE following the step in no-2
    -Go to "Basic" tab and select "Show console" radio button.
    -Go to "Advanced" tab and from the drop down select "JRE ...1.4.2" from the "Java Runtime Environment" drop down box.
    -Go to "Browser" tab and select all that in the "Settings" box applicable for browsers.
    -Go to "Cache" select "Enable Caching" if it is not selected currently. Select "Unlimited" from "Size" options.
    Now hit "Apply" button at the bottom and close the control panel using the 'X'.
    5. Restart your Windows machine.
    6. You are ready to run the applet from any of the browser (IE, NS, etc.)
    --------------------------end------------------------------

  • JAR File Signing : NoClassDefFoundError

    Hi,
    I have followed the new white paper, JAR file signing for JInit 1.3, and have used workround 2 to Register My Custom Sigingn Certificate Seperately.
    All appears to ge well, i.e. the dialog is shown, and when granted, the cerificate is listed within the JINIT 1.3 console.
    Howver, when I attempt to access Java code attempting to break out of the sandbox (executing a Host command), I receive a Java Exception :
    Exception occurred during event dispatching:
    java.lang.NoClassDefFoundError: oracle/forms/ui/VBean
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at java.net.URLClassLoader.defineClass(Unknown Source)
         at java.net.URLClassLoader.access$100(Unknown Source)
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
         at oracle.forms.handler.UICommon.instantiate(Unknown Source)
         at oracle.forms.handler.UICommon.onCreate(Unknown Source)
         at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
         at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
         at oracle.forms.engine.Runform.processMessage(Unknown Source)
         at oracle.forms.engine.Runform.processSet(Unknown Source)
         at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
         at oracle.forms.engine.Runform.onMessage(Unknown Source)
         at oracle.forms.engine.Runform.processEventEnd(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)
         at oracle.ewt.lwAWT.LWComponent.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    The oracle/forms/VBean.class is included within the JAR cache, as downloaded within f60all_jinit.jar (also used f60jinit.jar). These are as delivered within Patchset 11.
    We are using Forms 6i and JInit 1.3.1.9.
    Please note that the Java code works when using JInit 1.1.8.19 (after manually updating identity.obj with the signing identity).
    Any assistance, would be much appreciated.
    Regards
    Marc Ludwig

    Hi Duncan,
    I have cleared out the cache, tried re-installing etc. but continue to get the exception.
    Apologies for the length, but I attach the "hostcommand" Java code.
    // Copyright (c) 2002 Aquila Group Holdings Ltd
    package uk.co.aquilauk;
    import java.util.*;
    import java.text.*;
    import java.io.*;
    import oracle.forms.ui.*;
    import oracle.forms.properties.*;
    import oracle.forms.handler.*;
    * <code>HostCommand</code> is an Oracle Forms Pluggable Java Component that provides access to the client
    * machine allowing administrator web forms to run executables<P>
    * <P>The class will need to be signed before being used since access to the client machine
    * is an activity that is defined outside of the default Java sandbox.</P>
    * <!-- RevisionInformation -->
    * <DL><DT><B>Revision Information:</B></DL>
    * <pre>
    * Nick Holcombe 30/11/2001 Initial revision.
    * Nick Holcombe 04/12/2001 Added JavaDocs comments.
    * Marc Ludwig 03/01/2002 Added call to StreamGobbler to handle standard error and input streams.
    * </pre>
    * <!-- End RevisionInformation -->
    public class HostCommand extends VBean {
    * Stores the handler for this view class
    IHandler mHandler = null;
    // Return codes from host command
    static final int RC_CMDNOTRUN = -1;
    static final int RC_CMDERROR = -2;
    static final int RC_CMDNOTFINISHED = -3;
    * Register custom properties, used to invoke the setProperty/getProperty JavaBean methods
    static final ID P_MODAL = ID.registerProperty("MODAL");
    static final ID P_RETURNCODE = ID.registerProperty("RETURNCODE");
    static final ID P_NEWCOMMAND = ID.registerProperty("newCommand");
    static final ID P_ADDCOMMAND = ID.registerProperty("addCommand");
    static final ID P_RUNCOMMAND = ID.registerProperty("runCommand");
    private boolean modal = false;
    private int returnCode = RC_CMDNOTRUN;
    private Vector cmdArray = new Vector();
    private Process commandProcess = null;
    private boolean commandHasRun = false;
    private boolean isCommandStillRunning () {
    if (commandHasRun)
    return false;
    try {
    int ev = commandProcess.exitValue();
    commandHasRun = true;
    returnCode = ev;
    catch (java.lang.IllegalThreadStateException e) {
    return true;
    return false;
    private String getReturnCode () {
    if (isCommandStillRunning()) {
    return ""+RC_CMDNOTFINISHED;
    else if (commandHasRun) {
    return ""+returnCode;
    else {
    return ""+RC_CMDNOTRUN;
    private String getModal () {
    if (modal)
    return "TRUE";
    else
    return "FALSE";
    private boolean setModal (Object value) {
    String newModal = (String) value;
    if (newModal.equals ("TRUE"))
    modal = true;
    else
    modal = false;
    return true;
    private String newCommandArray () {
    cmdArray = new Vector();
    return "";
    private boolean addCommandArray (Object value) {
    String cmdEntry = (String) value;
    if (cmdArray == null) {
    cmdArray = new Vector();
    System.err.println ("HostCommand.addCommandArray: Adding command "+cmdEntry);
    cmdArray.addElement (cmdEntry);
    return true;
    private String runCommandArray () {
    execCommandArray();
    return (getReturnCode());
    private boolean execCommandArray () {
    returnCode = RC_CMDNOTRUN;
    commandHasRun = false;
    commandProcess = null;
    String cmd[] = new String[cmdArray.size()];
    int count = 0;
    try {
    if (cmdArray != null && cmdArray.size() > 0) {
    for (Enumeration e = cmdArray.elements() ; e.hasMoreElements() ;) {
    String cmdElement = (String) e.nextElement();
    cmd[count++] = cmdElement;
    commandProcess = Runtime.getRuntime().exec(cmd);
    StreamGobbler errorGobbler = new StreamGobbler(commandProcess.getErrorStream(), "ErrStream");
    StreamGobbler outputGobbler = new StreamGobbler(commandProcess.getInputStream(), "OutStream");
    errorGobbler.start();
    outputGobbler.start();
    if (modal) {
    returnCode = commandProcess.waitFor();
    commandHasRun = true;
    catch (Exception x) {
    x.printStackTrace();
    returnCode = RC_CMDERROR;
    commandHasRun = true;
    return false;
    return true;
    * Method in the IView interface that is called when the component is first
    * initialised from by the Forms Server.
    * @param a reference to the Handler object for this class
    public void init(IHandler handler)
    mHandler = handler;
    commandProcess = null;
    returnCode = RC_CMDNOTRUN;
    commandHasRun = false;
    cmdArray = new Vector();
    * Method in the IView interface that is called when the Forms Server wishes to
    * obtain the value of a specific property from the class.
    * For the 6i release, the get_custom_property method will be available which will
    * allow for a far simple usage model. The Form developer will simply be able to call
    * get_custom_property('HOSTCOMMAND') and we will return the host command as a string.
    * @param pid the property to be returned
    * @return the value of the property that was requested
    public Object getProperty(ID pid)
    if (pid == P_MODAL) {
    return (getModal ());
    else if (pid == P_RETURNCODE) {
    return (getReturnCode ());
    else if (pid == P_NEWCOMMAND) {
    return (newCommandArray());
    else if (pid == P_RUNCOMMAND) {
    return (runCommandArray());
    else // let the VBean superclass handle the other properties
    return(super.getProperty(pid));
    public boolean setProperty (ID pid, Object value) {
    boolean result = true;
    if (pid == P_MODAL) {
    result = setModal (value);
    else if (pid == P_ADDCOMMAND) {
    result = addCommandArray (value);
    else
    result = super.setProperty (pid, value);
    return result;
    * A convenience function to use the new ID.getName() method exposed in the 6i
    * release but which will still allow the PJC to be used in the 6.0 release
    * @param pid the property to display the name of
    * @return the property name
    public String getPropertyName(ID pid)
    try
    return pid.getName();
    // if there is an exception, it's 6.0 running!
    catch(Exception e)
    return null;
    * The test method which allows class to be run from the command line to determine
    * if it is functioning correctly.
    * @param args[] the command line arguments
    public static void main(String args[])
    String commandToRun = "";
    if (args.length == 0) {
    System.err.println("usage: hostcommand Command to run");
    System.exit(1);
    HostCommand hc = new HostCommand();
    hc.getProperty (P_NEWCOMMAND);
    if (args.length > 0) {
    for (int i = 0; i<args.length; i++) {
    commandToRun += args[i]+" ";
    hc.setProperty (P_ADDCOMMAND, args);
    System.out.println("CommandtoRun: >"+commandToRun+"<");
    hc.setProperty (P_MODAL, "TRUE"); // Make the test example modal
    String rc = (String) hc.getProperty (P_RUNCOMMAND); // Run the command, getting the return code
    System.err.println("rc="+rc); // Display the return code
    // Regardless of the modal property, wait until the command has finished before the return code
    // is retrieved, otherwise a -3 will be returned if the process is still running.
    if (hc.getReturnCode().equals(""+RC_CMDNOTFINISHED)) {
    System.err.println ("CommandNotFinished. Waiting for command to finish to get the return code");
    while (hc.getReturnCode().equals(""+RC_CMDNOTFINISHED)) {
    System.err.println("ReturnCode: "+hc.getProperty (P_RETURNCODE)); // Display the return code
    System.exit(0);
    // Copyright (c) 2002 Aquila Group Holdings Ltd
    package uk.co.aquilauk;
    import java.util.*;
    import java.io.*;
    * <code>StreamGobbler</code> is a public class that is currently called from the HostCommand class, to control output
    * and error streams produced when calling Host commands from the JVM.
    * <!-- RevisionInformation -->
    * <DL><DT><B>Revison Information:</B></DL>
    * <pre>
    * Marc Ludwig 03/01/2002 Initial revision.
    * </pre>
    * <!-- End RevisionInformation -->
    public class StreamGobbler extends Thread {
    InputStream is;
    String type;
    StreamGobbler(InputStream is, String type) {
    this.is = is;
    this.type = type;
    public void run() {
    try {
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line=null;
    while ( (line = br.readLine()) != null)
    System.err.println(type + ": " + line);
    catch (IOException ioe) {
    ioe.printStackTrace();
    Hope you are able to help. As mentioned previously, this same code works successfully when using JINIT 1.1.8.19 after manually updating the JInit identity.obj with our sigining identity.
    Regards
    Marc Ludwig

  • Got error when trying to generate Java proxy jar file for webservice

    Hi,
    I am having a warning message when trying to generate java proxy jar file on weblogic8.1
    webservice test web app, the message is as follows:
    "Warning Failed to generate client proxy from WSDL definition for this service.
    Prescription Please verify the <types> section of the WSDL."
    in the mean time, on weblogic starting terminal, I saw the following exceptions,
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\AlphaLength4Deserializer.java:36: cannot resolve symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkLengthFacet(__typed_obj,4L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\OSIFieldAnonTypeDeserializer.java:36: cannot resolve symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkMaxLengthFacet(__typed_obj,69L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\AlphaLength2Deserializer.java:36: cannot resolve symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkLengthFacet(__typed_obj,2L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\FreeFormAnonTypeDeserializer.java:36: cannot resolve symbol
    symbol : class FacetUtils"
    Can anybody help me about this issue? I attached WSDL file, also United Airlines
    got an enterprise weblogic license deal with BEA, any help will be highly appreciated.
    Thanks!!!
    Naichen
    [ModifyPNRWSContract.wsdl]

    Hi Naichen,
    I was able to successfully run both the autotype and clientgen Ant task, on the
    WSDL you provided. The code behind those Ant tasks are pretty much what the WebLogic
    Web Services test page run. Are you using WLS 8.1 SP2? If not, you might want
    to try with that version.
    Regards,
    Mike Wooten
    "Naichen Liu" <[email protected]> wrote:
    >
    >
    >
    Hi,
    I am having a warning message when trying to generate java proxy jar
    file on weblogic8.1
    webservice test web app, the message is as follows:
    "Warning Failed to generate client proxy from WSDL definition for this
    service.
    Prescription Please verify the <types> section of the WSDL."
    in the mean time, on weblogic starting terminal, I saw the following
    exceptions,
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\AlphaLength4Deserializer.java:36: cannot resolve symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkLengthFacet(__typed_obj,4L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\OSIFieldAnonTypeDeserializer.java:36: cannot resolve
    symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkMaxLengthFacet(__typed_obj,69L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\AlphaLength2Deserializer.java:36: cannot resolve symbol
    symbol : class FacetUtils
    location: package binding
    weblogic.xml.schema.binding.FacetUtils.checkLengthFacet(__typed_obj,2L);
    ^
    C:\DOCUME~1\u252738\LOCALS~1\Temp\wlwproxy37508.jar1533409921\com\ual\www\rcc\cb
    t\schema\modifypnr\FreeFormAnonTypeDeserializer.java:36: cannot resolve
    symbol
    symbol : class FacetUtils"
    Can anybody help me about this issue? I attached WSDL file, also United
    Airlines
    got an enterprise weblogic license deal with BEA, any help will be highly
    appreciated.
    Thanks!!!
    Naichen

  • Three questions about Java and Ftp

    Hello, i've the following questions about Java and Ftp:
    1- .netrc file is in $HOME directory but i can't access to this directory from java code. The following line producesan Exception (directory doesn't exists)
    FileWriter file = new FileWriter ("$HOME/.netrc");
    2- .netrc file must have the following permissions: -rw- --- --- but when i create the .netrc file the following permissions are on default: -rw- r-- r--, how can i change this permissions? (In java code, i can't use chmod.....)
    3- Are there any way to pass parameters to a .netrc file? If i get to do this i needn't change the permissions because i can't modify or create/destroy this file.
    Thanks in advanced!!!
    Kike

    1- .netrc file is in $HOME directory but i can't
    access to this directory from java code. The
    following line producesan Exception (directory
    doesn't exists)
    FileWriter file = new FileWriter ("$HOME/.netrc");$HOME would have to be replaced by a shell, I don't
    think you can use it as part of a legal path.
    Instead, use System.getProperty("user.home");
    Ok, thanks
    2- .netrc file must have the followingpermissions:
    -rw- --- --- but when i create the .netrc file the
    following permissions are on default: -rw- r--r--,
    how can i change this permissions? (In java code,i
    can't use chmod.....)Yes, you can: Runtime.exec("chmod ...");
    I need to use estrictly the .netrc with -rw- --- --- permissions
    Yes, i can use Runtime.exec ("chmod ..."); but i don't like very much this solution because is a slow solution, am i right?
    3- Are there any way to pass parameters to a.netrc
    file? If i get to do this i needn't change the
    permissions because i can't modify orcreate/destroy
    this file.I don't think so. Why do you need the .netrc file in
    Java at all? Writing a GUI frontend?I want to use automatic ftp in a java program and FTP server, the files and path are not always the same, so i can:
    - modify .netrc (for me is the complex option)
    - destroy and create a new .netrc (is easier but i have permissions problem)
    - use .netrc with parameters but i haven't found any help about it
    Thanks for your prompt reply!!!!
    Kike

  • My  Applet Jar file doesn't work !!

    hello ,
    I have written this java applet :
    import java.awt.*;
    import javax.swing.*;
    import java.applet.Applet;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.net.URL;
    public class test4 extends Applet implements ActionListener{
         private static final long serialVersionUID = 1L;
         private JButton B1 =new JButton("Forward ");
         private JButton B2 =new JButton("Backward");
         private JButton B3 =new JButton("Left");
         private JButton B4 =new JButton("Right");
    private JPanel P1 = new JPanel();
    private JPanel P2 = new JPanel();
    private JPanel P3 = new JPanel();
    private JPanel P4 = new JPanel();
    private JPanel P5 = new JPanel();
    private JPanel P6 = new JPanel();
    private JLabel L3 = new JLabel(" ");
    private JLabel L4 = new JLabel(" ");
    private JLabel L5 = new JLabel(" ");
    private JLabel L6 = new JLabel(" ");
    private JLabel L7 = new JLabel(" ");
    JSplitPane sppSplitPane0 = new JSplitPane( );
         public test4()
              JFrame.setDefaultLookAndFeelDecorated(true);
              sppSplitPane0.setDividerLocation( 250 );
              P3.add(L4);
              P3.add(B1);
              P3.add(L5);
              P5.add(B3);
              P5.add(L3);
              P5.add(B4);
              P4.add(L6);
              P4.add(B2);
    P4.add(L7);
              P1.setLayout(new BorderLayout());
              P1.add("North",P3);
              P1.add("Center",P5);
              P1.add("South",P4);
              P2.setLayout(new BorderLayout());
              P2.add("North" , P1);
              B1.addActionListener(this);
              B2.addActionListener(this);
              B3.addActionListener(this);
              B4.addActionListener(this);
              sppSplitPane0.setLeftComponent(P2);
              sppSplitPane0.setRightComponent(P6);
         public void actionPerformed(ActionEvent e) {
              try {
                   if (e.getSource() == B4) {
              URL myNewURL = new URL("http://amera/cgi-bin/test.cgi?R");
              System.out.println("URL = " + myNewURL);
              getAppletContext().showDocument(myNewURL,"blank");
                   else
                        if (e.getSource() == B3) {
                        URL myNewURL = new URL("http://amera/cgi-bin/test.cgi?L");
                        System.out.println("URL = " + myNewURL);
                        getAppletContext().showDocument(myNewURL,"blank");
                        else
                             if (e.getSource() == B2) {
                             URL myNewURL = new URL("http://amera/cgi-bin/test.cgi?B");
                             System.out.println("URL = " + myNewURL);
                             getAppletContext().showDocument(myNewURL,"blank");
                             else {
                                  URL myNewURL = new URL("http://amera/cgi-bin/test.cgi?F");
                                  System.out.println("URL = " + myNewURL);
                             getAppletContext().showDocument(myNewURL,"blank");
              } catch (Exception err) {
              System.err.println("Error!\n" + err);
              showStatus("Error, look in Java Console for details!");
         public static void main(String[] args) {
              test t=new test();
              JFrame frame =new JFrame();
              frame.add(t.sppSplitPane0);
              frame.setSize(1100,700);
              frame.setVisible(true);
    i made a jar file :
    i created a file and named it MANIFEST.MF .i wrote inside it :
    Main-Class: test
    Then i placed it in a folder with the test.class .I created jar file using command line.
    I entered the test.class path and then wrote this command :
    jar cvfm myjar.jar MANIFEST.MF *.class
    Then the jar file "myjar.jar" is created .
    it's executed but this function "public void actionPerformed(ActionEvent e) " won't wrok.
    i keep pressing the buttons but nothing is happening !!
    please help me .
    Edited by: Amera on Dec 27, 2009 2:51 PM

    Welcome to the Sun forums.
    Subject: My Applet Jar file doesn't work !! .
    1) Note that one '!' denotes exclamation, whereas 2 or more often denotes a dweeb.
    2) Since you are on your first post, I will point out that applets are an advanced topic, and should not be attempted by newbies.
    3) "doesn't work" is very vague. It is likely to produce a reply like "maybe the applet is lazy - try flogging it".
    Amera wrote:
    ..I have written this java applet :When posting code, code snippets, HTML/XML or input/output, please use the code tags. The code tags help retain the formatting and indentation of the sample. To use the code tags, select the sample and click the CODE button.
    Also note that the most preferred form of code is an SSCCE *(<- link).* In an SSCCE, your would remove all but one button (if the actionPerformed fails with 6 or 7 buttons, trim it down to fail with just one or two.
    i made a jar file :So does the applet work before you make the Jar file? Your post so far suggests the Jar file is the problem.
    i created a file and named it MANIFEST.MF .i wrote inside it :
    Main-Class: test
    Then i placed it in a folder with the test.class .I created jar file using command line.
    I entered the test.class path and then wrote this command :
    jar cvfm myjar.jar MANIFEST.MF *.class
    Then the jar file "myjar.jar" is created .
    it's executed but this function "public void actionPerformed(ActionEvent e) " won't wrok.
    i keep pressing the buttons but nothing is happening !!So you get 'no output in the console & no effect in the applet'?
    What is the URL where I can see your applet failing?
    As an aside, since Sun does not guarantee that applet clients will act on the showDocument command, even if it does not work, it would not be a 'bug'.
    Edited by: AndrewThompson64 on Dec 28, 2009 11:18 AM

  • I have a question about using adobe CS files in CS6 edition

    I am a graphic artist . I have a question about using adobe CS files in CS6 edition. when I am gonna open thse adobe CS created files in CS6 Edition i get a color variation than i made with the CS version.Please give me an idea about this issue as soon as possible.If you need i can upload my problem as a screenshot to clearity

    donrulz,
    Are your Edit>Color Settings the same?
    Are you using spot colours, such as Pantone (there have been some changes in CMYK values with new colour books)?

  • 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

  • Question about Java's HttpServer: Threading? Backlog?

    Hello,
    I have two questions about Java's HttpServer (com.sun.net.httpserver). From the JavaDoc:
    >
    Management of threads can be done external to this object by providing a Executor object. If none is provided a default implementation is used.
    >
    How can I get information about the default implementation in 1.6.0_13? Do you know the behavior? From my observations, the default implementation uses no Threads, meaning every request is handled in the same Thread, this results in handling the requests to the HttpServer one after another.
    Is this right?
    The second question is about this, also from the JavaDoc:
    >
    When binding to an address and port number, the application can also specify an integer backlog parameter. This represents the maximum number of incoming TCP connections which the system will queue internally. [...]
    >
    When setting the backlog to -1, it uses the systems default backlog. How can I determine the systems default backlog? Can some lines of Java code reveal it (there is no getBeacklog() method)? Or is it up to the Operating System (we use Redhat Linux)?
    Thanks a lot for your help!
    Regards,
    Timo

    How can I determine the systems default backlog?You can't. There is no API for that even at the C level.
    Can some lines of Java code reveal itNo.
    Or is it up to the Operating System (we use Redhat Linux)?Yes. Linux provides a large default. It seems to be at least 50 on most platforms. This is not something you should be worrying about.

Maybe you are looking for