wordinator icon indicating copy to clipboard operation
wordinator copied to clipboard

Command line exception

Open jdwinfodesign opened this issue 1 year ago • 5 comments

Downloaded Release 1.1.2 and ran successfully in Oxygen. I want to see the SWPX, so copied and pasted the command from the README: java -jar wordinator.jar -i html/sample_web_page.html -o out -x xsl/html2docx/html2docx.xsl -t docx/Test_Template.dotx The result: `PS C:\Users\jdwin\Documents\wordinator-sandbox> java -jar wordinator.jar -i html/sample_web_page.html -o out -x xsl/html2docx/html2docx.xsl -t docx/Test_Template.dotx WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.

  • 2023-05-22 07:48:00,661 [INFO ] Input document or directory='html/sample_web_page.html'
  • 2023-05-22 07:48:00,661 [INFO ] Output directory ='out'
  • 2023-05-22 07:48:00,661 [INFO ] DOTX template ='docx/Test_Template.dotx'
  • 2023-05-22 07:48:00,661 [INFO ] XSLT template ='xsl/html2docx/html2docx.xsl'
  • 2023-05-22 07:48:00,661 [INFO ] Catalog =Not specified
  • 2023-05-22 07:48:00,661 [INFO ] Chunk level ='root'
  • 2023-05-22 07:48:01,084 [INFO ] Making output directory 'C:\Users\jdwin\Documents\wordinator-sandbox\out'... Exception in thread "main" java.lang.ExceptionInInitializerError at org.wordinator.xml2docx.MakeDocx.transformXml(MakeDocx.java:249) at org.wordinator.xml2docx.MakeDocx.handleCommandLine(MakeDocx.java:204) at org.wordinator.xml2docx.MakeDocx.main(MakeDocx.java:86) Caused by: java.lang.UnsupportedOperationException: No class provided, and an appropriate one cannot be found. at org.apache.logging.log4j.LogManager.callerClass(LogManager.java:573) at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:598) at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:585) at org.wordinator.xml2docx.generator.DocxGeneratingOutputUriResolver.(DocxGeneratingOutputUriResolver.java:27) ... 3 more`

jdwinfodesign avatar May 13 '23 19:05 jdwinfodesign

The problem is something to do with your classpath. To diagnose it we need to know how you invoked Java, what your classpath was, and how the jar you're referring to was built.

larsga avatar May 18 '23 14:05 larsga

I believe this is fixed on the develop branch--it's an issue with how the logging libraries are used (52bbfc75c225921122df1753cbe9c0ffa155ba93).

If you can build from source, try checking out develop branch, do mvn clean install and run the all-dependencies jar from the target/ directory.

If you're not able to build from source, let me know and I can make a jar for you.

drmacro avatar May 21 '23 16:05 drmacro

The problem is something to do with your classpath.

I was using the default JRE for Windows 11, which is a Java SE. I'm so used to running builds in Oxygen, I don't even have JAVA_HOME set on my machine. Should I set JAVA_HOME to a JDK instead?

jdwinfodesign avatar May 22 '23 12:05 jdwinfodesign

I think @drmacro's tip is better than mine.

larsga avatar May 22 '23 14:05 larsga

@drmacro Build failed. I ran it a second time with error and debug switches and info piped to a text file.

log.txt

jdwinfodesign avatar May 22 '23 23:05 jdwinfodesign