Unable to use Java in Firefox 16 Extension using Live Connect

In Firefox 16, java can no longer be accessed using the global instance as per https://bugzilla.mozilla.org/show_bug.cgi?id=748343.
I have built a custom selenium-ide.xpi (http://seleniumhq.org/download/) which loads up java and runs through my custom framework. To access java I added an addJava.js file, which I included in the selenium-ide-common.xul file calling the java using something like what is found at https://developer.mozilla.org/en-US/docs/Java_in_Firefox_Extensions, however this no longer works.
Does anyone know how to fix this?
Thanks in advance, James

For some reason the below didn't post in the initial post.
I've tried the following to fix the issue:
Adding the below to the various .xul files, but each time I try the below I get that appletRef is null:
<div name="appletDiv">
<embed id ="cipherDocsApplet" type="application/x-java-applet;version=1.6" code="java.applet.Applet" pluginspage="http://java.com/download/" MAYSCRIPT="true" width="0" height="0" />
</div>
var appletRef = document.getElementById("cipherDocsApplet");
window.java = appletRef.Packages.java;
The below gives me java_instance.Packages is undefined.
var java_instance = window.document.createElementNS("http://www.w3.org/1999/xhtml","applet");
java_instance.setAttribute("id", "adsfund_java_instance");
java_instance.setAttribute("code", "java.applet.Applet");
java_instance.setAttribute("width", "0");
java_instance.setAttribute("height", "0");
java_instance.setAttribute("flex", "1");
var div = window.document.createElementNS("http://www.w3.org/1999/xhtml","div");
var elementToAppendTo = window.document.getElementsByTagName("vbox")[0];
elementToAppendTo.appendChild(div);
div.appendChild(java_instance);
var date = new java_instance.Packages.java.util.Date();
Finally I tried https://bug748343.bugzilla.mozilla.org/attachment.cgi?id=655062, adding the app element to my main xul file and getting it later, but that also gives me the same error: 'TypetError:app.Packages is undefined.'

Similar Messages

  • How to run Java from Firefox Extension using liveconnect?!

    Hi, I'm trying to run a very simple java program from a Firefox extension I'm making but I've run into a brickwall and just can't get it to work. I'm a complete beginner in java and don't know much javascript so I've copied and pasted code from around the net to get where I am now. I'm sure I'm just making some stupid error at some step.
    In order to work out what I'm misunderstanding/doing wrong I'd be really grateful if someone could show me how to get it to work using a very basic example:
    Say I have a .java file taken from the sun pages:
    * The HelloWorldApp class implements an application that
    * simply displays "Hello World!" to the standard output.
    class HelloWorldApp {
        public static void main(String[] args) {
            System.out.println("Hello World!"); //Display the string.
    }So I stick it into a jar using:
    jar.exe cvfe HelloWorldApp.jar HelloWorldApp.class HelloWorldApp.class
    I then place it directly on my C: drive.
    In the javascript of my firefox extension I have code copied and pasted from https://developer.mozilla.org/en/Java_in_Firefox_Extensions:
    var urlClasz = java.lang.Class.forName("java.net.URL");
    var urlArray = java.lang.reflect.Array.newInstance(urlClasz,1);
    urlArray[0] = new java.net.URL('file:///C:/HelloWorldApp.jar');
    var cl = java.net.URLClassLoader.newInstance(urlArray);
    var aClass = java.lang.Class.forName("HelloWorldApp", true, cl);
    var aStaticMethod = aClass.getMethod("HelloWorldApp", []);
    var greeting = aStaticMethod.invoke(null, []);This seems to start java but then only gives me the error:
    "Error: uncaught exception: Error calling method on NPObject! [plugin exception: java.lang.ClassNotFoundException: HelloWorldApp]."
    I would be infinitely grateful if someone could show me the code I would use in this situation to run the HelloWorldApp. If I could get it working in this basic situation I'm sure I could work it out from there.
    Thank you very, very much!!

    By the way, I answered just because nobody did and I have some experience with using java from mozilla javascript.
    But I never played with Firefox extensions.
    No problem baftos, I understand you might not have all the answers but you've helped loads so far, so thanks a lot! I've found it very difficult to find good documentation on this for a beginner like me.
    Adding public did it (although I thought that I'd tried that, oops) so thanks again for that. I may have a couple of other questions just in case you happen to know the answer!
    I'd like to send some string arguments to the method I really want to run eg:
    public class HelloWorldApp {
    public static void sayHello(String[] args)
    {code}After googling .forName and .getMethod to see how to pass parameters I've added some code:
    {code:java}
    var strClass = java.lang.Class.forName("java.lang.String");
    var parameters = java.lang.reflect.Array.newInstance(strClass,2);
    parameters[0] ="My string argument";
    parameters[1] ="3"; // etc...
    var argHolder = java.lang.reflect.Array.newInstance(strClass,1);
    argHolder[0] = strClass;
    var aClass = java.lang.Class.forName("HelloWorldApp", true, cl);
    var aStaticMethod = aClass.getMethod("sayHello", argHolder);
    var greeting = aStaticMethod.invoke(null, parameters);
    {code}What I thought I was doing was creating a java array: argHolder and putting the string class/object thingy?! in it so that getMethod would look for a method called "sayHello" which took a string array as an argument... but apparently not!
    This brings me back to square one with a cannot find method with these arguments error:
    "Error: uncaught exception: Error calling method on NPObject! [plugin exception: java.lang.IllegalArgumentException: No method found matching name getMethod and arguments [java.lang.String, [Ljava.lang.String;]]."
    You don't happen to know how to do this as well do you?!
    Edited by: mzatanoskas on Feb 13, 2009 1:40 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Cannot use Java on Firefox in Mac

    I'm Mac user. I have followed all the instruction to set up the java on firefox in my macbook. However, when I browsing those web site which request java, I still unable to open it.
    If I use Safari to open those web sites, that is absolutely fine.
    Does anyone can help me to solve this problem please?

    You can only use IE to display XPS files directly.
    Firefox doesn't know about this file.
    *http://windows.microsoft.com/en-us/windows/what-is-xps-viewer#what-is-xps-viewer=windows-vista
    *[https://bugzilla.mozilla.org/show_bug.cgi?id=358297 bug 358297] - MS-Windows: XPS Viewer incorrectly redirects to firefox (Vista, XP)

  • I cannot use JAVA with Firefox but I can use it with Internet Explorer WHY?

    I have never had a problem when JAVA 7 was needed to use a program. Until now. Firefox will not allow me to use Java. I have to open Internet Explorer when working with any program and it works.

    To protect Firefox users, Mozilla has blocked/disabled Java 7 u6 and below due to serious security flaws in the previous versions of Java 7. The security flaw would also apply to any other browser using the affected versions of Java 7. You can see the version of Java and whether it is disabled in Add-ons > Plugins; look for "Java Platform SE...". See - https://addons.mozilla.org/en-US/firefox/blocked/p138
    You can check your '''''enabled''''' Plugins at any time - https://www.mozilla.org/en-US/plugincheck/
    Information about Java, testing and updating it - https://support.mozilla.org/en-US/kb/use-java-plugin-to-view-interactive-content

  • Must not use Java 1.7 when using E-Business Suite

    This notification is being posted at the request of Oracle Corporation
    All E-Business Suite desktop administrators must disable the JRE Auto-Update for their end users immediately to stop it updating to Java 1.7.
    URGENT BULLETIN: Disable JRE Auto-Update for All E-Business Suite End-Users.
    The following link from my fellow blogger Steve Chan explains more: https://blogs.oracle.com/stevenChan/entry/bulletin_disable_jre_auto_update
    To disable automatic updates, you do this in the Java Control Panel using this workflow:
    1. From the Windows Start button launch Control Panel
    2. Double-click on the Java icon
    3. On the Update tab, uncheck the box that says Check for updates automatically.
    4. Click the OK button to complete
    So why is this required?If you have Auto-Update enabled, your JRE 1.6 version will be updated to JRE 7. This may happen as early as July 3, 2012. This will definitely happen after Sept. 7, 2012, after the release of 1.6.0_35 (6u35).
    Oracle Forms is not compatible with JRE 7 yet. JRE 7 has not been certified with Oracle E-Business Suite yet. Oracle E-Business Suite functionality based on Forms -- e.g. Financials -- will stop working if you upgrade to JRE 7.
    If you have already upgraded to 1.7 but already have 1.6 you do not need to uninstall 1.7. You can just tell the system which one to use. You do this using this workflow:
    1. From the Windows Start button launch Control Panel
    2. Double-click on the Java icon
    3. On ths Java tab, click the View button
    4. Uncheck the Enabled box against 1.7 and check the box against 1.6
    5. Click the OK button to complete
    There is also a known issue with WebLogic 10.3.6 and JDK 1.7 and you must use JDK 1.6 for that. I will be posting on my blog shortly about this issue.
    Seems to me therefore that until further notice, even for Discoverer, but definitely for E-Business Suite that you must stay on Java 1.6.

    Hi Jerre
    I hear your concern and when I heard about the issues with E-Business Suite and Java 7 I was horrified. After all, we kind of got used to this when Sun and Oracle were separate but now that Oracle own both you would think these problems would have gone away.
    I'm not an insider to the problems with E-Business Suite and I urge anyone that is using it to wait for Oracle's solution and /or follow the great blog owned by Steven Chan which is dedicated to EBS. I took another look a few minutes ago and the advice is still the same - to NOT upgrade to Java 7 if you have E-Business Suite you need to roll back to Java 6 and turn off the automatic updates.
    As for Discoverer, I have 10g clients whose workstations were automatically upgraded to Java 7 and had their applications fail. I have always advised my clients to turn off automatic updating of Java and keep their client Java at the same level as the server. There were serious issues here in the past but those were when Sun and Oracle were separate. We had compatibility issues when servers were on Java 5 and workstations upgraded to Java 6 and it looks like we may be having the same problems between Java 6 and Java 7.
    I tend to notice far fewer problems in corporate environments when IT departments manage the versions of Java on their servers and workstations rather than let it auto upgrade.
    It was me who uncovered a bug in 11.1.1.6 where the Java 7 JDK was not working. Since then Oracle issued a Discoverer patch to allow it to work with Java 7 so for users of 11.1.1.6 you should be OK now to go ahead and allow Java to upgrade. Mind you, if the same workstations need to connect to Forms or E-Business Suite the advice given earlier to not upgrade stilll applies - that is unless someone knows otherwise.
    Best wishes
    Michael

  • Sending udp packets using java and receiving it using c

    hi,
    Is it possible to send udp packets using java and receive the same using c??????? if yes.... plz help immediately.

    The biggest issue is data format. The JVM is big endian, with 16-bit characters. The machine running 'C' could be almost anything. A (signed!) byte array is probably the easiest unit of exchange.
    The Java program has its own techniques for storing/retrieving data to/from the byte array - and the C program has its own techniques. ASCII Strings are often the easiest to exchange - just convert the java String objects to byte array and send them.
    apaliwal1 has already given the UDP calls to send/receive the data.

  • Win7 Firefox 3.6.13 - I'm using remotely Anywhere (9.0 or later). Is there a plugin (that compares to ActiveX/Java) that Firefox can use other than HTML screen shots?

    Just trying to get rid of MS stuff. I like Firefox much better

    Your above posted system details show outdated plugin(s) with known security and stability risks.
    *Shockwave Flash 9.0 r999
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/
    In Firefox 3.6 and later versions you need the Next-Generation Java™ Plug-In present in Java 6 U10 and later (Linux: libnpjp2.so; Windows: npjp2.dll).
    http://java.com/en/download/faq/firefox_newplugin.xml
    See also http://java.sun.com/javase/6/webnotes/install/jre/manual-plugin-install-linux.html

  • Customized about:blank pages (for use with stylish firefox extension)

    i just made a couple of new archlinux about:blank pages and i thought i would share
    1 . 
    http://userstyles.org/styles/14090
    Last edited by tjwoosta (2009-01-24 23:18:52)

    2. http://omploader.org/vMTY0dg
    http://www.filefactory.com/file/a038c8a … larger.txt

  • Using java beans in jsp using tomcat

    hi i have made a form to enter user first name and last anme with html and then i have made a value javabean in which i want to store the information filled bu user. i want to display the information stored in java bean in jsp page i have made the full application and i have made class file of java bean as well as jsp file but when i try to run this web application in tomcat i am getting class not found exception.
    could anybody tell me that where i should store the bean class in tomcat and do i need to make any package in which i have to place my java bean file plz tell me complete procedure along with code if possible

    whew thats a lot of questions... All of this is pretty basic stuff. I would recommend you take a look at the web services tutorial: http://java.sun.com/j2ee/1.4/docs/tutorial/doc/
    lets see.
    Starting a package name with com is just a generic standard which is followed.
    It is most correct when creating commercial packages to create packages like com.companyName.project
    http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html
    You should not need a page import directive unless you are using classes in scriptlets: ie <% %> tags in your JSP. Your jsp:useBean tag will automatically import necessary classes - you don't need to import classes for beans specifically
    <jsp:useBean id="myClass" scope="session" class="com.myPackage" />
    Your directory structure should be something like this
    webApplicationRootDirectory
    - page1.html
    - page2.html
    - page3.jsp
    - page4.jsp
    - WEB-INF
         - web.xml
         - classes
           - com
             - myPackage
               - myClass.classerrrm. Thats about it I think.

  • Socket reading: hanging when using java, but OK when using javaw

    Tested and experienced on:
    Windows 2000 Workstation, Windows XP SP1
    jdk build 1.4.1_02-b06, build 1.4.2_04-b04
    My app is a GUI application. I am creating a socket like this:
    Socket socket = new Socket();
    socket.connect(new InetSocketAddress(proxy_host, Integer.parseInt(proxy_port)), 8000);
    BufferedReader in =
      new BufferedReader(
      new InputStreamReader(socket.getInputStream()));
    PrintWriter out =
      new PrintWriter(
       new BufferedWriter(
        new OutputStreamWriter(socket.getOutputStream())),true);
    String request = "GET url HTTP/1.1\r\n" +
                     "Accept: *\r\n" +
                     "Host: host\r\n" +
                     "Cookie: " + sessionCookie + "\r\n" +
                     "User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0; YComp 5.0.0.0)" + "\r\n" +
                     "Content-type: application/x-www-form-urlencoded" + "\r\n\r\n";
    out.print(request);
    out.flush();
    String str = "";
    while((str = in.readLine()) != null)
    socket.close();I am reading a HTML document from server. If I use the call
    java -jar MyJar.jar
    the reading starts hanging by reading the list line of the document. By call
    javaw -jar MyJar.jar
    all is fine. What could be the problem. I am really perplexed!

    Sounds like perhaps a timing issue. But a bigger issue is why aren't you simply using the higher-level java.net.URL, HttpURLConnection classes? You're reinventing the wheel here by writing low-level socket calls with HTTP protocol strings.

  • Read an excel file using java code

    Hi,
    I want to create an excel file on the client machine based on the personal details entered on the web page. And I want to save the file on the client machine in the form of CSV. Then I want to read the contents of the spreadsheet using Java Code from the using servlets. Can I read the contents of the file directly from the client machine or do i need to save the file on the server and then read the contents of it. Please help me solve this.

    Hi,
    I want to create an excel file on the client machine
    based on the personal details entered on the web
    page. And I want to save the file on the client
    machine in the form of CSV. Then I want to read the
    contents of the spreadsheet using Java Code from the
    using servlets. Can I read the contents of the file
    directly from the client machine or do i need to save
    the file on the server and then read the contents of
    it. Please help me solve this.As stated I am rather certain that is impossible.
    Servers don't access the file systems of client machines.

  • Why should I use Java

    HI,
    Someone asked me why are you using Java when you can use Visual Basic.
    Well, I ask this question in this forum ?? why ...
    please leave out the portablity part
    --j                                                                                                                                                                                                                                                                                                                                                   

    Well, here is my 2 cents, as it were. I tried learning VB, and found that while it is powerful, when it comes to designing specifically for Windows systems, I found it extremely hard to understand. When I first learned Java, it didn't take me long to understand the concept and relation of classes and objects, and I was writing Swing apps in no time. With VB, it wasn't that easy. Yes, it was mostly drag and drop and add a few lines of code, but I don't like that. I like to be able to get down into the code and see why it works the way it did, and with VB, I just couldn't grasp it. But with Java, it took me no time at all to be able to understand why it worked the way it did, and because of that, I will always choose Java over any other language, except maybe Miva Script, which is a server side language used for e-commerce websites. It was another language that was easy to learn. Does this mean I'm a lazy programmer, always taking the easy way out? Probably, but if it's easy for me to learn, it's easy for me to implement.
    James

  • How to create plugin in Adobe InDesign -CS5 using java?

    Hi,
    1.I want to create  new plugin in adobe in design CS5 using java .is it possible using java???Is any one know about  this please help me on this..

    Short answer: No, it isn't possible. The only available option is C++ development in most cases.
    Longer answer: It is possible to develop solutions with Java, depending on circumstances. The only available and truly sensible option is through InDesign Server which exposes InDesigns' scripting API to Java. Keep in mind that it us unavailable for desktop version of the product, and also, that it won't be a plugin, only scripting solutions. This means that you are given access to rather high-level API, and many details are removed. This may or may not be acceptable, depending on what exactly you want to achieve. Sometimes it is possible to avoid integration with Java at all.

  • Dial-up using Java ..

    Is it possible to communicate with a modem (on a COM port) using Java ? I'm trying to get a VPN connection to a server setup by dialing-in to it (sort of like Hyperterminal or Dial-up Networking in Windows) Is this possible with the new communications API ?
    Thanks.

    Is it possible to communicate with a modem (on a COM port) using Java ?
    Yes with useing jni
    Is this possible with the new communications API ?
    Dont know I am not that familar with the new communications API you would have to go take a look and see

  • FTP progarm using JAVA

    I need to fetch the files from Linux server through ftp using java. I am using the following package.
    org.apache.commons.net.ftp.*
    FTPClient class has the features like makeDirctory ,disconnect and so on.
    But, FTPClient class can not be recognizable. How can I make this cass as recognizable?

    Cross-post
    http://forum.java.sun.com/thread.jspa?threadID=639588&tstart=0

Maybe you are looking for

  • Time Machine doesn't see the WD Hard drive attached to the Extreme Base Sta

    All of a sudden I can't get Time Machine to recognize the drive that's been attached to the Base Station. It doesn't show up in Browse other time machine disks or, when I go to choose a back up disk. What's going on?

  • TV OUT Problem this is how I solved.

    Well, first of all I cannot  guarantee if this will work for all people with tv out problems. TV with PC I think will always be a BIG headache . How I did fix my TV OUT problem. Since I live here in Brazil, people have a problem with the system that

  • How can you view dvds through airplay?

    I just unsuccessfuly tried to play 3 dvds using Airplay via Apple TV. They displayed perfectly and behaved normally using the CD Player on my MacBookPro but would not display when I connected via Airplay to my TV. Why is this? Can I fix it?

  • Radio Buttons in Design Studio

    Hi Experts,     Am new to Design Studio, I am middle of creating dashboard. here i have to use radio button which shows Value and Quantity. where as if i select value as  a radio button then my dash board should show only respective Graph and Cross T

  • I reseted my mac and I'm trying to get my keychain back

    I reseted my mac and I'm trying to get my keychain back but they send me a code to my phone. My phone was stolen so I don't know what to do I tried changing the number on my apple account but it didn't work