Tika-Parsers deployment issue on Wildfly

后端 未结 2 1114
悲哀的现实
悲哀的现实 2020-12-21 11:26

As part of a web application i need to parse textual content of different incoming files. This should be quite simple using tika-parsers, but as soon as i t

2条回答
  •  猫巷女王i
    2020-12-21 12:13

    Besides the fact that Tika dumps a gigantic pile of questionable dependencies with a further mountain of very unwelcome transitive dependencies onto your runtime classpath, you are running into this issue:

    http://weld.cdi-spec.org/documentation/#4

    https://issues.jboss.org/browse/CDI-377

    Basically it is an incompatibility issue in CDI 1.1 that has been resolved in CDI 1.2; manually updating Weld to version 2.3.x in Wildfly may take the problem away entirely.

    Barring doing a manual upgrade, you can make the problem go away by declaring a META-INF/jboss-all.xml file with the following content. Assuming you have a war, the precise path is webapp/META-INF/jboss-all.xml.

    
        
    
    

    And make sure to define a WEB-INF/beans.xml file (again: assuming a war) in your own modules that need CDI support. This forces Weld to only try to configure modules which have a beans.xml file as part of them, which CXF will not.

    Besides all that I would really investigate the dependency tree and see what is pulled in through Tika; for example you will find that the javax.inject API is put on the compile scope and thus deployed with your application, something you really do not want.

提交回复
热议问题