We are creating a new project using jsf2.0, richfaces 4.0, jjdk 6 and tomcat 7.0
I want to know the standard way of creating project. I mean folder structure. Any sample application or book or link will be a great help to me.
Maven uses a best practice approach for project folders. Even when you do not plan to build with maven, have a look at their structures:
Maven: Introduction to the Standard Directory Layout
I participated once in a project, which had Spring 3.5, JSF 1.2 and ICEFaces 1.8, was running on JDK6 and everything was deployed to Tomcat 6.0 - similar situation to yours. We used Apache Maven as a project management tool.
Very flexible and comfortable. You could also consider using ICEFaces instead of RichFaces.
Related
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.
How to use iText with JBoss 7 Java EE project?
I created a Java EE Project using JBoss Tools
Group Id: org.jboss.tools.example
Artifact Id: multi
I'm now trying to use iText to create a PDF from my Bean
<p:document xmlns:p="http://jboss.com/products/seam/pdf">
This only prints plaintext
</p:document>
According to JBoss Wiki (http://docs.jboss.org/seam/1.1.5.GA/reference/en/html/itext.html) I need jboss-seam-pdf.jar and the iText.jar - can I use Maven for this? The dependency I found broke my project.
If anyone could help me set up iText with JBoss 7 I'd highly appreciate it
can I use Maven for this? The dependency I found broke my project.
Maven is always appreciated as dependency management mechanism.
The example you see is a sample froject using the old Seam framework >= 2 which is useful for Java EE 5 (now we have CDI). To use the seam-pdf module you have to integrate the Seam2 framework but it's obsolete now. My recommendation is instead of using declarative way to build PDF, use the iText API and build a pdf yourself. iText documentation is quite good and there is a book and many examples over the internet.
If anyone could help me set up iText with JBoss 7 I'd highly appreciate it
After you have created the war project add iText as maven dependency to your .pom file and you are ready to go.
We have a large project ear that contains a .har and a .war, currently built with ant - running on JBoss AS 5. We would like to migrate this application to JBoss AS 7. Much of the AS 7 documentation is Maven-centric. The project does not currently conform to the Maven directory structure conventions and would have to be completely restructured.
Is it worth migrating this application to Maven?
Or would it be quicker to just leave it using ant?
Depends on complexity of the build process.
I would recommend to convert to Maven. AFAIK it's going to be the main build tool for whole JBoss, and many efforts of JBoss as whole are, and will be, Maven centric.
I want to use spring 3.0.5 in NetBeans 7.0 IDE.. I have done following steps
Created a new Web Application project
downloaded the jars of spring framework
Added the jar folder to project library
but still it is not working... the default domain object "command" is not accessible inside my htm / jsp pages.
can anyone help me on this ?
thanks,
Netbeans 7.0 has support for Spring 3.0, Hibernate, JSF, etc
For Complete instructions & tutorial for NetBeans+Spring go to : http://netbeans.org/kb/docs/web/quickstart-webapps-spring.html
What I can tell for sure is that spring framework 3.0.2 is available. When I create a new web application, I can select the framework.
I'd like to play around with Spring for an upcoming Java EE project. Is there any difference between the Eclipse Spring IDE 2.3.2 plug-in (in the new Eclipse Marketplace) and the SpringSource Tool Suite (available at SpringSource).
More precisely: In my understanding, the Tool Suite is basically Eclipse 3.5 with a set of plug-ins. So the question is, are the plug-ins provided by the Eclipse Spring IDE 2.3.2 the same or is there any difference in functionality?
Thanks for your help, I hope you understand that the Eclipse platform can be overwhelming for beginners.
SpringSource ToolSuite is Eclipse + Spring IDE + others. The others are things like support for Roo, dmServer, tcServer, Grails, etc.
If all you need is the Spring IDE plugin (which gives support for Spring Framework development), then vanilla Eclipse + Spring IDE is going to be enough.
I quite like the pre-bundled STS versions, though, it's one less thing to worry about.
Feature Comparison: http://download.springsource.com/release/STS/doc/STS-feature_comparison.pdf
With the Eclipse Marketplace Client build in newer Eclipse versions (AFAIK starting with Helios) it is also possible to install Spring Tool Suite into an existing Eclipse. I have just done that.
Even though you can use just Eclipse + Spring IDE plugin, I would suggest going for SpringSource Tool Suite simply because it is stable set of very useful plugins. Since we switched to STS we never looked back :)
If you are already using Eclipse, you are likely using other plugins for your existing projects. Also you are like to use tool supports other than Spring for your future projects.
Spring IDE plugin with your existing Eclipse makes more sense if Spring is not your only requirement.