Sphinx4 breaks on AWS Elastic Beanstalk, works on

2019-08-13 22:20发布

I created a dummy Maven project that wraps CMU Sphinx4 in a servlet. The dependencies are sphinx4-core:1.0-SNAPSHOT and sphinx4-data:1.0-SNAPSHOT. When running locally (Eclipse) it works great, but then I deploy it to AWS Elastic Beanstalk and I get the following exception:

Property exception component:'null' property:'null' - java.io.FileNotFoundException: JAR entry edu/cmu/sphinx/models/en-us/en-us//means not found in /var/lib/tomcat8/webapps/ROOT/WEB-INF/lib/sphinx4-data-1.0-SNAPSHOT.jar 
edu.cmu.sphinx.util.props.PropertyException: java.io.FileNotFoundException: JAR entry edu/cmu/sphinx/models/en-us/en-us//means not found in /var/lib/tomcat8/webapps/ROOT/WEB-INF/lib/sphinx4-data-1.0-SNAPSHOT.jar

Caused by: java.io.FileNotFoundException: JAR entry edu/cmu/sphinx/models/en-us/en-us//means not found in /var/lib/tomcat8/webapps/ROOT/WEB-INF/lib/sphinx4-data-1.0-SNAPSHOT.jar

I suspect it's that double slash in there but I cannot explain why it doesn't happen on my dev machine (OSX).

thanks!

Edit:

My dev machine: OSX running Eclipse Luna with AWS plugin. I am using a J2EE project with a single servlet, and getting Sphinx JARs (core & data) through Maven. When I run the server in my dev machine (port 8080) I feed it a WAV file through a POST message, the file gets loaded correctly and I get the analysis as a textual response.

My prod machine: AWS Elastic Beanstalk. I deploy using AWS plugin. When I comment out the Sphinx part of the code, the server works (i.e. gets the file, and returns it to me, etc.)

If the problem is not the double slash, then the JARs are not being cooked right. This would make sense since the file it's looking for is not a class so the JAR cooking part of Maven should be told how to include resource files in the JAR it makes when it deploys.

Any idea how to do this ?

thanks again!

2条回答
可以哭但决不认输i
2楼-- · 2019-08-13 22:43

Double slash seems to be a problem on some JVMs, on other JVMs it works.

I've just committed an update to avoid double slashes. Please update sphinx4 and try again.

查看更多
Melony?
3楼-- · 2019-08-13 22:50

Turns out the problem was I was developing (OSX) on Java 7 and deploying to AWS to Tomcat/Java 8. Once I deployed to Tomcat/Java 7, everything worked as expected.

查看更多
登录 后发表回答