Tag Archives: java

Spring Roo @RooEntity from 1.1.x replaced in 1.2.x

If you have an older Spring Roo project created from Spring Roo 1.1.x and you’re trying to imported it to a more recent STS version and/or trying to upgrade to a later 1.2.x version of Spring Roo, you may be … Continue reading

Posted in Tech Notes | Tagged , , | Leave a comment

Adding jars to your OpenShift remote Maven repo

If your OpenShift app has dependencies on other Jars that are not publicly available in the usual maven repos (for example, other Jars from your own projects), you can push them to your remote Maven repo used when your app … Continue reading

Posted in Tech Notes | Tagged , , , | Leave a comment

Accessing Glassfish server admin when you’ve forgotten your admin password

For my own development I frequently rotate between different app servers and different versions, Tomcat, JBoss AS, Glassfish, trouble is when you work with one for a while and then go back to one of the others, you forget key … Continue reading

Posted in Tech Notes | Tagged , , | Leave a comment

Using Spring 3.1 Profiles

Profiles in Spring 3.1+ give you the ability to define conditional bean configurations based on a profile name, where one of your defined profiles is selected at runtime based on a selected profile name. For example, if you have certain … Continue reading

Posted in Tech Notes | Tagged , | Leave a comment

Forge app error “No mime type could be found for file favicon.ico”

Apps generated using JBoss Forge get this error showing up in the server log: JSF1091: No mime type could be found for file favicon.ico. To resolve this, add a mime-type mapping to the applications web.xml This is described in this … Continue reading

Posted in Tech Notes | Tagged , , , | Leave a comment

EE6 @Schedule Timer Service on JBoss AS 7.1

It seems that @Schedule methods won’t execute on JBoss AS7.1 unless you specify at least both the hours and minutes values on the scheduled method. For example, to execute a method every 30 seconds: @Schedule(seconds="*/30") public void doSomething() { …} … Continue reading

Posted in Tech Notes | Tagged , , , | 2 Comments

Core Spring – continued (2) – SpEL, Annotation based bean defs, Java-based configuration

Spring Expression Language (SpEL) introduced in Spring 3.0 introduces EL style language for referencing beans and properties, and gives a standard syntax for doing property replacement into beans. Annotation based bean definition component scan allows you to configure annotated beans … Continue reading

Posted in Tech Notes | Tagged , , , | Leave a comment

Using Spring with JPA and Hibernate

Spring + Hibernate HibernateTemplate is now obsolete (Spring 3.x +) – create bean for SessionFactory and wire it into Hibernate-based Repository beans Use the Hibernate Session api directly This approach has zero dependency on Spring APIs How to configure: Configure … Continue reading

Posted in Tech Notes | Tagged , , , , | Leave a comment

Useful Database Maven dependencies

MySql Connector: <dependency>     <groupId>mysql</groupId>     <artifactId>mysql-connector-java</artifactId>     <version>5.1.21</version> </dependency> HSQL:         <dependency>             <groupId>org.hsqldb</groupId>             <artifactId>hsqldb</artifactId>             <version>2.2.8</version>         </dependency> H2:         <dependency>             <groupId>com.h2database</groupId>            … Continue reading

Posted in Tech Notes | Tagged , , | Leave a comment

Spring JDBC & Transaction Support

General Spring data access uses concept of templates to: provide consistent error handling approach provide consistent api In the past, your DAOs previously extended base Spring DAO classes – this approach is no longer used/recommended (Spring 3.x +) -  use … Continue reading

Posted in Tech Notes | Tagged , , | Leave a comment