Posts

My reference Notes

  VM instances Red Hat Enterprise Linux 8 yum -y install bitstream-vera-fonts yum -y install fonts-* sudo yum install java-11-openjdk-devel sudo yum install wget sudo yum install vim yum install -y mlocate updatedb cd /home mkdir tomcat cd /tomcat wget https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.20/bin/apache-tomcat-9.0.20.tar.gz tar xzf apache-tomcat-9.0.20.tar.gz chmod -R 777 . echo "export CATALINA_HOME="/home/tomcat/apache-tomcat-9.0.20"" >> ~/.bashrc source ~/.bashrc vim /tomcat/apache-tomcat-9.0.20/conf/tomcat-users.xml Add the following <!-- user manager can access only manager section --> <role rolename="manager-gui" /> <user username="manager" password="manager" roles="manager-gui" /> <!-- user admin can access manager and admin section both --> <role rolename="admin-gui" /> <user username="admin" password="admin" roles="manager-gui,adm

How to install MySQL Server 5.6 on RHEL 7

  How to install MySQL Server 5.6 on RHEL 7 In this tutorial we will learn, how to install MySQL Server 5.6 on RHEL 7 . Follow the given below steps to install MySQL Server 5.6 . You must be login with root user in system Download the Yum Repo package of MySQL Server 5.6 Download the rpm package, which will create a yum repo file for MySQL Server installation. yum install wget wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm nstall mysql-community-release-el7-5.noarch.rpm package Install this downloaded rpm package by using rpm command. rpm -ivh mysql-community-release-el7-5.noarch.rpm After the installation of this package. We will get two new yum repo related to MySQL [root@localhost ~]# ls -1 /etc/yum.repos.d/mysql-community* /etc/yum.repos.d/mysql-community.repo /etc/yum.repos.d/mysql-community-source.repo [root@localhost ~]# Installing MySQL Server By using yum command, now we will install MySQL Server 5.6 . All dependencies will be installed itself. yum install
  One-Stop Guide to Profiles with Spring Boot Go to Tomcat server folder  open the catalina.properties and add below entry spring.profiles.active=localTestEnv Programmatically read profile import org.springframework.core.env.Environment ; import org.springframework.util.StringUtils ; @Autowired private Environment environment ; String [] activeProfiles = environment .getActiveProfiles(); logger .info( "active profiles: {}" + Arrays . toString ( activeProfiles )); logger .info( "active profiles: {}" + StringUtils . arrayToCommaDelimitedString ( activeProfiles ));

wsdl2java - undefined element declaration 's:schema'

  Recently I got a third party generated wsdl, and when I try to use  wsdl2java   cxf-codegen-plugin  in maven eclipse it shows the below error in the wsdl: undefined element declaration 's:schema' After some googling it seems to be a common issue with JAXB and WSDL. Here is the problematic part of the WSDL: <s:element minOccurs="0" maxOccurs="1" name="GetQuoteDataSetResult"> <s:complexType> <s:sequence> <s:element ref="s:schema"/> <s:any/> </s:sequence> </s:complexType> </s:element> The easier solution seems to be to download the WSDL and modify the schema in order to generate the stub. Here is what I did to the WSDL as per the suggestion: <s:element minOccurs="0" maxOccurs="1" name="GetQuoteDataSetResult"> <s:complexType> <s:sequence> <!-- s:element ref="s:schema&qu
Tomcat server  1.        Set autoDeploy = false.  This will apply to the /conf/server.xml a.        This addresses an issue where if autoDeploy=true, and there is a failed deploy, DS files get deleted, and prevents hot deploys if war file is prestaged. 2.        Add XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath= java options. This will apply to /home/tomcat/<JVM_NAME/bin/setenv.sh a.        Produce heapdumps realtime, instead of manually after the fact. 3.        Remove -verbose:gc java option a.        logs duplicate gc logs in Catalina.out Tomcat server needs to restart to effect the above changes.

Enable/Disable triggers in mysql

Image
Disable Triggers in MySQL 5.0 Information about triggers in MySQL 5.0 you can find here: MySQL 5.0 New Features: Triggers MySQL 5.0 Reference Manual :: 18 Stored Programs and Views :: 18.3 Using Triggers It is not possible to temporary disable triggers in MySQL 5.0. But there are several tricks: drop/create triggers drop triggers do anything you need (import, update, etc) create triggers Use global variable each trigger should check this variable in its code beginning set global variable to 1 (or other NOT NULL value) to disable triggers do anything you need (import, update, etc) set global variable to NULL to enable triggers global variable IS NULL by default see sample below: schema: script: CREATE TABLE `users` ( `id` int (10) unsigned NOT NULL auto_increment, `name` varchar (45) NOT NULL , PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `properties` ( `userid` int (10) unsigned NOT NULL , `updated`