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 6996383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:08:57+00:00 2026-05-27T20:08:57+00:00

I’m using glassfish 3.1 and JEE6 with EJB3.1. I’m simply trying to inject one

  • 0

I’m using glassfish 3.1 and JEE6 with EJB3.1. I’m simply trying to inject one Stateless LocalBean with the no-interface view into another EJB so that I can access one of its methods. But I immediately get a deployment error on the injection site.

If I inject its interface @EJB Interface interface;

Cannot resolve reference Local ejb-ref name=com.sallie.logic.RSSbean/tclient,Local 3.x interface =com.eb
.thriftEJBinterfaces.thriftEJBinterf*ace,ejb-link=null,lookup=,mappedName=,jndi-name=,r*efType=Session

If I inject it through no-interface view as in @EJB myBean bean;

  • javax.naming.NamingException: Lookup failed for ‘java:comp/env/com
  • javax.naming.NamingException: Exception resolving Ejb for ‘Remote ejb-ref
  • javax.naming.NameNotFoundException: c
  • javax.naming.NamingException: Lookup failed for ‘java:comp/env/c

No matter how I do the injection it doesn’t work. I have other EJBs doing the exact same thing in this project that work fine. My database access object uses injection and it’s still running. For some reason this EJB will not inject.

Edit: class declaration with annotation: (basically this class creates a socket connection to an external server not on my web app but that is available at that address using a IDL called thrift. This was tested and works on it’s on as a java SE program (NOTE:THE SERVER LOG ERRORS DO NOT INDICATE THAT THIS IS A PROBLEM. THE LOG FILES THROW REFERENCE AND NAMING EXCEPTIONS AS IF THEY CANNOT FIND THE EJB).

package com.eb.thrift;

import com.eb.thrift.sendEventMessage2;
import com.eb.thriftEJBinterfaces.thriftEJBinterface;

import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransportException;

import javax.annotation.ManagedBean;
import javax.ejb.Remote;
import javax.ejb.Local;
import javax.ejb.LocalBean;
import javax.ejb.Singleton;
import javax.ejb.Stateless;

@Stateless
@LocalBean
public class ThriftClient{

    public ThriftClient() { }

    public String sendToServer(String say) {
        System.out.println("Entering ThriftClient's main method starting server connection...");

        String msg = null;
        //**Make Socket**
        TSocket socket = new TSocket("982.222.33.44", 30888);

        //**Make Buffer**
        //TSocket bufferedSocket = (socket); skipping this step because the jvm already handles
        //the buffering on this end. 

        //**put in protocol**
        TBinaryProtocol protocol = new TBinaryProtocol(socket);
        //**create client to use protocol encoder**
        sendEventMessage2.Client client = new sendEventMessage2.Client(protocol);
        //**connect**
        try {
            socket.open();
        } catch (TTransportException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        try {
            client.ping();
        } catch (TException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        try {
            msg = client.sayMsg(say);
            return msg;
        } catch (TException e) {
            msg = "response from server failed";
            e.printStackTrace();
        }
        socket.close();
        return msg;
    }
}

I’ve tried this with and without the interface because I’m using 3.1 I can use no-interface view and it didn’t solve the problem.

I’m wondering if I could use some annotation parameters to explicitly set the mapping and name so that the reference can be found better.

  • 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-27T20:08:58+00:00Added an answer on May 27, 2026 at 8:08 pm

    I think you’ve proved that, despite what the logs say, the Thrift code is the problem. If you remove it, injection works; if you leave it in, injection fails. That points very strongly at the Thrift code.

    I suspect that this is a classloading problem. The app server can’t find the Thrift libraries, or finds the wrong version, and as a result, the class doesn’t load, or can’t be instantiated. That failure means the EJB can’t be instantiated, which means the lookup fails.

    You would expect the underlying exception causing the failure to be logged, but this might be a bug or oversight in the app server. That kind of thing does happen depressingly often.

    I’d try writing a really simple test version of the EJB that does:

    try {
        System.err.println(Class.forName("org.apache.thrift.transport.TSocket"));
    }
    catch (Exception e) {
        System.err.println(e);
    }
    

    And see what you get when the method is invoked.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am trying to render a haml file in a javascript response like so:

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.