How to specify Java Option (System Property) for embedded Tomcat while running Grails App?
Specifically, I want to have my grails app under development to connect to an Oracle db defined by an tnsnames.ora file. I have the tnsnames.ora file located in c:\drivers\Network\ on my PC. When I run开发者_如何学JAVA the grails app via "grails run-war", the db connection string defined in the tnsnames.ora file doesn't seem to be picked up:
grails prod run-war -Dserver.port=62215 -Doracle.net.tns_admin=C:\drivers\Network\
It seems the name-value pair of oracle.net.tns_admin is not being passed to the JVM used by the the embedded Tomcat that comes with Grails 1.2.0. If not, what is the proper way of specifying it, or pass any JAVA_OPTS to the underlying JVM?
You're best off setting your JAVA_OPTS in the Grails startup script (%GRAILS_HOME%/bin/grails.bat). See this link for an example.
精彩评论