• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exceptions in deploying EJB application with JBoss

 
vivien siu
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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:
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic