java - How to get full base path of spring application running on CentOS Wildfly server? -


i need full path of deployed spring application using java. tried following path

getclass().getprotectiondomain().getcodesource().getlocation().getpath() 

which returned following:

  • on wildfly running on centos :

"/content/myproject.war/web-inf/classes"

(partial path)

  • on wildfly running on win7 :

"/c:/wildfly-8.2.0.final/standalone/deployments/myproject.war/web-inf/classes"

(returning full path)

above worked on windows machine not working on wildfly running on centos.

there no such concept full path of deployed web application - @ least not in java ee specs, far know.

you seem assume tacitly deployed web application must located somewhere in file system , there absolute path of location.

but not case, , if happens case, it's implementation detail of app server application should not rely on.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -