Archive for 2009

December 18th, 2009
5:07 pm
CVSNT – cvslock.exe crashes on new repository add

Posted under CVS
Tags , , ,

cvslock.exe sometimes crashes with the following pair of event log messages :-

  1. Failed to bind listening socket: Only one usage of each socket address (protocol/network address/port) is normally permitted.
  2. Faulting application cvslock.exe, version 0.0.0.0, faulting module advapi32.dll…

Initially I thought this was due to not adding it as a firewall/antivirus exception, but the error still appears to happen the first time a repository is created and brought up/reconfigured. The 2 errors appear to be related – the socket error may be due to cvslock being started twice in error (indeed, this may be the cause of the other error too.)

Once the repository configuration is up and stable, the error does not seem to occur.

When the error occurs, a systray icon for cvslock appears, and selecting the debug listing menu option for the tray icon displays the error “no ipv6 address found for host” in a command window.

I tried stopping the services, creating a new repository (which succeeds), and then starting the services. The cvslock service refuses to start, and the tray icon appears as above. After a few seconds, the tray icon disappears, and the service can be started as normal.

This does appear to be a cvslock issue related to new repository creation. As the workaround is straightforward, and operation appears stable after that, the bug appears to be a minor one.

No Comments »

December 18th, 2009
4:52 pm
Eclipse Glassfish Plugin loses sync with Glassfish start/stop state

Posted under Eclipse
Tags , , ,

This appears to be an issue if you start Glassfish (2.1.1) outside of Eclipse (3.5.1) – Eclipse does not then always sync with it properly. It may try to start it when it is already started and fail, then fail to publish/run projects correctly.
There is an old bug logged on this here. It claims to have been resolved, but the resolution does not appear to be seamless – it appears that Eclipse cannot fully integrate with an externally started Glassfish.

I expect this to be sorted with Glassfish V3 as this is fully OSGI compliant.
In the meantime, the answer seems to be to allow Eclipse to fully control Glassfish, i.e. start and stop it itself, and to not start Glassfish externally when using Eclipse.

No Comments »

December 18th, 2009
4:16 pm
IOCell NDAS Netdisk – fix for very slow performance

Posted under Windows
Tags , , ,

I had a NetDisk attached via an HP Procurve gigabit switch, connected at 1000BaseT, but transferring at intermittent slow speeds, sometimes as slow as 1MB/sec. This was on a Core I7 920 with 12GB ram running Windows 7 64 bit (!)

This note from IOCell’s FAQ #6 fixed the problem :-

My computer is moving very slowly when my NetDISK is enabled, and the ACT light
…. on my NetDISK is solid yellow. What is going on?

This is a result of a bad connection between the computer and the NDAS device. Please make sure that you are using only network switches and routers, and that you are not using any network hubs. Also, if you have any software firewalls installed on your computer (i.e. Norton Internet Security, McAfee Personal Firewall, etc.), make sure to add ndasmgmt.exe and ndassvc.exe into their list of programs to Allow with full access. You can also try disabling your Antivirus software to see if that makes a difference. Please also try power cycling your NetDISK and switch as well.
 

The problem was the Windows Firewall – adding ndasmgmt.exe and ndassvc.exe to the list of allowed programs, both for private and for public, fixed the problem. Note that Antivirus can be a problem but it was not for me – I use Kaspersky and it was fine and needed no adjustment.

Comments Off on IOCell NDAS Netdisk – fix for very slow performance

December 18th, 2009
3:06 pm
Toad fails to connect with ORA-12154 on Windows 7 64 bit

Posted under 64 Bit
Tags , , ,

I hit this problem trying to connect to a local Oracle XE 10.2.0.1 database.
The problem is due to a bug in Oracle’s networking layer. It cannot parse program locations containing parentheses, and by default Toad installs to “Program Files (x86)” which causes the bug.

More details on OTN here.

The fault is designated Bug 3807408, and whilst there is an Oracle patch for it, the patch is not available for Oracle XE.

The easy way around the problem is just to install TOAD in “Program Files” rather than “Program Files (x86)”. The different directories are purely to aid in distinguishing 32 bit applications from 64 bit ones – it does not matter where applications are installed.

I removed and reinstalled TOAD in “Program Files” and this completely eliminated the problem. The problem would also apply to other applications which access Oracle, so worth bearing in mind.

No Comments »

December 18th, 2009
1:46 pm
Branching and Merging in Eclipse CVS and TortoiseCVS

Posted under CVS
Tags , , ,

Branching allows version histories of a CVS module to proceed in parallel, by branching from an earlier version in the repository. This typically arises when a new release is under development in the repository (or has been released) and bug fix changes are needed to an older version without affecting the new release. A branch would be made at the older version and the bug fixes placed on the branch. A client (Eclipse or TortoiseCVS) can pick the branch to work with, and the local files are updated to reflect that branch.

  1. To create a branch in Eclipse, select Team/Branch… from the context menu for the project
  2. To create a branch in TortoiseCVS, select CVS/Branch… from the context menu.
  3. To select a branch in TortoiseCVS, you do an Update Special and pick the branch to switch to.
  4. To select a branch in Eclipse, you do Team/Switch to another branch or version

When Branching, you should normally branch a complete module not just a file. If you just branch a file in eclipse, Eclipse gives you a warning that you are mixing tags within a project. Tortoise does not give you a similar warning however. See here for the internals of branching in CVS. It seems that whilst internally it is done per file due to historical coding reasons, it should ideally be ‘grouped’ as CVS does group files.

If you branch by mistake, you cannot delete it – just leave it unused in the repository.

You can merge changes back into a branch from another branch with both these clients. In both cases, you should have the target branch (which will often be the head) as the current loaded one. You then pick the branch to be merged into it.

  1. To merge a branch into the current branch in Eclipse, use Team/Merge
  2. To merge a branch into the current branch in TortoiseCVS, use CVS/Merge

No Comments »

December 18th, 2009
1:40 pm
Configuring and Using the Eclipse CVS plugin

Posted under CVS
Tags , ,

Eclipse comes with a CVS plugin pre-installed. To connect to a repository, open the CVS Repositories view and add one via new from the context menu. The Eclipse CVS client is a pure Java one with a more limited set of protocols than the full set allowed by CVSNT – I use the pserver protocol, which encrypts passwords but not any other traffic. This is fine for a trusted internal development network behind a firewall. Eclipse does allow password caching and asks for secret questions for password recovery.

Note that if you get timeouts trying to connect to your repository and you are using CVSNT, make sure that you have excluded cvsservice.exe and cvslock.exe fully from both your Antivirus software on the server and the Windows Firewall on the server. In my case I used the default TCP ports in all cases on both clients and the server without problems once this had been done.

By default, my icons in the package/project explorers did not show when a file was dirty, i.e. when I had made local changes to a checked out file (Eclipse terms this an outgoing change). I could see the changes in the Team Synchronization view, which is useful as it isolates your changes from all the unchanged files, and allows filtering on the type of changes (outgoing, incoming, both, change conflicts). However, it is highly desirable to have the simple feature of tagging the icons on the dirty files, and this did not work even though I strongly suspected that such a feature would be available. It turned out that this labelling of the icons is enabled in the preferences.  Select Window/Preferences, then select Team/CVS/Label Decorations in the left pane, then the Icon Decorations tab, and select all the options. In my case, Outgoing changes was not selected, so local changes to a file in Eclipse did not make it show up as ‘dirty’ on the explorer icon. Selecting the option fixed the problem.

Usage Points

  1. Most of the CVS options are under the Team submenu in the package explorer context menu.
  2. However, one exception which can catch the unwary – to revert to checked out version – use Replace With and Latest from HEAD or Another Branch or Version on the explorer context menu
    i.e. this command is not under the TEAM submenu.
  3. The CVS Repositories view is useful for browsing the server side repository including all the branches and files.
  4. The Team Synchronization view is useful for viewing your changes – incoming, outgoing, and change conflicts

No Comments »

December 18th, 2009
1:29 pm
Installing, Configuring and Using TortoiseCVS

Posted under CVS
Tags , , , ,

Download and install TortoiseCVS from here. Note that the release notes for version 1.10.10 state that 64-bit versions of Windows are supported. My installation runs fine on Windows 7 64-bit.

Except for the main preferences screen, all of Tortoise CVS is accessed via Windows Explorer context menus. Note that this also works within the file open dialogs of applications.

Connecting to the server is done from the CVS/Checkout… menu. In the left pane of the resulting dialog, you select the protocol, protocol parameters, the server, and the repository folder. In the case of my Java repository above, this will be /Java. Note that you do not need to tell the client the server side path of the repository root.

Tortoise does not cache passwords for access to the CVS server, so you have to enter it for the first time in each session. You can however add custom switches for the connection protocol, which may allow a password to be specified. Note that this is therefore not encrypted! You will probably want a dedicated low privilege account for CVS access if you do this, and in fact this is recommended anyway  – see here for details on how to set this up.

For the pserver protocol, you can add password=mypassword to the Protocol Parameters box in the checkout dialog.
The settings in this dialog are remembered for the next time you use it. If you access multiple replositories, they are remembered and may be selected in the list box at the top.

You do not want Tortoise control on all your explorer folders, as this can slow explorer down and clutter up the context menus when you don’t want it. Use the advanced tab in the preferences dialog to include/exclude folder trees from Tortoise control. Note that if you add a folder tree to include, all others are excluded – see this post here. You can also exclude network shares etc. (done by default).

Usage Points

  1. When checking out, you pick a module name in the RHS pane. You can browse for/refresh the module list first.
  2. After checkout, you get a subfolder for the module tree, which contains a cvs folder which contains metadata and is managed by Tortoise.
  3. If you do a ‘wild’ checkout you will end up checking out CVSROOT which you don’t need – this can be deleted.
  4. You can tag a file or group of files/module etc. to indicate a version, then check this out later using the tag. Note that internally, CVS uses a an “n.n” style internal version number starting at “1.1” for a file.

No Comments »

December 18th, 2009
1:12 pm
Installing and configuring a CVSNT Repository Server

Posted under CVS
Tags , , ,

This post details the setup of a repository server on a Windows based PC.

Download and install the CSVNT server here.
Make sure you pick the Windows Server software and not the “client trial”.
If you show all downloads you need to pick a server OS, not a client OS like Windows XP, even if installing on Windows XP Pro like I was. (You cannot install on XP home at all  – you must have simple file sharing turned off and Windows XP Home cannot do this). In my case, simple file sharing was off as I had already turned off ForceGuest, see here.
You can pick a specific account for access, or use the client account  – I presume the user/password must also match the server if you are in a workgroup rather than a domain but I did not test this. My installation was in a Workgroup with a specific account on the server PC. Note that you should run CVSNT under an account on the server with the minimum of privilege, rather than an administrator account. See here for details on how to do this.

The server runs 2 services – CVSNT Dispatch Service and CVSNT Locking Service, which both need to autostart (this is done by default). The server administration is via a control panel utility which is also available via the start menus.

Ensure that Simple File Sharing is turned off.
Make sure that you exclude cvsservice.exe and cvslock.exe in both the Windows Firewall and any Antivirus software.
In my case failure to do this caused 2 problems :-

  1. cvslock.exe crashed soon after startup
  2. The repository was not visible at all from the client side (in Eclipse) and would not connect – connection timeouts occurred.

You can run multiple repositories from a CVSNT server. In my case I am using a common root – “D:\CVS Repositories” and a subfolder for each respository underneath. My Java repository is named /Java and is similarly connected this way on the client. Its Root is therefore defined as D:\CVS Repositories\Java.

Connecting to the server

In all cases I use the pserver protocol – the Eclipse plugin does not support many protocols natively and pserver is the most common. I use the same protocol for Tortoise..  The server does not mandate the protocol used by the client (as far as I know) so provided the plugin is loaded for the protocol (see plugins page in the CVSNT control panel server admin tool) it should work. Pserver apparently only encrypts passwords but if you are running on a secure internal development network behind a firewall this should not be an issue, and should also improve performance as the protocol is not having to encrypt everything.

No Comments »

December 18th, 2009
12:30 pm
Tomcat with JPA Persistence jar signing issue

Posted under Tomcat
Tags , , ,

I hit this when deploying  an Eclipselink 1.1 web application to Tomcat 6.0.24, when trying to place all the persistence jars in <Tomcat Home>\lib

The app worked fine when including its own copy of the jars under WEB-INF\lib, but moving them to <Tomcat Home>\lib gave the following error :-

java.lang.SecurityException: class “javax.persistence.Persistence”‘s signer information does not match signer information of other classes in the same package

I checked all the other (non eclipselink) libraries present and could not see a clash. This post appears to shed some light, indicating that it is perhaps a mismatch of jar signing in the Eclipsink libraries.
However, it is strange that it works fine with the libraries deployed with the application rather than under Tomcat.

As Tomcat does not provide its own JPA support, I decided I was quite happy to deploy the libraries with the web app as that works fine, and to leave the issue unresolved.

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 »