4

I put qqwry.dat in src/main/resource in my SpringBoot project. In my class, I tried:

IPSeeker.class.getResource("/qqwry.dat"), IPSeeker.class.getClassLoader().getSystemResource("qqwry.dat")

Both is OK running on my own computer with tomcat embebed in SpringBoot Tomcat. But when I build them into JAR and run in Docker never worked. Very bothing.

fabian
  • 80,457
  • 12
  • 86
  • 114
wpp
  • 161
  • 1
  • 1
  • 7
  • Have you checked that your jar realy includes this resources? And what is the real name "qqwar.dat" or "qqwry.dat"? Are you sure you want a jar file? not a War to deploy it to an app server? – Rene M. Jun 27 '16 at 11:31
  • I build the jar and run in docker. src/main/resouces includes the following files:application.properties.qqwry.dat. and ,private static final String APP_CONFIG = "application.properties";in = PropertiesUtil.class.getClassLoader().getResourceAsStream(APP_CONFIG) ; apProperties.load(in); is Ok. – wpp Jun 28 '16 at 02:44
  • sorry .new here .don't know how to edit the comment in a elegant way – wpp Jun 28 '16 at 02:46

0 Answers0