Categories
Java Technology

Spring Security – Access Denied SpEL Changes

If you use Spring Security to lock down a web application and you use the hasAnyRole or hasAnyAuthority you are likely using a comma separated list of roles or authorities. If you upgrade to Spring Framework 5.3.13 or higher your roles will not parse correctly if the entire comma separated list is contained in single […]

Categories
Java

Using a pinned certificate for SSL communication

Using a pinned certificate for SSL communication can enhance security when communicating to a known service. The certificate from the server can be hard coded into a client application and used during SSL verification as an additional check. This has the drawback of requiring a client application update prior to the server certificate expiration. The […]

Categories
Android Java

Android Studio git ignore file

The default .gitignore file in Android Studio is good enough but not great. Whenever an IDE or SDK update takes place, files change and need to be committed to git. This becomes a bigger problem when the project is checked out on more than one computer. You will need to update projects on command line […]

Categories
Java

OpenJPA and MySQL Timestamps

Reading in MySQL Timestamps that default to ‘0000-00-00 00:00:00’ using JPA can result in errors if your MySQL connection is not properly configured. You may run into an exception such as this: java.sql.SQLException: Cannot convert value ‘0000-00-00 00:00:00’ from column 5 to TIMESTAMP. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926) The solution here is easy enough, […]

Categories
Technology Tomcat

Configuring Zenss to monitor Tomcat 6 through a firewall

One of the difficulties in monitoring a java process using JMX/RMI is the random secondary port opened for the JMX RMI connection objects. This random port can change every time the process is started, and there is no way to configure a firewall to allow this dynamic port to pass through. Fortunately there are some […]

Categories
Java

Returning a method parameter in JMock

I recently ran into a problem where I needed to test a Java method that dynamically created objects inside. These objects needed to be passed to and returned by a mock service class, but I did not know how to inject this class since it was created inside the method being tested. Here is a […]

Categories
Java Tomcat

javax.el.ELException: Function ‘:empty’ not found

After installing Continuum 1.1 and Archiva 1.1.1 a number of web pages failed to load throwing exceptions such as javax.el.ELException: Function ‘:empty’ not found. As it turns out, this has to do with Tomcat version 6.0.18 and the EL library that it comes with. As always, when on Linux, a script can fix things and […]

Categories
Java Technology

Running Java 6 on a Linux VPS

Could not reserve enough space for object heap Could not create the Java virtual machine What? Not enough RAM to run Java? Having a VPS (virtual private server) means that you are sharing RAM with other VPS owners on the server. The actual hardware of the server may have 4GB RAM for example, however your […]

Categories
Java Plesk Technology Tomcat

Tomcat Upgrade on Plesk for Linux/Unix

This article describes how to upgrade Tomcat running under Plesk and how to disconnect the control Plesk has over the Tomcat server. This may not be the ideal configuration for you if you have many clients using JSP webapps. Your clients will no longer have the ability to use the Plesk war upload feature from […]

Categories
Java Plesk Technology Tomcat

Tomcat webapps and a Plesk vhost.conf file

Plesk loves to overwrite all manual changes to the httpd.include file for your vhost. In fact, this is the normal behavior of Plesk, and you must place all changes in a separate file, vhost.conf (notice the warning inside of httpd.include) # ATTENTION! # DO NOT MODIFY THIS FILE OR ANY PART OF IT. THIS CAN […]