Archive for October, 2007

ProxyRequests not allowed here

Sunday, October 28th, 2007

Just encountered a problem trying to configure a Proxy redirect inside an .htaccess file:

ProxyRequests not allowed here

Not a single result on Google for this String.

Altavista had a single result in a language I don’t understand.

Metacrawler delivered also a result.

Yahoo had the same result as Altavista….which redirected to Ebay :-(

org.trails.exception.EmptyModelException Model does not exist

Friday, October 26th, 2007

And today’s error message of the day is:

org.trails.exception.EmptyModelException Model does not exist

This error message occurs, while extending the HibernateEditPage.

Model does not exist. Well, this error message could also do with some more specific text…..

Unable to parse OGNL expression ’selectedList’: selectedList

Thursday, October 25th, 2007

Unable to parse OGNL expression ’selectedList’: selectedList

is the error message of the day - when using the Trails HibernateEditPage…..wonder what the reason turns out to be in the end….

Ok - the solution

Inside of of the Pojos, the Annotation @Entity was missing ;-)

… implements ViewRequiresAssociation

Thursday, October 18th, 2007

Google is getting worse and worse….or maybe there really is no piece of Java code that contains that ?

ViewRequiresAssociation, UpdateRequiresAssociation, RemoveRequiresAssociation in Trails

Thursday, October 18th, 2007

This is to remind me to do a small example of ViewRequiresAssociation, UpdateRequiresAssociation, RemoveRequiresAssociation in Trails without having the error message that the Annotation is not allowed at this location…..

Getting up to speed on Trails

Thursday, October 18th, 2007

Finally getting up to speed on Trails. Once you have everything setup and don’t touch the running system - it is finally paying off - and results can be achieved really quickly….at least as long as you do not want any extras. Extras usually take some additional time and effort - but the more projects you do and the more code, components and services you can recycle, the more productive web development with Trails becomes.

@trails:NewLink example

Wednesday, October 17th, 2007

If you want to create a new object in Trails, using @trails:NewLink …..tbc

HibernatePersistenceService

Wednesday, October 17th, 2007

I have just had a look for an example how to use the HibernatePersistenceService in trails properly….as I could not find any code, I have tried to do the following:

HibernatePersistenceService service = (HibernatePersistenceService)this.getPersistenceService(); if (service != null){

User user = service.getInstance(User.class);

Unfortunately, this is not working as no User instance is returned - and all successive method calls on user lead to a NullPointerException.

The solution 

The solution is: You simply call the constructor of your data object….you do not need the getInstance() method at all.

Another error was, that the generated hibernate.cfg.xml file has not picked up the new data objects and therefore they were missing in the configuration file. So I have simply edited the file in the classes folder. Later I noticed those objects where not included as some setter methods were missing and so they were ignored….

Trails examples finally working!!!! After 3 days !!!!

Monday, October 15th, 2007

Yes! The Trials examples are working now. It has never taken be so long to get something running.

If I look back, there was a whole lot of reasons why it didn’t work.  But if you are about to get going with the Trails examples, do the following:

- Make sure you have Maven > 2.0.6 installed

- Make sure you have JDK 1.5.0 installed and that your JAVA_HOME points to something like: H:\java\sun\sdk\jdk\jre  This means, to the Runtime environment inside the JDK inside the SDK.

Inside the Trails-Hibernate there is a maven pom.xml file that references %JAVA_HOME%\..\lib\tools.jar

So if your path is different, Maven will tell you that you should install tools.jar using:

 mvn install:install-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.5.0 -Dpackaging=jar -Dfile=tools.jar

If you do that, Maven will happily tell you it has installed everything - but you won’t find any com.sun folder inside your repository.

- check out the project on: http://svn.codehaus.org/trails/tags/trails-1.1

After that go to the command line and do a:

  • mvn clean
  • mvn clean install -e > log.txt (so you can look at the errors better later on)
  • mvn eclipse:eclipse

Then import an “already-existing project” into Eclipse inside the examples folder, for instance the Roster example project.

Then go to the project and open the .classpath file and edit it and add the following lines near the end of the file:

    <classpathentry kind=”var” path=”M2_REPO/org/trailsframework/trails-core/1.1/trails-core-1.1.jar”/>
<classpathentry kind=”var” path=”M2_REPO/org/trailsframework/trails-hibernate/1.1/trails-hibernate-1.1.jar”/>
<classpathentry kind=”var” path=”M2_REPO/org/trailsframework/trails-security/1.1/trails-security-1.1.jar”/>

Then close the eclipse project, go to the command line and do a mvn clean again, so that Maven will download the correctly compiled dependencies instead of compiling them wrong from the sources.

Then go back to Eclipse and open the project. If there is still some errors do a mvn install from inside Eclipse.

Remember: If you change the environment variables, close all command line windows as it will not activate the changes until the last command line window has been closed. Also restart Eclipse if you fiddle around with the environment variables.

Trails examples - org.trails.validation.ValidateUniqueAspect and DescriptorInternationalization

Sunday, October 14th, 2007

After:

- uncommenting all references to  DescriptorInternationalization

- installing JDK 1.5.0 and updating the JAVE_HOME environment variable

- setting CLASSPATH to point to the tools.jar

- removing snapshot servers from the Maven settings.xml

- building the whole project from the command line

- importing all sub-projects in Eclipse as new projects (without copying of course)

… everything seems to be find now.
Except for running one of the examples…Jetty complains that is cannot find the class org.trails.validation.ValidateUniqueAspect