Dec 29

Long story short, if you see:
org.hibernate.console.HibernateConsoleRuntimeException: Could not create JPA basedConfiguration, you may have your workspace and/or project in a path with a space in one of the directory names.

Let me expound:
I recently downloaded the newest JBoss Developer Studio (JDS) and thought “hey I’ll whip up a JBoss Seam application using EJB3.0, JPA, and Hibernate.” I watched a tutorial and saw how awesome their Hibernate Configuration capabilities were. Then I tried to replicate it. I use the wizard to create a new Seam Web Project and boom, the very next step I get an error.

The full error was:
org.hibernate.console.HibernateConsoleRuntimeException: Could not create JPA based Configuration
Could not create JPA based Configuration
<No message>
java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException: <no message>
java.lang.reflect.InvocationTargetException
javax.persistence.PersistenceException: java.lang.IllegalArgumentException: Unable to visit JAR file:/C:/Documents and Settings/jmarcum/jbworkspace/example/build/classes. Cause: Illegal character in path at index 18: file:/C:/Documents and Settings/jmarcum/jbworkspace/example/build/classes
java.lang.IllegalArgumentException: Unable to visit JAR file:/C:/Documents and Settings/jmarcum/jbworkspace/example/build/classes. Cause: Illegal character in path at index 18: file:/C:/Documents and Settings/jmarcum/jbworkspace/example/build/classes
java.lang.IllegalArgumentException: Unable to visit JAR file:/C:/Documents and Settings/jmarcum/jbworkspace/example/build/classes. Cause: Illegal character in path at index 18: file:/C:/Documents and Settings/jmarcum/jbworkspace/example/build/classes
Unable to visit JAR file:/C:/Documents and Settings/jmarcum/jbworkspace/example/build/classes. Cause: Illegal character in path at index 18: file:/C:/Documents and Settings/jmarcum/jbworkspace/example/build/classes

Now the “Could not create JPA based Configuration” could be for several reasons, but one that you won’t find anywhere on the internet (except right here, and I know this because I looked) is because of your file location. You can’t have any spaces in the path to your filename. Like by default, JDS will put your stuff in C:\Documents and Settings\yourname\workspace. First off, thanks Windows for putting spaces in my default directories, that helps with everything. Second, thanks JDS for giving me the worst error message ever. Now true, they gave me a hint in the ‘details’, but the main error that shows up is much less helpful.

So anyway, hope that helps some other poor soul doomed to develop on Windows. Word to the wise, if you are on windows and developing using Java, always put your source in a short path (name-wise) that has no spaces. Like c:\source. Same thing for your maven repository. Get that shiz out of your home directory and move it to c:\repo. You can specify where the repository is in your settings.xml in your home directory. This will help in lots of things, like tools that don’t expect spaces, and limitations with windows command length (like if you have a super long classpath).

Cheers.

Dec 28

The title of this is a little misleading. I’m not ranting about Christmas (or at least don’t plan to as of now, who knows where the post will lead), I am just ranting and it happens to be Christmas time.

First, I just read an article in the NY Times that talks about text messages and their high prices. It basically says the providers are price gouging and should be ashamed of themselves/sued. Seriously? “Hi, I provide a service that cost a shit-ton to build the infrastructure for, including hardware and spectrum rights. I just figured out a stupid add on that teenagers love that costs me literally nothing, but I can charge 20 cents for.” “Umm, excuse me sir, that is wrong, if it is cheap for you and you charge me for it, that is unfair.” If you are addicted enough to text messaging that you will pay 20 cents per message, or 5 bucks for 200 or 15 bucks for unlimited or whatever it is, good for AT&T for convincing you to pay for something that email/twitter/facebook/IM does for free if you have a data plan. By the way, I pay 5 bucks a month for 200 text messages (of which I use 9), so AT&T got me too. Next time someone figures out a way to provide goods or services at a profit and you complain about it, slap yourself for being retarded. It is called capitalism and it works (usually).

Second item: Capitalism doesn’t work. Oh my god, I totally contradicted myself there, quick someone point it out. Actually, no one will point it out because only 4 people read this, and they are all too lazy to comment. Plus I just pointed it out. <Inner Rant>Why do I blog? Seriously 4 people read this and I’m sure I’ll bitch about all of these things to each one of them in due time anyway. It must be my delusions of grandeur. <End Inner Rant> So here is the thing about capitalism, she’s a fickle bitch. Economics 101 talks about supply and demand and self correction, and that is all well and good but that is only part of the story. The more important part, and the part that doesn’t “work” is speculation. What do I mean by speculation? No I don’t think you are too dumb to know the definition, I think I am, so I’m telling you what I think the definition is. When I say speculation I am really talking about any leveraging of money based on future expectations. Stocks, Options, Hedges, Futures, Loans, etc. Anytime your economy is based on future expectations, you will have large swings in prosperity/recession. The only way to keep moderate swings is to continually innovate (i.e. produce the same goods/services for less) which is improbable, and have no corruption (yeah right, this is the human race we are talking about), or to have regulations. The free market will correct itself, but only after rising so high that it comes crashing down (see today’s economy). I could have framed this argument way better, and it probably would have actually made more sense, but that would have taken too long. Just believe me, I made a 5 on my economics AP test.

Next, Christmas. Yep, worked it in, the title fits after all. I got in to a twiscussion (i just made that up and it means “discussion over twitter”, the least effective way to converse in depth) with one of my friends over an article saying scientists are pooping their panties over “Ice Age 3 Dinosaurs in Action” (I forget the actual title). They say “excuse me, it is scientifically inaccurate to show Dinosaurs coming AFTER mammoths in the earth’s history, and I won’t stand for it”. The person writing the article is witty enough to point out that said scientists didn’t complain about the scientific inaccuracy that the mammoth and the dinosaurs can SPEAK IN ENGLISH TO EACH OTHER. That is all well and good, but let’s take it one step further. Fiction doesn’t have to be scientifically correct. That is why it is called Fiction. There is a difference between show #1 — fiction that is portraying reality, like “hi, I’m a made up doctor character in the ER, here are some doctor words that should be correct” and show #2 — complete fiction like “hi, I’m a cartoon rabbit that speaks to a retarded hunter, so clearly I am not based in reality, I can shoot him in the face with a shotgun and it will only burn his hat and then I can sprint away leaving dust bubbles”. If you are a doctor and you watch show #1, you can be mad if the character says “I need 500g of pvc bilaterally injected into this smaschmorta stat” because that means they didn’t take the time to research that shit. However, unless you are an illustrated long-eared animal that leaves dust bubbles when you run, you need to STFU about realism while watching show #2.

Sorry, now really about Christmas. Christmas is the second kind of fiction in my opinion. It is a story not based in reality, so it doesn’t have to strictly be realistic. Before you get indignant and say “Jesus is real, you are sorely mistaken and will probably go to hell”, 2 things.

  1. This still definitely applies to the Santa Claus story part of Christmas, so think of it in that manner.
  2. I also believe it applies to the ‘virgin-born, resurrected, flies with angels’ Jesus story as well. If you don’t, just focus on point #1.

Because it is a fictional story, I see no problem in telling it to kids for a fun time. Poops and giggles if you will. But as soon as the kid is old enough/smart enough to question the story and say “that doesn’t seem real”, don’t lie to him. Encourage him to question seemingly made up things, because while fiction is fun, lying and telling them fiction is reality is unfair. Children look up to adults for direction, especially authority figures like parents, it is our nature as humans, and they take their word as truth. So make sure your word actually is the truth and encourage further learning. If you are concerned he’ll ruin the story for other kids, tell him not to, he’s the kid, you are the parent. And if he does, oh well, what’s the harm in making another kid smarter.

Next, parenthetical thoughts. I overuse those mofo’s. Almost every sentence I write has a parenthetical aside written in to it (man this is annoying) and man that is annoying to read. I’m sorry that I do it, I just have so many brilliant thoughts in my stream of writing that I have to try and cram them all in. I’ll try to do it with more literariness in the future.

Finally, damn I forgot my last one. I had a really good one that I was saving for the last, but I completely blanked on it now. Oh well, consider yourself unlucky. Here is a quick and topical substitute. Memory. My memory sucks balls. The other day I forgot my zip code and couldn’t pump gas with my credit card because it required it. Gay. Then, a while back, I forgot how old I was, I was off by 2 years. Yeah, 2 years. Apparently the last time my brain decided to remember my age was 2 years ago. Also, I will say I’m going to do something right as I’m starting to do it, then forget. Or someone will tell me to do something and I will forget to do it within 10 seconds. Example: Wife:”Hey, don’t forget to turn off the light as you come to bed.” Me<walking towards the bedroom from the kitchen, about 15 feet from light switch>: “Ok, will do.” Wife<10 seconds later>: “Damn it, you are in bed and the light is on.” Me<sucking at life>: “Man I suck at life.” So if anyone has any ideas on how I can turn back on my brain memory function, please leave a comment.