Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2007

Tip: Looking for answers? Try searching our database.

Cannot access with modifier error.

Thread view: 
wooks - 19 Jan 2007 22:49 GMT
I get this error when I try to instantiate the class coded below. Can
anybody help.

IllegalAccessException: Class
koala.dynamicjava.interpreter.context.GlobalContext can not access a
member of class url.DnldURL with modifiers ""
 at sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
 at java.lang.reflect.Constructor.newInstance(Unknown Source)

package url;

import java.io.*;
import java.net.*;

public class DnldURL {
   private DataInputStream URLData;

   DnldURL() throws IOException {

       try {
           URLData = new DataInputStream(new BufferedInputStream(
               new URL("someurl.com" ).openStream()));

       }
       catch (MalformedURLException mue) {
           System.out.println("Ouch - a MalformedURLException
happened.");
           mue.printStackTrace();
           System.exit(1);
       }
   }

//_________________________________________________________________________________

   public DataInputStream getURLData() {
       return URLData;
   }
}
Paul Hamaker - 20 Jan 2007 09:49 GMT
You forgot to make the constructor public.
--
http://javalessons.com  Paul Hamaker, SEMM
Teaching ICT since 1987


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.