Can the web application developed with Glassfish4 be normally deployed and run on Tomcat7 as a .war file?
Normally no. Glassfish 4 (even the web profile), is a java ee 7 container with support for ejb, jpa, cdi etc..
Tomcat is a lightweight servlet-container, tomcat 7 supports servlet 3.0 and EL 2.2 for example. Which is just a small subset of what glassfish (and java-ee has to offer)
Snapshot from Tomcat page
Apache Tomcat 7.0.x 8.0.x
Actual release 7.0.47 8.0.0-RC5
Servlet Spec 3.0 3.1
JSP Spec 2.2 2.3
EL Spec 2.2 3.0
WebSocket Spec 1.0 1.0
The java ee 7 web profile specification states that the following components are required:
• Servlet 3.1
• JavaServer Pages (JSP) 2.3
• Expression Language (EL) 3.0
• Debugging Support for Other Languages (JSR-45) 1.0
• Standard Tag Library for JavaServer Pages (JSTL) 1.2
• JavaServer Faces (JSF) 2.2
• Java API for RESTful Web Services (JAX-RS) 2.0
• Java API for WebSocket (WebSocket) 1.0
• Java API for JSON Processing (JSON-P) 1.0
• Common Annotations for the Java Platform (JSR-250) 1.2
• Enterprise JavaBeans (EJB) 3.2 Lite
• Java Transaction API (JTA) 1.2
• Java Persistence API (JPA) 2.1
• Bean Validation 1.1
• Managed Beans 1.0
• Interceptors 1.2
it depends: glassfish is a application server, tomcat is a servlet container
if you used JPA, EJB, or any other JEE component, forget about tomcat (unless you add libs for your own).
otherwise, if you used only web profile, you can deploy it on tomcat.
Related
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=
As we know, WebLogic Server 12c supports natively Java EE 7.
However, if we take a look at the WebLogic 12c documentation of standards there will be a lot of versions differences. Such as:
Java EE 7: Servlet 3.1, JPA 2.1, EL 3.0, JAX-RS 2.0, EJB 3.2, JMS 2.0
WLS 12c: Servlet 3.0, JPA 2.0, EL 2.2, JAX-RS 1.1, EJB 3.1, JMS 1.1
It's just a matter of importing the libraries? Or there is any restriction to use these latest versions?
Thanks a lot!
** UPDATE: WebLogic 12.2.1 is now released. It is Java EE 7 and JDK 8 certified. **
Wrong! WebLogic 12c (12.1.3) is Java EE 6 certified.
Versions 12.1.1 and 12.1.2 do not offer any feature of Java EE 7, although it is possible to run some new APIs over them (but you won't get support). But as you are interested, it provided on release WebLogic 12.1.3 a few Web-related features of Java EE 7 (such as fully compliant JAX-RS 2.0 and WebSockets).
Please read through the documentation as pointed by David Hunt. For a roadmap of WebLogic 12.1.3, you can see the blog post The road ahead for WebLogic 12c 12.1.3 and 12.1.4 (12.2.1).
Weblogic 12c 12.2.1 fully supports Java EE 7. Finally released...
Weblogic 12c 12.1.3 supports some of Java EE 7.
The server does not support version 3.0 of the J2EE Web module specification.
I am getting this error when I am publishing my module in jboss-5.1.0.GA-jdk6.
I have read all the solutions on google as well on stackoverflow, but didn't get the proper solution.
The solution is to use the version of the servlet spec that your JBoss server supports, or to use a version of the JBoss server that supports version 3.0 of the servlet spec. You're trying to use a brand new version of the spec with an old server that was released when this version of the spec didn't even exist.
See https://community.jboss.org/wiki/VersionOfTomcatInJBossAS for a matrix of JBoss versions and servlet spec versions.
I'm trying to build a JAX-RS based web service using IBM RAD 7.5.5 (which is basically Eclipse + plugins) and WebSphere 6.1.
When I create a new Dynamic Web Project, I get the "New Dynamic Web Project" dialog box.
For "Target Runtime", when I pick "WebSphere 6.1", the "Dynamic Web Module" is 2.4 and when I modify the Configuration there is no "JAX-RS (REST web services)" to select in the list.
However, for "Target Runtime", when I pick "WebSphere 7.0", the "Dynamic Web Module" is 2.5 and modify the Configuration there IS a "JAX-RS (REST web services)" to selected in the list.
So my question is, why isn't "JAX-RS" in the list for WebSphere 6.1 / Dynamic Web Module 2.4? Is it simply not supported? If someone could explain why and what the number "2.4" means, it would be greatly appreciated!
Thanks,
Rob
After some digging I can answer my own question ...
The "Dynamic Web Project" number (2.2, 2.3, 2.4, 2.5) corresponds to the version of the Servlet spec (example. Servlet 2.4, Servlet 2.5, Servlet 3.0).
Servlet 2.4 (supported by WebSphere 6.1) uses J2EE 1.4 and J2SE 1.3.
Servlet 2.5 (supported by WebSphere 7.0) uses Java EE 5 and Java SE 5.
Servlet 3.0 (possibly supported by WebSphere 8.0?) uses Java EE 6 and Java SE 6.
So, JAX-RS requires annotations which means it needs Java SE 5, and therefore Servlet 2.5.
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.