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

  • Home
  • SEARCH
  • 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 6134331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:20:31+00:00 2026-05-23T17:20:31+00:00

Trying to create the simplest EJB using NetBeans 7.0 and EJB 3 in Action

  • 0

Trying to create the simplest EJB using NetBeans 7.0 and EJB 3 in Action book.

Well, firstly I’ve created an interface:

package study;

public interface NewInterface {
    public void sayHello(String name);
}

Then, the EJB:

package study;
import javax.ejb.Stateless;

public class NewClass implements NewInterface{

    @Override
    @Stateless //! ERROR here !
    public void sayHello(String name) {
       System.out.println("Hello " + name);
    }  
}

Java complains at @Stateless

annotation type is not applicable to this kind of declaration

Why?

  • 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-23T17:20:31+00:00Added an answer on May 23, 2026 at 5:20 pm

    Should be on the class declaration (not the method). Like so :

    package study;
    import javax.ejb.Stateless;
    
    @Stateless
    public class NewClass implements NewInterface{
    
        @Override
        public void sayHello(String name) {
           System.out.println("Hello " + name);
        }  
    }
    

    From here

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

Sidebar

Related Questions

Trying to create several layers of folders at once C:\pie\applepie\recipies\ without using several different
I'm trying to create a sitemap using Linq to Xml, but am getting an
As a test I am trying to create the simplest webpage where I can
I'm trying to create a stream of data to the browser using websocket. The
I'm using Core Data and I'm trying to figure out the simplest way to
I'm trying to use one of the simplest forms of reflection to create an
I am trying to learn the jQuery validation plugin, so I created the simplest
I'm trying create a log specifically for logging user account activity. I created this
I am trying to create 3 table view cells using code (w/o nib). I
I am trying create a WCF service that leverages the WPF MediaPlayer on the

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.