• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

postgresql conection refuse through war file.

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I write this command (java -jar MedoolPatientServices-1.0.war postgres 'postgres3' @ 'localhost'
) on terminal, but it gives error,basically , in my application, i compiled my code through maven with command line(mvn clean -X package) and then after write (java -jar MedoolPatientServices-1.0.war postgres 'postgres3' @ 'localhost') this command , but it gives error.
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What error are you getting.
Include any stack trace, and the relevant code.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Either you are very confused about how Java works or there's a lot of missing information here.

You are attempting to execute a WAR file via the stand-alone Java "-jar" option. WAR files are designed to be handled by a web application container, not run stand-alone.

Furthermore, any application complex enough to need a JDBC driver requires extra build options. Because that ups the module count from one (executable JAR) to at least 2, unless you unpack the JDBC driver jar and pour its contents into the application JAR (which isn't recommended).

As a final note, a true WAR shouldn't be directly requesting database connections at all. Because the application container's JDBC Connection Pool resources can usually do the job more efficiently.

Is this question related to the one you asked in the Tomcat forum (https://coderanch.com/t/667059/Tomcat/Migration-java-tomcat-postgre-ubuntu ?)
 
Dave Tolls
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah, I didn't even notice it was a .war file...
 
Run away! Run away! Here, take this tiny ad with you:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic