简体   繁体   中英

How to war file execute Jetty-runner in command prompt

I am converting java class file as War File , So I want to execute war file via command prompt . can any one suggest to me how i can run successfully through command prompt.

When I Have run through command prompt below Error showing in my Eclipse Console .

D:\> java -jar c:\Jetty-runner.jar --port 8080 C:\firstsample.war 

now deploying my war file, but it will error like-- no Transacation manager found if your webapp require one , please configure one , this type error i faced ......

Just check your options

D:\> java -jar c:\Jetty-runner.jar -port 8080 -C:\ mysample.war

It should be like

 D:\>java -jar C:\Jetty-runner.jar --port 8080 C:\mysample.war

Better you keep jetty-runner and mysample.war in same directory.

This is because jetty-runner always runs it in production mode, so you have to specify database as well as make sure that in database.yml file you have correct db configuration for production mode, eg

$java -Ddb=/Users/gouravtiwari/rubyapps/myapp/db/development.sqlite3 -jar jetty-runner.jar myapp.war

And your database.yml:

development:
  adapter: sqlite3
  database: db/development.sqlite3

test: &test
  adapter: sqlite3
  database: db/test.sqlite3

production:
  adapter: sqlite3
  database: <%= java.lang.System.getProperty('db') %>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM