wood burning stoves*
The moose likes EJB and other Java EE Technologies and the fly likes EJB 2.1 Error - Find failed - java.sql.SQLException: Column not found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB 2.1 Error - Find failed - java.sql.SQLException: Column not found" Watch "EJB 2.1 Error - Find failed - java.sql.SQLException: Column not found" New topic
Author

EJB 2.1 Error - Find failed - java.sql.SQLException: Column not found

Alys Landle
Greenhorn

Joined: May 18, 2011
Posts: 5
Good morning!

I have an old Java application, using EJB 2.1 and BES application server. It's up and runnig fine today, but we have a project to migrate it to a new architecture (and hopefully, get rid of EJB 2.1), the first step being moving it all to JBoss AS 5.1. In order to do so, first I isolated one EJB module, called Address, and I'm doing tests with it, to get it working. After that, I will try moving the rest of the application.

I don't have experience with EJB (I'm more familiar with Spring or GWT), and I'm facing some troubles while doing this migration to JBoss. This first EJB module I'm trying to migrate, Address, has the following folder structure:



The ejb-jar.xml is like this:



Note: com.project.name is just an alias for the real package.

The jbosscmp-jdbc.xml:



The jboss.xml:



Another note: this sources are like 15 years old. The team responsible for it is no more here, and I have no ideia why they structured the project like this.

Inside the Facade (well, the class with *Facade name pattern), the code calling the findByPrimaryKey method it's:



And, retrieving the home is like this:



But, when I run the project and try to make a simple search, I get the error:



I can assure the column does exists in the database. This project is up and working fine today on the BES server, and, no changes in the database or the sources have been made (just configuration files).

Thank you all for any help, and please apologise misspellings. English is not my native language.
Alys Landle
Greenhorn

Joined: May 18, 2011
Posts: 5
Strange... the console log above is not showing the "_" character properly, but I wrote it...

The error I'm getting is "Column not found: T0_ADDRESS.ID_ADDRESS". There is a "_" between the words, it's not an empty space. I simply can't get this to show properly on my previous post, sorry.

Anyway... some progress (I think). I found this link in JBoss Community, and, I noted my jbosscmp-jdbc.xml doesn't have a primary key defined. So, I removed the field:


And tried to replace by this:


And now, the error I get is this:


The "_" is missing, and, since in the table it's "ID_ADDRESS", I get the Oracle exception. I believe I'm missing some configuration, or have done some wrong one, but I can't see what is it yet...
 
 
subject: EJB 2.1 Error - Find failed - java.sql.SQLException: Column not found
 
Similar Threads
JBoss with Oracle
Problem with CMP
Entity Bean Error - SQLException
HeuristicMixedException for XA transaction between JBoss 5.1.0GA and 3.2.0
JBoss duke's bank app-client issue