Posts Tagged ‘Java’

Spring Roo Exception: Row was updated or deleted by another transaction

While playing around with Spring roo I see this error while running the integration tests via

perform tests

roo org.springframework.orm.jpa.JpaOptimisticLockingFailureException: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction

The problem was here, that my database table which stored the specific entities had a version column but only NULL values inside. I have replaced the NULLs with an numeric value and then it worked.

“Updating Maven Project”. Unsupported IClasspathEntry kind=4

I’m just playing around with Spring Roo and multi-module Maven projects. When I start to import a project into the STS I am getting the following error and the SDK is getting unresponsive:

“Updating Maven Project”. Unsupported IClasspathEntry kind=4

The problem is somehow related to the m2e plugin integrated in the STS.

So solve this select (right click) on the STS/Eclipse modules

Maven -> Disable Maven Nature
Maven Disable Maven Nature in STS (Eclipse)

Maven Disable Maven Nature in STS (Eclipse)

run in the terminal

mvn eclipse:clean

and select again in STS

Configure -> Convert to Maven Project

 

 

 

Resetting Java formatting options in Netbeans

I’ve just searched for a way to reset the Java Formatting Options in Netbeans 7.1.1. And I didn’t find a convenient  way to do this. The only way I found was to directly delete the .xml file (org-netbeans-modules-editor-settings-CustomPreferences.xml) which is responsible for storing the Java settings:

USER_DIR/.netbeans/7.1/config/Editors/text/x-java/Preferences

quick coding info: order of Java modifiers

If you want to make your Java code more stylish (because you are using maybe the Maven Checkstyle Plugin) or more valid against conventions, you will stumble across the order of modifiers.

(more…)

JPPF 3.0 released

The new version of the nice Java Parallel Processing Framework (JPPF) is out. See what’s new in the release 3.0 by reading the release notes.

Neo4j. NoSQL graph database

Neo4j is a graph database, storing data in the nodes and relationships of a graph. The most generic of data structures, a graph elegantly represents any kind of data, preserving the natural structure of the domain.

Configure Glassfish 3.2 to use log4j

I am just working with Glassfish 3.2 and wanted to integrate log4j logging, so I can see Logger outputs in my normal server.log

  • First I downloaded a log4j jar.
  • Then I copied this jar file into my Glassfish /lib directory.
  • Then I created a log4j.properties file and put it into the /config directory of my domain (e.g. GLASSFISH_HOME/domains/domain1/config/)
  • After that I added a JVM option to reference the new properties file (Configurations > server-config > JVM settings > JVM Options > Add JVM option)
    e.g. -Dlog4j.configuration=file:///${com.sun.aas.instanceRoot}/config/log4j.properties
  • Then saving the settings and
  • restarting the Glassfish server

Ruby on Rails support dropped in Netbeans 7

What a pity. I really liked the Ruby support in Netbeans.

After thorough consideration, we have taken the difficult step to discontinue support for Ruby on Rails in the NetBeans IDE. Two main issues underpin this decision:

Java SE 7 and Java Development Kit 7 (JDK 7) are the next major releases of the Java SE platform, which Oracle is committed to deliver in 2011. A key objective of the NetBeans IDE has always been to offer superior support for the Java platform. To maintain that objective and capitalize on the JDK 7 release themes–multi-language support, developer productivity and performance–it is necessary that our engineering resources are committed to a timely and quality release of NetBeans IDE 7.0.

(via netbeans.org)

Fixing “use -source 5 or higher to enable generics” during Maven compilation

I just wanted to compile & assemble a Maven project using mvn assembly:assembly and got the following error:

Compilation failure [...]
(use -source 5 or higher to enable annotations)

To fix this error I needed to add

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-compiler-plugin</artifactId>

<version>2.3.2</version>

<configuration>

<source>1.6</source>

<target>1.6</target>

</configuration>

</plugin>

to my pom.xml file.

Install sun-java6-jdk on Ubuntu 10.04 (Lucid)

Sometimes installing Java can be as if someone stabs you hundreds of pencils in the ass. I  had trouble to install the Sun Java6 JDK after updating to Ubuntu 10.04.

(more…)

How to change a normal Eclipse project to a Java Eclipse project

I just had the problem that i wanted to change the project-type of an Eclipse project to ‘Java Project’ — it was a normal project before. This are the steps i executed:

  1. Close the project
  2. Go to the project directory  (e.g. using Terminal application)
  3. Open .project file
  4. Go to the XML node <natures> and insert <nature>org.eclipse.jdt.core.javanature</nature> as a child.
  5. Save the file
  6. Re-Open the project

That’s it.

Reblog this post [with Zemanta]

manual of the day… Install JBoss under Debian

apt-get install sun-java5-jdk
Next Page »" class="small button">older posts