X

How To Use Jersey Client Efficiently

While fixing a memory leak issue in JerseyClient some time ago i realised how easy it is to misuse the thing. In this blog post, i would like to introduce some tips to avoid unnecessary memory allocation and also to save some CPU cycles to achieve better throughput. Tip 1: Be careful when updating WebTarget config! In Jersey 1.x it was suggested to reuse Client instances (see here for details).In Jersey 2, reusing Client instances is still recommended, but as such it is not...

Monday, March 30, 2015 | REST | Read More

Jersey 2.x Client on Android - Take 2

In my earlier post i described what we did in Jersey version 2.16 in order to make Jersey client work on Android. The whole idea was that after separating JAXB providers out from the Jersey core module, things would just work out of the box. Unfortunately, it turned out the JAXB provider separation was not enough. Basic things worked (see my original post for a test case application), but Jersey was still trying to pull in some types not available in Android environment....

Tuesday, March 17, 2015 | REST | Read More

Jersey 2.17 Has Been Released

We have just released the 2.17 version of Jersey, the open source, production quality, reference implementation of JAX-RS 2.0. To download Jersey 2.17, please check out our download page. You can also check out the refreshed Jersey 2.17 documentation: API: https://jersey.java.net/apidocs/2.17/jersey/ User Guide: https://jersey.java.net/documentation/2.17/ This version includes mainly bug fixes. Following is a list of the most important updates: Ability to use multiple Jersey based...

Monday, March 16, 2015 | REST | Read More

When to Use JAX-RS Class-path Scanning Mechanism

The short answer is: never!. I have seen several nasty (so called) "bugs" caused by this feature so that i felt like sharing this little advice via blog post: Never ever use JAX-RS class-path scanning feature in a production environment Class-path scanning looks like a handy feature. Let say you do not want bother with enumerating all the components you would like to include in your JAX-RS application. Then your JAX-RS application class could look like: import...

Tuesday, March 3, 2015 | REST | Read More

Container Agnostic CDI Support In Jersey

Introduction At the time of this writing, Java SE support is being discussed as one of important additions to CDI 2.0 specification. Existing CDI implementations brought this feature already, only container bootstrapping has not yet been standardized. In Jersey version 2.15 we introduced Weld SE support, so that people could take advantage of CDI features also when running in Java SE environment. As part of this work, the old Jersey CDI module has been refactoredso that it...

Friday, February 13, 2015 | REST | Read More

Jersey 2 Performance

During my sabbatical week in January i have done some performance improvements in Jersey server core module. These changes are already included in Jersey version 2.16. To make sure the changes indeed made a positive difference i have re-established continuous performance testing for Jersey server side processing. These automated tests allowed Michal Gajdoš to collect some numbers that show how performance evolved within Jersey 2.x version space.In this post i would like to...

Thursday, February 12, 2015 | REST | Read More

Jersey 2.x Client on Android

From time to time, people are asking for Jersey Client support on Android device. Until Jersey version 2.15 it was not possible to get Jersey client running on Android devices due to javax.xml.stream dependencies included directly in the Jersey client core module. A list of Android supported Java packages is available here and the javax.xml.stream package is missing there. Current Jersey snapshot version introduces a new JAX-B module, so that all JAXB-B Jersey client...

Friday, January 30, 2015 | REST | Read More

Jersey 2.0 Integrated into GlassFish 4.0

The latest promoted build of GlassFish 4.0 (glassfish-4.0-b43.zip) now contains upgraded Jersey version, 2.0-m05. Users are getting an early access to the implementation of some parts of the JAX-RS 2.0 API Early Draft Review 3. The appropriate JAX-RS bundle, version 2.0-m09 , gets bundled into GlassFish 4.0 as well. What should work The simple answer is: all the basic stuff. We have particularly tested the following two examples: simple hello world webapp multipart webapp Both...

Friday, June 29, 2012 | REST | Read More

Jersey 1.12 is released

We have just released the 1.12 version of Jersey, the open source, production quality, reference implementation of JAX-RS. The JAX-RS 1.1 specification is available at the JCP web site and also available in non-normative HTML here. For an overview of JAX-RS features read the Jersey user guide. To get started with Jersey read the getting started section of that guide. To understand more about what Jersey depends on read the dependencies section of that guide. See change log...

Wednesday, February 22, 2012 | REST | Read More

Jersey 1.11 is released

Yesterday, we have released the 1.11 version of Jersey, the open source, production quality, reference implementation of JAX-RS. The JAX-RS 1.1 specification is available at the JCP web site and also available in non-normative HTML here. For an overview of JAX-RS features read the Jersey user guide. To get started with Jersey read the getting started section of that guide. To understand more about what Jersey depends on read the dependencies section of that guide. See...

Tuesday, December 13, 2011 | REST | Read More

Jersey 1.10 is released

Yesterday, we have released the 1.10 version of Jersey, the open source, production quality, reference implementation of JAX-RS. The JAX-RS 1.1 specification is available at the JCP web site and also available in non-normative HTML here. For an overview of JAX-RS features read the Jersey user guide. To get started with Jersey read the getting started section of that guide. To understand more about what Jersey depends on read the dependencies section of that guide. See...

Friday, November 4, 2011 | REST | Read More

Jersey 1.9 is released

On the last Friday, we have released the 1.9 version of Jersey, the open source, production quality, reference implementation of JAX-RS. The JAX-RS 1.1 specification is available at the JCP web site and also available in non-normative HTML here. For an overview of JAX-RS features read the Jersey user guide. To get started with Jersey read the getting started section of that guide. To understand more about what Jersey depends on read the dependencies section of that guide....

Monday, September 5, 2011 | REST | Read More

Jersey 1.8 is released

On the last Friday, we have released the 1.8 version of Jersey, the open source, production quality, reference implementation of JAX-RS. The JAX-RS 1.1 specification is available at the JCP web site and also available in non-normative HTML here. For an overview of JAX-RS features read the Jersey user guide. To get started with Jersey read the getting started section of that guide. To understand more about what Jersey depends on read the dependencies section of that guide....

Monday, June 27, 2011 | REST | Read More

Oracle Java Developer Conference 2011 v Brně

Včerejší Java konference v Brně byla podle mě hodně povedená. Na akci přijelo nakonec víc lidí, než kolik naznačovala předběžná registrace, takže kapacita místností byla naplněná, někdy dokonce až mírně přeplněná. Atmosféra konference byla příjemná, bylo vidět že přijeli hlavně vývojáři. Dobrým znamením bylo, že valná většina účastníků vydržela na konferenci až do úplného konce. Myslím, že to znamená, že byli s obsahem spokojeni. S Markem Potočiarem jsme mluvili o JAX-RS (Java...

Friday, May 27, 2011 | REST | Read More

Jersey 1.7 is released

On the last Friday, we have released the 1.7 version of Jersey, the open source, production quality, reference implementation of JAX-RS. The JAX-RS 1.1 specification is available at the JCP web site and also available in non-normative HTML here. For an overview of JAX-RS features read the Jersey user guide. To get started with Jersey read the getting started section of that guide. To understand more about what Jersey depends on read the dependencies section of that guide....

Tuesday, May 24, 2011 | REST | Read More

JAX-RS Presentation at JavaOne in Moscow

I have just finished my JAX-RS presentation at JavaOne in Moscow. In fact, I have pretty much re-used what Paul and Roberto were presenting in San Francisco. Only dropped the EJB/CDI integration part to fit into the 45 minute time slot. slides demos

Thursday, April 14, 2011 | Java | Read More

Jersey 1.6 is released

On the last Friday, we have released the 1.6 version of Jersey, the open source, production quality, reference implementation of JAX-RS. The JAX-RS 1.1 specification is available at the JCP web site and also available in non-normative HTML here. For an overview of JAX-RS features read the Jersey user guide. To get started with Jersey read the getting started section of that guide. To understand more about what Jersey depends on read the dependencies section of that guide....

Monday, March 28, 2011 | REST | Read More

Jersey 1.x Plans

It has been a long time i posted anything about the Jersey project here. As Paul has left Oracle, and i am taking over his leadership role for Jersey 1.x, i think it is the right time to start blogging again. This post should give you an overview of what are the plans for the Jersey 1.x in the near future. We want to improve Jersey integration with both GlassFish and WebLogic application servers, with focus on the following areas: Multiple Jersey versions running simultaneously...

Tuesday, March 22, 2011 | REST | Read More

Přednáška o JAX-RS a Jersey na WebExpo konferenci

WebExpo je údajně největší česká konference zaměřená na web. Za chvíli tam mám prezentovat JAX-RS a potažmo Jersey a už se moc těším. Je to vlastně poprvé, kdy budu prezentovat mimo Java komunitu, a moc mě zajímá, jak na to budou lidi reagovat. Taky jsem zvědavý na přednášky ostatních. Věším slajdy na http://blogs.sun.com/japod/resource/Jersey-WebExpo-Praha.pdf a vrhám se do víru konference...

Saturday, October 17, 2009 | Hezky česky | Read More

Jak se dostat do kanceláře SUNu v Praze na Chodově

Protože první poprázdninové setkání sdružení CZJUG proběhne vyjímečně v pražské kanceláři SUNu, zveřejňuji zde mapu, pár obrázků a stručný návod jak se na místo dostat. Mapa Kliknutím na mapu by se vám v prohlížeči měla otevřít aplikace mapy.cz, s nastavenou polohou místa setkání. Přesná adresa je: Praha 4, V Parku 8. Jak se dostat dovnitř, aneb proč být na místě opravdu včas Pro snazší orientaci přikládám raději i fotografie. Na té první je pohled směrem ke kanceláři od stanice...

Friday, September 25, 2009 | CZJUG | Read More

Jersey 1.1.1-ea Packages Available At GlassFish Update Center Repositories

Jersey version 1.1.1-ea was released a week ago. Paul described what's new at the released version at his blog. Corresponding packages are now available to all GlassFish v2 users. The Jersey 1.1.1-ea packages were also published for selected GlassFish v3 based distributions and integrated into the v3 main trunk for those, who rely on the nightly builds. Enjoy!

Tuesday, July 21, 2009 | REST | Read More

Soutěž o SunSPOT development kit

Stručně řečeno je SunSPOT malé víceúčelové elektronické zařízení programovatelné v Javě. Disponuje celou řadou senzorů (teplota, intenzita osvětlení, akcelerometry), dále anologovými a číslicovými vstupně/výstupními porty, dvěma mikrospínači, USB portem a obvody pro radiovou komunikaci. Více podrobností o technologii SunSPOT lze nalézt v angličtině na stránkách http://www.sunspotworld.com/Na posledním setkání CZJUGu jsem technologii stručně představil, včetně dvou živých...

Thursday, July 2, 2009 | CZJUG | Read More

Jersey 1.0.3 GlassFish V3 packages split up

Jersey version 1.0.3 is now available also to GlassFish V3 Prelude users via GFv3 update center. I am writing this, because several changes happened about how things work there. As you can see at the snapshot, the first big change relates to number of Jersey packages. Started from the 1.0.3 version, we are providing two separate packages. We are going to integrate with GlassFish V3 bits, so that people would not need to install Jersey separately. And as we wanted to lower the...

Monday, April 27, 2009 | REST | Read More

Jersey aplication sharing Grizzly with static content and servlets

I was asked the question some time ago by one of my colleges here at SUN, and the same question was asked again recently at our user mailing list: "I want to run Jersey based application on Grizzly web server, but i want to also run another servlet from there, and possibly also serve some static content using the very same Grizzly sever instance. How do i do that?" The answer is as simple as follows. Having imported import com.sun.grizzly.http.embed.GrizzlyWebServer;import...

Wednesday, April 22, 2009 | REST | Read More

Videa z únorového setkání CZJUGu

Videa z únorového setkání CZJUGu jsou k dispozici ke stažení. Jen pro připomenutí: jednalo se o monotematicky zaměřené setkání věnované technologii JavaFX. Úvodní prezentace Honzy Štěrby a Juraje Švece z pražského vývojového centra společnosti SUN Microsystems byla přímo nabitá demonstracemi předvádějícími jednotlivé funkce JavaFX. Michal Škvor pak navázal předvedením nástrojů potřebných pro vývoj. Zajímavá byla ukázka podpory JavaFX v nástrojích firmy Adobe. Setkání bylo...

Friday, April 17, 2009 | CZJUG | Read More

Videa z lednového setkání CZJUGu

26. ledna 2009 proběhlo na půdě katedry počítačů, ČVUT FEL, setkání CZJUG na téma webové služby. Za firmu SUN Microsystems vystoupil Marek Potočiar. Jeho prezentace projektu Metro byla obohacena několika povedenými demonstracemi, kdy jako runtime byl použit aplikační server GlassFish. Následoval přehled webservices stacku aplikačního serveru JBoss v podání Richarda Opálky z firmy RedHat. Jako bývalého člena Metrotýmu mě potěšilo, že i druhá prezentace se tohoto projektu...

Thursday, February 19, 2009 | CZJUG | Read More

Magical UNIX Date

We have an old bridge in my city. The city is called Prague, and the bridge is called Charles bridge. Whenever i am passing the bridge, i recall the date when they started construction. It was 1357 9.7. at 5.31 in the morning. Truly magical and exceptional date. My colleague Pavel told me today, in UNIX world, such a magical date and time happens to come today at 13 11:45:21 PST. Then if you issued the following command for obtaining UNIX time: perl -e "print time" You got: 1...

Friday, February 13, 2009 | Other | Read More

Configuring JSON for RESTful Web Services in Jersey 1.0.2

This is an update for a tech tip on configuring JSON in Jersey, which i wrote in October 2008. The way of JSON configuration, suggested in the tech tip, is now deprecated (but still functioning). Here i would like to describe the new API, which will hopefully last (and be supported) a way longer. Notice: you will need to bundle jaxb-impl-2.1.10.jar with your application in order to take advantage of the recently added JSON NATURAL convention Deprecated Configuration Configuring...

Friday, February 13, 2009 | REST | Read More

Jersey Based Java Client Talking to SmugMug

Jersey provides a great, easy-to-use REST client API. Recently someone wrote to our mailing list the opposite. We probably need to advertise better. Paul initially introduced the API in this blog post almost a year ago. But it is, of course, not the only place to look at. Javadoc for Jersey Client API could be found here. The Jersey Client API could be used pretty easily. However, instead of describing the API in detail, i would just like to present here a real life example. A...

Wednesday, January 28, 2009 | REST | Read More

Christmas present folow-up

In December, Paul described a way to easily obtain Jersey jar files from web. It was mainly focused on non-maven users. Then Ben asked for a zip file containing the jars. From now on, everybody can obtain such a zip archive at http://download.java.net/maven/2/com/sun/jersey/jersey-archive. You just need to select a version of Jersey and your preferred archive format. Zip archive of current snapshot is available at http://download.java.net/maven/2/com/sun/jersey/jersey-archive/1...

Friday, January 23, 2009 | REST | Read More

Prezentace projektu Metro na CZJUGu

Příští pondělí, 26.1.2009, proběhne v rámci setkání Českého JUGu přednáška Marka Potočiara o projektu Metro. Z abstraktu přednášky vyplývá, že součástí budou i dema. Marek je psal přímo pro tuto příležitost, a myslím, že se mu velice povedla. Kromě demonstrací zaměřených přímo na SOAP ukáže mimo jiné, jak na aplikačním serveru GlassFish kombinovat SOAP a REST. Pro REST službu použije samozřejmě projekt Jersey. Jestli vás tato oblast zajímá, přijďte v pondělí v 18h na Karlovo...

Tuesday, January 20, 2009 | CZJUG | Read More

Jersey 1.0 Available on GlassFish V3 Prelude Update Center

Today, GlassFish V3 Prelude, was launched. As Paul has written, Jersey 1.0 is part of the ensemble, and I would like to show, how to get JAX-RS and Jersey support installed on it. Jersey package is available on GlassFish V3 Prelude update center, which is easily accessible from GlassFish admin console. After you start your GlassFish instance, the default location for the admin console is http://localhost:4848/ You will just click on the Available Add-Onsbutton. Then the...

Thursday, November 6, 2008 | REST | Read More

Vyhlášení vítězů soutěže API Fest 08

Minulý čtvrtek proběhlo v pražské kanceláři SUNu slavnostní předání cen vítězům letošního API Festu. Podrobnosti o soutěži (v angličtině) najdtete na stránkách soutěže zde. Oběma vítězům pogratuloval i šéf pražského vývvojového centra SUNu, Pavel Šuk (další obrázky získáte kliknutím na fotku):

Tuesday, November 4, 2008 | CZJUG | Read More

TechTip on Configuring JSON in Jersey

Ed Ort has just written me, that my tech tip on configuring JSON format in Jersey was featured on the front page of java.sun.com: The tech tip itself is available at the enterprise tech tips blog page. I am currently working with Martin Grebac on a better JAXB integration, so that described JSON configuration could be simplified in the future versions of Jersey.

Friday, October 31, 2008 | REST | Read More

Výsledky ankety CZJUGu

V minulých dnech proběhla v rámci CZJUGu menší anketa. Její výsledky jsme se s Dagim rozhodli zveřejnit. Budeme se postupně snažit na jednotlivé podněty reagovat. Respondent statistics: Total respondents 108 Summary of results 1. Počet absolvovaných setkáni 0 26  24% 1 14  13% 2-5 37  34% 6 a více 31  29% Total answers 108   Among 108 respondents the most frequent answer is "2-5". Least frequent answer is "1". 2. Sledujete nektera setkaní z archivu AVC Ano 84  78% Ne 24  22% Total answers 108   Among...

Wednesday, October 1, 2008 | CZJUG | Read More

Zaměstnání v SUNu pro šikovné absolventy

Jsem v SUNu rád. A nejen pro to, co SUN v oblasti informatiky znamená, a že vyrábí skvělé technologie. Je to i tím jak bezvadná atmosféra tady panuje, a jaké lidi člověk v práci potkává. Z vlastní zkušenosti vím, že to není jen tak: mít možnost dělat práci, která vás baví, za dobré peníze, a ještě k tomu s lidmi se kterými svůj čas trávíte rádi. Takže mi teď dělá velkou radost, že můžu dát vědět všem, kdo absolvovali technicky zaměřenou vysokou školu (Bc., Ing., Mgr.) umějí...

Wednesday, September 10, 2008 | Hezky česky | Read More

Setkání Slovenského Java Teamu v Košicích

Motto tohoto příspěvku by klidně mohlo být: "Lepší pozdě než nikdy"V pondělí 16.6. jsem se zúčastnil už třetího setkání Javovské komunity na Slovensku, které se tentokrát konalo v Košicích. Prezentoval jsem tam jak jinak: aplikační server GlassFish. Košice mě mile překvapily. Mají nádherné náměstí. A musím přiznat, že i spoustu nádherných slečen, které se po něm večer procházejí (snad to nečte moje žena...).Co mě nemile překvapilo, byl způsob prodeje jízdenek na MHD (automat...

Friday, June 27, 2008 | Hezky česky | Read More

Jersey 0.8 Available At GlassFish Update Centers

As Paul advertised at his blog, Jersey 0.8 was released on the last Friday. Appropriate update center modules are now available for both GlassFish V2 and V3. Since Jersey has not been yet fully integrated with GlassFish module system, the module for GlassFish V3 contains only a subset of all examples available in full Jersey 0.8 bundle.

Tuesday, June 24, 2008 | REST | Read More

Simple Jersey Web App With Maven Take 2: Replacing Tomcat With GlassFish

Yesterday, i wrote about how to put together a simple Jersey based RESTful web application using just CLI and maven. I have ended with running the application using mvn tomcat:run. In this entry i would like to show, ho to easily update the pom.xml file, so that you can use mvn glassfish:run instead. I.e. how to run the thing on GlassFish V3 application server instead of Tomcat. Updating Your pom.xml Following is the updated pom.xml. Newly added pieces are red: <project...

Tuesday, June 3, 2008 | REST | Read More

Building Simple Jersey Web App With Maven

I have recently configured our Hudson server to push latest Jersey snapshots to maven repository at https://maven2-repository.dev.java.net/. Thanks to Martin Grotzke for his kind help! I am pretty new to maven, and wanted to make sure Jersey related jars are deployed just fine and could be easily used. Following is steps to create a new Jersey based web application from scratch. I will be using only CLI and maven. Create a New Project Layout At the beginning we need to create a...

Monday, June 2, 2008 | REST | Read More

Workarounding Cross-domain Restriction With Jersey

Having a JSON generating REST resource, you can consume provided data in your web page using JavaScript pretty easily. To access data at your own site you can obviously make a HttpRequest from JavaScript code. To access data from another site, you will need to workaround a cross-domain restriction somehow. Two possible approaches are described at Dan Theurer's blog entries here and here. In this entry i will show how to add the JavaScript representation option to your Jersey ...

Monday, May 26, 2008 | REST | Read More

jMaki Putting Data to Jersey

In this post I have described how to make jMaki widgets consume Jersey based web resources. In a read-only manner. Here I would like to show how to close the circle and make jMaki widgets push an updated information back to the Jersey. Many thanks to Greg Murray who has spent some time with me on Monday to put the following piece of code together. The most important part of it is emphasized and shows how to actually make a PUT request using jMaki function doAjax jmaki.subscribe(...

Thursday, May 8, 2008 | REST | Read More

Missing Brackets At JSON One-Element Arrays In Jersey

It is a bit uncomfortable, but if you need to deal with arrays in JSON produced by Jersey, you will need to provide a custom JAXB context resolver to make sure brackets are properly used in one-element arrays. As Reece Garrett pointed out, the very same issue was hit (and resolved) in Jettison as well. What is exactly the issue? Lets say, you have the following JAXB bean @XmlRootElement public class ArrayWrapper { public List<String> list = new...

Wednesday, April 23, 2008 | REST | Read More

Historicky první setkání Java teamu na Slovensku

Včera jsem měl velkou čest zúčastnit se historicky vůbec prvního setkání tzv. Java Teamu na Slovensku.Javateam je něco, co v Čechách známe pod pojmem Java User Group. (všimněte si, jak velmi neanglicky/neamericky oba typy označení působí). Vystoupil jsem s prezentací projektu GlassFish -- Java EE 5 aplikačního serveru, přičemž polovinu "slajdů" jsem "převzal" od Martina Grebače a druhou polovinu od Alexis Moussine-Pouchkine(a). "Pánové: ďakujem, merci bien, спасибо!"...

Thursday, April 10, 2008 | Hezky česky | Read More

Jersey 0.6 Available On GlassFish Update Center

New features are described in Paul's blog entry here. See this blog entry (about Jersey module v 0.2.1) describing how to run GlassFish update center client and get the Jersey module installed.

Sunday, March 9, 2008 | REST | Read More

jMaki Widgets Talking To Jersey Resources In JSON

In the recent post, i have announced an improvement in JSON format produced by Jersey. Here i would like to show how you can easily consume the new format by jMaki widgets. An example of what you can get is shown below. Jersey back-end resources are already available within Jersey examples as jMakiBackend web application. You just need to obtain the latest Jersey bundle and then build and deploy the jMakiBackend example via following: % cd jersey-0.6-ea/examples/jMakiBackend%...

Saturday, February 23, 2008 | REST | Read More

Better JSON Available In Jersey

Since today a better support for JSON data generated out of JAXB beans is available in Jersey. The main improvement is a simpler default JSON data format. Badgerfish convention was replaced by a new one, a slightly simplified so called mapped convention from Jettison. JSON convention used for particular beans is now also fully configurable by the end user. I will show how the configuration could be done below. The main differences between available formats could be described...

Friday, February 22, 2008 | REST | Read More

Jersey 0.5 Available On GlassFish Update Center

New features are described in Paul's blog entry here. See this blog entry (about Jersey module v 0.2.1) describing how to run GlassFish update center client and get the Jersey module installed.

Friday, February 8, 2008 | REST | Read More

Jak mě roboti (zase) dostali

Motto: Nesnažte se být rychlejší než automat V pondělí na prezentaci CZJUGu se mi povedl parádní generálský efekt s pluginem do Netbeans 6.0. Včera mi autoři pluginu vysvětlili a dnes jsem si oveřil, ze příčinou byla pomalá reakce "umělé inteligence" pluginu. O co jde? RESTful Web Services plugin se pro danou webovou aplikaci aktivuje na pozadí. Tedy pokud je nainstalován: musíte si jej napřed stáhnout z Netbeans 6.0 beta update centra (viz. obrázek)Plugin obsahuje knihovny...

Wednesday, January 30, 2008 | Hezky česky | Read More

Prezentace JSR-311 a projektu Jersey na CZJUGu

28. ledna v 18h budu v rámci pravidelných setkání českého sdružení uživatelů Javy (CZJUG) prezentovat JSR-311 a projekt Jersey. Byl bych rád, aby na konci sezení byli všichni přítomní schopni naimplementovat jednoduchou RESTful webovou službu v Javě. Kromě mé maličkosti vystoupí ten večer i Kohsuke Kawaguci, který předvede projekt GlassFish -- open source Java EE 5 aplikační server.

Friday, January 11, 2008 | Hezky česky | Read More

How to find out which process listens on certain port on Solaris?

This week i (again after a while) needed to know which (damn) process held certain port and so was quite "successfully" blocking my code. In Tux world i believe problem like this could be solved simply by using a stupid parameter of netstat command. It is unfortunately not that easy on Solaris :-( In an excited mood i totally forgot i had written a handy shell script for this purpose some time ago. So i killed all suspicious processes to solve the problem.Just to help myself...

Friday, November 30, 2007 | Solaris | Read More

Tech Tip on Implementing RESTful Web Services in Java

Last Friday a new tech tip was published on implementing RESTful web services in Java. Many thanks to Ed Ort for his help with editing and improving the text and making sure everything works fine with the example. The tech tip briefly introduces REST and then shows on a concrete example how to implement RESTful web services using Jersey -- reference implementation of JSR-311. The tech tip is available on the following addresses (the same content, different formatting): http://jav...

Monday, November 19, 2007 | REST | Read More

Povídání o RESTu a projektu Jersey pro CZJUG

Minulý čtvrtek jsme s Roumenem, Dagim a Filemonem nahráli povídání o RESTu, "staronovém" architektonickém stylu pro psaní webových služeb. Kromě RESTu jako takového byla řeč i o specifikaci JSR-311, která definuje RESTové API pro Javu a také o implementaci tohoto API v podobě projektu Jersey. Nahrávka je k dispozici na stránkách CZJUG na adresehttp://www.java.cz/detail.do?articleId=7968 Povídání bylo velice neformální, nahrávali jsme přes internet po desáté večer. Doufám,že se...

Thursday, November 15, 2007 | Hezky česky | Read More

Welcome to Indiana!

I am really enjoying adding this entry. I am running Solaris as usually, but this time i am using a live CD distribution called Indiana. (see http://opensolaris.org/os/project/indiana/documents/ for more details). And it works just fine on my Toshiba Tecra M3 laptop. The following screenshot i have taken and edited only with tools bundled along with Indiana. I have just downloaded a CD ISO image from http://opensolaris.org/os/project/indiana/resources/getit/, burned it and...

Tuesday, November 13, 2007 | Solaris | Read More

TechDays in Milan

For the rest of this week I am attending TechDays in Milan. I will be presenting JSR-311 and Jersey there. You can see the agenda at http://it.sun.com/sunnews/events/2007/sept/jc07/agenda.jsp. I would like to share some pictures from the event with you. Registration desk in the morning: Beamer checking in the conference room. In front you can see Arun Gupta (white t-shirt) and Alexis Moussine-Pouchkine (sitting at the table): Alexis is giving GlassFish presentation:

Wednesday, September 26, 2007 | REST | Read More

RESTful Web Services On Glassfish

Recently Jersey module become available on GlassFish Update Center. It comes along with several examples, which use GlassFish as a web container. The examples show how to build RESTful web services using Java. If you want to see such web services in action and find out how to implement them, the fastest way is probably to download and install GlassFish install Jersey module from GlassFish Update Center Try out the examples bundled with Jersey This entry will introduce one of the...

Monday, September 17, 2007 | REST | Read More

Jersey 0.2.1 Available On GlassFish Update Center

Jersey module is now publicly available on GlassFish Development Update Center. For those who would like to give it a try I will describe how to get it from there. Thanks to Rajeshwar, who actually pushed the module on the net, for his support and help. After installing GlassFish V2 run the Update Center client % $AS_HOME/updatecenter/bin/updatetool Then you should see Jersey at the list of available modules. Simply select Jersey module and click on the Installbutton. You...

Wednesday, September 12, 2007 | REST | Read More

Jersey Module Available On Glassfish Development Update Center

This entry contained steps to install Jersey module from GlassFish Development Update Center. Due to technical and legal reasons, I had to pull it out. I will post a new blog entry once the module becomes available at the "real" Update Center. Thanks for your understanding.

Friday, September 7, 2007 | REST | Read More

Jersey 0.2.1 Is Out!

Please look at Paul's blog for more details. The very same version should be soon available via GlassFish Update Center.

Tuesday, September 4, 2007 | Java | Read More

JSON Representation of JAXB Object Sample

The example is available at http://mediacast.sun.com/share/japod/JsonFromJaxb.zip I have bundled all necessary jar files, so everything you need to run the example is to unzip the archive, cd to JsonFromJaxb and run % ant dist It will produce dist/JsonFromJaxb.war, which you can deploy to your favorite Java web container. My favorite container is GlassFish, so I would continue with % $AS_HOME/bin/asadmin deploy dist/JsonFromJaxb.war The flights resource should be then...

Friday, August 31, 2007 | REST | Read More

Jersey will soon be available on GlassFish Update Center

GlassFish Update Center provides a simple way to add new modules and addons to an existing GlassFish V2 instance (read Nazrul's Weblog to get more information). Jersey support will be soon available there. It will allow users to deploy Jersey based RESTful web applications without need to bundle them together with Jersey base libraries. We will then see, if we can provide something more...

Tuesday, August 21, 2007 | REST | Read More

JSON Entity Providers In Jersey

I have recently added support for JSON entity providers to Jersey. Here you can find a simple sample showing how to utilize them. The entity providers follow a general schema described by Paul. The following resource class will publish CZK exchange rates for EUR and USD. Data will be provided in JSON format. @UriTemplate("/rates")public class ExchangeRates { @ProduceMime("application/json") @UriTemplate("CZK") public JSONObject getRates() { try { ...

Tuesday, August 7, 2007 | REST | Read More

Java Webservices Interoperability With .NET 3.0 At Jazoon

At Java One, Harold Carr and Arun Gupta were demoing a real life interoperability scenario showing MS Excel client talking to Java web service endpoint. Slides and demo screen-casts are available at Arun's blog I will show how to implement such scenario at upcoming Jazoon conference. It will take place in Zurich (Switzerland) in June (24-28). Please look at http://jazoon.com/en/conference/presentations.html?topic=Java_and_.NET_interoperabilityfor complete list of Java and .NET...

Tuesday, May 15, 2007 | Java | Read More

Using External Policies

In Manual Web Service Configuration In From Java Case you saw how to manually configure Java web service endpoint. This entry describes how to use external policies for endpoint configuration instead of including policy assertions directly into WSIT config file. The scenario enables you to store and maintain all your policies at one central place... Preparation To be able to reproduce following steps you will need an installation of glassfish v2. (I was using gf v2 b46)I...

Monday, May 14, 2007 | WS-Policy | Read More

Windows Vista Must Restart In Order To Connect an External Display

It was a big surprise for me, but yes: if you want to e.g. connect a video projector to your Vista machine, you have to restart the machine. For a long time I thought it was only a Solaris issue. With some laptops you just need to restart your X server session (i.e. logout/login). Recently I have heard from one of my colleague, who was giving a presentation (on the last Wednesday) he was not able to use the projector at all (he unfortunatelydid not try to restart his...

Friday, April 6, 2007 | Microsoft | Read More

Manual Web Service Configuration In From Java Case

As Fabian mentioned in his recent blog entry (http://blogs.sun.com/ritzmann), attaching policy assertions to webservices created from wsdl could be simply done by inserting the assertions directly into appropriate wsdl document. Today I will show how to attach them in from Java case Preparation All you will need is JDK (http://java.sun.com/javase/downloads/index.jsp) and Java EE Application Server with integrated WSIT. What follows was tested with jdk 5.0 update 10 (http://java...

Monday, February 26, 2007 | WS-Policy | Read More

Using JSR-88 For Web Application Deployment in Glassfish

JSR-88 introduces unified J2EE API for deployment. You will see how to use it for deploying/undeploying web applications and it will be demonstrated using glassfish Without JSR-88 You have several options how to deploy a web application onto glassfish. CLI interface ($GLASSFISH_HOME/bin/asadmin command) Admin Console (http://localhost:4848/) Autodeployment (place the war directly into filesystem: $GLASSFISH_HOME/domains/domain1/autodeploy) So for e.g. using CLI interface you can...

Friday, February 16, 2007 | Java | Read More

Finding Code Generating Log Messages By Ids In WSIT WS-Policy Framework

Recently I got an e-mail containing following log message id: SEVERE: WSP001002: Message was generated by our class in com.sun.xml.ws.policy.jaxws package. In the first place I was wondering where in the code the message had been logged: $ grep -n WSP001002 wsit/rt/src/\*\*/\*.java It returned empty result, even if I was sure such an id was used in the code. And the reason? In policy code we used a convention that log messages starting with WSP<id number> were generated with...

Friday, February 2, 2007 | WS-Policy | Read More

Solaris Nevada on Toshiba Tecra M3 -- CMOS Setup

The second time you have to answer the same question is the right time to consider writing the answer down somewhere When I was trying to install Solaris Nevada (http://www.opensolaris.org/) into my Toshiba Tecra M3 laptop for the first time (about 10 months ago), I experienced strange error messages and was not able to proceed. Until I changed my CMOS settings. Then one of my colleagues experienced the same issue and recently one another asked me for a hint. So I decided to...

Friday, December 22, 2006 | Solaris | Read More

Java Logging for Lazy Dogs

Glassfish (http://glassfish.dev.java.net) offers you pretty comfortable way how to control logging. You can find it in it's admin console and Fabian already described what to do to get some fancy logs out of e.g. WS-Policy WSIT framework there in his blog). However, there is yet another way to configure logging levels for non-glassfish environment. Simply edit your $JAVA_HOME/jre/lib/logging.properties file. And if you do not mind you will be overwhelmed with bunch of different...

Wednesday, December 13, 2006 | Sun | Read More

Measuring Performance of Policy Code in WSIT -- First Steps

This week I have spent some time on measuring performance of our wspolicy implementation and it's impact on overall performance of WSIT (http://wsit.dev.java.net/). Nowadays -- after feature freeze -- we want to spend some cycles on performance improvements. In this blog you can find some initial figures before performance optimization. First attempt For the initial measurement I created two services. Exactly same services just with one difference.One configured using...

Friday, November 24, 2006 | WS-Policy | Read More

Policy Relationship with JAX-WS

Despite the fact that many developers keep saying (especially when looking for a new job ;-) they do not mind learning new technologies and APIs, when it comes to reality a lot of them mind. Last time I wrote aboutWSIT. The implementation brings new quality features to web services technology and the key to this is having policies attached to particular services. You can read about the details in Marek's blog. The good news is, that adoption of WSIT does not mean switching to...

Friday, May 19, 2006 | WS-Policy | Read More

Next step in WS interoperability

When I heard about SOA (http://www.sun.com/products/soa) for the first time, I considered it a really great approach. I had just two doubts about it. I was pretty sure, a lot of functions within the enterprise IT infrastructure at the vast majority of potential customer sites were not ready to be accessed via web services. And the second one, well, it was really hard to believe, that every single existing web service in heterogeneous IT infrastructures, which was (and still...

Tuesday, May 16, 2006 | Sun | Read More