Refresing the Printer Services (in Windows Environment)

Hi,
We implemented a service which shows the list of the printers to the end user. But the list of printers does not get refreshed when we add or remove a printer from the windows machine where this application is running.
Does PrintServices get refreshed when a new printer is added or deleted ?
In JDK 1.6 they implemented some logic to refresh the list of printers based on windows notification event *"FindFirstPrinterChangeNotification"*
But i don't know for what events the java api updates the list of printers?
There is a piece of native code WPrinterJob.cpp which gives the list of events... but that piece of code is commented for some reason...
Does any body have a solution or a workaround for this problem?
Here is the piece of code from WPritnerJob.cpp
JNIEXPORT jlong JNICALL
Java_sun_print_Win32PrintServiceLookup_notifyFirstPrinterChange(JNIEnv *env,
jobject peer,
jstring printer) {
HANDLE hPrinter;
LPTSTR printerName = NULL;
if (printer != NULL) {
printerName = (LPTSTR)JNU_GetStringPlatformChars(env,
printer,
NULL);
JNU_ReleaseStringPlatformChars(env, printer, printerName);
// printerName - "Win NT/2K/XP: If NULL, it indicates the local printer
// server" - MSDN. Win9x : OpenPrinter returns 0.
BOOL ret = OpenPrinter(printerName, &hPrinter, NULL);
if (!ret) {
return (jlong)-1;
// PRINTER_CHANGE_PRINTER = PRINTER_CHANGE_ADD_PRINTER |
// PRINTER_CHANGE_SET_PRINTER |
// PRINTER_CHANGE_DELETE_PRINTER |
// PRINTER_CHANGE_FAILED_CONNECTION_PRINTER
HANDLE chgObj = FindFirstPrinterChangeNotification(hPrinter,
PRINTER_CHANGE_PRINTER,
0,
NULL);
return (chgObj == INVALID_HANDLE_VALUE) ? (jlong)-1 : (jlong)chgObj;
This is in WINDOWS Environment.
One workaround found on the web is to unload the Java class which caches these list of printers and reload it. But this process takes lot of time as it has to get all the list of printers every time.
Thanks,
Vijay.
Edited by: krisprol on Aug 29, 2008 12:05 AM

Re-installed (repair mode) iTunes. That fixed it.

Similar Messages

  • My image is too large for the print service. Best options...

    I shoot with a Nikon D800. It appears the images are too large for the print service. What's the best method to reduce file size? Open in Photoshop, edit size, and return to Aperture?

    You would have to look in your TV settings, that is likely the issue.

  • Colors of the Icons in the Print Document Content Window

    When you right click a single source layout and click properties and then click next it takes you to the Print Document Content Window, where you can take topics and by clicking the arrow that points to the right hand frame, move the topics into your print document.
    I have seen posts on this forum where people talk about the colors of the icons on this screen. I have seen these icons colored blue, white and grey, but nowhere in the documentation or on these forums are the colors specifically documented, telling you what they really mean.
    I have a situation where for one of my single source layouts, the colors of the topics on the left pane are blue and the colors on the right pane are white. Meanwhile, in another one of my single source layouts the colors on the left are blue, but the colors on the right are grey and that single source layout doesn't generate the topics that I want.
    Can anyone explain to me what these colors mean, and if as I am thinking, grey means not there, why are they there in one single source layoput and not in the other?
    Below are some screen shots that illustrate my issue.
    This is the bad screen.
    and this is the good one.

    Hi there
    The gray icons signify that the topics have been excluded by virtue of using a Conditional Build Expression.
    The blue icons signify that the topics are included in the Printed Output.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 moments from now - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcererStone Blog
    RoboHelp eBooks

  • My Mac won't share the printer to my windows 7 computer

    My Mac won't share the printer to my windows 7 computer. Worked fine with Snow Leopard but with Lion it won't print from my computer. It also won't connect with file sharing anymore. Any solution that may help please? Thank You

    You can get Firefox 3.6 from http://www.mozilla.com/en-US/firefox/all-older.html
    There is a third party version of Firefox 4 that runs on OS X 10.4/10.5 and PPC Macs, for details see http://www.floodgap.com/software/tenfourfox

  • Installation didn't create the listener service on Windows

    Dear Gurus,
    I had installed an Oracle 9.2.0.0 in a Windows environment. But when a saw the Windows services in the control panel I saw that the listener service's didn't appear!!!!
    Now I can connect to my Database.
    Can I create the listener by myself or I will have to re-install?
    Regards

    You shouldn't have even needed to "create" the listener. Just going to a command prompt and typing "lsnrctl start" should start the listener, and the service should then be created automatically. This of course assumes that if you have multiple versions of Oracle, the correct one was first in your PATH so that you got the correct version of lsnrctl.

  • OS Error in starting the OCFS Service on windows server 2008

    Hi,
    Installing the Oracle 11g R1 CRS on windows server 2008 operating system . It is displaying the folllowing error message
    ERROR : OS in Error in starting the OCFS Service
    Can any one please tell what could be the issue ..
    Thank You

    Solved this after some trawling through xml configuration files on the server.
    The file C:\Oracle\product\11.1.0\db_1\owb\j2ee\config\http-web-site.xml contains the reference to keystore.jks:
              <ssl-config keystore="*%ORACLE_HOME%*/owb/j2ee/config/keystore.jks" keystore-password="-&gt;keystoreadmin"/>
    changing this to:
              <ssl-config keystore="C:\Oracle\product\11.1.0\db_1/owb/j2ee/config/keystore.jks" keystore-password="-&gt;keystoreadmin"/>
    and the OC4J container starts successfully.
    Regards,
    -Haakon-

  • How can I start the Oracle services for windows?

    I started the oracle services by order :
    ifs:
    1.tnslistener
    2.iasdb
    3.oid
    4.processmanager
    5.OEMwebsite
    mid:
    1.webcache
    2.discoverer
    3.processmanager
    Is the order correct?

    Hi Michael,
    I think, then, that the problem is one of permissions. What I've done on Windows 7 installations is to go to the InDesign application folder (in program files), select the InDesign.exe file, use the Context menu (right-click) to display the Properties panel, and then turn on the Run This Program as an Administrator option in the Privelege Level section of the Compatibility tab. Click the Change Settings for All Users button to apply the change (assuming that your current user profile is an Administrator).
    Let me know if that helps!
    Thanks,
    Ole

  • Manually creating the oracle services inside windows services

    Hi All,
    After discussion we came up for the following conclusion and would like to have further discussion on the topic.
    - We have node 1 windows 2003 enterprise sp2 available on one of the server which has Oracle 11g R1 having custom database installed on it.
    - All database and Oracle server files are stored on shared storage.
    - It created windows services inside which we will be registered under cluster administrator
    - We will install Oracle 11g R1 on node 2 (Passive node of windows cluster) with the software only option.
    - We will manually create the oracle services on this node with the same name as we have on node 1.
    In case the node 1 will be failed, node 2 will fail over and will become active node for the users.
    Is there any one involve in such practice? did it work ?
    Thanks,

    I am installing 10g client and create an ORCL service using the Net configuration Assistant. I don't see this service when i open ontrol panel/administrative tools/services. Is this normal?
    I thought i wld see it and start the service and listener. Some confusion here.... first of all, listener is a server process, which listens for incoming calls, you don't have it on a client.
    Secondly, the service you created with Net Configuration Assistant is just an alias you'll use to connect a remote database to, and does not create any Windows service. You can find its specifications within tnsnames.ora file, in ORACLE_HOME\network\admin directory.
    I'd read some documentation

  • Unable to start the weblogic server from windows environment

    Hi All,
    In our training system we have installed the SOA 11g and it worked fine till today afternoon. We have logged off the admin user in windows account and logged with our login credentials into windows after that we are unable to start the weblogic server.
    - Earlier in the DOS command prompt we used to navigate to the path where the startWeblogic.cmd file located and then we execute the command, after that we will able to see the status message as RUNNING MODE in the bottom of the screen, and when ever we deploy an project using Jdeveloper in the weblogic server window some messages will appended based on the action.
    - Only when we issue the command to shut down the weblogic server at that time only the command will be back to the path from where we started the server.
    - After login to windows with our account, when we tried to start the weblogic server, it didn't throw any error instead of that after running few lines in the command window the prompt was back in to the (D:\Middleware\.....\Domains\bin)path from where we ran the command to start the server.
    Please help us to resolve the issue asap.
    Thanks in advance.
    Regards,
    Sathyaseelan

    Hi,
    Make sure that the user which you are using to start weblogic server should be part of Administrator group or the group to which your admin user belongs to.
    Regards,
    Kishore

  • How to monitor a java service in windows environment

    Hi all,
    I have a 5 java services running on a windows box.
    I want to monitor one of those. This service is called "appnew " and appnew interacts with the oracle database.
    If it is running normally the application name as seen in the task manager is "appnew running" whenever there is some runtime exception the name changes to "appnew error".
    now I want to develop some external tool which can send me alert emails when we get runtime exceptions and the service name changes to
    "appnew error".
    I appreciate your help.
    Thanks in advance.

    The code you are using to change the process name to "appnew error" is the place you want to put your call to an e-mail launch.

  • How to publishing the Bonjour service in Windows ?

    i know how to publish a bonjour service in the Mac OS,but i didn't know how to do this work in windows.Can somebody help me,thanks.

    https://discussions.apple.com/thread/4213411

  • Deploying the Cloud service using Windows Authentication

    Hi,
    I have a VPN Connectivity established to other VM Server where the DB is also installed. Now I a have created an application with DB connectivity
    I am able to connect the DB server using SQL authentication but how can I connect using Windows Authentication?
    What configuration changes I have to do in web.config or I have to modify any more changes else where?
    Thanks & Regards,
    Suresh Sahu

    Hi,
    Based on your description, you have connected to DB server using SQL authentication, I suggest your read the following link, and do some change in SQL that installed in the VM, hope it helps. If I misunderstand, please feel free to let me know.
    #http://msdn.microsoft.com/en-us/library/dd787978.aspx
    Best Regards

  • Can any software  provide the printing service for SAP?

    I need  printers for production tags. It is something like a label for the pack of goods.
    I will have to print different tags for different customers as they requested. If better I can find some software which can easily change the layout of printer, with simple GUI, people can just dragging to the correct position.
    Please give me some advice.

    I need a printer for production tags. It is something like a label for the pack of goods.
    I will have to print different tags for different customers as they requested. If better I can find some software which can easily change the layout of printer, with simple GUI, people can just dragging to the correct position.
    The tags will be hard to modify by SAP scripts.
    I need to find a easier solution, so that maybe even the end user can make customized product tag.
    Please give some advice. Thank you.

  • Adding Printer as a scanner in print service role (Distributed scan server), would it be possible in windows server 2008 r2 !!

    Hello All 
    I have a sharp printer that support scanniing as well and my question is : 
    I want to getting use from manage scanner service role that is belonging to the print service role in windows server 2008 , which has the feature of passing the scanned document to users shared folders which are exist in the same server.
    but when i try to add my printer as a scanner it did not accept .. so i cant proceed with my objective, which is allowing users to pass their scanned docs to their shared folder
    Any idea ?

    Can i scan to network shared folder without adding the used credentials, i am looking for this distributed scan features for this issue.
    now each time new user will come i will create for him a shared folder with his username and password then i will go to the printer web base page and add this shared folder to the address book, but i need the user to come to add his password. how i can tell
    the printer to authenticate him and directt his scan to his shared folder without asking him to enter his password to be able to create an address book for him ?? any help
    Thanks in advance !

  • When I try to print using Windows 2008 print server I have to use the generic print drivers supplied. If I use the OEM driver the printer locks up. I have tried a HP 4 plus and a Canon Copier.

    When I try to print using Windows 2008 print server I have to use the generic print drivers supplied. If I use the OEM driver the printer locks up. I have tried a HP 4 plus and a Canon Copier.

    A number of vendor drivers written for OS X cannot be used when connecting via SMB to a printer that is shared by Windows. This is due to limitations of the driver.
    In some cases, if you were to enable the LPD Print Service in Windows, you can connect to the share using the same syntax as SMB but on the Mac you would use the LPD as the protocol.
    If you can reply with the brand and model of printer you have then we may be able to provide more information.

Maybe you are looking for

  • When i delete songs manually on my iphone 5 i can't refill that music again because it still shows that it's on my iphone in itunes.

    my iphone can't sync to my laptop because it had a virus and had to be restored so i auto fill all my music. So when i connect my iphone the music still shows but won't play because i deleted it manually. How do i delete ghost files so i can auto fil

  • How to create an outline around an object

    Totally frustrated. I usually work in Illustrator but have to do this in Photoshop. I have a photograph inside text (used a clipping mask) but now need to just OUTLINE each letter with black.  Normally, in Illustrator I would select the pen tool and

  • How to install veritas volume manager in zones

    Hi folks, I wanna learn veritas volume manager. Is it possible to install VXVM packages on solaris Zones? how can i create virtual disk? Is there any simulator for VXVM for solaris. ? Thanks in advance.

  • FTP logon issues on IIS 7 using Windows Server 2008 R2

    Hi, I'm currently experiencing issues when trying to log on to an FTP server I created using Windows Server 2008 R2. The FTP web site has Enabled both Anonymous and Basic Authentication. On the Authotization Rules it has enabled Allow All Users and A

  • Last 100 rows of a database

    I have an application which needs to connect to a database and retrieve the 100 most recent rows and display them. Now the problem is that this operation must happen every 3-5 seconds. How could I perform this operation? Do I have to use a scrollable