package javax.ejb does not exist
Asked Answered
L

4

12

I have opened a project in netbeans to view the project but there is a same error in most of the files. It says that "package javax.ejb does not exist". This is a working project and I am not sure what is wrong. Can anyone help me?

Litt answered 21/11, 2011 at 3:7 Comment(0)
U
17

Try this first: http://forums.netbeans.org/topic44810.html

If that doesn't fix your problem, you can right click on your project and go to the properties section. Click on the Libraries section and select "Add Library". Then scroll down until you find the Libraries that start with "Java" (for example: Java EE 6 API Library). I add all of the Java libraries to my project to resolve this issue, however you might add them one at a time and see which one resolves it.

Upsilon answered 17/10, 2012 at 22:20 Comment(1)
I am unable to visit the site in the link since it has an invalid SSL certificate. Answers should be self contained and not depend on external sites! This is why you should add the relevant content from the external site to the answer text!Whirlybird
C
4

you just need to import Java EE Web 6 API Library to fix this issue, these libraries must be imported under the libraries folder: right click Add library, click on import library, scroll down and look for Java EE Web 6 API Library, click on import library and finally click on add library.

That should fix any issues

In my case I was working with java with ant java web app, i was also using Java EE Version Java EE 6 web

Checkroom answered 4/9, 2021 at 15:49 Comment(0)
B
0

I had the same problem when I tried to open a Java web service application and managed to resolve it after trying out a few things. For a Java web service application, there can be multiple causes to the problem. You may have "EJB and EAR" plugin already installed, however, Netbeans may not know the web server to use to run your application. It may have complained that "One or more projects do not have the target server set properly" when the project was opened. To resolve this problem, you have to assign a web server for the project. This is to be done not only for the main project, but also for the required projects that the main project may be dependent upon.

You first need to ensure that you have opened not just the main project, but also the required projects. To open the required projects, right-click on the main projects name in the main projects window and select Open Required Projects -> Open All Projects. After opening, the project names may be colored red in the project window to indicate problem.

In order to use a web server, you need to have one already installed. I chose Glassfish. Download and install Glassfish from https://glassfish.java.net/download.html, if you haven't done so. Also install the "Glassfish Server" plugin for Netbeans, if it's not already installed.

Now, in the Netbeans project window, right-click on the main project name and select "Resolve missing solver issue". If you see "Glassfish server" in the pop-up window that appears, select that one and click ok. If you don't see it, click "Add Server" then select "Glassfish Server", and setup the Glassfish server. Here you need to provide the installation directory of your Glassfish server, but I simply used the default values for the rest. Later I used username "admin" with blank password for running the project. Also perform the same steps to resolve the missing server for all of the required projects.

Benzol answered 22/3, 2015 at 5:55 Comment(0)
R
0

Add Java EE Web 8 API Library into the Libraries folder

Robyn answered 10/4, 2023 at 18:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.