Good Day All,
I have made progress and the following code works a treat and get the list of printers, Thanks!
However this does not:
I don't understand this at all what a constructor is, here is the definitions and below is the full error message, thanks again.
----------------------------------------------
Constructor Summary
CupsPrinter(java.net.URL printerURL, java.lang.String printerName, boolean isDefault)
Constructor
-----------------------------------------------
getJobs
public java.util.List<PrintJobAttributes> getJobs(WhichJobsEnumwhichJobs,
java.lang.Stringuser,
booleanmyJobs)
throws java.lang.Exception
Get a list of jobs
Parameters:
whichJobs - completed, not completed or all
user - requesting user (null will be translated to anonymous)
myJobs - boolean only jobs for requesting user or all jobs for this printer?
Returns:
job list
Throws:
java.lang.Exception
------------------------------------------------
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: Constructor not found.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:119)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
at anywheresoftware.b4j.object.WebSocketModule$Adapter$1.run(WebSocketModule.java:126)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
at anywheresoftware.b4j.object.WebSocketModule$Adapter$ThreadHandler.run(WebSocketModule.java:191)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: Constructor not found.
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:491)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:437)
at b4j.example.printgenero._page_parseevent(printgenero.java:365)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
... 10 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Constructor not found.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:119)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:482)
... 17 more
Caused by: java.lang.RuntimeException: Constructor not found.
at anywheresoftware.b4j.object.JavaObject.InitializeNewInstance(JavaObject.java:94)
at b4j.example.printgenero._getprintjobs(printgenero.java:289)
at b4j.example.printgenero._printjobs_clicked(printgenero.java:446)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
... 18 more
I have made progress and the following code works a treat and get the list of printers, Thanks!
B4X:
Dim cups As JavaObject
cups.InitializeNewInstance("org.cups4j.CupsClient",Array(ABMShared.myServerAddress,631))
Dim myPrinters As List
myPrinters = Regex.Split(",",cups.RunMethod("getPrinters", Null))
However this does not:
B4X:
Dim cups As JavaObject
cups.InitializeNewInstance("org.cups4j.CupsClient",Array(ABMShared.myServerAddress))
Log(cups.RunMethod("CupsPrinter.getJobs", Array("ALL",Null,True)))
I don't understand this at all what a constructor is, here is the definitions and below is the full error message, thanks again.
----------------------------------------------
Constructor Summary
CupsPrinter(java.net.URL printerURL, java.lang.String printerName, boolean isDefault)
Constructor
-----------------------------------------------
getJobs
public java.util.List<PrintJobAttributes> getJobs(WhichJobsEnumwhichJobs,
java.lang.Stringuser,
booleanmyJobs)
throws java.lang.Exception
Get a list of jobs
Parameters:
whichJobs - completed, not completed or all
user - requesting user (null will be translated to anonymous)
myJobs - boolean only jobs for requesting user or all jobs for this printer?
Returns:
job list
Throws:
java.lang.Exception
------------------------------------------------
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: Constructor not found.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:119)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:77)
at anywheresoftware.b4j.object.WebSocketModule$Adapter$1.run(WebSocketModule.java:126)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
at anywheresoftware.b4j.object.WebSocketModule$Adapter$ThreadHandler.run(WebSocketModule.java:191)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: Constructor not found.
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:491)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:437)
at b4j.example.printgenero._page_parseevent(printgenero.java:365)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
... 10 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Constructor not found.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:119)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:482)
... 17 more
Caused by: java.lang.RuntimeException: Constructor not found.
at anywheresoftware.b4j.object.JavaObject.InitializeNewInstance(JavaObject.java:94)
at b4j.example.printgenero._getprintjobs(printgenero.java:289)
at b4j.example.printgenero._printjobs_clicked(printgenero.java:446)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
... 18 more