Hi all!

Last weekend I have developed two little ejbs. one entity bean
and one session bean.

I started with the entity bean. Once I had coded it I tested it and
everything was fine.
Then I wrote the session bean which is a fasade controller
to the entity bean.
I had the following two problems:

1.
Since the session bean needs the entity bean in order to work
the deployment descriptor looks something like (ejb-jar.xml):

<session>
  ...
  <ejb-ref>
  <ejb-ref-name>NewsEB</ejb-ref-name>
  <ejb-ref-type>Entity</ejb-ref-type>
    <home>net.highteq.ejbs.news.NewsEBHome</home>
    <remote>net.highteq.ejbs.news.NewsEB</remote>
  </ejb-ref>       
</session>

This, however, will not work. The log files says: either add <ejb-link>
or modifiy jboss.xml. I tried <ejb-link> and it worked. 
Unfortunally I was not able to find any documentation about what to set in 
jboss.xml?

2.
After I had fixed the first problem I faced another problem:
The datasource was no longer available?
My jboss.xml has looked like this:

<jboss>
  <resource-managers>
    <resource-manager>
      <res-name>PostgresDB</res-name>
      <res-class>orb.jboss.ejb.deployment.JDBCResource</res-class>
      <res-jndi-name>PostgresDB</res-jndi-name>
    </resource-manager>
  </resource-managers>
</jboss>   

In fact the deployment descriptor must look something like the following:

<jboss>
  <enterprise-beans>
    <entity>
      <ejb-name>NewsEB</ejb-name>
      <jndi-name>NewsEB</jndi-name>
    </entity>
    <session>
      <ejb-name>NewsController</ejb-name>
      <jndi-name>NewsController</jndi-name>
    </session>
  </enterprise-beans>
  <resource-managers>
    <resource-manager>
      <res-name>PostgresDB</res-name>
      <res-class>orb.jboss.ejb.deployment.JDBCResource</res-class>
      <res-jndi-name>PostgresDB</res-jndi-name>
    </resource-manager>
  </resource-managers>
</jboss>   

Afterwards everything worked for me.
I know there is a "getting started" tutorial out there but it deals only with 
session beans.
What about an entity bean tutorial? Anyone working on it?
If no one is working on such a tutorial I would like to write it :-)

Yours,
Lars


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to