• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

java.lang.IllegalAccessError: tried to access field

 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

i have a little application which uses htmlunit.
but htmlunit is extremly slow so i thought i download the source, change the code in htmlunit where the httpclient is created and use it in my app (i know that the httpclient is much faster sending POST than the htmlunit, but htmlunit has js support, thats the reason why i use htmlunit and not only httpclient)
the httpclient is in a file called HttpWebConnection.java
private AbstractHttpClient httpClient_;

so i thought i change it to public, and access it:
response = conn.httpClient_.execute(httppost);

but now i get an error:
Exception in thread "Thread-3" java.lang.IllegalAccessError: tried to access field com.gargoylesoftware.htmlunit.HttpWebConnection.httpClient_ from class Groove.Client
at Groove.Client.sendRequest(Client.java:419)
at Groove.Client.getShort(Client.java:454)
at Groove.Client.connect(Client.java:200)
at Groove.Client.getInstance(Client.java:89)
at Groove.browser.GrooveView$6.run(ClientView.java:332)

what does that mean?
i also tried it with a getter method but i get the same error
 
Bartender
Posts: 1849
15
Eclipse IDE Spring VI Editor Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Seems to me this might be too difficult for a beginner forum. Let's see if you get more responses in the general forum...
 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What i can think of is jar file or the classes loaded at runtime. It may still refer to the old classes. As you have changed the code, please check whether only the modified classes are loaded at runtime
 
olze oli
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks alot! you have been right, i forgot to delete the .jar
its working now, thanks
 
I’m tired of walking, and will rest for a minute and grow some wheels. This is the promise of this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic