Conversay Developers Forum

NOTICE!

Use of the Conversay Developers Network (CDN Forum) requires registration with this site.  Click HERE to register now.

 
  CDN Forum  Application Dev...  Application Dev...  Using JSAPI2 with NetBeans
Previous Previous
 
Next Next
New Post 5/15/2008 10:23 AM
  CDN Host
20 posts
No Ranking


Using JSAPI2 with NetBeans 

Originally Posted by esmithbss:

Has anyone been successful in integrating the JSAPI2 Early Release RI with NetBeans 6.x?

I have extracted what I can from the eclipse ide doc and created a custome WTK environment; however, everytime I try o debug I receive a "Connection Refused" error.

 
New Post 7/8/2008 10:55 PM
  tegun
3 posts
No Ranking


Re: Using JSAPI2 with NetBeans 

I am using Netbeans 5.5.1 (I know I need to upgrade). The farthest I have gotten was including the files in the classpath. It compiles properly but when it reaches the following line it never successfully sets rec (it's null):

            rec = (Recognizer)
                EngineManager.createEngine(RecognizerMode.DEFAULT);

I got the code to work with ANT as described in the installation manual so I am going to see if I can aid in figuring out how to integrate JSAPI2 with Netbeans over the next week or so. If anyone has any solution to it already, that would be helpful!

 
New Post 7/9/2008 6:01 PM
  tegun
3 posts
No Ranking


Re: Using JSAPI2 with NetBeans 

Today I was able to get an example working in Netbeans 5.5.1 without using the ANT described in the installation manual. Because NetBeans has it's own ANT build in, all you need to do is create a new project and use the existing ant script provided by the JSAPI2. Here are the steps I followed in order to get the example projects loaded into NetBeans:

1. Select New Project... from the File menu. This will pop a New Project window.
2. Select General in Categories and after choose a Java Project with Existing Ant Script.
3. Click on Next button. This will pop a New Java Project with Existing Ant Script window.
4. For Location browse to the workspace folder previously specified. If you browsed to the correct folder, all remained blank form will be filled automatically.
5. Click on Set as Main Project. Click on Next button. This will show Build and Run Actions tab.
6. If you followed correctly upper instructions, first three forms will be filled according to theirs label names. Click on Next button. This will show Source Package Folders tab.
7. Click on Add Folder... button for Source Package Folders and select lib folder. Add com and edu folder following same operations, then press OK.
8. Click on Add Folder... button for Test Package Folders and select tests folder. Add demo folder following same operations, then press OK.
9. Select JDK 5 in the Source level field. Click on Next button. This will show Java Sources Classpath tab.
10. Click on Finish button.
 
The program now compiles in Netbeans and runs. I haven't tested out the debugging but I'm sure that works too. The problem is that it only works in that project. The problem I have is after I create the class, I cannot seem to use it in another java program. For example. I used the j2sehello application, modified it a little bit, compiled it and ran it in NetBeans. It ran fine as a standalone program. After I add the "j2sehello.jar" file to my new program, it compiles just fine. It's when I run the program it comes up with all these errors that I didn't see in the standalone application:

java.lang.IllegalArgumentException: javax.speech.EngineManager: no class found for com.conversay.speech.C5EngineListFactory
        at javax.speech.EngineManager.registerEngineListFactory(Unknown Source)
        at javax.speech.EngineManager.a(Unknown Source)
        at javax.speech.EngineManager.availableEngines(Unknown Source)
        at org.jsapi2.examples.j2sehello.HelloWorld.response(HelloWorld.java:31)
        at Prog.Prog$1.run(Prog.java:99)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
javax.speech.EngineManager: problem registering com.conversay.speech.C5EngineListFactory

Anyone know if I might be missing somehting? In the above bug I get three Unknown Sources:

        at javax.speech.EngineManager.registerEngineListFactory(Unknown Source)
        at javax.speech.EngineManager.a(Unknown Source)
        at javax.speech.EngineManager.availableEngines(Unknown Source)

This must mean I am missing some classes somewhere. Any help would be greatly appreciated. I am so close. plz help!

 

 
New Post 7/11/2008 8:39 AM
  tegun
3 posts
No Ranking


Re: Using JSAPI2 with NetBeans 

With help from the creator of JSAPI2 I was able to solve the problem with integrating JSAPI2 into NetBeans 5.5.1. I have version 6.0.1 installed on my other computer and confirmed that this solution should not be that much different from any other versions. After you have your project open:

1. Right click it and goto "Properties"

2. Under Project Properties click on "Libraries"

3. Under Compile-Tab click "Add JAR/Folder"

4. Search for your install directory of "JSAPI2\dist\" and add the following 4 .jar files (jsapi2.jar, kxml2.jar, ri-j2se.jar, and ri.jar)

5. You can also add any of the .jar files for the example files that were given (i.e. (Install Directory)\JSAPI2\examples\j2sehello\dist\j2sehello.jar) as classes.

6. On the left Panel click on "Run" and for example if your install directory was "C:\Conversay\JSAPI2\" then add the following line:

-Djava.library.path="C:\Conversay\JSAPI2\dist\ri\platform"

You can now compile and run any of the examples given using the NetBeans IDE. I recommend starting with the examples that were given. You might have to edit them a little bit in order for them to compile correctly.

 
New Post 9/23/2008 1:07 AM
  ranjeetsalunkhe
2 posts
No Ranking


Re: Using JSAPI2 with NetBeans 

Hi tegun,

Thanks for ur reply Netbeans with JSAPI2.0

1.AS u said in the 4 step that include 4 jar.after compilation i am getting this error.

Error preverifying class com.conversay.speech.platform.J2SEInputConnector
    VERIFIER ERROR com/conversay/speech/platform/J2SEInputConnector.openInputStream(Lcom/conversay/speech/URI;Ljava/lang/String;)Lcom/conversay/speech/platform/InputStreamInfo;:
Cannot find class java/io/BufferedInputStream

2.if i exclude the ri-j2se.jar then its build successfully.

3.after i am run the application got this error Uncaught exception java/lang/NoClassDefFoundError: javax/speech/EngineMode: Cannot create class in system package.

5.i am using netbeans 5.5.

so can u please suggest me the changes in the building and running procedure.

 
Previous Previous
 
Next Next
  CDN Forum  Application Dev...  Application Dev...  Using JSAPI2 with NetBeans