Deploying Confluence to OpenShift? - spring

I deployed Confluence 5.1 as a WAR to an OpenShift Tomcat 6 Cartridge.
Visiting the instance with my web-browser I get:
Error occurred during template rendering: Velocimacro : Error using VM library : template/includes/macros-deprecated.vm. Contact your administrator for assistance.
With the relevant portion of the server logs saying:
2013-04-14 05:32:03,322 FATAL [ContainerBackgroundProcessor[StandardEngine[Catalina]]] [atlassian.spring.container.SpringContainerContext] getComponent Spring Application context has not been set
2013-04-14 05:32:03,323 ERROR [ContainerBackgroundProcessor[StandardEngine[Catalina]]] [confluence.user.listeners.UserSessionExpiryListener] sessionDestroyed Application server does not give us access to expired sessions. Listeners that depend on receiving LogoutEvent will not be reliable. This web server is probably unsupported.
java.lang.IllegalStateException: Spring Application context has not been set
Atlassian support tells me to chown the Tomcat directories; but OpenShift doesn't seem to allow this.
How can I successfully install Confluence 5.1 on OpenShift?

You could use a DIY cartridge and deploy tomcat yourself. Using an action hook (for example the deploy hook) you could also adjust permissions if this is still required.

Related

Spring boot microservices doesn't work with Intelij IDEA

I am creating a spring boot microservice project with intelij IDEA.
Currently I have developed three seperate spring boot rest services as customer service, vehicle service and spring cloud config server. Spring cloud config server is pointing to a github repository.
The issue is sometimes above projects take more than 10 minutes to run and sometimes does't run and give an error message as "failed to check application readystate intellij attached provider for the vm is not found". I have no idea why this happens ?
There are two possible causes:
1. IntelliJ IDEA and the Spring application are running in different JVMs.
There is a bug for IntelliJ IDEA regarding that:
https://youtrack.jetbrains.com/issue/IDEA-210665
Here is short summary:
IntelliJ IDEA uses local JMX connector for retrieving Spring Boot actuator endpoint's data by default. However, it could be impossible to get local JMX connector address via attach api if Spring Boot application and IntelliJ IDEA are run by different JVMs. In this case, add the following lines to VM options of your Spring Boot run configuration:
-Dcom.sun.management.jmxremote.port={some_port}
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
As mentioned in the official Oracle documentation, this configuration is insecure. Any remote user who knows (or guesses) your port number and host name will be able to monitor and control your Java applications and platform.
2. Prolonged time to retrieve local hostname
You can check that time using inetTester. Normally it should take only several milliseconds to complete. If it takes a long time then you can add the hostname returned by inetTester to /etc/hosts file like this:
127.0.0.1 localhost winsky
::1 localhost winsky

How to enable jmxremote authentication for MobileFirst Platform on Tomcat

I try to configure login/password authentication for jmxremote connection on Tomcat 7 and MFP 7.1
With the properties -Dcom.sun.management.jmxremote.authenticate=false in file setenv.sh, all works fine. I can see the runtimes in the MFP Operational Console
When I change the properties -Dcom.sun.management.jmxremote.authenticate to true, I don't be able to see the runtime in the MobileFirst Operational Console and I have the following error in the file catalina.out
Exception in thread Initialization thread for Worklight runtime prod" java.lang.RuntimeException: Timeout while waiting for the management service to start up.120 secs.
Thanks
com.sun.management.jmxremote.authenticate=true means that you activate JMX on Tomcat with client authentication based on a user ID and password, without SSL. In this case other properties are required. See for example https://jazz.net/help-dev/clm/index.jsp?re=1&topic=/com.ibm.jazz.repository.web.admin.doc/topics/t_server_mon_tomcat_option2.html&scope=null.

IBM Worklight 6.2 returns "Service unavailable since initialization failed"

I got this problem after deploy worklight app inside websphere. I already follow exactly all these steps carefully without any mistakes.
http://blog.revivalx.com/2014/06/18/deploy-worklight-war-file-into-websphere/
When I try to invoke this URL inside my browser, it throw an error.
Service unavailable since initialization failed.
Already search out the log file, it said like this
[10/2/14 17:46:39:474 MYT] 0000009b Authenticatio E com.worklight.core.auth.impl.AuthenticationFilter isWaitingForInitialization FWLSE0242E: Failed to synchronize application runtime information. The servlet initialization failed and the servlet will deny service. The most common reason is a failure in JMX communication with the ''worklightadmin'' service. You need to restart the web application after fixing the problem. [project xxxxxxxx]
Worklight version
version=6.2.0
fixpack=00
buildNumber=20140613-0730
Websphere version
Webspshere Base v 8.5.5.0
build gm1319.01
First thing first, you are using an outdated version of Worklight 6.2; download the latest studio and server artifacts from IBM Fix Central.
Second, you are using Worklight 6.2, don't follow guides written for 6.1...
Instead, follow the official installation documentation.
Worklight 6.2 contains a new management service that you must take into account when deploying Worklight to an application server, this is not taken into account in the guide you linked to.
From the error message:
The servlet initialization failed and the servlet will deny service.
The most common reason is a failure in JMX communication with the
''worklightadmin'' service
Read carefully the Knowledge Center for 6.2, then try to install.
Also read this: How to solve management service not starting up in Worklight 6.2

IBM Worklight - Can't run an app on WebSphere Application Server

My app runs well on Worklight Development Server, but not on WebSphere Application Server V8.5 Liberty Profile.
I tried both Oracle JDK and IBM JDK, there was no difference.
There was no problem connecting to the server with jconsole, although I had to connect without ssl.
On Eclipse Console,
[2014-07-11 17:18:10] Starting build process: application 'U1', all environments
[2014-07-11 17:18:12] Application 'U1' with all environments build finished.
[2014-07-11 17:18:12] Deploying application 'U1' with all environments to Worklight Server...
[2014-07-11 17:19:02] Failed to deploy the application to Worklight server: : JMX configuration error. Unable to obtain MBeans. Reason: "FWLSE3012E: JMX configuration
error. Unable to obtain MBeans. Reason: "Connection refused".".
Thank you.
I do not know how the Studio deploys to an external Liberty server.
You could also:
Install Worklight Server and deploy using
- the Server Configuration Tool
- or the ant tasks (provided by the Worklight Server installer)
- or manual procedure documented at https://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.installconfig.doc/install_config/t_wlconsole_install.html
The manual procedure may give you hints about what is missing in your External Liberty Server.
It could be:
- rest connector and it's configuration https://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.installconfig.doc/install_config/t_optional_config_app_server_liberty.html
- JNDI properties so that Liberty can use the REST connector (step 3 at https://www-01.ibm.com/support/knowledgecenter/SSZH4A_6.2.0/com.ibm.worklight.installconfig.doc/admin/t_configuring_liberty_profile_for_wladmin_manually.html )

WebSphere 8.5: Importing 6.1 Profile ends with "fail to deploy application isclite"

On the 6.1 server I run...
$AdminTask exportWasprofile {-archive c:/tmp/my.car}
On the 8.5 server I see...
$AdminTask importWasprofile {-archive c:/tmp/my.car}
WASX7015E: Exception running command: "$AdminTask importWasprofile {-archive c:/
tmp/my.car}"; exception information:
com.ibm.wsspi.configarchive.ConfigArchiveException
com.ibm.wsspi.configarchive.ConfigArchiveException: fail to deploy application isclite
Is there something special I have to do to properly migrate profiles? Is there a place I can look to get more info as to what is going wrong?
From IBM WebSphere Application Server Migration Toolkit's website:
The IBM® WebSphere® Application Server Migration Toolkit is a suite of
tools and knowledge collections that enables your organization to
quickly and cost-effectively migrate to WebSphere Application Server
V7, V8, or V8.5, whether from a previous version of WebSphere
Application Server or competitive application servers including Apache
Tomcat Server, JBoss Application Server, Oracle Application Server,
and Oracle® WebLogic Server.
You should use it as it's bundled in WebSphere Application Server 6.1 (and higher) and offers two scripts that help you in the migration: WASPreUpgrade and WASPostUpgrade.
WASPreUpgrade "saves the configuration of a previously installed version of WebSphere Application Server into a migration-specific backup directory." while WASPostUpgrade "retrieves the saved configuration that was created by the WASPreUpgrade command from the backupDirectory that you specified." (quoting their pages).
Although they might be using wsadmin/Jython, I think you may have more success with these two command-line utilities.

Resources