Java EE 7 requires support for a default DataSource as discussed:
Defaults in Java EE 7 (Tech Tip #37) by Arun Gupta
Using default DataSource to simplify the development and deployment of a Java EE application by Matti Tahvonen
While I realize Apache Tomcat & Eclipse Jetty provide only a small subset of Java EE features, I wonder if either provides a way to configure such a default DataSource.
Eclipse Jetty and Apache Tomcat are defined as "web containers".
They only support the Servlet spec and a few incidental/related specs around the Servlet spec (such as JSP, JAAS, JSR 356 javax.websockets, etc).
For Eclipse Jetty, there's no full Java EE support option.
For Apache Tomcat, there's TomEE to bring in more of the features of Java EE to comply with the Web Profile of Java EE.
As for comp/DefaultDataSource, neither project has a mention of it in their codebases (not even testcases or documentation).
https://github.com/eclipse/jetty.project/search?utf8=%E2%9C%93&q=DefaultDataSource&type=
https://github.com/apache/tomcat85/search?utf8=%E2%9C%93&q=DefaultDataSource&type=
Related
Anybody facing the same problem? When I try to change the Dynamic Web Module version, eclipse does not allows me to.
Check this Link:
Quoting the same:
The error message is quite understandable - you are attempting to execute an application that requires the server to support Servlet Spec 3.0 when it doesn't. You must therefore, run the application on a server that complies with that version of the Servlet Specification.
As far as I know you have the following options at your disposal, at the time of writing this:
Apache Tomcat 7.0
Glassfish 3.1
IBM WebSphere 8
JBoss 6 and 7
I am trying to get the EJB Observer pattern to work and it seems very straight forward from examples like this:
http://www.devchronicles.com/2011/11/javaee-revisits-design-patterns_28.html
however when I implement the method:
public void doLogging(#Observes String message){
System.out.println("Observed:"+message);
}
the #Observer annotation import does not get inserted.
Also if I do it manually as:
import javax.enterprise.event.Observes;
it does not work looking like I do not have the classes/jars.
I am using EJB 3.0 and am hoping this is not present only in 3.1.
If this is the case how can i get the Observer pattern in EJB 3.0?
It's not part of EJB, but of CDI (JSR-299).
CDI is new since Java EE 6, which also covers EJB 3.1. As you've only EJB 3.0 at hands, this means that you're still on Java EE 5. These days we're already at Java EE 7. It's about time to upgrade.
Examples of Java EE 7 servers are JBoss WildFly 8.x, Oracle GlassFish 4.x, Apache TomEE 2.x and IBM WebSphere 9.x. Examples of Java EE 6 servers are JBoss AS 6.x/7.x, Oracle GlassFish 3.x, Apache TomEE 1.x and IBM WebSphere 8.x.
See also:
What is Weld, JSR-299?
It has been almost a month since i started working with jsf and jboss. I've worked with jsf before. But i didn't use jboss, just apache with it.
I've done a bit of search and i found that JBOSS is:
WildFly, formerly known as JavaBeans Open Source Software Application Server is an application server that implements the Java Platform, Enterprise Edition. JBoss is written in Java and as such is cross-platform: usable on any operating system that supports Java.
And instead of managed beans, there are Action classes. As far as i know, the concept is the same, but some annotations are different.
Are these the only differences between jsf with and without jboss? What good does it do in a jsf application? Is jboss really required?
No, you don't need specifically JBoss AS (now Wildfly, the name has been recently changed) but you obviously need some web container (de facto web server) which run JSF applications (for instance Tomcat, Jetty, Resin or Wildfly).
Difference between plain web container (Tomcat, Jetty) and application server (Wildfly, Glassfish) is that in AS you can use Java EE technologies like EJB or JMS. For JSF the difference is that JSF libraries are usually bundled with application server so you don't have to put them into your WAR file (or have scope provided in Maven).
Has anybody successfully implemented Weld with a JBoss AS 5.1 project? I'm using EJB3.1, and I'm disappointed with the injection limitations (can't call from POJO, lookups from JNDI)
BUT on their site, JBoss 5.x isn't listed as a tested platform.
http://seamframework.org/Weld
Supported platforms
Weld has been tested on the following platforms:
JBoss Application Server 7
JBoss Application Server 6
GlassFish V3.x
Apache Tomcat 6 & 7
Jetty 6.1 & 7.x
Java SE 5.0+
Anyone have success with this?
CDI support is only available OOTB in AS6 and above. If you want, you can embed Weld in your ear or war file. but it won't have EJB integration
I am really wonder what this actually means?
Can I use JBoss 7 in development and also in production with all EE 6 features (I need JMS, EJB 3.1, JSF 2.1, CDI...) or I have to wait for later releases of JBoss 7?
If not, what is the option since JBoss 6.x is only Web Profile certified and what is explanation for "only Web Profile certified"?
Thanks
An application server is only Java EE 6 "Full Profile" certified if it implements all aspects of the huge Java EE API.
An application server is only Java EE 6 "Web Profile" certified if it implements at least the following aspects of the Java EE API:
Servlet 3.0 / JSP 2.2 / EL 2.2 / JSF 2.0 / JSTL 1.2
EJB 3.1 Lite (support for Local containers only, i.e. no EARs)
JPA 2.0 / JTA 1.1
CDI 1.0
Bean Validation 1.0
JBoss 6 is only "Web Profile" certified, even though it also implements a lot of other Java EE aspects like JMS, EJB 3.1 Full, JAX-RS, etc, because it does not implement the entire Java EE API yet. If JBoss 6 offers exactly what you need, then I wouldn't worry about this certification. It's not an evidence that it's production-ready or something.
See also:
Overview of Java EE technologies and requirements for Web Profile
Can I use JBoss 7 in development and also in production with all EE 6 features (I need JMS, EJB 3.1, JSF 2.1, CDI...) or I have to wait for later releases of JBoss 7?
It depends on whether you associate any value with a certificate. JBoss 7 is not Java EE6 certified, because it has not yet been run against the Java EE 6 Full Profile TCK (technology compatibility kit), not that it doesn't implement any of the features required by Java EE 6. According to this post in the JBoss forums, a later 7.x (most likely 7.1) release of JBoss 7 will undergo the certification process.
If not, what is the option since JBoss 6.x is only Web Profile certified
You could wait for EAP 6 (which would include the certified JBoss 7.x release).
and what is explanation for "only Web Profile certified"?
JBoss 7 has passed the Web Profile TCK (which is a seperate TCK). The Web Profile specification outlined in JSR 316, states that the following components are required in a Web Profile compliant container:
WP.2.1 Required Components
The following technologies are required components of the Web Profile:
Servlet 3.0
JavaServer Pages (JSP) 2.2
Expression Language (EL) 2.2
Debugging Support for Other Languages (JSR-45) 1.0
Standard Tag Library for JavaServer Pages (JSTL) 1.2
JavaServer Faces (JSF) 2.0
Common Annotations for theJava Platform (JSR-250) 1.1
Enterprise JavaBeans (EJB) 3.1 Lite
Java Transaction API (JTA) 1.1
Java Persistence API (JPA) 2.0
Bean Validation 1.0
Managed Beans 1.0
Interceptors 1.1
Contexts and Dependency Injection for the Java EE Platform 1.0
Dependency Injection for Java 1.0
WP.2.2 Optional Components
There are no optional components in the Web Profile.
Web Profile products may support some of the technologies present in the full Java EE Platform and not already listed in Section WP.2.1, “Required Components”, consistently with their compatibility requirements.
By passing the Web Profile TCK, and by also including the components required in the Full Profile (allowed by WP2.2), you can continue to build applications requiring the full profile, on JBoss 7.
If your application requires only the web-profile instead of the full profile, then you may use JBoss 7 as a Web Profile certified container. There is of course, JBoss EAP, for those who require an enterprise solution with paid support options; the community version does not have any such SLA-based support option from JBoss/Redhat.
Just to give an update, JBoss 7.1.x is Java EE 6 Full Profile certified. JBoss 7.1.0.Final was released on 2012-02-16.