Package javax.enterprise.context missing in glassfish 4.1 - cdi

In the new Glassfish 4.1 the package javax.enterprise.context containing annotation SessionScoped for instance is missing.

add cdi-api.jar to the project by right-clicking on Libraries, selecting Add JAR/Folder, and selecting cdi-api.jar from the modules folder of glassfish installation.

See my answer here https://stackoverflow.com/a/26000827/523758 and the comment below, it should resolve your issue.

is easy, right-click on project and click in properties, then in Libraries + Add Jar/Folder, in x:\Program Files\glassfish..

Related

Why is Intellij code auto completion in JSF with Primefaces not working?

I have installed intellij IDEA Ultimate Edition latest version and started to test the compatibility of it with primefaces version 6.2.
If it could be compatible with primeface we are gonna switch from eclips to intellij.
unfortunatly i cann't figure out how to get code autocomplition to work for primefaces.
I have done alreaday the following.
created maven project.
added primeface dependency in pom.
Added primeface framework by right clicking on the project and choosing Add framework support....
Does any one know how to fix this issue?
Does anyone know the best IDEA for working with primeface?
I did solve it by the following. I got inspiration from here.
Added primeface framework by right clicking on the project and choosing Add framework support....
Added JSF facet to my web modules from File | Project Structure | Modules - module - JSF facet Ctrl+Shift+Alt+S
Restarting intellij IDEA
Quickly looking into this issue revealed this link, https://www.jetbrains.com/help/idea/preparing-for-jsf-application-development.html.
The website states that in order to enable support for JSF development, you need the Ultimate edition.
I would suggest taking a look at NetBeans. It is continuously developed alongside new implementations of Java EE (and soon Jakarta EE) and is therefore the go-to IDE environment for JavaEE development. Everything works pretty much out of the box.

Netbeans cannot find the CDI package javax.enterprise.context.*

I am creating a simple JSF application with one of my university colleagues, and I am having some trouble when I pull down the application from our repository. When I import the project into NetBeans IDE 8.0.1, the program does not compile correctly on the following CDI based annotation:
#Named
#RequestScoped
public class LoginController implements Serializable {...
It is informing me that it cannot find the following package:
import javax.enterprise.context.*;
Initially I had thought that I did not have the EJB and EAR plugin installed, however I have installed the Java EE bundle which I downloaded from the netbeans website. Are there any other JAR's, which I may be possibly missing, causing this specific error.
On my colleagues local machine everything works as expected without any issues at all, so I am left unclear why this is not happening on my computer.
yeah it seem this netbeans version lacking javax.enterprise package. Here is the solution
1) If you are using maven project, add javax.enterprise(cdi-api.jar) as dependency
2) For other projects, download cdi-api.jar, add this as external jar from project properties, it will enable CDI.
Yes you need to include another library. You are using the part that belongs to Java EE. By default java includes Java SE. So you need to add this library in your project.
Go to
Project Properties -> Libraries -> Add Library -> Java EE Web 7 Api Library
I had this problem too. The glassfish library structure has changed somewhat so instead of using the "Java EE from Glassfish" library we used the "Java EE from API" library and that fixed it.
Both proposed solutions are valid but the simplest one is the second one because you've got already everything needed in NetBeans 8.0.
Your problem is clearly the consequence of the default Java EE bundle (version 7) present in GlassFish 4.1. Of course, it is a NetBeans bug. Netbeans should have added the needed library to your project when you chose to work with Java EE 6.

Selected location does not represent a valid JavaFX Scene Builder installation

I have Netbeans 7.3 Beta 2 with latest Java 7 JDK on 32 bits, on Windows 8 Pro.
Problem: I removed Scene Builder 1.1 b07 and Installed the latest one b12, but now I can't set "Scene Builder Home" in Netbeans.
I get the following error:
"Selected location does not represent a valid JavaFX Scene Builder installation"
I tried pointing to all possible folders (Scene B. Folder, child folders, Oracle folder etc) (I know that it shouldn't be necessary).
The version before was OK and Netbeans detected it automatically.
I had Scene Builder 1.1 b07 before.
Now it doesn't want to be added into "Scene Builder Home" from Netbeans Options->Java->JavaFX.
That's quite annoying, because now I have to manually open each FXML from the source folder. Annoying.
I searched NetBeans bugs, but I didn't find anything. I wanted to add a new one, but I couldn't. Maybe because I already have 2 reported bugs.
Any suggestions?
I didn't remove and install NetBeans again, because I don't want to reimport the projects and configure it again just for this.
Edit:
I managed to report the bug. I had to delete the cookies from netbeans.org and log in again in order to be able to use the "report a bug" page. Let's hope for a quick fix. http://netbeans.org/bugzilla/show_bug.cgi?id=223994
It works flawlessly with the latest NetBeans 7.4, Java 7 JDK and SceneBuilder.
I assume it was a bug that was fixed. SceneBuilder 1.1 is a stable release now, which wasn't at that time, so this could be the explanation.
You Can use it outside of netbeans, I faced the same Error in Ubuntu linux. according to this bug you have to wait antil they fix it.
right now just use it outside of netbeans

Eclipse for Java EE on Linux - cannot see Java EE projects?

I just installed eclipse indigo on Ubuntu. After, I went to install new software > WEB, XML, Java EE etc.
When I go to Eclipse plugins, I see they are installed.
But when I try to create a new eg Web Project, I cannot see it! The one and only point to choose is "create new > general > project". Nothing else!
What could I be doing wrong?
Even though this does not answer the OP's question, I would recommend installing the latest Java EE version from here :
http://www.eclipse.org/downloads/?osType=linux
Back to your question. Perhaps you could try re-starting eclipse with the -clean option just to make sure that it's not obsolete workspace metadata which is at fault. If that does not work, I would reiterate the original suggestion to download the Java EE version to save time.
(Please don't be offended, but to rule out the obvious, you must have restarted Eclipse after installing all the plugins ?)

How To add the JDE To Eclipse Plugin

I have used NetBeans IDE,I installed the NetBeans plugin for BB,and then it will detect the List of JDE's presently installed in the System and i can use it in NetBeans.
Similarly i want to know how to add the Blackberry JDE to Eclipse IDE.It always come with Inbuit JDE 4.5 and what can be done to add new JDE's(5.0 ,6.0 etc) to the Eclipse IDE.I have Eclipse 1.0.67 version,
Besides in the Form ,is it possible,i have also downloaded Eclipse 1.1.s
Do i want to download new plugin similar to netbeans ,can u explain in detail?
Regards
Rakesh Shankar.P
In the Help menu, choose Install New Software. In the resulting dialog, click the Add... button. In the Location field add this url: http://www.blackberry.com/developers/jar/3.6/java/. You don't need to add a name, Eclipse will resolve it for you. Once it's added there is a wait while Eclipse fetches data from that url. Expand BlackBerry Java Plug-in Category once it loads, and the available SDKs will be there. Installing any of those will configure Eclipse with the JDE you want.

Resources