Property exception component:'jsgfGrammar' - java

So I have been trying to start writing my own code for Sphinx4. I created my own grammar, config, and java file, all necessary for it to run, and used the code from the HelloWorld demo. However, when I ran the code, I received this error:
Problem configuring HelloWorld: Property exception component:'jsgfGrammar' property:'grammarLocation' - Can't locate resource:/edu/cmu/sphinx/demo/hellowrld/
edu.cmu.sphinx.util.props.InternalConfigurationException: Can't locate resource:/edu/cmu/sphinx/demo/hellowrld/
Property exception component:'jsgfGrammar' property:'grammarLocation' - Can't locate resource:/edu/cmu/sphinx/demo/hellowrld/
edu.cmu.sphinx.util.props.InternalConfigurationException: Can't locate resource:/edu/cmu/sphinx/demo/hellowrld/
at edu.cmu.sphinx.util.props.ConfigurationManagerUtils.getResource(ConfigurationManagerUtils.java:483)
followed by more edu.cmu.sphinx.util.props that are missing apparently.
When I go to the project folder where the demos are, there aren't any files there, so I am not sure if there are files I am just missing or aren't included. Everything is in the same workspace folder as well.
Would anyone have any idea as to why my program isn't running? I need this baseline to work properly so I can write my own code.
Also any references to tutorial videos, links or documents to help with Sphinx4 would be greatly appreciated. I have seen a video from Puneet and Sharing is Caring on YouTube. The Sphinx site isn't that helpful in terms of starting because they mainly discuss the writing the code in manually, which was confusing.

Related

Eclipse 2020-12 - I can't create or edit groovy classes (was OK in 2020-09)

Recently Eclipse 2020-09 updated itself to 20200-12. My Java development has been OK. However, this evening, I needed to create a new Groovy class. The editor failed to open - I got an error 'window' (tltle = 'New') that said:
Creation of element failed. org/codehaus/groovy/eclipse/refactoring/core/utils/GroovyTypeBuilder
Opening an existing Groovy file results in the editor area being all grey and open editors have lost focus.
I've spent ages trying to find a solution - and failed.
If someone can help me with this, I'll be immensely grateful as work on my product has ground to a halt!
BACKGROUND
The new-class action creates a .log file. At the end of the log the entry is
Root exception:
java.lang.NoClassDefFoundError: org/codehaus/groovy/eclipse/refactoring/core/utils/GroovyTypeBuilder
Further up the log, I've seen other 'no class def found' entries for:
"org/codehaus/jdt/groovy/integration/LanguageSupport"
"org/codehaus/jdt/groovy/integration/LanguageSupportFactory"
"org/codehaus/groovy/eclipse/refactoring/formatter/GroovyIndentationService"
This is a Maven+Git project that produces a jar file.
Groovy complierversion is 2.5.14.
Maven dependency is groovy-xml-2.5.6,jar, which pulls in groovy-2.5.6,jar
I spent a long time at the start of 2020 working out the pom.xml so that the App's jar file and related folders+files all end up correctly. (I'm a Sunday-driver Maven guy, so once it worked, I was happy to leave it alone).
I really don't want to change versions of Groovy or anything - I don't think it's good practice to change 'infrasucture' in the middle of project.
As I don't know what other information will be helpful, I will provide it on request.

JDK install unique error

So while attempting to install JDK via new task on task manager, it gives me the following error message:
Unable to install Java
There are errors in the following switches: "(1).exe";
Check that the commands are valid and try again.
I searched for the problem using "There are errors in the following switches" and turned up only one result which didn't help (surprising, considering the internet we live in today). Any and all diagnostic help is much appreciated, I've run out of things to try.
Note: Only this .exe is giving me issues, all other .exe s run fine.
(The original poster has probably moved on. This is for people who encounter the same problem and find this Q&A via a Google search.)
The Question does not include enough information to diagnose the problem. Based on the little that has been provided, I would consider the following:
Maybe the ".exe" came from a suspect source. Download it again from the official Oracle Java download site. (Don't trust 3rd-party download sites. They may be serving up an installer that is actually a trojan horse, or loaded up with bloatware...)
The executable name "(1).exe" is most unusual. Maybe it is the name that is causing the installer to get confused. If the name got changed when you downloaded the file, try changing it back to whatever it should be ... or downloading it again.
You didn't say clearly how you tried to run the installer. Maybe you actually did invoke it the wrong way; e.g. with /(1).exe as a "switch".
Should I attempt a manual installation? Placing files where they need to go.
No. Bad idea. The installer should work if you have a genuine one and you run it the right way.

How do I get rid of the syntax error "duplicate class: CLASSNAME"?

I thought that maybe I could rearrange my source code into different folders based on what the source code files pertained to. So I did, and I realized that it might cause some problems. I put all of the source code files back in the main folder, and now I am receiving the syntax error: duplicate class: retailapplication.AddNewCustomerDialog.
My question is this... How do I get rid of this issue? It does not appear as though I have more than one copy of the source code files (which isn't possible anyways, because Windows wouldn't have allowed me to do that), so I'm not sure where it is assuming that I have a duplicate.
For what it's worth, I am using the NetBeans 8.0 IDE.
Any help would be greatly appreciated.
EDIT: 02/01/2015 (9:43 PM MST) - I put ALL of my files into different folders, and I am receiving this error on three of my source code files.

Eclipse can't find source when debugging java code

I am new to Java and started with Eclipse Kepler Service Release 1. I started a small project that contains two classes, each in its own file:
MIDI_Wrap_Test - a main (program) class
MIDI_Wrap - another class (MIDI_Wrap) which is intended as a MIDI wrapper. -
Both classes are in the same directory with file names being the same as the class name (with .java added of course). Something goes wrong and I want to debug it. However, when control transfers from the main program to the MIDI_Wrap file/class I get the error message 'source not found'.
I found out that this is a quite common error. The question and answer that seem to mirror my problem perfectly is found here. I added the project to the debug source path, noticing that the correct directories were already added but to no avail.
I must be doing something wrong but am not able to find out what. Can someone help me out of this?
I solved by shutting down eclipse and reopened it. This solved me, and code can be debug with source code view.

Need help with using Saxon-B(version 9.1.0.8) with Java 1.4.2

I need to transform one XML document into another using XSLT (for now from command line). I have to use Java 1.4.2. Based on that someone recommended using Saxon and provided the XSLT. It seems simple it should work, but I am lost.
I come more form a .NET environment, and have worked with XML and XSLT but not with Saxon and I am not that strong in Java.
Let me start by explaining what my problem is and what I have tried so far:
The Error:
C:\Projects\new_saxon_download>java net.sf.saxon.Transform -s:source.xml -xsl:style.xsl -o:output.xml
Exception in thread "main" java.lang.NoClassDefFoundError: org/xml/sax/ext/DefaultHandler2
at net.sf.saxon.Configuration.(Configuration.java:2047)
at net.sf.saxon.Transform.setFactoryConfiguration(Transform.java:81)
at net.sf.saxon.Transform.doTransform(Transform.java:133)
at net.sf.saxon.Transform.main(Transform.java:66)
Steps that led me here:
I downloaded Saxon-B by following a link from this page
I also found some information on a dependency about SAX2 from this
page and thus obtained that as well.
Set the CLASSPATH in my session:
set CLASSPATH=.;C:\Projects\new_saxon_download\saxon9.jar;C:\Projects\new_saxon_download\sax2r2.jar
Tried the transformation:
java net.sf.saxon.Transform -s:source.xml -xsl:style.xsl -o:output.xml
Then I get the error shown above. I have tried multiple google search, but nothing has helped.
Any advice or solution would be very helpful.
GOT IT - the description on how to fix the dependendcy issue is crap (sorry).
This file sax2r2.jar isn't the one you have to add to the classpath. It contains another jar (sax.jar) and that's the library you actually need. Just extract the sax2r2.jar and put sax.jar on the classpath, then it should work.
Give this a try: apache xml-commons includes xml-api.jar. I can't tell if this is usable with java 1.4.12 but it's worth a try.
Binary releases can be found here. Download one of the xml-commons-external archives, extract xml-api.jar and add that to your classpath.

Categories