wood burning stoves 2.0*
The moose likes JBoss/WildFly and the fly likes exceptions in deploying EJB application with JBoss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "exceptions in deploying EJB application with JBoss" Watch "exceptions in deploying EJB application with JBoss" New topic
Author

exceptions in deploying EJB application with JBoss

vivien siu
Ranch Hand

Joined: Nov 10, 2005
Posts: 143
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.


I'm not available, my BF's name is WORK.
vivien siu
Ranch Hand

Joined: Nov 10, 2005
Posts: 143
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

Joined: Nov 10, 2005
Posts: 143
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

Joined: Nov 24, 2005
Posts: 14688
    
  16

In jbosscmp-jdbc.xml, you can use tags like :
<table-name>, <create-table>, <drop-table>....

Check the documentation.


[My Blog]
All roads lead to JavaRanch
vivien siu
Ranch Hand

Joined: Nov 10, 2005
Posts: 143
Hi Satou,

There's no jbosscmp-jdbc.xml in my application. Do I need to make one so my app can function properly?
 
GeeCON Prague 2014
 
subject: exceptions in deploying EJB application with JBoss