Reading a file in Jboss causes Exception while using classloader or resource utils [duplicate]

Discussão em 'StackOverflow' iniciado por Stack, Abril 20, 2021.

  1. Stack

    Stack Membro Participativo

    We have an application deployed in JBoss as WAR file. It is showing error while we are reading files using classloader as well as resource utils. If we are giving the full path hardcoded, we are able to read file. The same code is working fine with Tomcat server which is build in in spring tool. We have kept all our files to be read under resources folder.

    File file = ResourceUtils.getFile(String.format("classpath:jsons/%s", filename));


    Even if we are keeping files under root directory also it is not working. How can I solve the problem?Please Help.. Thankyou...

    Continue reading...

Compartilhe esta Página