Software Development, Linux, and Windows

Notes on Software Development, Linux, and Windows

Determine what Product Key was used for a Windows Install

This works for Windows 7, 8, and 10: The use case for this is that you have several licensed copies of the same Windows version, but do not remember which key you used on which computer. Open the Start Menu and type: cmd Type the following at the command prompt: slmgr -dli After about 15 [...]

Posted in Windows | Comments Off

JPA: How to use a base class for your entities

In order for to extend a base class from you entities, you must use the annotation @MappedSuperclass on the base class: @MappedSuperclass public abstract class AbstractBaseEntity Then in your entity class extend the class as you usually would: @Entity public class MyConcreteEntity extends AbstractBaseEntity

Posted in JPA | Comments Off

How to resolve LazyInitializationException with SpringMVC using JPA with Hibernate

Follow the below steps if you see the org.hibernate.LazyInitializationException being thrown while trying to render your page. Add a filter to your web.xml file: <filter> <filter-name>SpringOpenEntityManagerInViewFilter</filter-name> <filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class> </filter> <filter-mapping> <filter-name>SpringOpenEntityManagerInViewFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>

Posted in Hibernate, JPA, SpringMVC | Comments Off

Install CentOS 7 Server with GUI

Boot from the CentOS 7 Installation DVD and select Install CentOS 7. Select language to use during the installation process and click [Continue]. You should now be at the Installation Summary screen. Under SOFTWARE, click Software Selection. Select Server with GUI and click [Done]. Note for this next part of configuring RAID 0 at the [...]

Posted in CentOS | Comments Off

Install and run Minecraft Server on CentOS 7 Server

Create a CentOS Installation DVD The first thing you need to do if you do not have it already is Create a CentOS Installation DVD Install CentOS 7 Server with GUI Follow the steps in this article to install CentOS 7, but note that you will want to use a static IP so that you [...]

Posted in CentOS | Comments Off

Handling Multiple Exceptions in one catch block

Overview Java 1.7 added support to handle more than one Exception in a single catch block. Example: This is a nice feature, and here is an example that demonstrates this and how to extract the name of the Exception class being thrown for logging: package com.petersarazin.exception; import java.io.IOException; import org.junit.Test; public class ExceptionHandling_Test { @Test [...]

Posted in Java | Comments Off

Create a CentOS Installation DVD

Point your browser at https://www.centos.org. Click the [Get CenotOS Now] button. Click the DVD ISO button. choose a mirror and download the .iso image. Burn the .iso image to a blank writable DVD.

Posted in CentOS | Comments Off

Open mysql on firewall in CentOS 7

Login or set user to root su – See the before of what services are open on the public zone firewall-cmd –zone=public –list-services Open up access to mysql on the public zone firewall-cmd –zone=public –add-service=mysql See the after of what services are open on the public zone firewall-cmd –zone=public –list-services Once verified, modify the permanent [...]

Posted in CentOS, Linux, MySQL | Comments Off

Install MariaDB on CentOS 7

Starting in CentOS 7, MariaDB has replaced MySQL as the default database installation. MariaDB is a 100% compatible binary replacement of MySQL. Login as root su – Download and Install MariaDB yum install mariadb-server Configure MariaDB to start on System boot systemctl enable mariadb Start the mariadb service systemctl start mariadb Make MariaDB more secure [...]

Posted in CentOS, MariaDB | Comments Off

Installing Oracle JDK on Ubuntu

You must run these 3 commands: sudo apt-get install python-software-properties sudo add-apt-repository ppa:webupd8team/java sudo apt-get update To install Java 7, run this command: sudo apt-get install oracle-java7-installer To install Java 8, run this command: sudo apt-get install oracle-java8-installer To change the default Java installation, run this command: sudo update-alternatives –config java

Posted in Java, Language, Linux, Ubuntu | Comments Off