DOMNotSupportedException in com.sun.java.browser.dom.* classes

I'd like to enable an applet to modify the DOM in a browser window directly (ie. by using org.w3c.dom.* stuff). I'm using the latest 1.5.
I'm using a small class that I've pasted below to attempt to facilitate this. It evidently works in MSIE, where I receive the "Got document" message indicating a non-null value for 'page', but in Mozilla or Netscape, I get the following exception thrown:
netscape.javascript.JSException
     at netscape.javascript.JSObject.getWindow(Unknown Source)
     at sun.plugin.dom.DOMServiceProvider.getDocument(Unknown Source)
     at sun.plugin.dom.DOMAccessor.getDocument(Unknown Source)
     at econ.ClientLink.run(ClientLink.java:35)
     at sun.plugin.dom.DOMService.invokeLater(Unknown Source)
     at econ.ClientLink.start(ClientLink.java:25)
     at sun.applet.AppletPanel.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)
com.sun.java.browser.dom.DOMUnsupportedException
     at sun.plugin.dom.DOMServiceProvider.getDocument(Unknown Source)
     at sun.plugin.dom.DOMAccessor.getDocument(Unknown Source)
     at econ.ClientLink.run(ClientLink.java:35)
     at sun.plugin.dom.DOMService.invokeLater(Unknown Source)
     at econ.ClientLink.start(ClientLink.java:25)
     at sun.applet.AppletPanel.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)
Got document: null
Is this just simply only supported for MSIE? This seems highly unlikely.
I suspect it might have something to do with permissions in Mozilla, as these lines also appear in the log:
liveconnect: the url of the applet is http://word and the permission is = false
liveconnect: JavaScript: calling Java system code
liveconnect: JavaScript: default security policy = http://word
I haven't yet found anyone who could explain them. I'd like to try playing with permissions, buy I don't know how to do so. Any suggestions?
--- code follows ---
import javax.swing.*;
import java.applet.*;
import org.w3c.dom.*;
import com.sun.java.browser.dom.*;
public class ClientLink extends JApplet implements DOMAction {
DOMService service;
Document page;
public void start() {
try {
service = DOMService.getService(this);
System.out.println("Got service.");
service.invokeLater(this);
catch (Exception e) {
e.printStackTrace();
public Object run(DOMAccessor doma) {
System.out.println("Entry successful.");
try {
page = doma.getDocument(this);
System.out.println("Got document: "+page);
catch (Exception e) {
e.printStackTrace();
System.out.println("Error: "+e.toString());
return null;
}

A couple of things I've found with DOMService and/or LiveConnect and the more recent java and browser releases :
1) You probably need to edit your java.policy file to grant permissions since the security in Java is now managed independently from the browser
2) You need to remember to have mayscript="true" in your applet tag
3) JSObject's dont work unless you've called JSObject.getWindow(...) first.
4) Many legitimate java exceptions will appear misleadingly as security exceptions

Similar Messages

  • Class not found com/sun/java/util/collections/list

    hi
              i am trying to execute the following:
              java weblogic.jspc -d c:\weblogic\classes -keepgenerated
              printAllParameters
              and get the follwoing message:
              class not found com/sun/java/util/collections/list
              any suggestions?
              thanx
              

    Try it like this:
              java weblogic.jspc -d c:\weblogic\classes;c:\weblogic\lib\weblogicaux.jar ...
              Melrose Public Library <[email protected]> wrote:
              > hi
              > i am trying to execute the following:
              > java weblogic.jspc -d c:\weblogic\classes -keepgenerated
              > printAllParameters
              > and get the follwoing message:
              > class not found com/sun/java/util/collections/list
              > any suggestions?
              > thanx
              Dimitri
              

  • Report cannot be rendered (com/sun/java/util/collections/Iterator)

    Hello all
    I'm new both to Weblogic Server and BI Publisher.
    A few days ago I thought that I managed to install BI Publisher on top of Weblogic. It turns out to be untrue because I am not able to view any report, being it a sample or a newly created one.
    Platform: Windows 2003 32-bit
    Weblogic version: 10.3.3.0
    BI Publisher version: 10.1.3.4.1 (doesn't work both w/ and w/o the latest patchset 9791839)
    And now to the problem. Whenever I try to view a report, I get an error message stating "The report cannot be rendered because of an error, please contact the administrator". Being both the user and the administrator, I am forced to press the "Error Detail" link, upon which the only thing that pops below is "com/sun/java/util/collections/Iterator" (in red).
    The same non-verbose error message appears also when running in debug mode. Weblogic logs are empty from warnings, errors, etc.
    As for the Weblogic Server, it claims that the xmlpserver application has been deployed and started successfully.
    It seems to me that the BI Publisher application is trying to use java class that doesn't exist (com.sun.java.util.collections.Iterator). Of course I have no clue how to prove that because I do not have the source code for this app.
    Oracle support is hardly able to understand the problem, so I thought maybe one of you could give me some answer.
    Any Ideas?
    Jonathan

    By the way, I deployed the app under Oracle Report's cluster. Don't know whether it matters.

  • ResourceEntityResolver.java referencing com.sun.java.util.collection

    Im trying to compile the WL5.1 ResourceEntityResolver.java class but it is
    referencing com.sun.java.util.collection package. Where can I find this
    package?

    This can be an issue when using Tomcat and upgrading version of Mojarra.
    Tomcat will store a file with the extension of .ser in the work directory. This file contains the names of the ServletContextListener instances
    that need to be invoked when the application is next started. The problem is that if they use the values in that file and the listeners don't
    exist, they don't rescan the application to rebuild the .ser, they just fail.
    The way to fix this is to search for .ser files in your web container's work directory and the ones for the web application in question.

  • Com.sun.java package

    Hi,
    What is the different between javax.swing and com.sun.java.swing package ? Are they the same ?
    Where can I download com.sun.java.swing package ?
    Regards,
    Lim Boon Sun

    The official Sun statement is that one should only use the classes listed in the APIs, i.e. javax.swing.*. Classes in packages such as com.sun.* contain version dependent implementations and are subject to change without notice. So, if you use them in your programs, it is very likely that your programs will not run under future (and previous) versions of the JRE.
    So, just like the other fellow said, STICK TO THE javax.swing.* packages !

  • Package com.sun.java.swing not found in import

    I'm trying to show graphic information but the swing package does not load up don't know what is going on Any help is welcome
    THIS IS THE LINE I GET WHEN I TRY TO IMPORT SWING
    Package com.sun.java.swing not found in import

    I'm trying to show graphic information but the swing
    package does not load up don't know what is going on
    Any help is welcome
    THIS IS THE LINE I GET WHEN I TRY TO IMPORT SWING
    Package com.sun.java.swing not found in importThat's an old package reference. Try javax.swing

  • Jdk1.3.1 'com.sun.java.swing does not exist'???

    Thats what the compiler tells me, though it finds javac with no problem in the
    jdk1.3.1 lib directory. Any clue to what I'm missing here? Thanks nt

    Swing used to be in the com.sun.java.swing package in the very earliest releases, but now it is in the javax.swing package.

  • Com.sun.java.swing.*; ??

    I have notice these class references in a couple of sample programs.
    Do these come with every installation of the jre. I have 1.4 install
    and when i reference these library..I am told they don't exist..
    What are they ??
    Where do they come from ??
    How do I get them running in my apps.
    aj

    Anything in the
    sun.*
    and
    com.sun.*
    should not be used directly by you (unless the API's say so), yes the L&F's live in this name space, as does the native bits of Java and the basic implementations of stuff you can only get at via factorys but you still should not use them (unless you are going via the factory, and then you should never rely on it being the same between JREs).

  • Error "cannot access com.sun.java..."

    edit i mistyped in the topic name, i mean to say "com.sun.j3d..."
    I've set myself up using JCreator, installed j3d, j2sdk, and jdk. Tried a few test programs to make sure everything was working (a basic hello world and my chess game i created my junior year in highschool). It was all running fine.
    So i started reading into j3d tutorials, and came across the HelloUniverse sample program. I slapped the code in and compiled it, only to be met with:
    "cannot access com.sun.j3d.utils.applet.MainFrame".
    I commented out the import line that included this, compiled, and it gave me another message complaining about the same thing, only this time ending in:
    "...geometry.ColorCube"
    Obviously, its just running down the line with all of the j3d imports, so i ran through and reinstalled all my j3d files; still didnt work. I can't figure out what's wrong with it. Please help.
    Message was edited by:
    philjoh

    May be, it is not getting the class it is pointing to, in your classpath. Have u put jaxrpc-ri.jar in your classpath, since this jar contains ur class?
    Regards,
    - Tinu

  • Com.sun.java.swing package not found

    All my other programs compile fine if they're not using that package

    yea...wrong import....
    use
    import javax.swing.*;notice the X

  • Looking for com.sun.xml.tree package

    Hi,
    I�m looking for a jar which contains the XmlDocument class to download.
    I found the package, (it�s com.sun.xml.tree) but I cannot find where the package/jar is to download it.
    Your help will be much appreciated.
    Thank you,
    Chris

    I have all latest jars (jaxp, xerces, xalan, jdom, dom4j and any related jars). I have w3c DOM and i have been trying to convert it to JDOM and dom4j using relevant APIs. i keep getting following error.
    Exception in thread "main" java.lang.AbstractMethodError: com.sun.xml.tree.Eleme
    ntNode.getNamespaceURI()Ljava/lang/String;
    at org.dom4j.io.DOMReader.readElement(DOMReader.java:181)
    at org.dom4j.io.DOMReader.readTree(DOMReader.java:106)
    at org.dom4j.io.DOMReader.read(DOMReader.java:88)
    Can you advise what could be the reason and how to resolve this?
    FYI : my w3c DOM has been created with com.sun.xml.tree.XmlDocumentBuilder class and other methods of the package. I need to resolve this error at earliest to move forward.
    I would apprecaite early response at [email protected]
    Thanks,

  • In what jar is: com.sun.activation.registries.MailCapFile located?

    I am attempting to implement JavaMail in an application in an OS400 environment. I simply want to send a text message (no attachements). My code works up to the point of: Transport.send(message); where I get a NoClassDefFound: com/sun/activation/registries/MailCapFile
    Here's the code:
    private void sendEmail(String recipient,String msg){
         String smtpSvr = "xxx.yyyyyyyyy.com";     
         String subject = "Log Transfer Errors";
         String from = "[email protected]";
         Properties p = System.getProperties();
         p.put("mail.smtp.host",smtpSvr);
         Session mailSession = Session.getDefaultInstance(p,null);
         Message message = new MimeMessage(mailSession);
         try {
         message.setRecipients(Message.RecipientType.TO,InternetAddress.parse(recipient));
         message.setFrom(new InternetAddress(from));
         message.setSubject(subject);
         message.setContent(msg,"text/plain");
         Transport.send(message);
         } catch (AddressException e) {
              System.out.println(""+e);
         } catch (MessagingException e) {
              System.out.println(""+e);
         } catch (Exception e) {
              System.out.println(""+e);
    I have JavaMail working fine in a servlet running in WebSphere 5.0 on the same OS400 v5r2.
    Do I need to add another jar file to my CLASSPATH?? Don't know in what jar the:
    com.sun.activation.registries.MailCapFile class is in????

    From its name I would guess that it's in "activation.jar". In fact looking in that file on my AS/400, it IS in activation.jar. You must have missed the instructions that you would need that for JavaMail to work properly. You can get it here:
    http://java.sun.com/products/javabeans/glasgow/jaf.html

  • Com.sun.* Not Found only in NetBeans - Javac finds them fine!

    I am not sure what is up with this, but NetBeans will not let me specify anything from the com.* packages. It shows the packages in the auto-type boxes as I type in the name (com.sun.blahblahblah) but highlights the statement with a red underline and states 'Package not found".
    Just to let it be known, I have a look-and-feel demo java file downloaded from the net that compiled perfect and runs as expected, and it makes much use of the com.sun.* packages. And I can run NetBeans with the --laf command line option and it will run using any of the LAF's in the com.* packages itself, but still not see them in the IDE for coding use ><
    Any ideas?
    Thanks in advance.

    I just popped in what you wrote, and another thing just for giggles:
    import com.sun.image.codec.jpeg.JPEGImageEncoder;
    import com.sun.crypto.provider.*;and they threw no errors. Why is it that my laf is throwing errors when they are plainly there?
    Example -
           public void actionPerformed(ActionEvent event) {
             try {
               UIManager.setLookAndFeel(getText());
               SwingUtilities.updateComponentTreeUI(
                 ChangingLaF.this);
               // call myFrame.pack()
               // to resize frame for laf
             } catch (IllegalAccessException e) {
               // insert code to handle this exception
             } catch (UnsupportedLookAndFeelException e) {
               // insert code to handle this exception
             } catch (InstantiationException e) {
               // insert code to handle this exception
             } catch (ClassNotFoundException e) {
               // insert code to handle this exception
             }This is the code I got off the net, this + a bit more to the .java file of course, compiles perfect with javac. The programmer used the package path com.sun.blahblah as the radiobutton text, that is what the UIManager.setLookAndFeel(getText()); getText() nonsense is. But other than that I see no reason an erro should be thrown in netbeans over UIManager.setLookAndFeel(com.sun.java.swing.plaf.motif.MotifLookAndFeel);
    I did try it with quotes though as a previous post recomended and got this message:
    init:
    deps-jar:
    Compiling 1 source file to E:\Java Apps\Calendar\build\classes
    E:\Java Apps\Calendar\src\Main\MainFrame.java:283: unreported exception java.lang.ClassNotFoundException; must be caught or declared to be thrown
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
    1 error
    BUILD FAILED (total time: 0 seconds)
    <

  • Re: com.sun.faces.config.ConfigListener not found

    I am using Tomcat 4.1.24 and got the demos from EA4 working. Now I am getting an error in my own JSF WAR file about com.sun.faces.config.ConfigListener class cannot be found.
    What jar file would I be missing?
    Thank you.

    Hi All,
    I am facing the same problem on TOmcat 4.0. I copied the jsf-ri.jar from war file/lib to tomcat_home/common/lib and the problem was resolved. Can anyone from Sun address this issue please as to why this is so?
    Also, now the container is not able to access the Faces Servlet. I should mention here that this does not work only when deployed as a war file.
    regards,
    piyu

  • Moving from com.sun.xml classes to the new xml support integrated in java

    So far, for our XML implementation, we have used the DocumentEx, ElementEx, etc. from com.sun.xml.
    We understand that xml is now supported by the java itself (javax.xml.parsers?) and we wish to update our code to use the newer API.
    Is there a simple mapping between the old DocumentEx and ElementEx and new classes in javax.xml? Can it really be simple to "get rid" of com.sun.xml?

    The combination of the:
    Oracle XML SQL Utility
    and
    Oracle XML Parser for PLSQL V2
    give you what you need.
    null

Maybe you are looking for

  • Sync From iPhone 4 to MacBook Pro?

    I had my MacBook stole and did not back up my stuff i.e music, contacts calender.. Is the any way i can sync from my iPhone to my MacBook Pro? I dont wanna loose 1900+ Songs and contacts .. Any help would be good!

  • Can you meet this kind of requirement

    i wanna realize the following layout in alv. |       |--||-- |   header |--||-- |   item |--||-- | Anybody have any idea, please tell me thank you in advance Message was edited by:         Kevin Gao

  • Install client for two different oracle versions

    hello, right now I'm involved in two different projects, which work with Oracle 9i and 10g, and I need to access both databases from the same computer. My question is if it's possible to install the client software for both versions without problems.

  • BEx general question

    Hi All, At present  our client SAP system is BW 3.x. and we have BEx related to that. and ou client Sand Box system is having SAP BI 7.0.and from this Sandbox, when giving rrmx transaction it is showing BEx 3.x version only. because BI 7.0 bex is not

  • Webdynpros available in which SAP version?

    Hi All, Can any one tell me from which version of SAP we have webdynpro's available ? Thanks, Jagadam