Updating Tyrus in Glassfish

This article is inspired by similar one about Jersey and will provide similar information. Thanks to Michal for creating such comprehensive instructions.

Fortunately, Tyrus does not depend on HK2 so the task here is lot easier. To be absolutely honest, I did expect some issues with Grizzly dependency in Tyrus client, but changes are backwards compatible (applies to Tyrus 1.4), so you can update Tyrus to any version of released Glassfish very easily.

Which version of Tyrus am I using?

You can get this from tyrus-core.jar manifest:

1
2
$ unzip -p $GLASSFISH_HOME/glassfish/modules/tyrus-core.jar META-INF/MANIFEST.MF | grep Bundle-Version
Bundle-Version: 1.0.0

This means you are using Tyrus 1.0. I strongly recommend to upgrade. Latest version now is Tyrus 1.4 and the output will look like:

1
2
$ unzip -p $GLASSFISH_HOME/glassfish/modules/tyrus-core.jar META-INF/MANIFEST.MF | grep Bundle-Version
Bundle-Version: 1.4.0

Glassfish distributions

Table below contains overview of current Glassfish 4.x builds:

Glassfish version Download link Tyrus version
4.0 (Java EE 7 RI) [download] 1.0
4.0.1 b01 [download] 1.0
4.0.1 b02 [download] 1.2.1
4.0.1 b03 [download] 1.2.1
4.0.1 latest nightly [download] latest

Updating to Tyrus 1.4

1
2
3
4
5
6
7
8
9
10
11
$ rm $GLASSFISH_HOME/glassfish/modules/tyrus-*jar
$ unzip -j ./websocket-ri-archive-1.4.zip "websocket-ri-archive-1.4/lib/*" -d $GLASSFISH_HOME/glassfish/modules/
Archive:  ./websocket-ri-archive-1.4.zip
inflating: [path]/modules/tyrus-client-1.4.jar
inflating: [path]/modules/tyrus-container-glassfish-cdi-1.4.jar
inflating: [path]/modules/tyrus-container-grizzly-client-1.4.jar
inflating: [path]/modules/tyrus-container-servlet-1.4.jar
inflating: [path]/modules/tyrus-core-1.4.jar
inflating: [path]/modules/tyrus-server-1.4.jar
inflating: [path]/modules/tyrus-spi-1.4.jar

And that’s it. Remember to restart Glassfish instance after replacing Tyrus jar files.

Note

As of now (1/24/2013) latest nightly build of Glassfish contains Tyrus 1.3.3. Next nightly should contain latest Tyrus release – version 1.4.

Links

Comments:

I update Tyrus 1.4 as you described but it seems have a bug when inject EJB from ServerEndpoint.

When I use Glassfish 4 on http://download.java.net/glassfish/4.0/release/glassfish-4.0.zip, I can call EJB from ServerEndPoint using mark Stateless annotation for ServerEndpoint class.

When I update Tyrus 1.4, I got exception from ServerEndPoint class, it can not dectect EJB.

Please check it.

Thank you.

Posted by misamap on April 30, 2014 at 11:04 AM CEST #

Hello misamap,

can you please file a new issue against TYRUS [1] and provide reproducible application? Also you might want to retry with Tyrus 1.5 (latest release).

Regards,
Pavel

[1] https://java.net/jira/browse/TYRUS

Posted by Pavel on April 30, 2014 at 05:17 PM CEST #

Thanks - Tyrus 1.0 that comes with the current release version of GlassFish (4.0) is completely broken and this guide helped me fix it. I was basically sitting with an Unresponsive server - no errors; it just failed silently with my custom decoder.

I hope GlassFish gets an update soon.

Posted by Alan on May 23, 2014 at 02:53 PM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Pavel Bucek-Oracle

Search

Categories
Archives
« May 2015
SunMonTueWedThuFriSat
     
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
      
Today