• 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

create process error = 2

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm trying to print a password using a printer that is already configured to my system.

But when I click on print, all the classes are working fine, except the PrintUtil class , which gives me the java.io.Exception.

I've pasted a copy of the trace below.

Would be grateful to anyone who could find a solution. If any more details are required, please ask as i don't know where to look to figure out the error.

LOGS

42316 [28108402@qtp-16651101-3] DEBUG app.tracelog - LoginPinMailerExtractService:exService Entered
42316 [28108402@qtp-16651101-3] DEBUG app.tracelog - LoginPinMailerExtractService:exService userid : administrator
42316 [28108402@qtp-16651101-3] DEBUG app.tracelog - LoginPinMailerExtractService:exService strbatchno before customer list retrieval:
42331 [28108402@qtp-16651101-3] DEBUG app.pintracelog - PinMailerProcessLogin:extractProcess() Extract Process Started :
42456 [28108402@qtp-16651101-3] DEBUG app.pintracelog - PinMailerProcessLogin:extractProcess() Extract Process querystring : SELECT AUL.USER_ID, AUL.USER_NAME, TRANS_REF_NO, USER_EMAIL FROM APP_USER_LOGIN_PWD_REQUEST AUL,IHB_USER_PROFILE AUP WHERE AUL.USER_ID=AUP.USER_ID AND AUL.USER_ID IN ('testbankuser124') AND STATUS = 'C'
42456 [28108402@qtp-16651101-3] DEBUG app.pintracelog - PinMailerProcessLogin:extractProcess() Extract Process querystring : SELECT AUL.USER_ID, AUL.USER_NAME, TRANS_REF_NO, USER_EMAIL FROM APP_USER_LOGIN_PWD_REQUEST AUL,IHB_USER_PROFILE AUP WHERE AUL.USER_ID=AUP.USER_ID AND AUL.USER_ID IN ('testbankuser124') AND STATUS = 'C'
42487 [28108402@qtp-16651101-3] DEBUG app.pintracelog - PinMailerProcessLogin:extractProcess() Extract Process userid : testbankuser124
42487 [28108402@qtp-16651101-3] DEBUG app.pintracelog - PinMailerProcessLogin:extractProcess() Extract Process username : testbankuser
42487 [28108402@qtp-16651101-3] DEBUG app.pintracelog - PinMailerProcessLogin:extractProcess() Extract Process tranrefno : 5554
42487 [28108402@qtp-16651101-3] DEBUG app.pintracelog - PinMailerProcessLogin:extractProcess() Extract Process useremail : testbankuser124
42487 [28108402@qtp-16651101-3] DEBUG app.pintracelog - PinMailerProcessLogin:getCustomerDetails CustomerId:testbankuser124
42518 [28108402@qtp-16651101-3] INFO app.pintracelog - PinMailerControllerLogin:generatePinMailer Pin File Name:D:/workspace/DLB/retail/admin/data/pinmailerlogin/Pinmailer.ps
42518 [28108402@qtp-16651101-3] DEBUG app.pintracelog - PinMailer:writePinMailer Details Map pad :Key Array:[pinmessage, userid, username, tranrefno, pinnumber, pinbatchno, useremail, address1, address2, address3, address4, address5],Values:[Pin : Login Password, testbankuser124, testbankuser, 5554, P1*8WB1#, 22852295, testbankuser124, DEPOSIT, , , , ]
42534 [28108402@qtp-16651101-3] DEBUG app.tracelog - PrintUtil:printUtil -2 PrinterName : TVS MSP 245 Star
42534 [28108402@qtp-16651101-3] DEBUG app.tracelog - PrintUtil:printUtil -2 File Path : D:/workspace/DLB/retail/admin/data/pinmailerlogin/Pinmailer.ps
42534 [28108402@qtp-16651101-3] DEBUG app.tracelog - PrintUtil:printUtil -2 Exception : java.io.IOException: Cannot run program "printtest": CreateProcess error=2, The system cannot find the file specified
42534 [28108402@qtp-16651101-3] INFO app.pintracelog - PinMailerControllerLogin:generatePinMailer statusFlag : false



 
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is the exception telling you (it appears to be being very helpful) have you looked for the missing item?
 
Lisha Hercules
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes. i've checked for the file it says is missing. Pinmailer.ps

It's present in the specified directory. It contains data as well.
 
Lisha Hercules
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I've still not found a solution but I think I've found where its getting stuck.

Inside the PrintUtil class I'm passing a command string to the exec method.

The code looks like this.





The command when printed on the trace looks like this.

printtest TVS MSP 245 Star@D:/workspace/DLB/retail/admin/data/pinmailerlogin/Pinmailer.ps






Is it the right way to pass a command to exec?
 
Wendy L Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry no idea, I am ducking out now.

only 1 thing left to try do you use File.separator to make the string?
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does printtest exist ? can you run this command from a command propmpt ?
 
Lisha Hercules
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No it doesn't run on the command prompt. Says invalid command.

I tried with print as well.

print /d:TVSMSP245Star D:\pinmailer.ps

(I've created a file called pinmailer.ps under the d drive for testing)

but still it doesn't seem to work.

It says unable to initialize device TVSMSP245Star. I've checked the name of the printer in properties. It's correct so far.

I don't get why it is not able to initialize. Also, mine is a USB printer on port USB001. Is there a separate syntax for that?
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well if it doesn't work from the command prompt, then it's not a Java problem.
Can you print to this printer using another program such as notepad ?
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
Lisha Hercules
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes of course.. It's working well with all other programs, where the print dialog box opens, and I have to click Print.

It's just not budging if I try to do it from the command prompt.






Thank you, Sheriff... This is the first time I'm registering on something like this, and it feels good to know people out there are taking time off to help me out. I hope I am also able to contribute the little knowledge that I have, to others out there like me.
 
Lisha Hercules
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I resolved it myself. Thank you all for trying to help me.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic