Archive for October, 2007

Cannot find the class file for java.lang.Object.

Sunday, October 14th, 2007

The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project.

This problem is often encountered (especially by beginners). The solution is often quite simply: Just right click on the project, select the properties and then click on the the Java Build path tab. Scroll down to the bottom and change the java system library to Java version or add it if it is not included yet.

Upgrading Maven to 2.07

Saturday, October 13th, 2007

I was just using the command mvn clean install for the first time, and I got the error message that I need Maven 2.0.6….I was still using Maven 2.0.1 So now I have downloaded Maven 2.0.7 (hopefully it doesn’t matter to have a newer and hopefully even better version), changed my classpaths, closed all DOS windows and trying again to successfully get the Trails samples to work. This time I have also checked out Trails 1.1 instead of 1.1.1 - as 1.1 is the real 1.1.1 version or something confusing….

Ok, Maven has now finished its job - but: still the same problem :-( :

Project ID: com.javaforge.tapestry:tapestry-spring:jar:1.0.0

Reason: Cannot find parent: com.javaforge.tapestry:tapestry-javaforge for projec
t: com.javaforge.tapestry:tapestry-spring:jar:1.0.0 for project com.javaforge.ta
pestry:tapestry-spring:jar:1.0.0

Cannot find parent again!!!!!!!!!!!!!!!!!!!!!! AAAAAAAAAAAAAAAAAAARRRRRRGH

Maven wants to access:

\home\me\.m2\repository\com\javaforg
e\tapestry\tapestry-javaforge\1.0.0-SNAPSHOT\maven-metadata-http:\repo1.maven.or
g\maven2\.xml

but the operating system Windows XP says “no”….. :-(

The solution

I had dodgy SnapShot servers in the Maven settings.xml files

com.erinors.tapestry:tapdoc-project

Saturday, October 13th, 2007

Just trying to build Trials 1.1.1. Of course, Maven has not completed its job:

Project ID: com.erinors.tapestry:tapdoc-maven-plugin:maven-plugin:0.7.0-20070512.100908-1

Reason: Cannot find parent: com.erinors.tapestry:tapdoc-project for project: com.erinors.tapestry:tapdoc-maven-plugin:maven-plugin:0.7.0-20070512.100908-1

Does Maven do more harm then good ?

Saturday, October 13th, 2007

In theory, Maven is great. In practice you spend an awful lot of time on:

  • learning how to use it
  • learning how to deal with weird errors
  • waiting for it to finish its job

And now, add together all the time from all those Java developers all over the world.

Isn’t that a lot of time being basically wasted ?

Update 

Ok, once you are through with the learning Curve and once you have setup a local repository, things become a lot easier.

The other day I had to compile and “old” Ant based project - and I must admit Maven is more comfortable to use, once your POM.XML files are setup property:

But still: If your Maven project is working properly, this does not mean that it will never make any problems anymore - suddenly it stops working  and classes are not recognized anymore…and you have to clean your whole repository and build everything again from scratch. So it is a BIT unreliable in my opinion…and Eclipse does not like Maven very much and is playing up all the time (so I always use the command line interface instead).

Why does Maven overwrite itself all the time?

Saturday, October 13th, 2007

Maven is weird. Every time you launch a Maven target, it keeps on downloading the same stuff all over again - without remembering what is has already in its Repository.

Solution

…the SnapShot Servers!

Maven error: Cannot find parent

Friday, October 12th, 2007

I hate Maven! I keep on getting:

Project ID: com.javaforge.tapestry:tapestry-spring:jar:1.0.0

Reason: Cannot find parent: com.javaforge.tapestry:tapestry-javaforge for projec
t: com.javaforge.tapestry:tapestry-spring:jar:1.0.0

…although both tapestry-spring and tapestry-javaforge are inside the repository :-(

With maven -e I saw this weird path:

 Caused by: java.io.FileNotFoundException: \home\me\.m2\repository\com\javaforg
e\tapestry\tapestry-javaforge\1.0.0-SNAPSHOT\maven-metadata-http:\repo1.maven.or
g\maven2\.xml (Die Syntax f³r den Dateinamen, Verzeichnisnamen oder die Datentrõ
gerbezeichnung ist falsch)

org.apache.maven.plugins:maven-idea-plugin:maven-plugin:2.0

Friday, October 12th, 2007

Maven is such a pain and a timekiller once in a while. This time, I have downloaded the trials examples from svn and wanted to compile the Roster demo. However, Maven is refusing to download it……and manual installation didn’t help either.

[INFO] Scanning for projects…
[INFO] Searching repository for plugin with prefix: ‘idea’.
Downloading: http://webobjects.mdimension.com/maven2/releases/org/apache/maven/p
lugins/maven-idea-plugin/2.0/maven-idea-plugin-2.0.jar
[WARNING] Unable to get resource from repository tapestry-snapshots (http://peop
le.apache.org/~hlship/tapestry-snapshot-repository/)
Downloading: http://repository.codehaus.org//org/apache/maven/plugins/maven-idea
-plugin/2.0/maven-idea-plugin-2.0.jar
[WARNING] Unable to get resource from repository codehaus (http://repository.cod
ehaus.org/)
Downloading: http://www.ibiblio.org/maven2/org/apache/maven/plugins/maven-idea-p
lugin/2.0/maven-idea-plugin-2.0.jar
[INFO] ————————————————————————
[ERROR] BUILD ERROR
[INFO] ————————————————————————
[INFO] Failed to resolve artifact.

Anyway, I have decided to delete the repository and start again!

Extending the Trails default pages using the HibernatePersistenceServiceImpl

Friday, October 12th, 2007

Unfortunately Trails is not very well documented yet (even the JavaDocs!). So I have to find my way by searching through posts on the Trails mailing-list or using the buggy JadClipse Plugin.

Anyway, if you want to have a custom page that can display a single entity, have a look at this example:

public abstract class ViewBlogPage extends TrailsPage
implements IExternalPage, PageBeginRenderListener
{

public void activateExternalPage(Object args[], IRequestCycle cycle)
{
String blogURL = (String)args[0];

HibernatePersistenceServiceImpl service = (HibernatePersistenceServiceImpl)this.getPersistenceService();
service.getSessionFactory().getCurrentSession().createCriteria(Blog.class);

Eclipse keeps on crashing :-(

Friday, October 12th, 2007

Stackoverflow Error in Eclipse!

Oh no - my Eclipse (not my MyEclipse!) keeps in shutting down every couple of minutes…haven’t found out whether it is my laptop or whether it is something fishy with Eclipse or one of the plugins.

Stackoverflow Error in Eclipse!

The “solution”

!ENTRY org.eclipse.ui 4 0 2007-10-12 15:33:47.828
!MESSAGE java.lang.StackOverflowError
!STACK 0
java.lang.StackOverflowError
at net.sf.jadclipse.JadclipseSourceMapper.findSource(JadclipseSourceMapper.java:93)

… which basically menas that the Jadclipse Plugin sucks….memory.

But I need it and as I am too busy/lazy to look for an update, I think I’ll live with this situation for a while.