This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 145935 - Create JAX-RPC service from existing EJB doesn't seem to do anything
Summary: Create JAX-RPC service from existing EJB doesn't seem to do anything
Status: RESOLVED DUPLICATE of bug 134984
Alias: None
Product: webservices
Classification: Unclassified
Component: JAX-RPC (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-02 15:17 UTC by rdelaplante
Modified: 2008-09-08 10:34 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rdelaplante 2008-09-02 15:17:09 UTC
I created a J2EE 1.4 web project and made it part of an EAR that contains an EJB 3.0 project.  In the web project I
created a new JAX-RPC web service endpoint, and told it to create the service from an existing EJB.  I chose the EJB 3
session bean (only has a local interface).  It created an empty web service and didn't show any sign that it used the
EJB.  It didn't add ejb resource reference to web.xml, no code that uses the EJB, etc.   

I was hoping this feature would show me how to access EJB 3.0 session bean from J2EE 1.4 since I can't figure out how to
look it up in JNDI without getting exceptions.
Comment 1 Milan Kuchtiak 2008-09-05 09:54:30 UTC
The wizard generates configuration stuff like web.xml, webservices.xml or jaxrpc-config.xml file.

But I agree the feature is rather poor.
It should also generate the lookup method for Local interface.
(Note: the feature works the same regardless EJB is 3.0 or 2.0)

There is a workaround for that - use Insert Code -> Call Enterprise Bean (editor) action.

The code like this is generated(the bean is ABean with ALocal interface):

    private a.ALocal lookupA() {
        try {
            Context c = new InitialContext();
            return (a.ALocal) c.lookup("java:comp/env/A");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }

Nevertheless, I tested the generated code  with GlasFish V2 and it doesn't seem to work.
It's more likely a GlassFish problem and I'll report a bug for that.
Comment 2 Milan Kuchtiak 2008-09-05 10:27:40 UTC
I reported an issue to EJB experts to evaluate: issue 146293.
Comment 3 pslechta 2008-09-08 10:34:19 UTC

*** This issue has been marked as a duplicate of 134984 ***