• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

exceptions in deploying EJB application with JBoss

 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I made an EJB application. This are the two exceptions I get. Can somebody tell me what they mean?

I deployed my application. JBoss created one new table "StudentBean" instead of using the one I mapped to, which is an existing table named "Student". So I delete the table JBoss created, and change the existing table "Student" name to "StudentBean".

Load failed; CausedByException is: Unknown column 'studentName' in 'field list'; CausedByException is: Load failed; CausedByException is: Unknown column 'studentName' in 'field list'; nested exception is: javax.ejb.EJBException: Load failed; CausedByException is: Unknown column 'studentName' in 'field list'; - nested throwable: (javax.ejb.EJBException: Load failed; CausedByException is: Unknown column 'studentName' in 'field list')



then, I go into my ejb-jar.xml. And changed the field for tags <ejb-name> under both <entity> and <assembly-descriptor> from StudentBean to Student. Now this is the exception I get:

java.rmi.ServerException: EJBException:; nested exception is: javax.ejb.EJBException: Could not instantiate bean; CausedByException is: null; CausedByException is: javax.naming.NamingException: Could not dereference object [Root exception is java.lang.NullPointerException]



I can never seem to map my EJB application to exisitng tables (means not created by JBoss but by myself). The configuration I made to JBoss are the following:
1. add the JDBC MySql driver into server/default/lib dir.
2. copy the mysql-ds.xml into server/deploy dir.
3. modify the mysql-ds.xml by changing the username and password. Also the <connection-url> tags.

Did I miss out any configurations I should do? Please advice.
 
vivien siu
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
another thing to ask. I read from JBoss: A developer's guide that JBoss creates table by default if the table does not exists. How does Jboss checks whether the table exists or not? by referring which tag in which xml file?
 
vivien siu
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
another thing: The EJB application was done using NetBeans 5.0 release version. Maybe it's just NetBeans screwing things up. :roll:
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In jbosscmp-jdbc.xml, you can use tags like :
<table-name>, <create-table>, <drop-table>....

Check the documentation.
 
vivien siu
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Satou,

There's no jbosscmp-jdbc.xml in my application. Do I need to make one so my app can function properly?
 
Forget Steve. Look at this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic