• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Slime does not pay. Always keep your tiny ad dry.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic