I have a Spring MVC Web application with MySQL database running on tomcat. I have configured Tomcat 7 (JBoss EWS 2.0), MySQL 5.5 and phpMyAdmin 4.0 on openshift. Then I have deployed my .war file following this tutorial. But my .war file doesn't work, I have renamed it to ROOT.war, and in root of openshift application it shows me a blank page. When I used some sample .war file from internet(for example this one), everything works perfect.
I thougt maybe the problem is in the database connection, so this is how my datasource in mvc-dipatcher-servlet.xml
looks like with OpenShift's environment variables:
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://${OPENSHIFT_MYSQL_DB_HOST}:${OPENSHIFT_MYSQL_DB_PORT}/${OPENSHIFT_APP_NAME}?characterEncoding=UTF-8"/>
<property name="username" value="${OPENSHIFT_MYSQL_DB_USERNAME}"/>
<property name="password" value="${OPENSHIFT_MYSQL_DB_PASSWORD}"/>
</bean>
I have also tried with hardcoded version but the same result - pretty simple blank page:
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://127.0.0.1:3306/myDatabaseName?characterEncoding=UTF-8"/>
<property name="username" value="myRootUserName"/>
<property name="password" value="MyPassword"/>
</bean>
Is there any solutions for this problem?
UPDATE
With the suggestion of @Artur Malinowski I ran rhc tail - a <appname>
command:
This is what I got:
DL is deprecated, please use Fiddle
==> app-root/logs/jbossews.log <==
Dec 30, 2014 7:06:06 AM org.apache.catalina.loader.WebappClassLoader clearRefere
ncesJdbc
SEVERE: The web application [/quiz] registered the JDBC driver [com.mysql.jdbc.D
river] but failed to unregister it when the web application was stopped. To prev
ent a memory leak, the JDBC Driver has been forcibly unregistered.
Dec 30, 2014 7:06:06 AM org.apache.catalina.loader.WebappClassLoader clearRefere
ncesThreads
SEVERE: The web application [/quiz] appears to have started a thread named [Aban
doned connection cleanup thread] but has failed to stop it. This is very likely
to create a memory leak.
Dec 30, 2014 7:06:06 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /var/lib/openshift/54a274c6e0b8cd33d
10000a4/app-root/runtime/dependencies/jbossews/webapps/quiz.war has finished in
15,066 ms
Dec 30, 2014 7:06:06 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-127.4.37.1-8080"]
Dec 30, 2014 7:06:06 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 15415 ms
==> app-root/logs/phpmyadmin.log <==
[Tue Dec 30 07:03:35 2014] [notice] caught SIGWINCH, shutting down gracefully
- - - [30/Dec/2014:07:03:35 -0500] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.2.15
(Red Hat) (internal dummy connection)"
[Tue Dec 30 07:04:06 2014] [notice] SELinux policy enabled; httpd running as con
text unconfined_u:system_r:openshift_t:s0:c2,c79
[Tue Dec 30 07:04:06 2014] [notice] Digest: generating secret for digest authent
ication ...
[Tue Dec 30 07:04:06 2014] [notice] Digest: done
[Tue Dec 30 07:04:06 2014] [notice] Apache/2.2.15 (Unix) PHP/5.3.3 configured --
resuming normal operations
[Tue Dec 30 07:05:31 2014] [notice] SIGHUP received. Attempting to restart
[Tue Dec 30 07:05:32 2014] [notice] Digest: generating secret for digest authent
ication ...
[Tue Dec 30 07:05:32 2014] [notice] Digest: done
[Tue Dec 30 07:05:32 2014] [notice] Apache/2.2.15 (Unix) PHP/5.3.3 configured --
resuming normal operations
==> app-root/logs/mysql.log <==
141230 7:05:12 InnoDB: highest supported file format is Barracuda.
141230 7:05:13 InnoDB: Waiting for the background threads to start
141230 7:05:14 InnoDB: 5.5.40 started; log sequence number 1755443
141230 7:05:14 [Note] Server hostname (bind-address): '127.4.37.2'; port: 3306
141230 7:05:14 [Note] - '127.4.37.2' resolves to '127.4.37.2';
141230 7:05:14 [Note] Server socket created on IP: '127.4.37.2'.
141230 7:05:14 [Warning] 'proxies_priv' entry '@ root@ex-std-node501.prod.rhclo
ud.com' ignored in --skip-name-resolve mode.
141230 7:05:14 [Note] Event Scheduler: Loaded 0 events
141230 7:05:14 [Note] /opt/rh/mysql55/root/usr/libexec/mysqld: ready for connec
tions.
Version: '5.5.40' socket: '/var/lib/openshift/54a274c6e0b8cd33d10000a4/mysql//s
ocket/mysql.sock' port: 3306 MySQL Community Server (GPL)