Applet : caught a SecurityException.  That's OK.

I am trying to connect a Stateless Session Bean from an Applet. Do I
need to add any permissions in the weblogic.policy files or to the JRE
policy files used by the browser?
Without providing any extra permissions anywhere, I am able to set the
InitialContext and lookup the EJBHome object using the initial
context.but when i am casting the object looked up to the corresponding
EJB home object using PortableRemoteObject.narrow(), I am getting the
exception(a snapshot):
caught a SecurityException. That's OK.
looked up.............:javax.naming.InitialContext@4d1d41
looked up.............:ClusterableRemoteRef(192.9.126.107
[192.9.126.107])/285
Interface 0:
com.mindteck.spider.uaa.server.slbean.UAAUserAuthenticatorHome
Interface 1: javax.ejb.EJBHome
Interface 2: weblogic.ejb20.interfaces.RemoteHome
Interface 3: weblogic.rmi.internal.StubInfoIntf
before casting
java.lang.ClassCastException
at
com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(Unknown
Source)
at javax.rmi.PortableRemoteObject.narrow(Unknown Source)
at
com.mindteck.spider.uaa.client.ui.UAAUserLogin.btnAuthenticate_actionPerformed(UAAUserLogin.java:203)

Hi Cameron,
Thanks for your reply but the problem is if I grant all permission to the JRE
policy file used by the browser then the stuff is working coolly.
Can you suggest alternative way to receive asynchronous messages(JMS) by the
applet which has been processed and added to the Queue by an EJB.
Thanks
Sanjit
Cameron Purdy wrote:
Generally speaking, Applet to EJB direct connection is a very bad approach.
Are you sure that is what you should do?
Peace,
Cameron Purdy
Tangosol, Inc.
Clustering Weblogic? You're either using Coherence, or you should be!
Download a Tangosol Coherence eval today at http://www.tangosol.com/
"Sanjit Bose" <[email protected]> wrote in message
news:[email protected]..
I am trying to connect a Stateless Session Bean from an Applet. Do I
need to add any permissions in the weblogic.policy files or to the JRE
policy files used by the browser?
Without providing any extra permissions anywhere, I am able to set the
InitialContext and lookup the EJBHome object using the initial
context.but when i am casting the object looked up to the corresponding
EJB home object using PortableRemoteObject.narrow(), I am getting the
exception(a snapshot):
caught a SecurityException. That's OK.
looked up.............:javax.naming.InitialContext@4d1d41
looked up.............:ClusterableRemoteRef(192.9.126.107
[192.9.126.107])/285
Interface 0:
com.mindteck.spider.uaa.server.slbean.UAAUserAuthenticatorHome
Interface 1: javax.ejb.EJBHome
Interface 2: weblogic.ejb20.interfaces.RemoteHome
Interface 3: weblogic.rmi.internal.StubInfoIntf
before casting
java.lang.ClassCastException
at
com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(Unknown
Source)
at javax.rmi.PortableRemoteObject.narrow(Unknown Source)
at
com.mindteck.spider.uaa.client.ui.UAAUserLogin.btnAuthenticate_actionPerform
ed(UAAUserLogin.java:203)

Similar Messages

  • Can any one change this Applet into a class that extends Jpanel.....

    Hi,
    I need this applet as a class that extends JPanel, I will be very very thankful to you if any one kindly change this Applet code into a class that extends JApplet.
    I will be very thankful to you if some one can reserve few minutes & do this favor early.
    Thanks a lot for any help.
         My Pong Code
    import java.applet.*;
    import java.awt.*;
    import java.io.*;
    import java.awt.event.*;
    public class Class1 extends Applet implements Runnable
    {     private final int APPLET_WIDTH = 900;
         private final int APPLET_HEIGHT = 600;
         private int px = 15;
         private final int py = 560;
         private final int ph = 10;
         private final int pw = 75;
         private int old_px = px;
         private int bx = 450;
         private int by = 15;
         private final int bh = 20;
         private final int bw = 20;
         private int move_x = 2;
         private int move_y = 2;
         private boolean done = false;
         Thread t;
         private final int delay = 25;
         public void init()
         {     setBackground(Color.black);
              setSize(APPLET_WIDTH, APPLET_HEIGHT);
              requestFocus();
              addKeyListener(new DirectionKeyListener());
             (t = new Thread(this)).start();
         public void run()      {
        try      {     while((t == Thread.currentThread()) && (done == false))           {     
                   if ((bx < 15) || (bx > APPLET_WIDTH-30))                     move_x = -move_x;                                if ((by < 15) ||                    ((by > APPLET_HEIGHT-60)&&                     ((px<=bx)&&(bx<=px+pw))))
                        move_y = -move_y;
                   if (by > APPLET_HEIGHT)
                        done = true;
                                   bx = bx + move_x;
                   by = by + move_y;                                                repaint();
                   t.sleep(delay);
         catch(Exception e)      {}
         }//end run
         /*public void move_paddle(int amount)
              old_px = px;
              //if (amount > 0)
                //if (px <= APPLET_WIDTH-15)
                   px = px + amount;
              //else if (amount < 0)
               // if (px >= 15)
                   px = px + amount;
         public void paint(Graphics page)
              //     page.setColor(Color.black);
              //     page.drawRect(old_px, py, pw, ph);
                   page.setColor(Color.blue);
                   page.drawRect(px, py, pw, ph);
                   page.setColor(Color.white);
                   page.drawOval(bx, by, bw, bh);
                   if ((done == true) && (by > APPLET_HEIGHT))
                        page.drawString("LOSER!!!", APPLET_WIDTH/2, APPLET_HEIGHT/2);
                   else if (done == true)
                        page.drawString("Game Over, Man!", APPLET_WIDTH/2-10, APPLET_HEIGHT/2);
         private class DirectionKeyListener implements KeyListener               
              public void keyPressed (KeyEvent event)
                   switch (event.getKeyCode())
                   case KeyEvent.VK_LEFT:
                        old_px = px;
                        if (px >=15)
                             px -=10;
                        break;
                   case KeyEvent.VK_RIGHT:
                        old_px = px;
                        if (px+pw <= APPLET_WIDTH-15)
                             px += 10;
                        break;
                   case KeyEvent.VK_Q:
                        done = true;
                   default:
                   }  //end switch
                   repaint();
              }//end keyPressed
              public void keyTyped (KeyEvent event)
              public void keyReleased (KeyEvent event)
         }  //end class 
    }

    thank you sir for your advice.
    Its not like that I without any attempt, just past code here & asked for its conversion. I spent about 5 hours on it, can say spoil whole day but to no avail. You then just guide me, give some hint so that I do it. I will most probably wanted to do it by myself but asked for help when was just disappointed.
    I try to put all init() in default constructor of identical copy of this applet that extends JPanel. Problem.....ball tend to fell but pad not moving. Also out out was not getting ant color input. That was like my best effort.....other tried that I found by search like just do nothing only extend panel OR frame in spite of applet, start applet from within main of another class.... these are few I remember what I tried.
    I will be very very thankful to you if you can help/guide me how can I do it. Behavior of the Applet is like a normal PONG game with on pad controlled by arrow keys, & one ball colliding with walls of boundary & falling down.
    Thanks a lot again for your attention & time.

  • I am being charged for 3 GB that apparently Verizon hadn't caught up on that I had used!! The last night of my cycle I called and checked and I had .5 GB left and right before midnight when the cycle ended it caught up on 3 GB!! I now have to pay for this

    SO CRAPPY!!! SO FED UP WITH VERIZON!! WE ARE GETTING SCREWED OVER!! I am being charged for 3 GB that apparently Verizon hadn't caught up on that I had used!! The last night of my cycle I called and checked and I had .5 GB left and right before midnight when the cycle ended it caught up on 3 GB!! I now have to pay for this data I know I did not use! I never have my data on!! Now it says I used 7 GB last month!!!

    Data usages are always estimated...I don't believe any carrier post data usage in real time.  I've had my data increased due to a large chunk being unaccounted for at the time of my cycle.  Thankfully when I'm billed for it...it has never pushed me over my limit. 

  • How do I make an applet make the page that is hosting it go to a page?

    Lets say that www.applet.com is hosting a page. Lets say I click that applet. I want the page, in the same browser that the applet is on, go to another page. How do I do this?

    hi Virum.
    u seem to post quite alot when maybe, with a bit of searching, you could find it urself. Ive been programmin in java for mayb 3 months now. heres your solution i think:Applet.getAppletContext().showDocument("http://www.yourpage.com/");
    Applet.getAppletContext().showDocument("http://www.yourpage.com/","tragetframe");

  • New Markup using JVue applet with default colors that override .ini setting

    Goal: To load the JVue applet initially populated with a given document(drawing) and if there are no markups at all:
    •     Give the user a markup with a custom filename
    •     Configure the applet so that all markups:
    o     Have a specific custom outline color that overrides setting in allusers.ini
    o     Have a specific custom fill color that overrides setting in allusers.ini
    Problem: The following code achieves everything except setting the custom colors via the method configureMarkups().
    •     If configureMarkups() is called, the applet will not save a valid Markup file (it is zero bytes).
    •     If configureMarkups() is simply not called, the applet will save a valid Markup file (but the markups are not the desired color)
    •     See the text following this code for a more detailed process flow:
    package com.kpe.esd.applets;
    import java.awt.Color;
    import com.cimmetry.core.Property;
    import com.cimmetry.markupbean.Markup;
    import com.cimmetry.markupbean.MarkupBean;
    import com.cimmetry.markupbean.MarkupEntitySpec;
    import com.cimmetry.vuebean.event.VueEvent;
    import com.cimmetry.vuebean.event.VueFileListener;
    import com.cimmetry.vuebean.event.VueMarkupListener;
    import com.cimmetry.vuebean.event.VueModelEvent;
    import com.cimmetry.vuebean.event.VueModelListener;
    public class JVueKPE extends com.cimmetry.jvue.JVue
    implements VueMarkupListener, VueModelListener, VueFileListener {
    /** serialVersionUID */
    private static final long serialVersionUID = 1L;
    public void onInitDone() {
    super.onInitDone();
    System.out.println("***KPE*** JVue extension (Build 20120219-i) has been initialized.");
    * @param markupBean
    * @param filename
    * @param author
    public void createUserMarkup(MarkupBean markupBean, String filename, String author) {
    System.out.println("***KPE*** createUserMarkup()");
    System.out.println(" filename: " + filename);
    System.out.println(" author: " + author);
    final boolean first = markupBean.getActiveMarkup().getName().contains("ntitled");
    final Markup newmarkup = first
    ? markupBean.getActiveMarkup() : markupBean.createMarkup(true);
    newmarkup.setName(filename);
    // Create a Properties class and instantiate the object
    final Property root = new Property("Markup", "KPE User Markup");
    root.addChildProperty("CSI_DocID", "<<dms:newmarkup>>"+filename);
    root.addChildProperty("CSI_DocName", filename);
    root.addChildProperty("CSI_DocReadOnly", "false");
    root.addChildProperty("CSI_DocAuthor", author != null ? author : "mickeymouse");
    root.addChildProperty("author", author != null ? author : "minniemouse");
    root.addChildProperty("Read-Only", "false");
    root.addChildProperty("CSI_MarkupType", "normal");
    newmarkup.setProperty(root);
    this.getActiveVueBean().getVueEventBroadcaster().addMarkupListener(this);
    this.getActiveVueBean().getVueEventBroadcaster().addModelListener(this);
    this.getActiveVueBean().getVueEventBroadcaster().addFileListener(this);
    // Make sure this is the last line of the method!!!
    if (!first) markupBean.setActiveMarkup(newmarkup); // This has no effect on enabling markup entity buttons
    public void createUserMarkup_tested_works(MarkupBean markupBean, String filename, String author) {
    System.out.println("***KPE*** createUserMarkup()");
    System.out.println(" filename: " + filename);
    System.out.println(" author: " + author);
    final Markup newmarkup = markupBean.createMarkup(true);
    newmarkup.setName(filename);
    // Create a Properties class and instantiate the object
    final Property root = new Property("Markup", "KPE User Markup");
    root.addChildProperty("CSI_DocID", "<<dms:newmarkup>>"+filename);
    root.addChildProperty("CSI_DocName", filename);
    root.addChildProperty("CSI_DocReadOnly", "false");
    root.addChildProperty("CSI_DocAuthor", author != null ? author : "mickeymouse");
    root.addChildProperty("author", author != null ? author : "minniemouse");
    root.addChildProperty("Read-Only", "false");
    root.addChildProperty("CSI_MarkupType", "normal");
    newmarkup.setProperty(root);
    this.getActiveVueBean().getVueEventBroadcaster().addMarkupListener(this);
    this.getActiveVueBean().getVueEventBroadcaster().addModelListener(this);
    this.getActiveVueBean().getVueEventBroadcaster().addFileListener(this);
    // Always search for, and delete, "untitled" markups
    final Markup[] allmarkups = markupBean.getMarkups();
    for (Markup thismarkup : allmarkups) {
    System.out.print("***KPE*** Markup Name: " + thismarkup.getName());
    if (thismarkup.getName().contains("ntitled")) {
    markupBean.deleteMarkup(thismarkup);
    System.out.println(" <<< removed.");
    } else {
    System.out.println(" <<< kept.");
    // Make sure this is the last line of the method!!!
    markupBean.setActiveMarkup(newmarkup); // This has no effect on enabling markup entity buttons
    public void configureMarkups(boolean isGreenMarks) {
    System.out.println("***KPE*** configureMarkups()");
    System.out.println(" isGreenMarks: " + isGreenMarks);
    final MarkupBean mbean = this.getActiveVueBean().getMarkupBean();
    final Markup active = mbean.getActiveMarkup();
    MarkupEntitySpec spec = active.getMarkupSettings();
    if (spec == null) {
    System.out.println("***KPE*** Why is spec null?");
    spec = new MarkupEntitySpec(mbean);
    spec.setColor(isGreenMarks ? Color.GREEN : Color.RED);
    spec.setFillColor(Color.YELLOW);
    mbean.selectionSetSpec(spec);
    @Override
    public void onMarkupEvent(VueEvent evt) {
    System.out.println("***KPE*** markup event = " + evt.getEventName());
    switch (evt.getType()) {
    case VueEvent.ONENTERMARKUPMODE:
    break;
    @Override
    public void onModelEvent(VueModelEvent evt) {
    System.out.println("***KPE*** model event = " + evt.getType());
    @Override
    public void onFileEvent(VueEvent evt) {
    System.out.println("***KPE*** markup event = " + evt.getEventName());
    Process Flow
    APPLET IN HTML
    <object id = "JVue" name = "JVue by Oracle"
    classid = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    codebase = "${viewer.codebase}"
    width = "100%" height = "50%" >
    <param name="code" value="com.kpe.esd.applets.JVueKPE" />
    <param name="codebase" value="${viewer.codebase}" />
    <param name="cache_archive" value="jvue.jar,jogl.jar,gluegen-rt.jar" />
    <param name="cache_version" value="cache_version" />
    <param name="type" value="application/x-java-applet;version=1.6" />
    <param name="mayscript" value="true" />
    <param name="scriptable" value="true" />
    <param name="EMBEDDED" value="TRUE">
    <param name="HEAVYWEIGHT" value="FALSE">
    <param name="VERBOSE" value="DEBUG">
    <param name="JVUESERVER" value="${viewer.autoVueServlet}">
    <param name="DMS" value="${viewer.autoVueDMS}">
    <param name="DMSARGS" value="USERNAME;DMS_PRESERVE_COOKIES;">
    <param name="USERNAME" value="anonymous">
    <param name="DMS_PRESERVE_COOKIES" value="TRUE">
    <param name="ONINIT" value="onJVueInit();">
    <param name="GUIFILE" value="${viewer.autoVueGUI}">
    </object>
    JAVASCRIPT: ONJVUEINIT()
    function onJVueInit() {
    var applet = getJVue();
    if (applet) {
    applet.setFile('${viewer.autoVueFilename}'); // [B1]
    applet.waitForLastMethod();
    AVOpenMarkupFile();
    AVConfigureMarkups();
    } else {
    alarm('!! Cannot find AutoVue applet !!!');
    }; // end onJVueInit()
    JAVASCRIPT: AVOPENMARKUPFILE()
    function AVOpenMarkupFile() {
    var applet = getJVue();
    if (true) {                   
    applet.openMarkup('*'); // [2]
    } else {
    waitForMarkupsToBeLoaded(applet); // This statement is VERY important.
    var vuebean = applet.getActiveVueBean();
    applet.waitForLastMethod();
    alarm("VueBean: " + vuebean);
    var mbean = vuebean.getMarkupBean();
    applet.waitForLastMethod();
    alarm("MarkupBean: " + mbean);
    alarm("Markups Count: " + mbean.getMarkupsCount());
    var found = -1;
    var untitled = false;
    var allmarkups = mbean.getMarkups();
    if ( false ) { // mbean.getMarkupsCount() == 1
    if (allmarkups[0].getName().slice(0,8) == 'Untitled') {
    allmarkups[0].setName(pg_userMarkupFilename);
    } else {
    alarm(allmarkups[0].getName().slice(0,8));
    } else {
    for (var index = 0, len = allmarkups.length; index < len; ++index) {
    var item = allmarkups[index];
    // Your code working on item here...
    alarm("Markup Name: " + item.getName());
    alarm("Markup Property: " + displayProperty(item.getProperty(), 0, 0, 1));
    if (pm_isHistory) { item.setReadOnly(true); }
    if (item.getName().slice(0,8) == 'Untitled') {
    found = index;
    untitled = true;
    // Untitled Markups get removed later by custom applet
    } else {
    if (item.getName().indexOf(pg_userMarkupFilename) > -1) {
    found = index;
    } else {
    if (!pm_isHistory && pm_isLead) { item.setReadOnly(false); }
    var information = item.getMarkupInformation();
    if (information != null) {
    for (var j = 0, len2 = information.length; j < len2; ++j) {
    var info = information[j];
    // Your code working on item here...
    alarm("Markup Information: " + info );
    if (untitled || (found == -1)) createMarkup(mbean, 'mickey mouse');
    JAVASCRIPT: CREATEMARKUP()
    function createMarkup(mbean, author) {
    getJVue().createUserMarkup(mbean, pg_userMarkupFilename, author);
    Note: Both versions of createUserMarkup() seem to work and allow successful saving of the markup file if configureMarkups() is not subsequently called.
    JAVASCRIPT: AVCONFIGUREMARKUPS()
    function AVConfigureMarkups() {
    var applet = getJVue();
    applet.configureMarkups(pm_isGreen);
    };

    Please try this, let me know if it doesn't work.
    public void configureMarkups(boolean isGreenMarks) {
    System.out.println("***KPE*** configureMarkups()");
    System.out.println(" isGreenMarks: " + isGreenMarks);
    final MarkupBean mbean = this.getActiveVueBean().getMarkupBean();
    MarkupEntitySpec spec = mbean.getMarkupEntitySpec();
    if (spec == null) {
    System.out.println("***KPE*** Why is spec null?");
    spec = new MarkupEntitySpec(mbean);
    spec.setColor(isGreenMarks ? Color.GREEN : Color.RED);
    spec.setFillColor(Color.YELLOW);
    mbean.setMarkupEntitySpec(spec);
    For the future: please try limiting code snippets to only minimum relevant lines, otherwise it's very hard to come up with quick suggestions...

  • How can I stop Firefox from running a Java applet from a site that I no longer trust?

    I've found plenty of answers to the opposite question (at <https://support.mozilla.org/en-US/questions/963349> and <https://support.mozilla.org/en-US/kb/how-allow-java-trusted-sites>, among other places), but none for my question.
    Firefox apparently builds a list of trusted sites for Java using its "Allow and Remember" dialog, but gives no easy way to edit that list (other than adding more sites to it). What am I supposed to do if I clicked "Allow and Remember" at some time in the past, and now want to revoke that permission?

    You can inspect and manage permissions for the domain in the currently selected tab via these steps:
    *Click the "[[Site Identity Button|Site Identity Button]]" (globe/padlock) on the location/address bar
    *Click "More Information" to open "Tools > Page Info" with the Security tab selected
    *Go to the Permissions tab (Tools > Page Info > Permissions) to check the permissions for the domain in the currently selected tab
    You can also clear the Java cache.
    *http://www.java.com/en/download/help/5000020300.xml - How do I clear the Java cache?
    *Control Panel > Java > General tab > "Temporary Internet Files" > Settings > Delete Files
    1

  • I want to access the "Page Setu " menu item of the "File" menu of the Netscape using Applet or JavaScript so that i can remove the header and footer from the page that will be printed.

    A print command should be given from a button on the page. Hope someone helps me

    If you have secondary hard drives or other writable volumes connected to your Mac, each contains an invisible Trash folder named .Trashes at the root (top) level of the volume, which in turn contains an invisible Trash folder for each user.
    -from -> Solving Trash Problems.
    Clinton

  • I have a station that will not display a particular java applet.

    It has had 1.4, then 6.0 and when attempting to click on the applet of a calendar, a box pops up, then waits a second, then shows a red x.
    So I uninstalled all Java, rebooted, and installed 5.0.12 etc.
    It still does it and if you hit cancel, it puts undefined in the box where the date should belong on the form.
    I turned on through the console the logging and this is what appears if I look at the calendar after looking at a working java applet off of Sun's webpage. I only cut and pasted what appeared after I typed the address into the address bar and entered through it.
    (ok. starting below...)
    basic: Stopping applet ...
    basic: Finding information ...
    basic: Releasing classloader: sun.plugin.ClassLoaderInfo@1a082e2, refcount=0
    basic: Caching classloader: sun.plugin.ClassLoaderInfo@1a082e2
    basic: Current classloader cache size: 1
    basic: Done ...
    basic: Joining applet thread ...
    basic: Destroying applet ...
    basic: Disposing applet ...
    basic: Joined applet thread ...
    basic: Unregistered modality listener
    basic: Quiting applet ...
    (ok thats it)

    I think any version below version 1.6 doesn't have
    javax.swingThat's 1.1.6, not 1.6 ;)

  • Report in Applet throws SecurityException

    Hello,
    I try to integrate CrystalReport into my Applet.
    ReportClientDocument reportClientDoc = new ReportClientDocument();
    reportClientDoc.open("reportName.rpt", 0);
    ReportViewerBean reportViewer = new ReportViewerBean();
    reportViewer.setReportSource(reportClientDoc.getReportSource());
    reportViewer.init();
    reportViewer.start();
    The Applet throws a SecurityException. It runs if the java.policy from client will be modified:
    grant  {
      permission java.util.PropertyPermission "*", "read,write";
      permission java.io.FilePermission "<<ALL FILES>>", "read, write, delete, execute";
      permission java.lang.RuntimePermission "createClassLoader";
    Is there a way without a modify by client? Server can be adjust.
    Edited by: ergerg on Aug 17, 2011 8:29 PM

    here it is :
    java.security.AccessControlException: access denied (java.io.FilePermission lena.png read)
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)
         at java.security.AccessController.checkPermission(AccessController.java:401)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
         at java.lang.SecurityManager.checkRead(SecurityManager.java:887)
         at sun.awt.SunToolkit.getImageFromHash(SunToolkit.java:408)
         at sun.awt.SunToolkit.getImage(SunToolkit.java:422)
         at javax.swing.ImageIcon.<init>(ImageIcon.java:81)
         at javax.swing.ImageIcon.<init>(ImageIcon.java:107)
         at PNGLoader$1.actionPerformed(PNGLoader.java:38)
         at java.awt.Button.processActionEvent(Button.java:381)
         at java.awt.Button.processEvent(Button.java:350)
         at java.awt.Component.dispatchEventImpl(Component.java:3526)
         at java.awt.Component.dispatchEvent(Component.java:3367)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)

  • Dont ask why! How do I call an applet that is in a jar file that is...

    Can someone tell me how I would call an applet that is inside of a jar file that is inside of a parent jar file?
    example call to an Applet
    <APPLET CODE="TimeApplet" ARCHIVE="time.jar" />what I want to do is something like
    <APPLET CODE="TimeApplet" ARCHIVE="parent.time.jar" />
    where parent is the top jar and time is the inner jar.any help or links to tutorials/articles would be most appreciated.
    if you ask why I wont answer.

    we are doing a signed applet and we only want the user to have to sign 1 time
    and we have lots of applets to display so we dont want to have them sign for
    each item.Sorry but that doesn't make much sense, niether does putting a jar file in a jar file.
    Do you want the "do you trust" question only one time? If so than you only have
    to sign all the jar files with the same key.
    You can load a jar file from your applet but it seems that these jar files will run
    in sanbox security no matter how you sign it:
    http://forum.java.sun.com/thread.jspa?messageID=3582952
    Asking why does make sense, I coud be asking how to climb a building without
    telling my objective is to get on the 10th floor.
    You would tell me how to climb the building an I'd probably do it and find out
    later I could just as well have taken the elivator.

  • How to run server application on that talks to applet in embeded in webpage

    i have a client(applet) and server application that are designed to communicate via sockets. the applet will run from a webpage and i know how to publish that. but the problem is the server application. i have been told that it too should run on my host, but how can i specify that and how to find out whether or not my host allows such a thing.
    any clarifying reply would be highly appreciated.
    sam

    If thinking about a Java solution, look at JSP/Servlet technology. (i.e. http://jakarta.apache.org)
    In short, servlets a classes that run in a container accesible by HTTP.
    There is also J2EE, wich uses RMI to perform this task.

  • Can an Applet call a Perl script that performs Unix file commands?

    Hi,
    I would like my applet to move a Unix file from one directory to another. (Both directories and the file are on the same server as the applet).
    In my applet I have code that calls (I think) a Perl script through a URL connection and passes the name of the file that needs to be moved:
    URL urlMove = new URL("http://myserver.com/cgi-bin/fileMove.pl?" + fileToMove);
    URLConnection urlConn = urlMove.openConnection();
    In the cgi-bin I have a perl script (fileMove.pl) that performs the move:
    #!/usr/bin/perl
    use CGI qw(:standard);
    $pfile = $ENV{?QUERY_STRING?};
    $cmd = ?mv stageArea/$pfile $pfile?;
    system $cmd;
    The Perl script works fine when I call it directly from Internet Explorer, but when I call the script from the Applet the file is not moved. Am I doing something wrong?

    Got it to work!
    Changed the Java code to:
    URL urlMove = new URL("http://myserver.com/cgi-bin/fileMove.pl?" + fileToMove);
    urlMove.openConnection();
    InputStream moveStream = urlMove.openStream();
    and in the Perl script added the line:
    print "Content-Type: text/html\n\n";
    The applet running my a PC is now effortlessly moving files on the unix server, wahoo.
    Aside: I also found that my applet web server and the files the applet reads/writes do not have to be on the same machine. In the applet's cgi-bin directory I created a "link" to the networked unix directory where the image files are actually located. I really expected the Applet I/O Security to complain, but it work like a charm. Go figure.

  • Regional settings impact JavaScript Number conversion to String in applet

    Environment:
    XP, IE6 and IE7, JDK 1.6.0_13,1.6.0_10,1.6.0_7, Apache
    Hi,
    We recently converted our application from the MS JVM to Sun JVM 1.6 and have since had numerous problems with a user's regional setting impacting the application's behaviour.
    The application is using an applet, passing JavaScript Number values to an Applet where the input argument in the Java function is declared as a String.
    We have users with various regional settings, most don't impact the application, but we have found problems when the regional settings are set to "French (France)" or "German (Germany)".
    With "French (France)" JavaScript Number values >=10000000 get truncated to a Java String value of just the first character.e.g. 10000000 is converted to "1", 200000000 is converted to "2".
    With "German (Germany)" a trailing "0" is added to the converted String, and for values >=10000000 we get the String value with an additional 6 "0"s and then 2 additional "0"s as the input Number value is increments by each power of 10.
    A simple example follows.
    Any help understanding why this is happening and any coding solution would be appreciated.
    The default number format for the various regional settings seems to be impacting the implicit conversion to String in LiveConnect.
    We can re-code to convert the Number value to a String in the JavaScript before calling the applet, but this involves significant re-coding of the application.
    We also have a workaround to verify that navigator.userLanguage returns one of the list of supported languages and exit the application if the language is unsupported.
    Thanks
    Rob
    Example output for test:
    OK
    English (United States)
    Regional Settings Number format sample: 123,456,789.00
    lang=en-us,javascript Number=1,Applet Java String value =(1)
    lang=en-us,javascript Number=11,Applet Java String value =(11)
    lang=en-us,javascript Number=111,Applet Java String value =(111)
    lang=en-us,javascript Number=1111,Applet Java String value =(1111)
    lang=en-us,javascript Number=11111,Applet Java String value =(11111)
    lang=en-us,javascript Number=111111,Applet Java String value =(111111)
    lang=en-us,javascript Number=1111111,Applet Java String value =(1111111)
    lang=en-us,javascript Number=11111111,Applet Java String value =(11111111)
    lang=en-us,javascript Number=111111111,Applet Java String value =(111111111)
    lang=en-us,javascript Number=1111111111,Applet Java String value =(1111111111)
    lang=en-us,javascript Number=11111111111,Applet Java String value =(11111111111)
    NOT OK >=10000000
    French (France)
    Regional Settings Number format sample: 123 456 789,00
    lang=fr,javascript Number=1,Applet Java String value =(1)
    lang=fr,javascript Number=11,Applet Java String value =(11)
    lang=fr,javascript Number=111,Applet Java String value =(111)
    lang=fr,javascript Number=1111,Applet Java String value =(1111)
    lang=fr,javascript Number=11111,Applet Java String value =(11111)
    lang=fr,javascript Number=111111,Applet Java String value =(111111)
    lang=fr,javascript Number=1111111,Applet Java String value =(1111111)
    lang=fr,javascript Number=11111111,Applet Java String value =(1)
    lang=fr,javascript Number=111111111,Applet Java String value =(1)
    lang=fr,javascript Number=1111111111,Applet Java String value =(1)
    lang=fr,javascript Number=11111111111,Applet Java String value =(1)
    NOT OK
    German (Germany)
    Regional Settings Number format sample: 123.456.789,00
    lang=de,javascript Number=1,Applet Java String value =(10)
    lang=de,javascript Number=11,Applet Java String value =(110)
    lang=de,javascript Number=111,Applet Java String value =(1110)
    lang=de,javascript Number=1111,Applet Java String value =(11110)
    lang=de,javascript Number=11111,Applet Java String value =(111110)
    lang=de,javascript Number=111111,Applet Java String value =(1111110)
    lang=de,javascript Number=1111111,Applet Java String value =(11111110)
    lang=de,javascript Number=11111111,Applet Java String value =(111111110000000)
    lang=de,javascript Number=111111111,Applet Java String value =(11111111100000000)
    lang=de,javascript Number=1111111111,Applet Java String value =(1111111111000000000)
    lang=de,javascript Number=11111111111,Applet Java String value =(1.1111111111E20)
    Example code:
    Test1.java
    import java.applet.Applet;
    public class Test1 extends Applet {
    public void init() {
    public String stringTest(String str) {
    String out = "Applet Java String value =(" + str + ")";
    return(out);
    index.html
    <html>
    <body>
    <APPLET CODE="Test1.class" NAME="test1" WIDTH="0" HEIGHT="0">
    <PARAM NAME="scriptable" Number="true">
    </APPLET>
    <script type="text/javascript">
    var x;
    document.write("<BR>")
    x = Number("1");
    document.write("lang="+navigator.userLanguage +",javascript Number=" x "," + document.test1.stringTest(x)+"<BR>");
    document.write("<BR>copy/paste the above 2 lines of code, adding an additional '1'<BR>");
    </script>
    </body>
    </html>
    </html>

    I have found a workaround by setting the locale in the applet to a locale that does perform implicit Number to String conversion correctly.
    e.g.
    public void init() {
    try {
    Locale.setDefault(Locale.US);
    } catch (Exception e) {
    System.err.println("Failed to set Locale, Caught Exception: " + e.getMessage());
    and adding this line to the java.policy to prevent "access denied (java.util.PropertyPermission user.language write)" errors.
    permission java.util.PropertyPermission "user.language", "read, write";

  • Applet without JMF installation at client side

    hello,
    I am trying developing an applet SIP phone based on Jain Sip Applet Phone( which originally can only deal with audio signal). But I found a big problem that I have to make every client install the JMF, however the clients hope there is no software to be installed locally.
    In application, I can run it without JMF installation by copying all the dlls to system32 directory and add some related JMF source code into my own project. Or just simply put the jmf.property to the "lib" directory, which also works.
    However, as for the applet, it dosen't that simple for the security thing. Here is the output in cosole:
    @mediaManager.detectSupportedCodes- number of capture devices: 2
    - name of the capture device: JavaSound audio capture
    - format accepted by this AUDIO device: LINEAR, 44100.0 Hz, 16-bit, Stereo, LittleEndian, Signed
    - format accepted by this AUDIO device: LINEAR, 44100.0 Hz, 16-bit, Mono, LittleEndian, Signed
    - format accepted by this AUDIO device: LINEAR, 22050.0 Hz, 16-bit, Stereo, LittleEndian, Signed
    - format accepted by this AUDIO device: LINEAR, 22050.0 Hz, 16-bit, Mono, LittleEndian, Signed
    - format accepted by this AUDIO device: LINEAR, 11025.0 Hz, 16-bit, Stereo, LittleEndian, Signed
    - format accepted by this AUDIO device: LINEAR, 11025.0 Hz, 16-bit, Mono, LittleEndian, Signed
    - format accepted by this AUDIO device: LINEAR, 8000.0 Hz, 16-bit, Stereo, LittleEndian, Signed
    - format accepted by this AUDIO device: LINEAR, 8000.0 Hz, 16-bit, Mono, LittleEndian, Signed
    - name of the capture device: vfw:Microsoft WDM Image Capture (Win32):0
    - format accepted by this VIDEO device: YUV Video Format: Size = java.awt.Dimension[width=352,height=288] MaxDataLength = 202752 DataType = class [B yuvType = 32 StrideY = 704 StrideUV = 704 OffsetY = 0 OffsetU = 1 OffsetV = 3
             - format accepted by this VIDEO device: YUV Video Format: Size = java.awt.Dimension[width=160,height=120] MaxDataLength = 38400 DataType = class [B yuvType = 32 StrideY = 320 StrideUV = 320 OffsetY = 0 OffsetU = 1 OffsetV = 3
             - format accepted by this VIDEO device: YUV Video Format: Size = java.awt.Dimension[width=176,height=144] MaxDataLength = 50688 DataType = class [B yuvType = 32 StrideY = 352 StrideUV = 352 OffsetY = 0 OffsetU = 1 OffsetV = 3
             - format accepted by this VIDEO device: YUV Video Format: Size = java.awt.Dimension[width=320,height=240] MaxDataLength = 153600 DataType = class [B yuvType = 32 StrideY = 640 StrideUV = 640 OffsetY = 0 OffsetU = 1 OffsetV = 3
             - format accepted by this VIDEO device: YUV Video Format: Size = java.awt.Dimension[width=640,height=480] MaxDataLength = 614400 DataType = class [B yuvType = 32 StrideY = 1280 StrideUV = 1280 OffsetY = 0 OffsetU = 1 OffsetV = 3
    java.lang.RuntimeException: No permission to capture from applets
    -> Couldn't connect to audio capture device
    java.lang.RuntimeException: No permission to capture from applets
    -> Couldn't connect to video capture device
          I found that my applet can detect two device which is correct but has "no permission to capture from applets".
          In the progress of installation the JMF, and option is "permit recording from an applet". I read the source code, and found it dose the following works:
          if I choose "permit recording from an applet",  then "allowCapture=1", and in "settingPanel.java" it dose:
         "boolean allowCapture = checkAllowCapture.getState();
          Registry.set("secure.allowCaptureFromApplets", new Boolean(allowCapture));"
          I want to do what the installation progress did to give permition to applet, however, when I do the following:
           private static final String PROP_ALLOW_CAPTURE_FROM_APPLETS
            = "secure.allowCaptureFromApplets";
           Registry.set(PROP_ALLOW_CAPTURE_FROM_APPLETS, new Boolean(true));
           Registry.commit();
          in my project , it throws exception like this: "Failed to initially commit JMFRegistry. Ignoring err.java.lang.SecurityException: commit: Permission denied"
          The code which i thought could give applet the rights is denied.
          Till now, I have also read some similar questions in different forums, but there is no good answer.
          Can you help me? Is there any possibility to run the applet without installation on the client side ? Is my method right? If not, how should I do?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    xljiayuan wrote:
    ..I am trying developing an applet SIP phone based on Jain Sip Applet Phone( which originally can only deal with audio signal). If this is pure audio, can it be done using JavaSound?
    ..But I found a big problem that I have to make every client install the JMF, however the clients hope there is no software to be installed locally.To run an applet, the applet needs to be 'installed' on the user machine. Same with anything else.
    BTW - have you investigated JavaFX? It is effectively the replacement for JMF, and possibly has a better end-user experience than trying to install JMF.
    However, as for the applet, it dosen't that simple for the security thing. Here is the output in cosole:
    in my project , it throws exception like this: "Failed to initially commit JMFRegistry. Ignoring err.java.lang.SecurityException: commit: Permission denied"Is your applet digitally signed? If not, it has no hope of intercepting sound on the client. It is that simple.
    Imagine if you visited a web page with a 1px x 1px applet (effectively invisible) that could hear everything you say, and transmit it back to the server. Sun is not about to allow that, unless the end-user has granted the applet extended permissions.

  • Security manager - applet - write/read files

    Hi.
    I've been trying to built a SecurityManager to allow my java applet to construct a file (*.txt or *.doc) on the server (webhosting provider) it came from. Unfortunately when I use the setSecurityManager method to set my Security Manager as the default Security Manager for that specific applet, the applet throws a SecurityException. It wouldn't allow me to change the Security Manager.
    I want to change the default Security Manager so that my applet can have permission to read and write to the specified file (*.txt or *.doc). I don't want to save any kind of files on the host computer even if I can do that, I only require to save my file (*.txt or *.doc) to the computer from were the applet's classes came from.
    Thank you!

    If there is a security manager already installed, this method first calls the security manager's checkPermission method with a RuntimePermission("setSecurityManager") permission to ensure it's ok to replace the existing security manager. This may result in throwing a SecurityException. Thus I think that you need to grant the setSecurityManager permission to your current SecurityManager to be able to replace it.

Maybe you are looking for

  • Same driver version, different file sizes? What the dif?

    <div class="DownloadBriefBox"><div class="DownloadNameBox">Creative Sound Blaster Audigy series beta driver 2.8.00 [/i] <span class="DownloadSizeBox">Filesize : <span class="DownloadSizeText">42.35 MB <img height="6" src="http://support.creative.com/

  • My notes are disappearing?

    Hello! I have an iphone 4s and i have a lot of important  notes. randomly, a very important note is GONE. My phone didnt even crash. I really really need to get this back. Someone help!!!

  • Back up dvds

    ok compltere computer dies restored back to factery state have 5 dvd backup through hp back up have all the drivers and microsoft updates systen running fine . SO HOW do i put my backed up stiff back on this computer windows 7 

  • The error 034 when calling BAPI_XBP_JOB_START_IMMEDIATELY

    Hi,dear all, When I call the function 'BAPI_XBP_JOB_START_IMMEDIATELY' to start all jobs, the 'RETURN' type 'BAPIRET2', 'NUMBER' is 034, 'TYPE' is E. Do you have some idea about what's the potential problem on it? Thanks a lot.

  • Can you revoke a root certificate?

    A customer has lost the backup of it's own offline PKI Root Server (Windows 2003). As a security precaution we want to revoke the current root and issuing certificates. In our test environment we already managed to create a new root certificate and a