Blog Archives

January 8th, 2010
10:22 am
Useful reference/tutorial sites on Facelets

Posted under JSF
Tags , , , ,

I have found the following sites useful :-

Tutorials

Reference Information

No Comments »

December 18th, 2009
8:10 pm
Tomcat as a service under Windows 7 64 Bit / 32 bit JVM

Posted under Tomcat
Tags , ,

See the Tomcat 6 Download Page

If you use the Windows service installer (self installing Exe) to install Tomcat 6.0.24 under Windows 7 64 bit, it insists on a 64 bit JVM. I am using a 32 bit JVM and if you try to use that, Tomcat will not start.

You can do this by using the 32 bit Windows zip version, which still allows you to run Tomcat as a service. It also allows you access to the Tomcat Configuration/Monitor utility which you can also run in the System Tray, but you have to set this up manually.

The following steps will do this install :-

1/ Download the 32 bit Zip installation above, and unzip to the desired target installation location.

2/ Edit <Tomcat Home>\conf\server.xml to change the default http port from 8080 if required

3/ Edit  <Tomcat Home>\conf\tomcat-users.xml to add an admin user if desired, by inserting the following in the <tomcat-users> section :-

<role rolename=”manager”/>
<role rolename=”admin”/>
<user name=”admin” password=”mypassword” roles=”manager,admin”/>

4/ Issue the command Service install from an administrator privileged command window pointing at the <Tomcat Home>\bin directory.

5/ Create the following shortcuts to run the Tomcat Configuration Utility and the System Tray Monitor Utility.
Substitute your device and directory for <Tomcat Home>.

Configuration Utility – Target “<Tomcat Home>\bin\tomcat6w.exe”  //ES//Tomcat6
System Tray Monitor – Target:  “<Tomcat Home>\bin\tomcat6w.exe”  //MS//Tomcat6
(Both Cases) – Start In: may be left blank
(Both cases) – Tick the Run as Administrator check box under either the Shortcut or compatibility tab.

6/ Note that you will have to OK running as administrator each time you run one of the shortcuts, assuming you have User Account Control turned on in Windows 7. This is also true if you try to run the tray monitor automatically in the startup group. Windows 7 insists that each time you log in, you have to OK the administrator usage(!) This is supposed to happen by adding such autostarted tray applications to a “blocked startup” group which have a tray icon to display and then selectively “OK” them to unblock them/OK the administrator usage. This never worked for me – anything I placed in the startup folder which needed administrator access just plain did not run at all, and I never saw this “blocked” icon. As it would mean OKing at each login anyway, it seemed to me that there is no point trying to autostart tray icons that need administrator access as it was more hassle to unblock them (even if it did work) rather than just run them as needed from the super bar or quick launch bar (and of course OK them).

No Comments »

December 18th, 2009
7:38 pm
Running CVSNT as a limited account under Windows XP Pro

Posted under CVS
Tags , , ,

To set this up, I gave the designated user full permissions on the repository root, with full inheritance to all subfolders and files. I also made the user the owner, but this may not have been required. I also gave full access to the designated temp directory (the one set up in CVSNT admin) to this user.

When I tried to use a dedicated ‘limited’ (non administrator) account under windows XP pro I received the following error when I tried a checkout of CVSROOT :-

CVSNT user does not have read access to CVSROOT

Initially I thought this was an issue blocking all checkouts, as with the user set as an administrator, this checkout is allowed. However, the error only occurs on CVSROOT – all other operations on other modules appear to work normally. As CVSROOT is created internally by CVSNT as part of the repository, we should not be checking it out anyway so this should not be a problem.

Setting up this way minimises security issues especially when saving an explicit password parameter in TortoiseCVS (with the pserver protocol) to get around the lack of password caching.

The CVSNT admin utility, under the Server Settings tab, allows an anonymous user to be specified, allowing anonymous access from the clients. I did test this briefly, but could not get it to play ball with TortoiseCVS – tortoise always seemed to get demands for a password and gave an error if I tried anonymous access. I googled for answers to no avail – no info was available on this setting. I combed the documentation but this all seems to be aimed at the command line interface to CVS rather than the GUI control panel interface used in CVSNT.

My final solution therefore was to use an explicit limited (non administrator) account, which works fine.

No Comments »

December 18th, 2009
6:46 pm
Installing the IceFaces Eclipse Plugin

Posted under Eclipse
Tags , ,

At the time of writing, the latest plugin version is 3.6.2. The zip of this version does not contain the installation instructions which were present in version 3.6.1, explaining how to download to a local repository and install from that within Eclipse.

The instructions may be found in ReadMe.pdf here.

No Comments »

December 18th, 2009
5:38 pm
Eclipse JPA out of synch with newly fetched CVS project

Posted under Eclipse
Tags , ,

I had this issue when deleting and refetching a project from CVS into Eclipse.

It reported that it was unable to resolve a number of the persistence classes such as EntityManager and EntityManagerFactory, even though the libraries and the imports were all present correctly.

This was solved by removing the Java persistence facet from the project facets page, applying the change, and adding persistence back and reconfiguring it. The problem then disappeared.

This was one of several Eclipse ‘gotchas’ I have found where Eclipse reports errors which do not exist. Often, a reconfigure such as the above, or a restart/reload will sort it.

No Comments »

December 18th, 2009
5:25 pm
Eclipse error “Class is listed in persistence.xml but not mapped”

Posted under Eclipse
Tags , , ,

Sometimes eclipse lists the following error in the problem view :-

Class xxx is listed in the persistence.xml file but is not mapped

This appears to be a synchronisation problem within Eclipse, as deleting the classes from persistence.xml and then adding them back by browsing with Eclipse’s own persistence.xml editor eliminates the problem, even though the resulting file is identical. Validating the original file did not solve the problem.

Even with the error listed, projects still run and build successfully, so the problem is not serious.

I have also had other cases where Eclipse has whinged about a perfectly good persistence.xml, and have in general just lived with it as it is not serious.

This is an important issue to be aware of though to prevent much head scratching when such a problem is believed to be a real error and is not!

No Comments »

December 18th, 2009
12:24 pm
Eclipse JPA Generate Tables From Entities “Unable to identify VM” error

Posted under Eclipse
Tags , , ,

This error was caused by importing Eclipse projects from another configuration. The projects had a different JRE library configured, which eclipse listed as “Unbound” as it was not present.

Simply adding the default JRE system library and removing the unbound definition solved the problem. To do this, right click the project, and select Build Path/Configure Build Path. Select the libraries tab on the right hand pane and add/remove from there.

Strangely, this problem did not stop projects running completely – eclipse still allowed a number of small test projects to run even with the “unbound” jre configured. The problem only appeared to manifest itself when trying to create the database schema from the entities via right clicking on the project and selecting JPA Tools/Generate Tables from Entities, wherupon the error occurred.

No Comments »

December 17th, 2009
7:22 pm
Changing Server Properties in Eclipse

Posted under Eclipse
Tags , ,

A little counter intuitive gotcha this one. At first glance, you would expect to right click a server in the servers view, and pick properties. However, if you do this, you do not get the full set – you just get the ability to switch deployed file location and some monitoring options.

If you just double click the server in the list, or right click and select Open, you get the Overview page listing (almost – see below) all the available properties for the server. For some reason in the past I tripped over this more than once, as it just does not seem right that the properties context menu option does not give the full property page (or at least link to it)!

Also, note that the ‘monitoring’ options available on the properties context menu option do not also appear on the Overview page – however the location  options do appear on the overview page in more comprehensive form.

DOH!!!

Comments Off on Changing Server Properties in Eclipse