Netbeans wizard for JSF pages doesn't recognize TomEE 1.6 to have Web Profile support - netbeans

I am creating a Java EE 6 application with the help of Netbeans 8.0 and TomEE 1.6. I have successfully added the server to netbeans and even generated some entity classes. I am currenlty trying to generate some JSF pages using the Netbeans wizard. However I get the following message
Cannot be generated for Java EE 6 sources wihtout server with complete Java EE 6 Web profile support (at least EJB Lite support).
I am using TomEE 1.6.0.2 plus

The problem is Netbeans 8 has a bug in which it fails to find the tomee-common-[version].jar in the [TomEE]/lib directory.
The solution is to simply rename the jar file to an older version.
For example, you have [TomEE]/lib/tomee-common-1.6.0.2.jar or [TomEE]/lib/tomee-common-1.7.1.jar. Rename these files to [TomEE]/lib/tomee-common-1.6.0.jar
This should sort you out :)

you can use tomcatEE 1.7.2 with a few small changes
you find here:
http://zarnisfd.blogspot.com/
I think this also applies to TomEE 1.6

According to the following sites:
http://forums.netbeans.org/ntopic48005.html
https://netbeans.org/bugzilla/show_bug.cgi?id=210835
Tomcat does not support EJB's therefor you would need to use an enterprise server that at least supports EJB Lite. One such server would be GlassFish

Related

How can I chose a specific version of Java EE in Eclipse?

It's my first day with Java EE and I would like to understand:
How I can set up a Java EE 7 project? and where can I check what Java EE version I am actually using?
I downloaded the latest Eclipse for Java EE Developers (Neon) and am now trying to understand how all these parts fit together.
I ended up downloading Java Platform, Enterprise Edition 7 Web Profile SDK Update 3 as well as a Shell file to install Java Platform, Enterprise Edition 7 SDK Update 3.
I know there is a lot of instructions provided but I would just like to set up my Eclipse environment.
Happy for any help or resource!
You can follow this tutorial http://www.edu4java.com/en/servlet/servlet4.html it's old but it basically the same thing
You have to create a new project (Dynamic Web Project)
The versions of the Facets you choose will determine which Java EE spec version it aligns with
Choose your application server (I personally recommend Wildfly http://wildfly.org/, but the built-in Java EE Preview Server can run Servlets on its own)
And you are ready to go !

Maven archetype for java ee 6 and eclipse

I need to create a java ee 6 project which contains:
JSF
EJB
JPA
The Web-things should be compiled to a .war file, the ejb to the ejb-jar and overall into an ear file. The application will be deployed to a Glassfish v3.
I was looking for a maven archetype which I can use and integrate into Eclipse. However I haven't found one. Can you help me?
I consider Andy Gibson's Knappsack Archetype as a good starting point for what you are looking for. It gives you certain levels of working projects from a very basic setup to one filled with examples.
Alternatively, Adam Bien's Weblog is always a good place for finding simple solutions as for example a minimal project setup.
The Java EE MVC Security Archetype is a quickstart for websites that want user self registration and security configuration.
You can try it out on Openshift, though sometimes you have to wait a couple of minutes for openshift to load and start the application.
The archetype includes the following technologies:
Java EE MVC web application for Wildly 9 environment
JSF 2.2 and Bootstrap
JPA 2.1
H2DB (H2 Development Database)
JUnit/Arquillian/Drone/Graphene for testing
Java EE SecuritySupported by JBoss/Wildfly Database Module
Please note: This post is self-promotional.

JSF and Richfaces on JBoss AS 4

I need to develop a presentation layer for an existing Java EE application running on JBoss AS 4.2.1.GA. I have been reading on JSF, Facelets and RichFaces and tried a few examples - some things worked but others didn't because of the limitations of library versions I used, considering the outdated JBoss.
Can someone recommend the direction I need to be heading to get this done as quickly as possible by using the mentioned server? By this I mean the Eclipse tool (WTP, JBoss Tools, ...), type of project, dependencies, ... Also, to shorten development time, maybe also use JRebel?
I know I would be better off using the latest server, but unfortunately it is not an option.
Also, I have installed JBoss Tools for Eclipse Indigo, but for creating RichFaces Project, it requires JBoss EAP 6 or AS 7.1.
I had created applications using JSF 1.2, RichFaces 3.3.3, JBoss Seam 2.0.2 (not required) for JBoss AS 4.2.2.GA. For development was used Eclipse (3.4/3.5) IDE for Java EE Developers. Version of Eclipse is not important. Yes, you need WTP. In my projects seam-gen was used for generating project skeleton. If you don't use Seam you can create Web project.

Unable to find interface javax.transaction.UserTransaction;

I am trying to setup a new Netbeans project with JPA. The Java SDK version is 1.5.0_22-b03 and J2EE version is J2EE 1.4.I am using TOPLINK Essentials for JPA.
Going by javadoc javax.transaction.UserTransaction interface comes with J2EE 1.4.
Then why it's not able to find javax.transaction.UserTransaction?
The JPA 1.0 specification is meant to cater to Java EE 5 containers and not J2EE 1.4 containers (unless the same also support EJB 3.0 like the erstwhile OC4J containers from Oracle). Likewise JPA 2.0 caters to Java EE 6 containers.
I would suggest using Netbeans with Java EE 5 or Java EE 6, instead of heading for a wild goose chase on getting your JPA 1.0/2.0 provider to work amicably with a J2EE 1.4 container. This isn't merely about placing some JARs in your compile time classpath; your runtime classpath will require classes that are available only in a Java EE 5/6 container.
Either you have an incorrect classpath or you are missing a required jar. What are you using to build?
You have not correctly included the j2ee-1.4.jar in your project classpath. Otherwise you can reference to it. Perhaps you meet problem in setting classpath of your java project in netbeans.
Please check your jar to ensure it is correctly downloaded.
Maybe this is an old question but since no other answer has been posted, I post what I was able to do to make it work.
I found a file at:
C:\Program Files (x86)\NetBeans 8.1\java\modules\ext\hibernate4
Right-click your project >Libraries >Add jar > find your Netbeans installation directory...
usually => C:\Program Files (x86)\NetBeansXXX
find java\modules\ext\hibernate4 and choose jboss-transaction-apixxxxx.jar
hope it helps everyone else,

How to make a java project from a Websphere ear work with JPA

I have an EAR installed in Websphere 6.1. Development is done in Eclipse, but using a simple Java project and updating the *.java and *.class files directly to the server. I want to start using JPA, but the #Stateless annotation gives the error "cannot be resolved to a type". What am I missing?
Thank you for your time,
Iulia
You need either to be on WebSphere 7.0, or to have installed the EJB3 Feature pack for WebSphere 6.1. You pattern of use of EAR files and plain java projects sounds a little diferent from what I've done. Suggest you start by following Roland Barcia's tutorial, et that going before you experiment with other patterns.
This tutorial may be helpful, it relates to WebSphere 6.1 + feature pack.