Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB3.0 not working in Websphere 7

 
Mika Tapanainen
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I can't get the EJB3.0 to work in Webspere 7. I got the error message:



My EchoServiceWSImpl (works without EJB) uses the EJB bean:



The service interface (is needed for the EJB3.0) is:



The service implementation is:



I have also beans.xml (I'm not sure if this is needed) in the jar metainf folder:



Do you know what is the problem?

BR,

Mika
 
Mika Tapanainen
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also I got the exception:

 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WAS 7 supports JEE 5, so, there is no support for beans.xml (which is anyway CDI and not related to EJB).

And, I don't see either a @Local or @Remote declaration on the EJB interface.
 
Mika Tapanainen
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now the ejb3.0 is working. The solution was to change my maven project type to the "ejb" and use the ejb 3.0 version in the maven ejb plugin.

Yes, you are correct the beans.xml is not needed.

But the @Local annotation is not needed. I checked from the EJB3.0 specification:

ejb-3_0-fr-spec-simplified.pdf page 16


If bean class implements a single interface, that interface is assumed to be the business interface
of the bean. This business interface will be a local interface unless the interface is designated
as a remote business interface by use of the Remote annotation on the bean class or
interface or by means of the deployment descriptor.


 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1101
10
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mika Tapanainen wrote:
But the @Local annotation is not needed. I checked from the EJB3.0 specification:

Oh ok. I was not aware of that.
 
Mikalai Zaikin
Ranch Hand
Posts: 3353
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems the error is WAS7 specific. I was able to fix this error by generating application.xml DD for the EAR. It could be done via context menu: Java EE > Generate Deployment Descriptor Stub.

HTH,
MZ
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic