+ Start a Discussion


When I use the Eclipse workbench and run my java application, I can log in to Salesforce.com, query records and update the records.

When I attempt to execute my java application at the DOS prompt, I receive the following:

Exception in thread "main" java.lang.IllegalAccessError: tried to access field c
om.sforce.soap.enterprise.QueryResult.records from class com.weiler.UpdateFrontE
        at com.weiler.UpdateFrontEndTest.UpdateFrontEndTest.VerifyAccount(Update
        at com.weiler.UpdateFrontEndTest.UpdateFrontEndTest.<init>(UpdateFrontEn
        at com.weiler.UpdateFrontEndTest.UpdateFrontEndTest.main(UpdateFrontEndT

I am using Eclipse 3.0.1.  My java environment is - java version "1.4.2_04".

I noticed that when I create a new java project in Eclipse and I add the com.sforce.soap.enterprise package, to compile my application, I have to change the QueryResult.java to public.

The line that Eclipse is forcing me to change from private to public is:

   public com.sforce.soap.enterprise.sobject.SObject[] records;

Any ideas is appreciated.



Mike Schumacher

you should be using the generated getRecords method instead of changing the visibility of the records field.


Thanks.   I change the 'if' test back to   if (qr != null).   My application now works in Eclipse and in my command window.

I checked the quickstart.java and the example it used was if (qr != null).  I have to guess that while I was learning my way around Java and the salesforce.com APIs, I made a change and then never got back to testing it in the command window.

Thanks for the quick turnaround on the answer.

Mike Schumacher