Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
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
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Beginning Java
Cannot make a static reference to the non-static method
Michael Piaser
Ranch Hand
Posts: 92
posted 8 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I can't figure out what this error message "Cannot make a static reference to the non-static method getEndUserCharge(long, long, long, long) from the type UpdateUserWS" actually means.
The error is coming from:
public void updateDetailsPackage() { some unrelated code long zero=0; double endUserCharge=0; endUserCharge = UpdateUserWS.getEndUserCharge(long zero, long zero, long zero, long zero); <-------- error is here System.out.println("OrderManager (voxportal): updateDetailsPackage=, charges="+endUserCharge); } [\code] In UpdateUserWS: [code=java] public double getEndUserCharge(long parm_User, long parm_Portal, long parm_Package, long parm_Flow) { System.out.println("UpdateUserWS (voxportal): getEndUserCharge: parms user="+parm_User+", portal="+parm_Portal+", package="+parm_Package+", flow="+parm_Flow); double number=0; ClientResponse clientResponse = webResource.path("api").path("user").path("update").path("getUserCharges"). queryParam("parm_User", currentUser.getCurrentAccount().getToken()). queryParam("parm_Portal", securityWS.codePortal().toString()). queryParam("parm_Package", String.valueOf(parm_Package)). queryParam("parm_Flow", String.valueOf(parm_Flow)). accept("application/json").get(ClientResponse.class); status = clientResponse.getStatus(); //if token doesn't exist or it's wrong, logout if (status == VoxportalWS.CLIENT_TOKEN_INVALID) { redirect(); } else if (status == SUCCESSFUL) { number= clientResponse.getEntity(double.class); } System.out.println("UpdateUserWS (voxportal): getEndUserCharge: returning="+number); return number; }
Henry Wong
author
Posts: 23951
142
I like...
posted 8 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Basically, the getEndUserCharge() method is *not* a static method. You need to call it with an instance of an UpdateUserWS class.
Henry
Books:
Java Threads, 3rd Edition
,
Jini in a Nutshell
, and
Java Gems (contributor)
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Server error 500
Map<Integer, String> or String[] ?
Make a runnable jar of my project in Eclipse
re: Getting error on @Post of a client form
Accessing fields in a bean within a bean
More...