java - Getting reources path creates weird path (in jar works) -


i've got weird problem. access resources files this:

file xmlfile = new file(getclass().getresource(xmlpath).getpath()); 

where xmlpath "/meta-inf/file.xml".

when run eclipse, works fine. unfortunately, when pack jnlp file, upload web app on tomcat (from download jar's jnlp) stops work.

when run jnlp, downloads jar's should , fails start. throwing exception:

java.io.filenotfoundexception: c:\users\a050868\desktop\http:\address:port\webapp\downloads\lib\package.jar!\meta-inf\componentcontext.xml (the filename, directory name, or volume label syntax incorrect) 

how can access file, in resources/meta-inf folder, in cached locale jar copy? seems, java try access jar on server side - no local, downloaded jnlp.

any ideas?

all files packed in jnlp file. don't exist individual files on filesystem when port package.

that said, available on classpath. can access content of package using appropriate classloader.

getclass().getclassloader().getresourceasstream(...) 

this may


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -