Tuesday, November 26, 2013

Futaba 9C Throttle Lock

To get a "Throttle Lock" for electric motors on the Futaba 9C while not in a heli mode:

  • Select one of the programmable mixes
  • SW: E, Posi: Down
  • Mix: On
  • Mas: Thro, Slv: Thro
  • Link, Trim: Leave Off
  • Offset: 0% (Throttle stick to idle, then hold rotary for 1sec)
  • Rate 'down': +100%, 'up': -100%
Similarly for the T8FG:
  • Offset Y at -100
  • Rate -100 for both directions

Friday, August 2, 2013

Super Slinky



This was a free plan in the January 2013 R/C Model Aeroplane magazine, by Alex Whittaker, including
 "...ye olde health warning. Super Slinky is the Yorkie bar of simple sportsters. She's not for girls, the faint-hearted, Guardian readers, those of a nervous disposition or Southern jessies. She's no trainer, follow-on trainer or first low winger. She's for experienced pilots, aerobatic hooligans and unrepentant throttle benders. The truth is, she's a very bad girl."

With a warning like that, I couldn't resist. The original idea of the plan is a very quick build. One type of rib, box fuse, plank tail. Of course it took me 3 month, using stick-build tail, one extra wing bay, and in general every attempt to not rush it.

Wingspan110 cm
Length90 cm
Area27.5 dm2
Weight1275 g
Loading46.4 g/dm2
AirfoilSemi-Symmetrical
EngineOS 25

First flight was on 2013/08/01, thanks to Bill L. for providing the wing rubber bands! Very easy to fly, maybe as a result of slightly larger wing and CG abt. 2cm in front of main spar, since several internet posts warned about a CG that is too far back. Later used the "Brush Script Std." font as template for wing marking.

Monday, April 1, 2013

"Throttle Hold" for RC boat or car

The Futaba T8 has a "smart" throttle hold option, meaning: The throttle hold will only engage when the throttle stick is close to the low position. Makes sense for an airplane or helicopter that uses a range of idle-to-full throttle. Does not help with a car or boat where you want reverse/stop/forward.

For a boat I wanted the throttle hold to hold the throttle output at 50%, but the built-in throttle hold function would only engage after moving the throttle stick near the full reverse position.

Fix: Use throttle curves.
Curve 1: usual 0..100% linear curve.
Curve 2: Always at 50%, with switch "SF" to engage, the same one I otherwise use for throttle hold.

Saturday, December 29, 2012

How to Glue ABS?!


.. can be like trying to nail Jello to the wall.

While starting on a model boat project that involves an ABS hull, the question came up how to best glue things to plastic: Wooden bulkheads, deck, metal drive tube, other plastic parts, ...

This specific boat I'm about to build is a Graupner Bugsier 3. Its hull is made from ABS plastic. For what it's worth, the site http://www.kuederli.com/bugsier3/ has a very nice description of building this kit. It does mention re-enforcing and sealing the hull with epoxy and glass mats, but doesn't mention a specific type of epoxy. Based on what I learned, plain epoxy will not work at all. The kit's instructions recommend Stabilit Express. Stabilit Express is a very good 2-component glue:
  • Nicely bonds to ABS, wood, metal, anything
  • Gap-filling
  • Sets in a short time
  • Can be drilled, sanded
...but it's very hard to obtain outside of Europe. http://www.hobby-lobby.com/ used to sell it, but won't any longer. Ordering it from German companies like Conrad seems impacted by shipping restrictions.

So I tried various glues in a very unscientific way: Glue snippet of ABS plus piece of wood to ABS, see how it holds up to me trying to pull it apart.

Here's what didn't work:
  • Various Epoxies (Tower Hobby, DevCon 30 min, UHU Plus endfest 300, Loctite Heavy Duty 5min, ...) - Usually a good bet for any glue task, but doesn't stick at all to ABS.
  • JB Weld MarineWeld, PC-11 Marine Epoxy - May be more resiliant to UV and water, but don't help with ABS.
  • Alumilite casting resin - Seemed like a good idea for flowing into bottom of hull to make is watertight, closing every little pinhole, but peels right off the ABS when hard.
  • JB Weld - Won't stick.
  • Gorilla glue - The foaming polyurethane variety. Very messy, doesn't stick to ABS. 
  • Contact cement - Spread on, let dry, then press parts together. Seem to stick, but separate easily once the glue dries.
While most of the above would initially appear OK, the hardened glue will simply 'pop' off the ABS as soon as you slightly deform the ABS or pull a little stronger.
What works with ABS:
  • Stabilit Express - we knew that.
  • UHU Hart - Nice for bonding wood to ABS, but also hard to obtain in the USA.
  • Acetone - sneaks into smallest gap, melts the ABS, gives perfect bond, but needs perfect 'fit'. Not gap-filling at all, doesn't bond to anything else. 
  • ZAP Slo, gap-filling CA - May be even better if surface is wetted with acetone just before adding CA. Since the
  • DevCon Plastic Welder, 'cream' colored - Smells a lot like Stabilit Express, may be the closest to it.
  • Loctite Plastic Bonding System - A pen-type heptane activator plus a CA-type glue. 
  • Loctite Plastic 5min Epoxy - Not to confuse with regular epoxy, this one somewhat works on ABS, but not as well as DevCon Plastic Welder nor the CA-type Bonding System.

Sunday, September 2, 2012

Another Dead Mac Disk. Backup Woes

The disk in an iMac died. Disk replacement was a little easier than in the one earlier this year.

After the replacement, tried Time Machine with an external USB-3 Toshiba drive. Worked fine twice, then the next morning it showed backup errors. The system.log listed file type modification errors. After a Disk Repair, backup functioned OK. Maybe the external drive goes to sleep over night?

Being in backup mode, tried the Control Panel "Backup & Restore" on a Windows computer. Ended in backup errors

c:\windows\system32\config\systemprofile\syncup 0x80070002 The sytem cannot find the file specified

Fix mentioned on http://en.community.dell.com/support-forums/software-os/f/3526/p/19431232/20030578.aspx: Open the Windows navigator. In the left panel, it lists the Windows 7 "Libraries" for Documents, Music, Pictures, Videos. Each one contains a user specific folder like "My Documents", a shared folder and a "Sync Up" entry. Delete the Sync Up entry, and backup works fine.

Tuesday, July 17, 2012

Speedy Bee

Built from plans provided by KCRC member.

First flight around July 1, 2012.

Engine is OS FS-26.

Flies well, very not-speedy. Can fly inverted without dropping, loop in no space at all.

Is overall a bit flimsy because I decided to build it as suggested on plan with removable tail section, rubber-banded wing etc. Landing gear is very narrow, need to turn slowly on taxi to keep wingtips above ground.

Thursday, July 5, 2012

RIGblaster plug & play needs USB-2

Tried to communicate with a RIGblaster plug & play via Java RXTX.
The Rigblaster is essentially a USB-to-serial converter. All functioned fine on a new Windows 7 computer with 64 bit Java, until suddenly it didn't. The RXTX code hung somewhere in its CommPortIdentifier class that is used to open a port.

Reason turned out the type of USB port. This computer happens to have USB-2 as well as newer USB-3 ports. With USB-2 all is fine, with USB-3 the RXTX library hangs.

Wednesday, July 4, 2012

Eclipse E4 Selections, Events, Context Variables

Eclipse 4.2 includes the new "E4" APIs which offer different ways of communication between portions of your Eclipse application.
The Lars Vogel article http://www.vogella.com/articles/Eclipse4Services/article.html nicely lists these, and here are some comments from trying them out.

Selections

In Eclipse 3.x, you used the ISelectionProvider:

ISelectionProvider selections = null;
selections.setSelection(new StructuredSelection(selected_item));

Obtaining the selection provider could be circuitous, and the selection had to be published as an ISelection, typically a StructuredSelection.

On the receiving end, you needed to register a listener to the selection provider and unpack the ISelection.
In Eclipse E4, there is @Inject magic at play that can be difficult to debug, but the resulting code is sure nice:

// In a "GUI creation" routine invoked via @PostConstruct,
// arguments are injected because the @Inject is implied.
// To get an ESelectionService injected into other method,
// a specific @Inject would be required.
@PostConstruct
public void createControls(final Composite parent,
    final ESelectionService selections)
{
    // Create GUI...
    // ... monitor for example selection of list.
    MyModelObject my_selected_object = ...;
    // Publish any selectd model object or array of model objects "as is".
    // No need to wrap into StructuredSelection:
    selections.setSelection(my_selected_object);
});

To receive such a selection in another piece of E4 code:

// E4 will invoke this whenever the active selection changes.
// If the active selection is instanceof MyModelObject, it will be provided.
// Otherwise, null will be sent.
@Inject
public void handleChangedSelection(
    @Optional
    @Named(IServiceConstants.ACTIVE_SELECTION)
    final MyModelObject selected)
{
    // No need to unpack a StructuredSelection.
    // May only have to check for null
    System.out.println("Received changed selection " + selected);
}

If your selection listener happens to only receive null arguments, the reason is likely that the selected object does not match the type that you want to receive. To debug this, change the argument of your selection receiver from MyModelObject to just Object and check the type of the received object.
When porting existing code, you may by accident still publish a StructuredSelection that wraps your MyModelObject class. The E4 framework will not unwrap a StructuredSelection. Just publish and receive the exact class that you want to transfer!

Context Variables

There is only one global selection mechanism. If you want to pass updates on various model items between E4 components, you can use context variables.
Publishing anything into a context variable is as easy as publishing a selection, but note that you can now name the item that you put into the context. This allows you to publish different types of information under different names, effectively having access to multiple selection services.
You can either use a string or a class reference:

@Inject
public void methodThatPublishesContextVariable(final MWindow window)
{
    MyModelObject my_selected_object = ...;

    final IEclipseContext context = window.getContext();
    context.declareModifiable("my_item");
    context.set("my_item", my_selected_object);
}

Receiving the item updates is very similar to receiving the selection:

// E4 will invoke this whenever the named context variable changes.
@Inject
public void handleChangedItem(
    @Optional
    @Named("my_item")
    final MyModelObject item)
{
    // May have to check for null
    System.out.println("Received changed item " + item);
}

It is important to remember that the context is hierarchical!
In the publishing code it is tempting to directly ask E4 to inject the context like this instead of going via the MWindow as shown before:

@Inject
public void methodThatPublishesContextVariable(final IEclipseContext context)
{
    ...
    context.set("my_item", ...);
}

This will not work as expected! The context that your part gets injected will be the context of your part. You will then publish the context variable for "my_item" within that local context, and updates are not received by other parts. By instead asking for the window to be injected and publishing to the window's context, all parts within that window will receive updates:

@Inject
public void methodThatPublishesContextVariable(final MWindow window)
{
    final IEclipseContext context = window.getContext();
    ...
    context.set("my_item", my_selected_object);
}

If you want all windows of your application to receive updates, you can even use the application's context:

@Inject
public void methodThatPublishesContextVariable(final MApplication app)
{
    final IEclipseContext context = app.getContext();
    ...
    context.set("my_item", my_selected_object);
}

The scoped, hierarchical nature of the context variable mechanism therefore allows you to control who receives the updates: The same part, all parts in the window, or everything in the application.

Event Broker

Finally, the IEventBroker provides a lower level mechanism to post and receive events. When posting events, you can decide to simply post them in a fire-and-forget mode, or send them and wait for the receivers to handle them:

class MyClass
{
    // Receive event broker.
    // Could also fetch in code via
    // IEclipseContext.get(IEventBroker.class)
    @Inject
    private IEventBroker event_broker;
    
    void codeThatSendsEvents()
    {
        MyModelObject my_object = ...;
        event_broker.post("my_object", my_object);
    }

The 'post()' shown here is the fire-and-forget way. Use 'send()' to wait for receivers to handle the event.
To receive events for the topic "my_object" that carry data of type MyModelObject, use the following:

@Inject
public void receiveEvent(
    @Optional
    @UIEventTopic("my_object") final MyModelObject item)
{
    System.out.println("Received " + item);
}

When replacing @UIEventTopic with @EventTopic, events will be received on some event handling thread. The annotation @UIEventTopic asserts that events are received on the user interface thread, which is useful if your event receiver intends to make UI modifications, for example display the event in SWT widgets.




Friday, June 15, 2012

Eclipse Plugins with Native Code for Multiple Platforms

Eclipse plugins can contain native code. Since the native code is specific to a certain architecture, this should probably be put into a fragment that is then added to the 'main' plugin depending on the architecture.

Such fragments can support multiple platforms, for example Linux on both 32 and 64 bit CPUs, by adding something like this to the MANIFEST.MF:

Eclipse-PlatformFilter: (& (osgi.os=linux) (| (osgi.arch=x86)(osgi.arch=x86_64)))
Bundle-NativeCode
 lib/linux/x86/mylib.so;    osname=linux; processor=x86,
 lib/linux/x86_64/mylib.so; osname=linux; processor=x86_64

On Linux, the correct library for either CPU type will be now available.Excellent!

However, when combining such plugins into a feature-based product, a problem arises. Assume you have a fragment for windows, one for Linux, one for OS X. When you add the fragments to the product's feature, you must again specify their architecture:

   plugin
         id="org.mylib.linux"
         os="linux"
         arch="x86"
         ...
If you don't specify the os and arch in the feature, the build will fail: Eclipse will try to include your plugin on both Windows and Linux, but then complain that the "linux" plugin doesn't work on Windows and vice versa.

If you do specify the os and arch, however, you can only list one arch, even though our linux fragment would work on both x86 and x86_64.

The solution is to list the same fragment again in the fragment.xml with the other os and arch settings:

   plugin
         id="org.mylib.linux"
         os="linux"
         arch="x86_64"
         ...

Note that you may have to do this directly in the feature.xml. The feature editor's Plug-Ins tab doesn't support adding an already included plugin multiple times, but once you did add it in the feature.xml, you can view and edit it in there.

Sunday, May 13, 2012

Nook Simple Touch Hung on Update

Found my Nook Simple Touch hung this morning in an update. Unclear when this started, some time over night. The Nook was plugged into the charger all the time.

After about 10 minutes I decided that the "Please don't turn off your NOOK!" is nonsense, because nothing was happening. Note that the progress bar at the bottom was not animated and appeared somewhat mispainted.



After holding the power button at the back of the device pressed for at least 20 seconds, the device power cycled and went through a bootup cycle which almost immadiately entered the "Installing..." display again. But this time, the progress bar at the bottom was animated, slowly filling from the left. Then it switched to another startup screen, the progress too about 2 minutes.

Finally the usual screen saver appeared. I could unlock the device, and the main screen displayed a notification icon regarding a software update. The time of the update is the time of the power cycle.


Tuesday, April 3, 2012

Apple iMac Harddrive Replacement

Needed to replace the Harddrive on an Apple iMac. This is a white plastic Intel iMac. After removing all screws from the bottom (where the memory modules are also installed), the back of the case can be pulled off, starting at the bottom, with a 'crack'. There's a lot of aluminium-backed tape inside, and after removing the LCD panel the hard drive becomes accessible.

The original drive was 160GB. A 250GB replacement was found for around $60 (3.5", SATA).

Then it came to re-installing the operating system from DVDs, where I ran into two surprises:
  1. No disk found.
    With Linux, installing an OS from DVDs is fairly straight forward. You are guided through partitioning the hard drive etc. With OS X, I was expecting it to be even easier, but wrong: The installation asks you to select a hard drive for the installation without offering anything. Solution: Close the installer, select Tools/Disk Utility from the menu to format and partition the drive. When installing again, you can now select the drive.
  2. Can't eject the disk??
    When prompted to insert the second installation DVD, I could not figure out how to eject the first one. Nothing worked. Finally I learned that the drive was empty ... I had not fully re-assembled the case because I first wanted to check if everything "worked". When the iMac ejects a DVD, it's usually kept half-way in the drive because of the felt lining of the DVD slot. This time, the iMac had ejected the first OS installation DVD, it had rolled of the table and vanished under some cubboard. From the outside, I could not tell if there's a DVD in the drive or not. Since I didn't remember ejecting the DVD nor saw one in the usual half-out-of-the-drive position, I had assumed that it's still "in"....

Monday, March 12, 2012

Extra 3.25





First heard about the design as a Model Airplane News plan, designed by Rich Uravitch. Then found the Lanier kit version on EBay, got it for Christmas in 2010 together with a used OS FS 26. Unclear how old that engine is. It looks a bit more gummed up than my other 10-year old OS 26.

The Lanier kit has very nice laser-cut pieces which I wanted to preserve, since it's getting harder to find nice kits. So this plane was built by copying the pieces of the kit.
Everything came together quickly until it was time to assemble the middle section for which the kit provides a vacuum formed clear plastic part. Created a plaster mold, but failed to duplicate it because it was hard to get a suitably large sheet of clear plastic. Ordered a canopy from Tower for a 60-sized cup that appeared similar, but that piece arrived broken. So ended up creating the center section from scratch out of balsa.
The kit also includes a cowling which I didn't want to remove from the kit, either. Tried to copy it in fiberglass, which turned into a big mess. Then ordered a replacement fiberglass cowling from Fiberglass Specialities, but have not put it on because it's much easier to reach the engine without a cowling. The only part on this plane that came from the kit is the aluminum landing gear.

The kit suggests a weight of 3.5 to 4.5 lbs, but my plane came out just under 3 lbs! It appeared front-heavy, had to move the receiver battery into the back of the fuse to balance. Servos are 3 normal sized ones and a small one for throttle. One servo with bell-cranks for ailerons, no "flap" mixing option.

Wingspan 120 cm
Length 87 cm
Area 23.4 dm2
Weight 1330 g
Loading 56.8 g/dm2
Airfoil Semi-Symmetrical
Engine OS FS 26
Tank120 cc

First flight was on the 2012/03/12. Engine runs fine, solid put-put-put, no screamer. The plane has a tank that only uses a third of the front section, and I don't know how long it will run, but after 4 minutes it's still 3/4 full.The plane feels very light and can fly quite slow. very easy to fly, like a trainer except maybe a faster roll rate.

Wednesday, February 29, 2012

Eclipse JFace 'VIRTUAL' TreeViewer basically requires TreeColumnLayout?

When switching a TreeViewer from an ITreeContentProvider to a 'VIRTUAL' TreeViewer with ILazyTreeContentProvider, the tree display initially appeared blank. The items in the tree would only become visible after waiting a little, or by doing some window operations that result in a refresh of the tree. This happened especially on Mac OS X.

After looking closer, it became obvious that the one and only column of the tree had a nearly zero width. Note the arrow in the image that shows the column separator:




The issue seems to be that a non-VIRTUAL TreeViewer knows all its items right away and can size the tree columns appropriately. When swtiching to a VIRTUAL TreeViewer, the items are updated as needed, and the column refresh can lag.

Early "fixes" involved forcing a refresh after setting the TreeViewer input:

tree.setRedraw(false);
tree_viewer.setInput(config);
tree_viewer.refresh();
tree.setRedraw(true);

or

tree_viewer.expandAll();

But the best workaround seems to be to use a TreeColumnLayout that always auto-sizes the one and only column:


// Note that the TreeViewer needs to be the only widget
// under the parent widget. If necessary, add Composite
// to wrap the TreeViewer
final TreeColumnLayout layout = new TreeColumnLayout();
parent.setLayout(layout);
final TreeViewer v = new TreeViewer(shell, SWT.VIRTUAL | SWT.BORDER);
v.setLabelProvider(new LabelProvider());

Friday, February 3, 2012

Avoid Soft Links in Eclipse Headless build - or ant in general?

Ran into a really strange problem.
As a result of a headless Eclipse product build, I usually get an abc.app for Mac OS X.
But this time around I got an abc.app for Mac OS X that "worked", but the program icon was wrong. In addition, there was an Eclipse.app directory that's mostly empty.
Products for other architectures (Linux, Windows) looked OK.

Apparently, the build process had first put the Eclipse.app in place, tried to assign the icon etc., and then renamed it to the actual product name abc.app, but something failed in the process. The Eclipse.app partially remained in place, and there was no icon.

Solution: I had recently changed the build directory to /tmp. On Mac OS X, /tmp is a soft link (symbolic link) to /private/var. Either the Eclipse headless build or maybe ant in general has problems with soft links. After using a "real" directory path without any soft links as the build directory, things were fine again.

Thursday, December 22, 2011

Chipsair 2






Update of the first Chipsair that crashed due to unknown reasons.
Just lost it while spinning, maybe because the battery voltage dropped too far while tossing it around. Hence this one has a voltage display...

Update was build in very similar way to the first Chipsair but possibly a little stronger: Extra thin ply in the elevator, added bracing in the aft of the fuselage.

Wingspan 1.58 m
Wing Area 36.34 dm2
Tail 50 cm
Tail Area 6 dm2
Weight 2012 g
Wing Loading 55 g/dm2
Length 1.1 m
Airfoil Eppler E197
Engine OS MAX 46 LA (blue)

First flight on December 22, 2011, where I noticed at the field that the aileron hinges where actually not glued in, yet! So for the first flight scotch tape held them in place, and I tried to avoid aileron use to keep them attached to the wing.

The pictures also still show the push-pins on the windshield because I'm not sure if the glue is 100% dry.

This might have been the last plane where I could use the Pacer ZAP hinge glue that seems to become unobtainable.

Overall it flies GREAT. Plenty power, plenty authority from aileron and elevator, which I had worried about. Very nice and slow landings, while on the other hand endless loops and quite some vertical performance.


Friday, September 9, 2011

JDBC 'commit' even for SELECT

You probably knew this, but a 'commit' can even be necessary for SELECT calls that don't change any data.

After calling JDBC Connection.setAutoCommit(true)), every JDBC call, be it SELECT, INSERT, UPDATE, DELETE starts a transaction that needs to be ended with a commit (or rollback).

This might be obvious for a sequence of INSERT or UPDATE calls that change data, and you want a final commit() to perform an atomic update.

With a SELECT, the update is necessary to avoid the following situation:
  1. Calling SELECT to fetch something. That starts a Transaction!
  2. Now somebody else changes the data.
  3. You call SELECT again to get the 'latest', but since you're still in the original Transaction, you get the same old data as in step 1.
If you have other code that changes the data and happens to call commit() before you reach step 3, all will look OK, but to be sure that you end the original reading transaction and always get the 'latest' data in a later read, it has to be done like this:
  1. SELECT, commit()
  2. Now the data might change.
  3. If you later need to fetch the 'latest', again SELECT and commit()

Tuesday, September 6, 2011

RAOTA - What an idea!

Rest Areas on the Air, starting on Nov. 23, 2011:

Map http://www.tdot.state.tn.us/maintenance/restareas.htm mentions "2 hour parking limit":



Sunday, August 28, 2011

Dandy E205



This is not about a high-performance sailplane but about building something that you knew about maybe 30 years ago...

Graupner used to have a glider kit called "Dandy". I found a new-old-stock Dandy kit offered on eBay, but it went for what I considered way too much. So I decided to build something similar to the Dandy, and luckily found the web site http://www.koralpe.biz/dandy.html which has nice pictures of the original kit and a plane built from it.
I had also read about the Eppler 205 airfoil, both good and bad, so I decided to try that.
Finally, the "glider" should have an electric motor because using a high-start is somewhat cumbersome. The motor and prop combination was determined by trying various things in online motor calculators and by comparing with off-the-shelf models of similar wingspan, weight and type.




Wingspan170cm
Length105cm
AirfoilE205
StabE193, 50 x 11cm
Wing Area39.1 dm2
Weight1156g
Wing Loading29.6g/dm2
Decal FontOptima Extra Black
MotorTurnigy C3530-1100, Kv1075, 73g, 15A Max, later MVVS 10 2/1120
Prop9x5 Folding Prop
Speed Controller25A max
Battery2200mAh 3S LiPo


The center of gravity came out somewhat too far in the back unless two batteries are packed into the front of the plane. The total weight of about 1.2kg includes the two batteries and radio gear. The original plane had a slightly smaller wingspan, weight of 1.0kg, and a wing loading of 16-29g/dm2.

First flight was on the morning of August 28, 2011. Two brief flights before breakfast. It flies nicely! I was surprised how slow. Current draw is 13A at full power, and about 5A when cruising around.

--

17 July 2016: Axis of Turnigy snapped off (!) during climbout. Managed to land ok, but prop vanished in the woods.
Replaced with MVVS 10 2/1120. On summer evenings using about 400 mAh for 10 minute flight.

Tuesday, August 16, 2011

Oracle JDBC Version Woes

Ran into a strange Oracle error today in a Tomcat program.
The code ran fine in two other Tomcat instances, but failed in a third one.
The error happened to be
ORA-03115: unsupported network datatype or representation
which basically means: There is a version mismatch between the database and the JDBC library.

Reason
That Tomcat instance had a copy of ojdbc14.jar in its lib/ subdirectory that was used instead of the ojdbc14.jar included in the application's *.war file.

Unfortunately it is hard to tell the version of an ojdbc14.jar from the outside.

Possible Solutions
  1. Unzip the ojdbc14.jar and check its manifest file.
  2. Get the version programmatically
The latter can for example be displayed on some 'internal' web page of your application:

Connection connection = ...;

DatabaseMetaData md = connection.getMetaData();

out.append(...md.getDriverName() + " " + md.getDriverVersion() ...);


That way it is possible at runtime to check which version you are actually using.

Moral
Don't put *.jar files in the Tomcat lib/ directory. Include them in the *.war file.
Yes, this way you might load multiple copies, one for each *.war, but that beats later wating time to debug an app that suddenly stops working because some Tomcat instance has the wrong *.jar in its lib/ directory.

Saturday, August 13, 2011

Mercurial seems to hang in SourceForge connection because of host key change

Had a problem where mercurial seemed to hang forever in a SourceForge transaction.
It was run from within Eclipse via MercurialEclipse, and there was no indication as to
what's happening nor any way to stop it other than to kill Eclipse.

This was under Windows with hg calling putty, which in turn was configured to use an ssh key pair registered with SourceForge that had worked OK some time ago.

When executing hg from the command line, it would also hang, but I could stop it with Control-C, and then it would show the following message:

hg clone ssh://name@....hg.sourceforge.net/hgroot/....
interrupted!
remote: The server's host key is not cached in the registry. You
remote: have no guarantee that the server is the computer you
remote: think it is.
remote: The server's rsa2 key fingerprint is:
remote: ssh-rsa 2048 86:7b:1b:12:85:35:8a:b7:98:b6:d2:97:5e:96:58:1d
remote: If you trust this host, enter "y" to add the key to
remote: PuTTY's cache and carry on connecting.
remote: If you want to carry on connecting just once, without
remote: adding the key to the cache, enter "n".
remote: If you do not trust this host, press Return to abandon the
remote: connection.
remote: Store key in cache? (y/n) ^C

Again this was under Windows. On a real operating system the host key change prompt might have appeared before the Ctrl-C and thus be more obvious.

Anyway, the fix:

Run
putty -i path\to\the\key.ppk
once which will show the same host key change prompt and this time you can accept it.

From then on, hg works OK again.