aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Enterprise bean does not support references. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Enterprise bean does not support references." Watch "Enterprise bean does not support references." New topic
Author

Enterprise bean does not support references.

Deepak Bobal
Ranch Hand

Joined: Feb 06, 2008
Posts: 96
I am using Netbeans 6.5 while making a stateless bean.

i made a Enterprise bean using EJB module and deployed .

Then made a Web Client and when i call the EJB in Servlet using InsetCode>Call Enterprise Bean

I get an error "Enterprise bean does not support references." at the pop up in Red Color.

How it can be sorted out.

Thanking You

Constant dripping hollows out a stone....
nitin pokhriyal
Ranch Hand

Joined: May 19, 2005
Posts: 263
if you can post your code that will help you in getting answer faster and clear.
Deepak Bobal
Ranch Hand

Joined: Feb 06, 2008
Posts: 96

This Remote Interface

package com.example;

import javax.ejb.Remote;


@Remote
public interface StatelessSessionRemote
{
String show();

}



This Is Stateless EJB



package com.example;

import javax.ejb.Stateless;


@Stateless
public class StatelessSessionBean implements StatelessSessionRemote {

public String show()
{
return "Stateless EJB is called ";
}



}



Now i am making a web module

and when i call this EJB from servlet

as--

right click>Call Enterprise Bean

and it asks the bean name

when i select the bean

it shows

Enterprise bean does not support references.
Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 916

Hi,

can you post the servlet ? more precisely the (generated) inject code

Regards,
Mihai


SCJP, SCJD, SCWCD, OCPJBCD
Deepak Bobal
Ranch Hand

Joined: Feb 06, 2008
Posts: 96
Mihai

i have just made a servlet by calling it from Netbeans

so there is default generated code ,that NetBeans give

and when i

right clicj there

i get a drop down

i select Call Enterprise bean

then i get above mentioned problem..

Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 916

Just a tip, try to build an Enterprise App not a EJB module
Deepak Bobal
Ranch Hand

Joined: Feb 06, 2008
Posts: 96
Mihai

I 1st i made that only.When that didn't work and gave the same problem .

then i made Modules and now it's also showing the same problem .


Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 916

This is strange, I have done this a lot of times and it works.
I am not shore what your version is (not) doing.

Regards,
M
Deepak Bobal
Ranch Hand

Joined: Feb 06, 2008
Posts: 96
i am also ..

but now i am going to try this on NetBeans 6.7.1.
nitin pokhriyal
Ranch Hand

Joined: May 19, 2005
Posts: 263
how did you deploy your ejb module to app server?
Have you seen any in your application server resources that ejb has been deployed?
How are you calling your ejb from servlet?

It looks to be that you are not using correct reference of remoteInterface to call your bean.
Deepak Bobal
Ranch Hand

Joined: Feb 06, 2008
Posts: 96
Hi All

it started working .

there was the problem of IDe.

Earlier i was using NetBeans 6.5 BETA

Now i worked at 6.7.1 and received result.

Thank You
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Enterprise bean does not support references.