I am relatively new both to IBM Liberty server and Bluemix. My existing web application was deployed as a war in a local WebSphere Liberty server (version 8.5.5.7) and is running fine without any issue.
However the real problem comes when I am pushing the war file to IBM Bluemix Liberty server. There are 2 ways on how I tried to push my local app.
Option 1
Here I exported my application as a war with target runtime as WebSphere Liberty server under IBM group and then used cf push <appname> -p <app.war>
This does not give me any error while uploading but I am unable to access the application with the given context root.
Like http://<appname>.mybluemix.net/<<root>>/login.jsp
where <<appname>>
is the name of the app and <<root>>
is the name of the war file.
With these configurations however I am able to access the apps deployed in local Liberty server but not in Bluemix. Here Bluemix was not able to find context of the web application .
Option 2
Here I followed the link below link and tried all the steps mentioned over there:
I packaged the whole server with war and tried to deploy the entire server.zip
server.bat package defaultServer ––include=usr
cf push icmconsole -p E:\softwares\liberty\wlp-javaee7-8.5.5.7\wlp\usr\servers\defaultServer\defaultServer.zip
It seems after uploading the instance crashes and gives the error below in the log:
2015-10-15T13:58:29.10+0530 [API/0] OUT App instance exited with guid 50ff6
9b3-58de-4453-b795-2c58cf1b3fdc payload: {"cc_partition"=>"default", "droplet"=>
"50ff69b3-58de-4453-b795-2c58cf1b3fdc", "version"=>"d0097634-3404-47c9-8848- 324c
c6b08315", "instance"=>"a75978ad7c88496ea3c36d1dbc277b34", "index"=>0, "reason"=
>"CRASHED", "exit_status"=>0, "exit_description"=>"failed to accept connections
within health check timeout", "crash_timestamp"=>1444897709}
My server.xml file looks like this :
<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>javaee-7.0</feature>
</featureManager>
<!-- This template enables security. To get the full use of all the capabilities, a keystore and user registry are required. -->
<!-- For the keystore, default keys are generated and stored in a keystore. To provide the keystore password, generate an encoded password using bin/securityUtility encode and add it below in the password attribute of the keyStore element. Then uncomment the keyStore element. -->
<!-- <keyStore password=""/> -->
<!--For a user registry configuration, configure your user registry. For example, configure a basic user registry using the basicRegistry element. Specify your own user name below in the name attribute of the user element. For the password, generate an encoded password using bin/securityUtility encode and add it in the password attribute of the user element. Then uncomment the user element. -->
<basicRegistry id="basic" realm="BasicRealm">
<!-- <user name="yourUserName" password="" /> -->
</basicRegistry>
<!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
<httpEndpoint id="defaultHttpEndpoint" httpPort="9080" httpsPort="9443" />
</server>
The web.xml is like :
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>mCaaS</display-name>
<servlet>
<servlet-name>MCaaSServletloggedin</servlet-name>
<servlet-class>com.example.myproject.loggedin</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MCaaSServletloggedin</servlet-name>
<url-pattern>/mcaas</url-pattern>
</servlet-mapping>
<servlet>
<display-name>MCaaSServletonClose</display-name>
<servlet-name>MCaaSServletonClose</servlet-name>
<servlet-class>com.example.myproject.MCaaSServletonClose</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MCaaSServletonClose</servlet-name>
<url-pattern>/onClose</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>HelloWeb</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>HelloWeb</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet>
<description></description>
<display-name>ImageCreator</display-name>
<servlet-name>ImageCreator</servlet-name>
<servlet-class>com.example.myproject.ImageCreator</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ImageCreator</servlet-name>
<url-pattern>/ic.jpg</url-pattern>
</servlet-mapping>
<error-page>
<error-code>404</error-code>
<location>/WEB-INF/jsp/404.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/WEB-INF/jsp/500.jsp</location>
</error-page>
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
</web-app>
Could you guys throw any light on my issues? It looks like I am missing some configurations. Any help would be greatly appreciated.