Nov 18, 2009
It may be the case that I'm not looking hard enough but I can't find this anywhere in the documentation:
To achieve a cascade type of 'none' using Hibernate annotations you'll need to do the following:
@OneToMany(cascade = {})
Exactly why they couldn't have provided CascadeType.NONE enum I don't know.
EdD
Nov 05, 2009
Just a quick post to say that the London Java Community (LJC) now has its own website. Barry Cranford has set the site up to publicise the group, which is rapidly growing in size, and its activities and events. Barry has done a great job with the community so far and continues to provide great events for Java technologists.
If you're interested in the LJC's activities or want to get involved you can find the site at http://www.londonjavacommunity.co.uk.
Cheers,
EdD
Oct 05, 2009
This is annoying since it then becomes possible for a tired or hurried developer to accidentally select and subsequently modify the wrong (i.e. distributable) file, upon rebuilding of the project distributable this can lead to lost changes since this file will most likely be overwritten.
If, like me, you've been through the annoyance of editing your distributable files and then losing the changes you may be pleased to know that there's a simple solution to this which is as follows:
- In the 'Project Explorer' view select a folder that you wish to exclude from search results.
- Right click the folder and select 'properties'.
- Select the 'Derived' checkbox.
- Click 'OK'.
Cheers,
EdD
Jul 24, 2009
Last night I attended the 'Android for Java Developers' event which was put on by the London Java Community. Reto Meier, an Android advocate from Google took us through the basics of the platform and covered topics including IDE support, some of the libraries available, how applications are assembled and signed and also provided some information on the Dalvik virtual machine.
A couple of Android devices were passed around for us to play with during the talk, having never used Android before I had somehow arrived at the conclusion that the OS was a bit clunky compared to the iPhone/ Palm Pre, this illusion was quickly dispatched when I got to play with the devices and I was in-fact impressed at how responsive and feature laden both devices were. (Note to self I will definitely be getting an Android phone as soon as the contract on my horriffic self rebooting N95 runs out!)
The event was really interesting, as a developer it was pitched at just the right
level giving an insight in to both technical and commercial aspects of
the platform and also providing useful feature comparisons with other platforms. I was also pleased to hear about the inclusion of proper threading support: Android/ Dalvik has a multi-threading model analogous on a basic level to standard Java whereas the iPhone OS is inherently single threaded. I see this as a serious plus point for Android since phone apps are already getting more complex and often need to be able to run as background services without locking the rest of the phone up.
So there you have it, many thanks to the LJC for putting on the event, Google for hosting us and to Reto and his colleague (whose name I have forgotten - sorry!) for an entertaining and enlightening talk! I'm now off to write a best selling Android app, make my millions and retire early!
EdD
Jun 21, 2009
The ECMT manager which forms part of the S60 MIDP SDK doesn't work out of the box with Java 1.6 (6.0). In this situation the error 'Cannot start ECMT Manager' is displayed when attempting to open the manager.
To fix this do the following:
- Navigate to <S60 MIDP SDK Install Path>\bin\epoc32\tools\ecmt\config
- Backup (via copy) config.properties to config.properties.original
- Open config.properties in a text editor
- Locate the property epdt.java.version.start and append the String ',1.6,6.0' (excluding the quotes) to it's value
e.g. epdt.java.version.start=1.4.1,1.4.2,1.5,5.0,1.6,6.0 - Save the file.
Now try and open the ECMT manager again, if the fix has worked then the manager should open without any errors occuring.
Hope that helps,
EdD
Mar 26, 2009
I have found this quite useful, it lists a load of useful Maven properties which aren't obviously available in the Maven documentation:
http://docs.codehaus.org/display/MAVENUSER/MavenPropertiesGuide
EdD
Feb 26, 2009
I recently started using Hudson as a Windows service, upon doing this I noticed that it completely ignores my Maven configuration file %HOMEPATH%\.m2\settings.xml. I couldn't initially figure out why this was happening until I remembered that Windows services run by default as the system account, not as a user account. The system account doesn't have any concept of the same %HOMEPATH% environment variable which is used when I use Maven interactively which is why my settings.xml was being ignored under Hudson .
To overcome this problem make sure you use the settings.xml file under belonging to the actual Maven installation which Hudson uses to build your project, in my case this was:
C:\Program_Files\Programming\Java\apache-maven-2.0.10\conf\settings.xml
A quick update to this file, adding in the settings I usually use (basically a Nexus mirror) sorted this right out.
Note: This should be obvious but by modifying the settings.xml belonging to the Maven installation you are essentially changing the system wide Maven defaults which will affect all users unless they have specified otherwise in their own settings.xml file.
EdD
Dec 04, 2008
IntelliJ has a wonderful feature which, during debugging, allows for the evaluation of code at runtime, this is one of my favourite debugging utilities and is accessed through ALT+F8.
I've been using Netbeans more and more recently and could not for the life of me figure out if there was an equivalent function... well there is, and it's CTRL + F9 which gives you this little wonder.
Once the window above appears you can just type in your expression (using CTRL + SPACE for code suggestion/ completion) and hit enter to see the results! I'm so pleased I've discovered this, I knew it had to be in there somewhere in NetBeans - it's just a shame it took me this long to find it!
EdD
Oct 30, 2008
It takes ages to re-install SJSAS so this should save some time when you need to test different appserver versions with different JDKs and don't have the time to reinstall or the resources to have multiple installs.
- Stop your appserver domain(s), nodeagent(s) and instance(s).
- Locate <SJSAS_HOME>\config\asenv.bat where SJSAS_HOME is yous SJSAS install dir e.g. C:\Sun\ApplicationServer.
- Take a backup of the file.
- Locate the 'AS_JAVA' variable. e.g. set AS_JAVA=C:/PROGRA~2/PROGRA~1/Java/JDK15~1.0_1
- Figure out the DOS 8.1 path to the JDK you want to use and replace the existing path with this value.
- Start up your application server.
- Check the server.log output - it should contain the updated JDK path.
C:/PROGRA~2/PROGRA~1/Java/JDK15~1.0_1\bin\java
EdD
Sep 18, 2008
Sep 02, 2008
When you create an SJSAS Instance debugging is disabled by default, if like me you are often rebuilding your appserver and use appserver debugging a lot then this can become a real pain since an instance restart is required after every rebuild in order to switch debugging on. I recently discovered that you can programatically enable/ disable debugging which means that it is possible to switch debugging on in your appserver build script so that it is ready for you to connect as soon as you have built your appserver.
The ASADMIN command for this is as follows, you'll need to replace the bits in triangular braces with your own values e.g. <eddsBox> might become localhost. Note that this command doesn't alter the default port (9009) since I have encountered issues with SJSAS 8.1 when altering the port.
asadmin set --echo=true --host <eddsBox> --port <MydomainAdminPort> --passwordfile <path to pwd file> --user <admin user> <instance-name>-config.java-config.debug-enabled=true
In my case this can be translated to the following Ant target:
<target name="enable-debug-on-instance" depends="-init"
description="Enables debugging on the SJSAS instance - used for development purposes only.">
<exec dir="${basedir}" executable="${asadmin-executable}" failonerror="true"
failifexecutionfails="true">
<arg value="set"/>
<arg value="--echo=true"/>
<arg value="--host"/>
<arg value="${appserver-host}"/>
<arg value="--port"/>
<arg value="${appserver-domain-admin-port}"/>
<arg value="--passwordfile"/>
<arg value="${appserver-passwordfile}"/>
<arg value="--user"/>
<arg value="${appserver-admin-user}"/>
<arg value="${appserver-instance}-config.java-config.debug-enabled=true"/>
</exec>
</target>
EdD
Aug 09, 2008
A few words after a remarkably quick and hassle free Roller installation...