port currently owned by unknown windows application

T

tolu45

Dear All,

I have a problem with a code i am developing. I am trying to print the
result of a JList to a printer. I followed the example in the java
cookBook using CommAPI but when i try to print, i get the following
exception "port currently owned by unknown windows application". Can
anybody help by telling me how to solve this problem or how to go
around it. I have put a listener and set the waiting time to 30000sec
even at that, i never get the ownership of the port.

regards,
Noah.
 
J

JScoobyCed

tolu45 said:
Dear All,

I have a problem with a code i am developing. I am trying to print the
result of a JList to a printer. I followed the example in the java
cookBook using CommAPI but when i try to print, i get the following
exception "port currently owned by unknown windows application". Can
anybody help by telling me how to solve this problem or how to go
around it. I have put a listener and set the waiting time to 30000sec
even at that, i never get the ownership of the port.

regards,
Noah.

I guess the windows driver is having the owership of the printer. Try
deleting the printer from your list of windows printers.
 
T

tolu45

I am not sure if you are talking about the physical printer. If you
are, i can't delete it because i have only one network printer
installed.If i delete it how do i print?. If you are talking about the
software i create a new instance each time i want to print.

Thanks
 
T

Thomas Weidenfeller

tolu45 said:
I have a problem with a code i am developing. I am trying to print the
result of a JList to a printer. I followed the example in the java
cookBook using CommAPI

How does that match with your later statement:

You either have a physically connected printer, then JavaComm (you are
talking about JavaComm when you say CommAPI?) is a way to print to it
(but possibly the worst one can come up with), or you have a remote
printer. In the later case, JavaComm has no way to reach it at all.

You probably want to have a look at the real printing APIs in Java
instead of messing with JavaComm.

/Thomas
 
R

Roedy Green

I have a problem with a code i am developing. I am trying to print the
result of a JList to a printer. I followed the example in the java
cookBook using CommAPI but when i try to print, i get the following
exception "port currently owned by unknown windows application". Can
anybody help by telling me how to solve this problem or how to go
around it. I have put a listener and set the waiting time to 30000sec
even at that, i never get the ownership of the port.

That is not the way you would normally print, unless you were using
some specialised printer not supported by the OS. See
http://mindprod.com/jgloss/printing.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top