Jetty 8 configuration with JSR-356(websockets) - java

I want to ask if Websockets configuration in jetty 8 can not be done through annotations like we do in jetty 9. Jetty 9 has both JSR-356 implementation and its own implementation.
I was referring this http://examples.javacodegeeks.com/enterprise-java/jetty/jetty-websocket-example/.
Question is can we use annotations to configure websockets in jetty 8. If yes then how?

Jetty 8 is EOL (End of Life), and only supported Servlet 3.0.
It never had support for JSR-356 (javax.websocket)
Jetty 9.1.0 added support for JSR-356 as part of its Servlet 3.1 finalization.

Related

Does upgrade to Spring 5 require Tomcat 8.5+

Every tutorial for the upgrade to Spring 5 has tomcat 8.5+ as a requirement but no detailed explanation. The application that I want to upgrade should not run as a standalone application with an embedded webserver, but beeing deployed on a tomcat 6, which we cannot upgrade for several reasons.
As #procrastinate_later points out, Spring 5 actually requires Servlet 3.1 (and Tomcat 8.5.x).
Spring 5 has initially was expected to have Servlet 3.0+ minimum requirement which supported only from tomcat 7
We’ll definitely raise to Servlet 3.0+ (from our present Servlet 2.5 runtime compatibility)
So you need to upgrade to at least Tomcat 7.
Looking at the What's New in Spring Framework 5.x documentation:
Java EE 7 API level required in Spring's corresponding features now.
Servlet 3.1, Bean Validation 1.1, JPA 2.1, JMS 2.0
Recent servers: e.g. Tomcat 8.5+, Jetty 9.4+, WildFly 10+
Cross-referencing this with the Apache Tomcat Which Version documentation, Tomcat 8.0 would be sufficient for the Servlet 3.1 requirement, but Tomcat 8.0 has been superseded by Tomcat 8.5+, as stated in the Which Version (Tomcat 8.x) documentation:
Tomcat 8.5 is thought as a replacement for Tomcat 8.0. Please refer to Migration guide for guidance on migrating to Tomcat 8.5....Users of Tomcat 8.0 should be aware that Tomcat 8.0 has now reached end of life. Users of Tomcat 8.0.x should upgrade to Tomcat 8.5.x or later.

Does Tomcat or Jetty support "java:comp/DefaultDataSource"

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=

Get Observer pattern on EJBs working on my web app

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?

Weld (JSR-299) and JBoss AS 5.1 possible?

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

Is AOP enabled in JBoss AS 7?

I was able to deploy a WAR file with AOP enabled in JBoss Application Server 5. I passed the spring-agent jar as the javaagent parameter.
But I am not able to deploy the war file in JBoss AS 7. Is AOP enabled in AS 7?
EDIT:
AOP Support in JBOSS 4
So, AOP Support is present in JBoss AS 4, and I was able to make it work in AS 5.
Application Server 7 is the latest version and one would expect to find some word about it in the AS 7 documentation. I am not able to find anything.
Am I missing something?
Read the JBoss Community forum thread on this topic: JBoss AOP is not part of AS 7
You're not missing anything, but JBoss 7 is. There is (currently) no explicit JBoss AOP support in 7.

Categories

Resources