Can not load printer from windows service

View: New views
6 Messages — Rating Filter:   Alert me  

Can not load printer from windows service

by Riyaz Saiyed :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

We've a printing application that takes a printer name as argument and load that printer.I've configured tanuki wrapper to start and stop this application.
If I start this application via running a batch file, it work perfectly.
But if I install this application as windows service an run application via starting a service, it does not load printer.
The exception message I get here is : "Can not load specified printer : MTW_Printer. Printer not found."
With batch file approach, it locates printer : "Specified Printer found : Win32 Printer : \\172.22.192.230\MTW_Printerr"
Here both the messages are application specific and application generates it when it tries to load printer.

Regards,
Riyaz
Regards,
Riyaz..



Re: Can not load printer from windows service

by Hubert Felber :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
Probabely:
Your printers are stored under a user account, that's why it works from
batch file.
As your service runs under the account "system", you don't have access
to the printers configured for that certain user account.
You 'll have to run your service with the same user account as you
configured the printers.
Hubert

>>> Riyaz Saiyed <riyaz_saiyed@...> 07.10.2009 11:07 >>>

Hi,

We've a printing application that takes a printer name as argument and
load
that printer.I've configured tanuki wrapper to start and stop this
application.
If I start this application via running a batch file, it work
perfectly.
But if I install this application as windows service an run application
via
starting a service, it does not load printer.
The exception message I get here is : "Can not load specified printer
:
MTW_Printer. Printer not found."
With batch file approach, it locates printer : "Specified Printer found
:
Win32 Printer : \\172.22.192.230\MTW_Printerr"
Here both the messages are application specific and application
generates it
when it tries to load printer.

Regards,
Riyaz

-----
Regards,
Riyaz..


--
View this message in context:
http://www.nabble.com/Can-not-load-printer-from-windows-service-tp25783037p25783037.html

Sent from the Java Service Wrapper mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart
your
developing skills, take BlackBerry mobile applications to market and
stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference 
_______________________________________________
Wrapper-user mailing list
Wrapper-user@...
https://lists.sourceforge.net/lists/listinfo/wrapper-user

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Wrapper-user mailing list
Wrapper-user@...
https://lists.sourceforge.net/lists/listinfo/wrapper-user

Re: Can not load printer from windows service

by Christian-167 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Riyaz & Hubert,

Hubert is fast and right.

When running as a service, the Wrapper and its JVM, will by default be
running as the Windows SYSTEM user.  This user does not have the
ability to access network drives or printers.

It is also possible to run as a specific user account to gain access
to network drives etc:
http://wrapper.tanukisoftware.org/doc/english/prop-ntservice-account.html

I think this should work out for you.

Cheers,
Christian Mueller

On Wed, 2009-10-07 at 11:12 +0200, Hubert Felber wrote:

> Hi,
> Probabely:
> Your printers are stored under a user account, that's why it works from
> batch file.
> As your service runs under the account "system", you don't have access
> to the printers configured for that certain user account.
> You 'll have to run your service with the same user account as you
> configured the printers.
> Hubert
>
> >>> Riyaz Saiyed <riyaz_saiyed@...> 07.10.2009 11:07 >>>
>
> Hi,
>
> We've a printing application that takes a printer name as argument and
> load
> that printer.I've configured tanuki wrapper to start and stop this
> application.
> If I start this application via running a batch file, it work
> perfectly.
> But if I install this application as windows service an run application
> via
> starting a service, it does not load printer.
> The exception message I get here is : "Can not load specified printer
> :
> MTW_Printer. Printer not found."
> With batch file approach, it locates printer : "Specified Printer found
> :
> Win32 Printer : \\172.22.192.230\MTW_Printerr"
> Here both the messages are application specific and application
> generates it
> when it tries to load printer.
>
> Regards,
> Riyaz
>
> -----
> Regards,
> Riyaz..
>
>


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Wrapper-user mailing list
Wrapper-user@...
https://lists.sourceforge.net/lists/listinfo/wrapper-user

Re: Can not load printer from windows service

by Riyaz Saiyed :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Christian and Hubert, thanks a lot..

When I right click and select service proiperties, and under Log On tab select This Account with my user name and password, I was able to start the service SUCCESSFULLY.

Only thing, how do I provide password on configuration file. Is it possible. Because I want to provide similar details
via config file.
As link explained, I tried setting account property in config file but it didn't work .

wrapper.ntservice.account=.\mindtree\m1002575

error:
wrapper  | CreateService failed - The account name is invalid or does not exist, or the password is invalid for the account name specified. (0x421)
Press any key to continue . . .

Thanks and regards,
Riyaz


Christian-167 wrote:
Hi Riyaz & Hubert,

Hubert is fast and right.

When running as a service, the Wrapper and its JVM, will by default be
running as the Windows SYSTEM user.  This user does not have the
ability to access network drives or printers.

It is also possible to run as a specific user account to gain access
to network drives etc:
http://wrapper.tanukisoftware.org/doc/english/prop-ntservice-account.html

I think this should work out for you.

Cheers,
Christian Mueller

On Wed, 2009-10-07 at 11:12 +0200, Hubert Felber wrote:
> Hi,
> Probabely:
> Your printers are stored under a user account, that's why it works from
> batch file.
> As your service runs under the account "system", you don't have access
> to the printers configured for that certain user account.
> You 'll have to run your service with the same user account as you
> configured the printers.
> Hubert
>
> >>> Riyaz Saiyed <riyaz_saiyed@mindtree.com> 07.10.2009 11:07 >>>
>
> Hi,
>
> We've a printing application that takes a printer name as argument and
> load
> that printer.I've configured tanuki wrapper to start and stop this
> application.
> If I start this application via running a batch file, it work
> perfectly.
> But if I install this application as windows service an run application
> via
> starting a service, it does not load printer.
> The exception message I get here is : "Can not load specified printer
> :
> MTW_Printer. Printer not found."
> With batch file approach, it locates printer : "Specified Printer found
> :
> Win32 Printer : \\172.22.192.230\MTW_Printerr"
> Here both the messages are application specific and application
> generates it
> when it tries to load printer.
>
> Regards,
> Riyaz
>
> -----
> Regards,
> Riyaz..
>
>


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Wrapper-user mailing list
Wrapper-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wrapper-user
Regards,
Riyaz..



Re: Can not load printer from windows service

by Leif Mortenson-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Riyaz,
Please be sure to read over the wrapper.ntservice.account property
thoroughly as the account must be setup in the control panel correctly
so it will be able to run services.
http://wrapper.tanukisoftware.org/doc/english/prop-ntservice-account.html

To set the password, use the following property:
http://wrapper.tanukisoftware.org/doc/english/prop-ntservice-password.html
Towards the bottom of the file, you will see ways to avoid including
the password in the configuration file if that is a concern.

Cheers,
Leif

On Wed, Oct 7, 2009 at 7:00 PM, Riyaz Saiyed <riyaz_saiyed@...> wrote:

>
> Hi Christian and Hubert, thanks a lot..
>
> When I right click and select service proiperties, and under Log On tab
> select This Account with my user name and password, I was able to start the
> service SUCCESSFULLY.
>
> Only thing, how do I provide password on configuration file. Is it possible.
> Because I want to provide similar details
> via config file.
> As link explained, I tried setting account property in config file but it
> didn't work .
>
> wrapper.ntservice.account=.\mindtree\m1002575
>
> error:
> wrapper  | CreateService failed - The account name is invalid or does not
> exist, or the password is invalid for the account name specified. (0x421)
> Press any key to continue . . .
>
> Thanks and regards,
> Riyaz
>
>
>
> Christian-167 wrote:
>>
>> Hi Riyaz & Hubert,
>>
>> Hubert is fast and right.
>>
>> When running as a service, the Wrapper and its JVM, will by default be
>> running as the Windows SYSTEM user.  This user does not have the
>> ability to access network drives or printers.
>>
>> It is also possible to run as a specific user account to gain access
>> to network drives etc:
>> http://wrapper.tanukisoftware.org/doc/english/prop-ntservice-account.html
>>
>> I think this should work out for you.
>>
>> Cheers,
>> Christian Mueller
>>
>> On Wed, 2009-10-07 at 11:12 +0200, Hubert Felber wrote:
>>> Hi,
>>> Probabely:
>>> Your printers are stored under a user account, that's why it works from
>>> batch file.
>>> As your service runs under the account "system", you don't have access
>>> to the printers configured for that certain user account.
>>> You 'll have to run your service with the same user account as you
>>> configured the printers.
>>> Hubert
>>>
>>> >>> Riyaz Saiyed <riyaz_saiyed@...> 07.10.2009 11:07 >>>
>>>
>>> Hi,
>>>
>>> We've a printing application that takes a printer name as argument and
>>> load
>>> that printer.I've configured tanuki wrapper to start and stop this
>>> application.
>>> If I start this application via running a batch file, it work
>>> perfectly.
>>> But if I install this application as windows service an run application
>>> via
>>> starting a service, it does not load printer.
>>> The exception message I get here is : "Can not load specified printer
>>> :
>>> MTW_Printer. Printer not found."
>>> With batch file approach, it locates printer : "Specified Printer found
>>> :
>>> Win32 Printer : \\172.22.192.230\MTW_Printerr"
>>> Here both the messages are application specific and application
>>> generates it
>>> when it tries to load printer.
>>>
>>> Regards,
>>> Riyaz
>>>
>>> -----
>>> Regards,
>>> Riyaz..
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay
>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>> http://p.sf.net/sfu/devconference
>> _______________________________________________
>> Wrapper-user mailing list
>> Wrapper-user@...
>> https://lists.sourceforge.net/lists/listinfo/wrapper-user
>>
>>
>
>
> -----
> Regards,
> Riyaz..

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Wrapper-user mailing list
Wrapper-user@...
https://lists.sourceforge.net/lists/listinfo/wrapper-user

Re: Can not load printer from windows service

by Riyaz Saiyed :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

The problem is solved. I was giving wrong value for property wrapper.ntservice.account.
wrong:  wrapper.ntservice.account=.\mindtree\m1002575
correct: wrapper.ntservice.account=mindtree\m1002575

Also I've enable prompt password for user: wrapper.ntservice.password.prompt=true

Regards,
Riyaz..


Hi Christian and Hubert, thanks a lot..

When I right click and select service proiperties, and under Log On tab select This Account with my user name and password, I was able to start the service SUCCESSFULLY.

Only thing, how do I provide password on configuration file. Is it possible. Because I want to provide similar details
via config file.
As link explained, I tried setting account property in config file but it didn't work .

wrapper.ntservice.account=.\mindtree\m1002575

error:
wrapper  | CreateService failed - The account name is invalid or does not exist, or the password is invalid for the account name specified. (0x421)
Press any key to continue . . .

Thanks and regards,
Riyaz


Christian-167 wrote:
Hi Riyaz & Hubert,

Hubert is fast and right.

When running as a service, the Wrapper and its JVM, will by default be
running as the Windows SYSTEM user.  This user does not have the
ability to access network drives or printers.

It is also possible to run as a specific user account to gain access
to network drives etc:
http://wrapper.tanukisoftware.org/doc/english/prop-ntservice-account.html

I think this should work out for you.

Cheers,
Christian Mueller

On Wed, 2009-10-07 at 11:12 +0200, Hubert Felber wrote:
> Hi,
> Probabely:
> Your printers are stored under a user account, that's why it works from
> batch file.
> As your service runs under the account "system", you don't have access
> to the printers configured for that certain user account.
> You 'll have to run your service with the same user account as you
> configured the printers.
> Hubert
>
> >>> Riyaz Saiyed <riyaz_saiyed@mindtree.com> 07.10.2009 11:07 >>>
>
> Hi,
>
> We've a printing application that takes a printer name as argument and
> load
> that printer.I've configured tanuki wrapper to start and stop this
> application.
> If I start this application via running a batch file, it work
> perfectly.
> But if I install this application as windows service an run application
> via
> starting a service, it does not load printer.
> The exception message I get here is : "Can not load specified printer
> :
> MTW_Printer. Printer not found."
> With batch file approach, it locates printer : "Specified Printer found
> :
> Win32 Printer : \\172.22.192.230\MTW_Printerr"
> Here both the messages are application specific and application
> generates it
> when it tries to load printer.
>
> Regards,
> Riyaz
>
> -----
> Regards,
> Riyaz..
>
>


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Wrapper-user mailing list
Wrapper-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wrapper-user

Regards,
Riyaz..