dev-guide



OpenMRS Tomcat IntelliJ deployment freeze fix

Test Environment

JDK 1.6 - 1.6.0.33
Tomcat 6 - 6.0.35
IntelliJ 13 - 13.1.4
Openmrs - 1.9.0


After deploying to Tomcat from IntelliJ; I keep getting this error:
Artifact openmrs-webapp:war exploded: Server is not connected.
Application Server was not connected before run configuration stop, reason: Unable to ping server at localhost:1099

The error is exactly similar to http://stackoverflow.com/questions/19068977/intellij-cant-start-simple-web-application-unable-to-ping-server-at-localhost  but on windows and editing the hostfile did not make a difference.

The deployment process starts and freezes before the point where it should actually deploy the war file  - "Artifact is being deployed, please wait..." However I am on Windows 7 x64. I tried all the SO thread advice till I found one where it advised to remove the setenv.bat from C:\Programs\tomcat6\bin. When I removed it, I still get the message, but my deployment works and I can launch the webapp fine. Also move the setenv.bat fole confs to IntelliJ as shown below(also removed the java.lang.OutOfMemoryError: PermGen space error):



IntelliJ IDEA instructs Tomcat to use temporary directory as CATALINA_BASE where it places context configuration with the Artifact path from your project settings, it doesn't copy your web application into webapps directory.


OpenMRS runtime.properties file fix while deploying on Tomcat from IntelliJ

Test Environment


JDK 1.6 - 1.6.0.33
Tomcat 6 - 6.0.35
IntelliJ 13 - 13.1.4
Openmrs - 1.9.0

Deploy error - C:\Users\chandan\Application Data\OpenMRS\-runtime.properties (http://pastebin.com/QtLEMdaf)

To deploy openmrs at a path other than the root context path, use the setting in Tomcat and make sure you have the openmrs.xml file in %TOMCAT_HOME%\conf\Catalina\localhost  ; as below

<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" reloadable="false" useHttpOnly="false">
  <!-- <loader loaderClass="org.openmrs.web.OpenmrsWebClassLoader" useSystemClassLoaderAsParent="false"></loader> -->
  <!--<Resource name="jdbc/openmrs"
auth="Container"
type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory"
validationQuery="SELECT * FROM users"
url="jdbc:mysql://localhost:3306/openmrs"
driverClassName="com.mysql.jdbc.Driver"
username="openmrs"
password="openmrs"
maxWait="3000"
maxIdle="100"
maxActive="10" />
-->
  <!--
<Resource
name="mail/OpenmrsMailSession"
auth="Container"
type="javax.mail.Session"
mail.smtp.host="localhost"
        mail.smtp.port="25"
        mail.transport.protocol="smtp"
        mail.smtp.auth="true"
        mail.smtp.user="openmrs"
        password="openmrs"/>

<Resource
name="jms/ConnectionFactory"
auth="Container"
type="org.activemq.ActiveMQConnectionFactory"
description="JMS Connection Factory"
        factory="org.activemq.jndi.JNDIReferenceFactory"
        brokerURL="vm://localhost:61626"
        brokerName="LocalActiveMQBroker"/>

<Resource
name="jms/someTopic"
auth="Container"
type="org.activemq.message.ActiveMQTopic"
description="my Topic"
        factory="org.activemq.jndi.JNDIReferenceFactory"
        physicalName="FOO.BAR"/>

  <Resource
  name="jms/someQueue"
  auth="Container"
  type="org.activemq.message.ActiveMQQueue"
  description="my Queue"
        factory="org.activemq.jndi.JNDIReferenceFactory"
        physicalName="FOO.BAR"/>
-->
</Context>



Reference Links


Architecture overview

API usage example

Hibernate examples

http://www.flossmanuals.net/openmrs-developers-guide/

Comments