• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Null pointer exception in code

 
Vivek Moyal
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a null pointer exception when i run this program please help where i am wrong



error is this


 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should be obvious from the stack trace and reading line 18 which object is null, and ought not to be.
 
Rob Spoor
Sheriff
Pie
Posts: 20512
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Completely unrelated to user interfaces. Moving to Other JSE/JEE APIs.
 
Vivek Moyal
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ans this because i dont get any help over the net everywhere is the same code and there is a null pointer exception so please help me
 
Rob Spoor
Sheriff
Pie
Posts: 20512
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Central.createSynthesizer(new SynthesizerModeDesc(Locale.ENGLISH)) obviously returns null. I'm not familiar enough with javax.speech to tell you why, but the Javadoc says that Central.createSynthesizer returns
a Synthesizer matching the required properties or null if none is available
.
 
Vivek Moyal
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But i want to know that how should i remove the "null pointer exception" because i dont get any help from anyone
 
Rob Spoor
Sheriff
Pie
Posts: 20512
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe nobody knows why there isn't a synthesizer available. I certainly don't.
 
Vivek Moyal
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using this code for text to speech and i have an application which is already doing this that is a dictionary and i want to do this through my code if anybody know any other way to do this than please tell me i am waiting
 
uppala sumanth kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey i got the same problem stated above .... can any one please help me out
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you actually (properly) installed a jsapi implementation? Will Central.createSynthesizer() return non-null if you pass "null" for the argument? If not, then you haven't correctly installed your implementation. Follow the directions for whatever you're installing to get it working.
 
uppala sumanth kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've installed correct only and I'm using eclipse IDE....
All thae classes and methods of JSAPI are present int the JRE env for the project...
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So which provider did you install? FreeTTS, IBM Speech for Java, ... ?
 
uppala sumanth kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't install any thing .. jus pasted that JSAPI into my java - lib folder....
And i'm new to this JSAPI... this is the first time i'm using!!!
 
uppala sumanth kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you please tell me the procedure ...
which provider should i insatll ...
and steps to be followed....!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic