[jdom-interest] java.lang.IllegalAccessError

Alex Rosen arosen at silverstream.com
Mon Jun 3 16:07:27 PDT 2002


In Java, any class in the same package can access a protected method. So
this call should be perfectly legit. No idea why it would complain. I assume
this is IBM's VM that it's running on - it's not a pre-release version or
anything is it?

Alex

> -----Original Message-----
> From: jdom-interest-admin at jdom.org
> [mailto:jdom-interest-admin at jdom.org]On Behalf Of Jan van de Sandt
> Sent: Saturday, June 01, 2002 5:11 PM
> To: jdom-interest at jdom.org
> Subject: [jdom-interest] java.lang.IllegalAccessError
>
>
> Hello,
>
> I'm using JDOM beta 8 in combination with WebSphere 4.0.3 and I get an
> java.lang.IllegalAccessError when I call the Document
> constructor with an
> element as the argument.
> When I look at the source this error this seems logical because the
> setDocument method of the Element class is protected. So this method
> should only be accessible by subclasses of Element and not by the
> ContenList class.
> The stack trace:
>
> Original Exception:
> Error Message: org.jdom.ContentList tried to access method
> org/jdom/Element.setDocument(Lorg/jdom/Document;)Lorg/jdom/Ele
> ment;Error Code: 500
> Target Servlet: null
> Error Stack:
> java.lang.IllegalAccessError: org.jdom.ContentList tried to
> access method
> org/jdom/Element.setDocument(Lorg/jdom/Document;)Lorg/jdom/Ele
> ment;     at org.jdom.ContentList.add(ContentList.java:221)
>      at org.jdom.ContentList.add(ContentList.java:146)
>      at java.util.AbstractList.add(AbstractList.java:101)
>      at org.jdom.Document.setRootElement(Document.java:212)
>      at org.jdom.Document.<init>(Document.java:116)
>      at org.jdom.Document.<init>(Document.java:131)
>
>
> Has anybody experienced this problem before and should the setDocument
> method not be friendly instead of protected ?
> Thanks in advance,
>
> Jan.
>
>
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/yo
uraddr at yourhost.com




More information about the jdom-interest mailing list