在AWS弹性魔豆Sphinx4断裂,工程开发计算机上机上、弹性、魔豆、工程

2023-09-11 11:45:50 作者:你若一笑,江山不要!

我创建了一个虚拟的Maven项目包装CMU Sphinx4在一个servlet。该依赖性是 sphinx4核1.0-SNAPSHOT sphinx4数据:1.0-SNAPSHOT 。当本地运行(Eclipse中),它的伟大工程,但后来我把它部署到AWS弹性魔豆,我也得到了以下异常:

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

我怀疑它在那里,双斜杠,但我无法解释为什么它不会发生在我的开发机器(OSX)。

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

谢谢!

编辑:

我的开发机:OSX运行Eclipse月神与AWS插件。我使用的是J2EE项目中使用一个servlet,并获得狮身人面像的JAR文件;基于Maven(芯放数据)。当我在我的开发机器(8080端口)上运行的服务器我给它一个WAV文件通过POST消息,该文件被正确地加载和我得到的分析文本响应。

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.

我的督促机:AWS弹性魔豆。我部署使用AWS插件。当我注释掉的code狮身人面像的一部分,服务器的工作原理(即获得该文件,并将其返回给我,等。)

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.)

如果问题不是双斜杠,然后将瓶子没有被煮熟的权利。这将使意义,因为它是要找的文件是不是这样的Maven的JAR烹调部分应被告知如何将在JAR资源文件,它使得当它部署

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 ?

再次感谢!

推荐答案

双斜线似乎在某些JVM上的一个问题,它的工作原理其他JVM。

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

我刚刚提交的更新,以避免双重斜线。请更新sphinx4,然后重试。

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