Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4330910
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:01:53+00:00 2026-05-21T10:01:53+00:00

I am using EJB3.0, Weblogic 11g I am trying to do simple lookup from

  • 0

I am using EJB3.0, Weblogic 11g

I am trying to do simple lookup from servlet to Statelessbean and run there a method. both under the same EAR.
I managed to do it with Jboss. but I know that in Weblogic it’s little bit diffrent so I channged my code and this is what I am doing and still no success:

The interface I have declared:

 @Local
 public interface OperatorBlockBeanLocal
 {
    public void testme();

 }

This is the class which implements the Interface:

@Stateless
@Local{ OperatorBlockBeanLocal.class })


@JNDIName(value = "OperatorBlockBean")


 public class OperatorBlockBean implements OperatorBlockBeanLocal
 {
    public void testme()
 {
    System.out.println("OperatorBlockBean");
 }
 }

And this is the servlet which trying to lookup the bean I decalred before:

try
    {
        context = new InitialContext();

        operatorBlockBean = (OperatorBlockBeanLocal) context
                .lookup("java:comp/env/OperatorBlockBean");
        operatorBlockBean.testme();
    } catch (NamingException e)
    {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

Ofcourse that I get NamingException. anyone has any idea?

thanks,
ray.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T10:01:53+00:00Added an answer on May 21, 2026 at 10:01 am

    Try using

    @Stateless(mappedName="OperatorBlockBean")
    @Local{ OperatorBlockBeanLocal.class }
    public class OperatorBlockBean implements OperatorBlockBeanLocal
    

    You can also use EJB injection in your servlet and not do a lookup. Here’s how:

    @EJB OperatorBlockBeanLocal operatorBlockBean;
    

    The EJB will injected so you don’t have to do a lookup.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Ejb3.0, Weblogic 11g, JDBC I am invoking a method which is running remotely
I am using Weblogic 11g, EJB3.0. I am struggling for weeks with this problem.
I am using Weblogic 11, ejb3.0 I have code which is doing lookup to
I am using EJB3 webservice and Jaxb. No where in my input xsd I
I know one can use interceptors before a method call by using the @AroundInvoke
Hi I am trying to use Jasper (4.0.2) reports with JBoss 6 using an
Using Glassfish, I can setup a string jndi entry: JNDI name: com/xyzcompany/echo/EchoServiceBean/viewName Factory Class:
Using PHP, I'd like to convert a string containing a Roman number into its
I would like to create an exception handler for the specific case that happens
I was looking for some help on CDI APIs. I'm sorry if my question

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.