Wednesday, July 8, 2009

Oracle Installation error: ORA-12560

I'm setting up a development environment on my machine for a new web app in Ruby on Rails with an Oracle back-end. This was my first time installing an Oracle database. It's quite an archaic and un-user-friendly process. The good news is, I've spent a lot more time praying than I usually do while at work. I'll try to keep this short.

OS: Windows XP, SP3
Installing: Oracle 10g Standard Edition
Steps:
  1. Download the zipped 10gR2 installer package from Oracle's website (~625MB).
  2. Extract the zip file somewhere on my hard drive.
  3. Run the setup file in the extracted folder.
  4. Follow the wizard, selecting not to create the sample database at the beginning. Use the defaults for everything else. Yay, now we've got an empty Oracle installation.
  5. Now to create a database. Click Start > All Programs > Oracle - OraDb10g_home1 > Configuration and Migration Tools > Database Configuration Assistant.
  6. Follow the wizard, keeping the defaults (except I changed the character encoding to Unicode).
The Problem: I got a whole ton of error dialog boxes popping up. I chose "ignore" on all of them, allowed the database to finish being created, and then took a look at the log file (myOracleFolder\product\10.2.0\db_1\cfgtoollogs\dbca\myDatabaseName\emConfig.log). The log file mentions:

CONFIG: ORA-12560: TNS:protocol adapter error

oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException: ORA-12560: TNS:protocol adapter error

at oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeImpl(SQLEngine.java:1467)
at oracle.sysman.assistants.util.sqlEngine.SQLEngine.connect(SQLEngine.java:814)
at oracle.sysman.emcp.util.GeneralUtil.initSQLEngine(GeneralUtil.java:363)
at oracle.sysman.emcp.DatabaseChecks.validateUserCredentials(DatabaseChecks.java:986)
at oracle.sysman.emcp.ParamsManager.validatePassword(ParamsManager.java:2694)
at oracle.sysman.emcp.EMDBPreConfig.checkConfigParams(EMDBPreConfig.java:1268)
at oracle.sysman.emcp.EMDBPreConfig.checkParameters(EMDBPreConfig.java:1060)
at oracle.sysman.emcp.EMDBPreConfig.invoke(EMDBPreConfig.java:174)
at oracle.sysman.emcp.EMDBPreConfig.invoke(EMDBPreConfig.java:160)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:141)
at oracle.sysman.assistants.util.em.EMConfiguration.run(EMConfiguration.java:430)
at java.lang.Thread.run(Thread.java:534)
Jul 8, 2009 9:50:33 AM oracle.sysman.emcp.EMConfig perform
SEVERE: Invalid username/password.
Refer to the log file at C:\oracle\product\10.2.0\db_1\cfgtoollogs\dbca\orcl\emConfig.log for more details.
Jul 8, 2009 9:50:33 AM oracle.sysman.emcp.EMConfig perform
CONFIG: Stack Trace:
oracle.sysman.emcp.exception.EMConfigException: Invalid username/password.
at oracle.sysman.emcp.EMDBPreConfig.checkConfigParams(EMDBPreConfig.java:1272)
at oracle.sysman.emcp.EMDBPreConfig.checkParameters(EMDBPreConfig.java:1060)
at oracle.sysman.emcp.EMDBPreConfig.invoke(EMDBPreConfig.java:174)
at oracle.sysman.emcp.EMDBPreConfig.invoke(EMDBPreConfig.java:160)
at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:141)
at oracle.sysman.assistants.util.em.EMConfiguration.run(EMConfiguration.java:430)
at java.lang.Thread.run(Thread.java:534)


The solution:
Uninstall the half-created database I just made, restart my machine, and then recreate the database. Now it works. *smacks forehead*

Monday, July 6, 2009

Haikus on learnjapanesepod.com

I often listen to a podcast called learnjapanesepod. It's excellent --highly recommended for anyone studying Japanese as a part of this balanced breakfast, including classes, listening to Japanese music, going to Japan, watching anime, and writing nerdy things in Japanese to your wife on your whiteboard at home.

A couple of haikus that I wrote in the their forums were read "on the air" on their podcast last Friday... I'm excited :) . Btw, the name I used was "jensengo".

Here's the link for that episode: http://learnjapanesepod.com/fun-friday-for-3rd-july-2009/.

Monday, March 23, 2009

asp.net crashes

I thought I would note some possible causes of the evil "server application unavailable" message when you try to view an ASP.NET application. It always helps to check your Event Log messages, too.

1) Cause: Incorrect file-system-level permissions. Solution: set the Windows permissions of your web site source code top-level folder to at least allow "Read & Execute", "List Folder Contents", and "Read" access for the following user accounts, where "MyMachineName" is your local machine's name.
- MyMachineName\IUSR_MyMachineName
- MyMachineName\IWAM_MyMachineName
- MyMachineName\ASPNET

2) Cause: Infinite recursion (stack overflow). Solution: fix your code so a method can't call itself infinity times.

3) Cause: Infinite memory allocation (heap overflow). Solution: something in your code is infinitely requesting memory. Check for a spot in your code where a new command is used in an infinite loop or some other situation where it's repeatedly instantiating objects.

Monday, March 16, 2009

Noonday seashore: a Haiku

...and now for something completely differenter. This is my first attempt at a haiku in Japanese. I provided fairly tight English translation which follows the meter.


昼の海
うるさい鴎
そよ風と

A noon-day seashore
Annoying, noisy seagull
With a gentle breeze



I think it has the greatest effect when you read on line at a time, slowly. I had in mind the shore of Lake Michigan in Saint Joseph, MI, where I grew up. There are lots of happy memories on those beaches. The seagulls can be really annoying, too :) . But please feel free to imagine any shore you like. I think Japanese can probably relate to this, since they are surrounded by ocean.

I used incomplete sentences, both in Japanese and English. I'm not exactly sure how it sounds to a native Japanese (please inform me!). So anyways, that's that. Please let me know what you think of either version! I'd appreciate critiques!

Tuesday, February 10, 2009

application unavailable

Here's a helpful tip if you're getting messages like this when you try to access an ASP.NET page you're working on:

Server Application Unavailable

The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.

Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.



The short answer is: probably stack overflow. Check your methods and properties for infinite recursion.

Long answer:

This error is not usually very helpful, and the Event Log doesn't show anything interesting except a note that basically says something really bad happened to aspnet_wp.exe, and it exited unexpectedly. Sometimes you can't seem to pause execution in debug mode, too.

Just in case you're fuzzy on what happens normally, aspnet_wp.exe ("ASP.NET") is a chunk stuck onto IIS to serve your ASPX pages. When IIS gets a request from a web user for a file ending in .aspx, it thinks to itself, "What the heck is this?! ASP.NET, do you know anything about this?" And then aspnet_wp.exe says, "Oh sure, I do those all the time." And then IIS says, "Good-- here, take it!" So ASP.NET goes through executing your code for the page. Little does it know that it has fallen into a doomed execution path of infinite recursion that you created! It keeps looping along, until Windows sees that it has a 1.5 bizillion stack frames, and it says, "Hey you! You're taking more than your fair share, mister!" ...And Windows kills the process. Brutal, I know. Then, the .NET Runtime Error Reporting thingamajig comes along and says, "Oh my gosh! They killed ASP.NET!!" And writes that in your Event Log.

So yeah, watch out for infinite recursion. I suppose a similar problem would happen if you overflowed the heap instead.

Friday, January 30, 2009

Moving files in TortoiseSVN

I'm using WinXP, Subversion 1.5.5, TortoiseSVN 1.5.6.

I was having a little trouble moving some files that were under SVN control, but I was able to quickly find some help on this website: http://vidmar.net/weblog/archive/2007/12/11/subversion-and-tortoisesvn-tips-and-tricks.aspx about doing it.

Don't move files within your repository with Windows Explorer. Instead use the TortoiseSVN > Rename option from the context menu when you right-click a file. Then just use backslashes to specify the directory you want your file (or folder) moved to.

...also, you can use Windows Explorer to move SVN files if you RIGHT-click and drag, not left click. When you release the mouse button, a context menu will show up, where you can choose to "SVN Move to here". That works.

Thursday, December 11, 2008

Twas the Night Before a Corrupted Windows Profile

Score: Windows Profile: 2, Gordon: 3.

Twas the night before a corrupted Windows profile and all through the workplace,
Elves come to your computer, random things to erase.
I arose from my bed and arrived there the next day,
And stuck my laptop on the docking station (in the usual way).

When what to my wondering eyes should appear,
AC power was on, yet no other features were here.
I tried to undock it. I thought that was the trick.
But nothing seemed to happen after the mouse click.

I thought to myself, "this thing just needs a good reboot".
"Windows is shutting down" disappeared, but the mouse screen stayed. Oh shoot.
"If you won't shut down, then we'll have to do this the hard way."
I held down the button till the screen went away.

I started it back up, and everything was just fine.
It found the AC power and all the other hardware of mine.
Now I could work. I was cruising in style.
Except now, "Windows cannot locate your roaming profile."

So it logged me in under that evil TEMP account
(the one that always erases whenever you log out).
Redoing my settings I can handle just fine,
But now I'm eternally stuck to use TEMP every time.

It said something about a file name being too long.
Well, last time I logged in, no such thing had gone wrong.
I logged out and in, then rebooted once more...
Nothing changed --I even tried System Restore.

Of course the "Undo Last Restore" failed. Microsoft is that elf.
I just laughed when I saw it, in spite of myself.
I moved lots of long-named files out of My Documents to the C: drive,
I logged out and back in, and then my profile was alive!

It took a while to log in, so I ran a Disk Cleanup and Defrag.
It seems to be better. There's not so much lag.
But I heard the elf exclaim ere he drove out of sight,
"255-character-long profile filenames to all, or you're picking a fight!"

Thank you.

Although WinXP supports much longer filenames, the profile manager has trouble with filenames over 255 characters long. I also noticed that it doesn't like non-ASCII filenames. For example, I had a file named "かんしゃさい.doc". I had also tried copying the corrupted profile to a new local account, and this file along with the long-named ones refused to be copied. After renaming the non-ASCII one and moving the long-named ones (I didn't want to rename) out of My Documents\Visual Studio 2005\Projects\ into a new folder C:\Projects, everything worked just fine.

There are other good resources out there for this problem, too. I recommend:
http://forums.microsoft.com/WindowsToolsandUtilities/ShowPost.aspx?PostID=3947666&SiteID=69

Friday, December 5, 2008

Error CS0117: '<MyClass>' does not contain a definition for 'Profile'

I discovered another bad idea: creating a member variable named 'Context' in a web page class (or any class that inherits System.Web.UI.Control). I happened to make this mistake in a MasterPage class.

If you do, you should receive a love letter or two from the compiler much like mine:
'MyNamespace.MyClass' does not contain a definition for 'Profile'
...and/or:
'MyNamespace.MyClass' does not contain a definition for 'ApplicationInstance'.

You'll also find this warning:
'MyPageClass.Context' hides inherited member 'System.Web.UI.Control.Context'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword.

Here's the list of other member names you may only envy when building classes that inherit the Control class:
http://msdn.microsoft.com/en-us/library/system.web.ui.control_members.aspx

Monday, December 1, 2008

Error CS0570 '<propertyname>' is not supported by the language

I ran into this error today and was able to resolve it. Hopefully I can save someone else some trouble.

In a solution, I have a web project in C# that references a C# project called BusinessComponents. I had replaced some .dll files in the BusinessComponents project with newer versions without updating the references. Then, I tried to access a new property called PseudoFamily in the dlls from the web project. It exploded, saying:
'MSU.Radiology.CIS.ServiceLayer.FamilyManager.PseudoFamily' is not supported by the language

...and I found a message in VS's Output pane that said (I shortened it a bit):
Reference to type '...PseudoFamily' claims it is defined in 'c:\...BusinessLogic.DLL', but it could not be found.

Removing and re-adding the references from the BusinessComponents project to the .dll files fixed the issue.

(I should have guessed... in following with Microsoft's long tradition of 'restart to fix it')