When I try to create an Enterprise application using the wizard (Ant project) I get the following error
java.lang.NullPointerException: Cannot invoke "org.netbeans.modules.j2ee.dd.api.application.Application.setDisplayName(String)" because "this.application" is null
at org.netbeans.modules.j2ee.earproject.ProjectEar.setupDDFromVirtual(ProjectEar.java:290)
at org.netbeans.modules.j2ee.earproject.ProjectEar.getApplication(ProjectEar.java:255)
at org.netbeans.modules.j2ee.earproject.ui.wizards.NewEarProjectWizardIterator.testableInstantiate(NewEarProjectWizardIterator.java:160)
at org.netbeans.modules.j2ee.earproject.ui.wizards.NewEarProjectWizardIterator.instantiate(NewEarProjectWizardIterator.java:139)
at org.openide.loaders.TemplateWizard$InstantiatingIteratorBridge.instantiate(TemplateWizard.java:1048)
at org.openide.loaders.TemplateWizard.handleInstantiate(TemplateWizard.java:602)
at org.netbeans.modules.project.ui.NewProjectWizard.handleInstantiate(NewProjectWizard.java:51)
at org.openide.loaders.TemplateWizard.instantiateNewObjects(TemplateWizard.java:436)
at org.openide.loaders.TemplateWizardIterImpl.instantiate(TemplateWizardIterImpl.java:228)
at org.openide.loaders.TemplateWizardIteratorWrapper$ProgressInstantiatingIterator.instantiate(TemplateWizardIteratorWrapper.java:155)
at org.openide.WizardDescriptor.callInstantiateOpen(WizardDescriptor.java:1602)
at org.openide.WizardDescriptor.callInstantiate(WizardDescriptor.java:1546)
at org.openide.WizardDescriptor.access$2300(WizardDescriptor.java:67)
[catch] at org.openide.WizardDescriptor$Listener$2$1.run(WizardDescriptor.java:2233)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
Of course, all the fields in the wizard are filled. However, there are no errors when creating WAR and EJB separately. The error occurs only when an EAR is created, even if it is empty.
use
NetBeans 12.6
Windows 10 OS
GlassFish Server 6.2.1
Java 17
All paths are spelled out correctly, read / write permissions to directories are set
Screen
I can reproduce your problem, and NetBeans Bug Report 5953 "Creating a new Enterprise Application (Java with Ant) impossible (only when selecting JakartaEE9) - NPEs thrown" has already been raised.
The bug report is unresolved, but the problem only occurs when creating a Jakarta EE 9 Enterprise Application. I successfully created a Jakarta EE 8 Enterprise Application simply by selecting Jakarta EE8 from the Java EE Version drop list within the wizard.
You have several options available to resolve this, but none of them are good:
Wait for NetBeans to fix the problem. Definitely not recommended!
Create a Jakarta EE8 Enterprise Application with the Ant wizard instead, if you don't require EE 9 functionality.
Create a Jakarta EE8 Enterprise Application with the Ant wizard, then "hack" the generated projects to use EE 9.
Use another IDE which properly supports this functionality.
Create the EE 9 Enterprise Application in another IDE, then import the projects into NetBeans.
Using Maven or Gradle isnstead of Ant as the build tool doesn't help either:
I couldn't create a Maven Enterprise Application when using Jakarta EE8 or Jakarta EE9, though I didn't research why.
The project wizard doesn't even offer "Enterprise Application" as an option when using Gradle.
Notes:
NetBeans 13 will be released next month, but I don't think this issue will be fixed.
Also see the (ominous) bug report "NETBEANS-2871 Resolve Enterprise Application support" from 2019 which remains unresolved:
Need to figure out whether maybe Web Applications (in Ant, Maven, and
Gradle) might not be enough in terms of Java EE support, i.e., do we
need Enterprise Applications and EJB-specific project types, if not,
let's remove them.
It works with jakarta EE9 provided you do the following:
Plugin versions in all pom.xml files:
maven-compiler-plugin 3.9.0
maven-war-plugin 3.3.2
maven-dependency-plugin 3.2.0
In the pom.xml file of -ejb- change packaging war to jar.
Then:
Clean and build in the following order:
top, ejb, web and ear.
That's all.
Related
I have installed the Weblogic 12c server and I want to add it to a project in Netbeans 11. When I select "add server" from server instance, the Weblogic server option is not displayed
I expected to see the option as shown in the following link https://www.oracle.com/webfolder/technetwork/tutorials/obe/java/wls_12c_netbeans_install/wls_12c_netbeans_install.html
I was able to connect the plugin for weblogic from netbeans version 8.2.
You must copy the plug-in files from the netbeans 8.2 directory to the netbeans 11 directory.
Files of a plug-in:
...\plugins\servers\enterprise\modules\org-netbeans-modules-j2ee-weblogic9.jar
...\plugins\servers\enterprise\config\Modules\org-netbeans-modules-j2ee-weblogic9.xml
...\plugins\servers\enterprise\update_tracking\org-netbeans-modules-j2ee-weblogic9.xml
...\plugins\servers\enterprise\update_tracking\org-netbeans-modules-weblogic-common.xml
Checked on versions 11, 11.1, 11.2.
Update.
Second method
The plugin can be compiled from sources.
Plugin sources here:
https://github.com/apache/netbeans/tree/master/contrib/j2ee.weblogic9
But you need to build all netbeans project. Build command:
ant all
The resulting .nbm file can then be imported in NetBeans (Tools -> Plugins -> Downloaded -> Add Plugin)
Discussion of the problem here:
https://issues.apache.org/jira/browse/NETBEANS-2476
Compiled nbm plugin file:
https://issues.apache.org/jira/secure/attachment/12991973/org-netbeans-modules-j2ee-weblogic9.nbm
Checked on versions 12.x
From what i can tell only Netbeans versions 7.2, 7.3, 7.4, 8.0 can work with weblogic as of now. Also the guide you are following is using a pre Apache Netbeans version. I would recommend switching to one of the following Netbeans versions. Download the All bundle or EE.
Netbeans 8.0
Netbeans 7.4
https://netbeans.apache.org/kb/docs/web/jsf-jpa-weblogic.html
Unfortunately Apache NetBeans 11.0 does not currently support the addition or use of a WebLogic server. See open Apache NetBeans Bug Report 2476: Netbeans 11 EE Support Weblogic Server
I don't know for sure, but I suspect that this is a legal problem is related to licensing issues rather than any technical obstacles. The absence of licensing on Apache NetBeans 11.0 also impacts other important products such as Hibernate (NETBEANS-2719 Resolve Hibernate Support), and Wildfly (NETBEANS-2415
Bring back support for WildFly server).
There are licensing issues because Apache assumed ownership of NetBeans releases from Oracle last year.
Also, because WebLogic was supported "out of the box" in NetBeans 8.2 there is no old WebLogic plugin available for use on Apache NetBeans 11.0.
Your options are:
Regress NetBeans to use the most recent NetBeans release which does support WebLogic: Oracle NetBeans 8.2. Note that this means you cannot develop using Java EE 8, nor use any JDK version > 8.
Stick with Apache NetBeans 11.0, and instead of WebLogic use one of the four application servers which it formally supports "out of the box": Payara, Glassfish, Apache Tomcat and Apache TomEE.
Install your WebLogic server outside of Apache NetBeans 11.0, and deploy your NetBeans web applications to that external server.
I'm trying to create a simple webform in Java with Eclipse but I've seen that I have to do New Project --> Web --> Dynamic Project
However, all I see when I click on New Project is the screenshoot below. I don't have the Web option.
I'm using Ubuntu and I've installed Eclipse Standard 4.3.2 (http://www.eclipse.org/downloads/packages/release/Kepler/SR2)
Should I install a different version? Eclipse IDE for Java EE Developers?
UPDATE
This is the printshoot of the error when installing the IDE for Java Developers
Eclipse IDE for Java EE is not a different version so much as a different package containing support for developing JSPs, Servlets, and other web artifacts. Kepler SR2, though, is a version--a two year old one that's since been superseded by Mars.2. So download the Mars.2 version of the Eclipse IDE for Java EE Developers. The download page at http://download.eclipse.org/ should always have the current supported version.
My problem is when adding WildFly 8.x Runtime in targeted runtimes in eclipse, then I can't run servlets, I mean the server runtime library is not in the path.
can you provide me with help.
I'm running ubuntu 14.10, eclips luna, JRE 1.8 and WildFly 8.2.0.
note: I don't want to manually add the servlet-api jar file.
Thank's in advance.
Edit1:
I found that not only the servlet implementation part is not loaded, but all other modules of WildFly, so this ensures me that the problem is in the whole server runtime!
Edit2:
as stated here in 2.1.1. Installing a new runtime section,
You will also note a Deploy-Only Runtime type. This type does not provide a classpath for WTP projects. It is used solely by it's server type for the purpose of setting up a deploy directory for users who do not wish to make use of starting, stopping, or debugging their projects inside Eclipse.
can I conclude that my version is has a "deploy-only runtime type", but it's Version 8.2.0.Final 2014-11-20 Java EE7 Full & Web Distribution !!!
It's OK now, I just installed JbossAS Tools, which is described in eclipse as follows:
Provides WTP server adapters for JBoss installations. These adapters are capable of deployment and providing classpaths for projects
then I could specify project runtime for new projects directly, or add WildFly runtime as a server library from build path for old projects.
I've been trying to integrate deploying java .war's in GlassFish V3 through Maven. While I have found a few plugins, none of them look to be very active:
Maven Glassfish Plugin
Eskato's Wordpress Blog on Maven
And I got the most information out of Eskato's Blog, it was written March 2008, so I don't know what the state of GlassFish Maven integration is, nor can I find a suitable plugin to work with. With the Maven GlassFish Plugin I have had some success, but it still doesn't work entirely well for all goals it says it supports, which makes some of the commands ineffective.
Has anyone else been able to integrate Glassfish V3 and Maven successfully? If so, what resources did you use to get it done?
Update: CARGO-491 has been fixed and I've updated my answer accordingly. To summarize, there are now basically three options:
Maven GlassFish Plugin
A first option would be to use the Maven GlassFish Plugin. This plugin allows to interact with a local or remote GlassFish install and the management of Glassfish domains and component deployments from within the Maven build lifecycle.
Maven Embedded GlassFish Plugin
The second option would be to use the Maven Embedded Glassfish Plugin. As stated by its name, this plugin doesn't rely on an existing install but uses an embedded GlassFish, running in the same JVM as the plugin. This plugin is extremely nice if you want to keep your build portable (anybody can get your POM and run a build involving GlassFish without having it installed) with almost the same features as a normal GlassFish install, except clustering of course (you can use a preconfigured domain.xml if you want). See Testing with the GlassFish Maven plugin and JavaDB Embedded for an example.
Maven Cargo Plugin
The work initiated by Kohsuke Kawagushi as been finally integrated in Cargo and, starting with Cargo 1.0.1, GlassFish 3.x is now supported. Using the Maven Cargo plugin is thus a third option. This would be interesting for builds that want to interact with containers in an agnostic way. But I'm not sure Cargo allows all the flexibility of the GlassFish specific plugin(s) (e.g. deployment of JMS resources, etc).
maven-glassfish-plugin and maven-embedded-glassfish-plugin both have their pros and cons. The main difference is that the latter works with an Embedded Glassfish instance, as indicated by its name, i.e. the server is running in the same VM as the plugin.
So you cannot use maven-embedded-glassfish-plugin to deploy your WAR to a standalone Glassfish server, you need maven-glassfish-plugin to do that.
The main problem I had with the maven-glassfish-plugin is the fact that its interaction with the Glassfish server is stateful - I could not find a way to use it such that my WAR would get deployed to the server in any case, no matter whether the previous build succeeded or not.
glassfish:deploy does not work if the WAR is deployed already. glassfish:redeploy does not work if the WAR is not deployed. And Maven has no if-else logic...
I've blogged about how to configure Maven Embedded GlassFish plugin to work correctly with GlassFish 4.0 until there's a new release of that plugin.
https://blogs.oracle.com/brunoborges/entry/glassfish_4_beta_and_maven
Also, it is possible to configure a datasource in the glassfish-resources.xml and have it working correctly.
https://blogs.oracle.com/brunoborges/entry/configure_datasources_for_maven_embedded
These are useful tips to anyone that want to run Java EE 7 projects with Maven and GlassFish 4
You can use this one :
http://www.hascode.com/2011/09/java-ee-6-development-using-the-maven-embedded-glassfish-plugin/
https://github.com/andrzejsliwa/glassfish-maven-plugin/wiki
http://cargo.codehaus.org/Maven2+plugin
I use the glassfish plugin on maven-glassfish-plugin.dev.java.net and did some code changes to support v3 now. I requested committer status and wait for acknowledgement. Hopefully I can commit my changes.
I have to organize a development environment where I can run Maven projects with JBoss Seam, IDE eclipse 3.4.x and deploying to JBoss 5.
The projects that will run on this environment are based in Java 6, EJB3 and JSF1.2. The environment has to support hot-deploy.
I used to work in a development environment with Sysdeo Plugin to make Tomcat run all my applications - I've rarely used EJB (only for MDB's).
So I would prefer an environment similar to this.
I'd like to know what you guys use for the kind of architecture (what kind of eclipse plugins - if they work fine, things like that)
The thing I really didn't get right is why my Maven2 project with SEAM as a dependency packaged as EAR doesn't appear in my server (in Eclipse Ganymede - tab servers) for me to make deploy (right click - option Add and Remove Projects...).
Do I have to include an specific project nature to make my Maven2 EAR project visible to my JBoss AS included in my Eclipse Ganymede?
Seam doesn't appear to go well with Maven2. I'm facing some problems to make they work together - some dependencies appear to be missing and I have to put some extra files in some special places like seam.properties and components.xml with some special contents.
I feel like forced to use seam-gen and Ant. Too bad!
Not sure if this is helpful to you, but but we run the following
eclipse as IDE
mercurial for source code management
merclipse mercurial eclipse plugin http://goldenhammers.com/merclipse/
maven for builds (and m2eclipse)
mylyn with bugzilla for issue tracking
tomcat as application server
hudson for continuous integration http://hudson-ci.org/
reviewboard for code reviews http://www.review-board.org/
sonar for code quality metrics http://sonar.codehaus.org/
proxmox VE for virtualization http://pve.proxmox.com/wiki/Main_Page
Most things run on separate virtual machines to keep interference to a minimum. Proxmox VE is a breeze to setup (15 mins and you are running).
Hudson monitors the repository and automatically builds and tests each push.
If the war build is successful it is automatically (re)deployed (using a hudson plugin) into Tomcat and restarted.
I cannot recommend these tools enough.
HTH
I am currently working on the same environment you asked for, with the only difference I am running the app on a tomcat 6.0.18. I prefer to use tomcat 'cause it's so faster to run, and I don't use EJB for now.
Eclipse plugins :
maven : m2eclipse.codehaus.org
jboss tools : www.jboss.org/tools
web tools platform for hot deploying : www.eclipse.org/webtools/
I took the Eclipse Java EE version, I don't use seam-gen to create the basic architecture.
I don't have so many problems with this environment, sometimes the hot-deploy doesn't work and I have to manually clean files.
The only problem I had was with the separation of my app in two modules : eclipse wasn't doing the job well (not taking the last package of one module while building the other one), and I discover the option "disable workspace resolution", which works fine now.
Works fine. Hope it will for you.