Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Stange UnsupportedEncoding Exception

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

I have a very strange problem. Please advise if you can.
I have written a very trival C++ application to integrate by java program with windows OS to run as a service.

Namely I install service, service calls a bat file when started and bat files contain DOS scripting to to start my java program.

While there are better solutions, this solution work fine. I have given this info for background infomation.

Sometime my application must write to an ouptut stream using codepage 437. When it does so I get an "java.io.UnsupportedEncodingException", cannot find cp437 etc. However charset.jar exists in jre lib folder & is specifed on sun.boot.class.path. This only happens when I start run my application from my service.

When I run command from a command prompt, processin of cp437 happens no problem. This there some reason why when running as service, that charsets.jar is not being loaded on classpath?

Is there a separate CLASSLOADER being used somewhere?

I have recently down an upgrade to my application, no changes in upgrade affect encoding etc but before upgrade I had no issues with 437.

I hope problem isn't too vague, if anyone has any suggestion it would really help. I am considering reinstalling jre

Please advise

Rgds
Ed
 
Marshal
Posts: 27375
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then there's something different in your service setup vis-a-vis your command line. Relative paths relative to a different working directory? Mapped drives referenced in your command line? Using different JREs? You'll have to find out what.
 
The world's cheapest jedi mind trick: "Aw c'mon, why not read this tiny ad?"
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic