aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Null pointer exception in code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Null pointer exception in code" Watch "Null pointer exception in code" New topic
Author

Null pointer exception in code

Vivek Moyal
Ranch Hand

Joined: Nov 02, 2009
Posts: 57
There is a null pointer exception when i run this program please help where i am wrong



error is this


Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39393
    
  28
It should be obvious from the stack trace and reading line 18 which object is null, and ought not to be.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19718
    
  20

Completely unrelated to user interfaces. Moving to Other JSE/JEE APIs.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Vivek Moyal
Ranch Hand

Joined: Nov 02, 2009
Posts: 57
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

Joined: Oct 27, 2005
Posts: 19718
    
  20

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

Joined: Nov 02, 2009
Posts: 57
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

Joined: Oct 27, 2005
Posts: 19718
    
  20

Maybe nobody knows why there isn't a synthesizer available. I certainly don't.
Vivek Moyal
Ranch Hand

Joined: Nov 02, 2009
Posts: 57
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

Joined: Dec 30, 2010
Posts: 4
Hey i got the same problem stated above .... can any one please help me out
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

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.


[Jess in Action][AskingGoodQuestions]
uppala sumanth kumar
Greenhorn

Joined: Dec 30, 2010
Posts: 4
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

Joined: Jul 08, 2003
Posts: 24187
    
  34

So which provider did you install? FreeTTS, IBM Speech for Java, ... ?
uppala sumanth kumar
Greenhorn

Joined: Dec 30, 2010
Posts: 4
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

Joined: Dec 30, 2010
Posts: 4
can you please tell me the procedure ...
which provider should i insatll ...
and steps to be followed....!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Null pointer exception in code