Closed llamafilm closed 3 years ago
I found that running ttt-ttpe-all
gets a little further on the dependency issue. Then it throws an exception:
% java -jar ~/.m2/repository/com/skynav/ttt/ttt-ttpe-all/7.1-SNAPSHOT/ttt-ttpe-all-7.1-SNAPSHOT.jar --font ttt-ttpe/src/test/fonts/NotoSans.xml ~/Downloads/Netflix_sub.xml
Timed Text Presentation Engine (TTPE) [7.1-SNAPSHOT] Copyright 2014-19 Skynav, Inc.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.apache.fontbox.ttf.advanced.AdvancedTypographicTable.<clinit>(AdvancedTypographicTable.java:51)
at org.apache.fontbox.ttf.OTFParser.readTable(OTFParser.java:106)
at org.apache.fontbox.ttf.TTFParser.readTableDirectory(TTFParser.java:280)
at org.apache.fontbox.ttf.TTFParser.parse(TTFParser.java:129)
at org.apache.fontbox.ttf.OTFParser.parse(OTFParser.java:83)
at org.apache.fontbox.ttf.OTFParser.parse(OTFParser.java:31)
at org.apache.fontbox.ttf.TTFParser.parse(TTFParser.java:84)
at org.apache.fontbox.ttf.OTFParser.parse(OTFParser.java:71)
at com.skynav.ttpe.fonts.FontState.maybeLoad(FontState.java:410)
at com.skynav.ttpe.fonts.FontState.getGlyphMapping(FontState.java:178)
at com.skynav.ttpe.fonts.Font.getGlyphMapping(Font.java:209)
at com.skynav.ttpe.layout.LineLayout$TextRun.getAdvance(LineLayout.java:1142)
at com.skynav.ttpe.layout.LineLayout$TextRun.getAdvance(LineLayout.java:1131)
at com.skynav.ttpe.layout.LineLayout.getNextBreakOpportunity(LineLayout.java:332)
at com.skynav.ttpe.layout.LineLayout.layout(LineLayout.java:184)
at com.skynav.ttpe.layout.ParagraphLayout.layout(ParagraphLayout.java:50)
at com.skynav.ttpe.layout.ParagraphLayout.layout(ParagraphLayout.java:46)
at com.skynav.ttpe.layout.BasicLayoutProcessor.layoutParagraph(BasicLayoutProcessor.java:551)
at com.skynav.ttpe.layout.BasicLayoutProcessor.layoutParagraphs(BasicLayoutProcessor.java:543)
at com.skynav.ttpe.layout.BasicLayoutProcessor.layoutParagraph(BasicLayoutProcessor.java:534)
at com.skynav.ttpe.layout.BasicLayoutProcessor.layoutDivision(BasicLayoutProcessor.java:520)
at com.skynav.ttpe.layout.BasicLayoutProcessor.layoutBody(BasicLayoutProcessor.java:503)
at com.skynav.ttpe.layout.BasicLayoutProcessor.layoutRegion(BasicLayoutProcessor.java:484)
at com.skynav.ttpe.layout.BasicLayoutProcessor.layoutISDInstance(BasicLayoutProcessor.java:441)
at com.skynav.ttpe.layout.BasicLayoutProcessor.layout(BasicLayoutProcessor.java:366)
at com.skynav.ttpe.app.Presenter.performPresentation(Presenter.java:645)
at com.skynav.ttpe.app.Presenter.processResult(Presenter.java:353)
at com.skynav.ttv.app.TimedTextVerifier.verify(TimedTextVerifier.java:2238)
at com.skynav.ttv.app.TimedTextVerifier.verify(TimedTextVerifier.java:2363)
at com.skynav.ttv.app.TimedTextVerifier.run(TimedTextVerifier.java:2440)
at com.skynav.ttv.app.TimedTextVerifier.run(TimedTextVerifier.java:2406)
at com.skynav.ttx.app.TimedTextTransformer.run(TimedTextTransformer.java:535)
at com.skynav.ttx.app.TimedTextTransformer.run(TimedTextTransformer.java:531)
at com.skynav.ttpe.app.Presenter.main(Presenter.java:224)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 34 more
I managed to make it work by downloading commons-logging-1.2.jar from here and copying it to the jars folder. I'm sure there must be a better way to build this app. It would be great to document it for Java novices like myself.
% mvn -DskipTests clean package
% find . -name "*.jar" -exec cp {} jars \;
% java -cp "jars/*" com.skynav.ttpe.app.Presenter --font ttt-ttpe/src/test/fonts/NotoSans.xml ~/Downloads/Netflix_sub.xml
Thanks, I will update the documentation for TTPE. The problem you are facing is that you failed to follow the instructions at https://github.com/skynav/ttt before attempting to build the subordinate ttt-ttpe project. [The same applies to the ttt-ttv project.] N.B. that this software is intended to be built and used by someone with intermediate to advanced knowledge of Java and Maven.
The build instructions for
ttpe
say to useant build
but this gives an errorI figured out the project uses maven instead, so I ran
mvn clean install
and got an error about Too many open files in system. My Mac running Big Sur has maxfiles at 10000 by default, so I fixed it withThen the build succeeds, but I cannot run it:
So I tried extracting the JAR and running it this way.
I don't know Java code at all, but I think maybe it can't find the TimedTextTransformer class because I don't see this in the JAR.
The versions I'm using: