JAX-RS URISyntaxException after upgrade to WebLogic 12.1.3+

May 23, 2016

Reading time ~1 minute

REST clients fail after WebLogic upgrade from 12.1.2 to 12.1.3 or 12.2.1.

WebLogic 12.1.2 is shipped with Jersey 1.13 and my REST clients are working fine. However, after upgrading WebLogic, they fail as follows:

javax.ws.rs.core.UriBuilderException: java.net.URISyntaxException: Illegal character in path at index 71: http://xxx.no/app/rest/MyRestWS/MyRestMethod/%7B"data":"JTDER28E303031815","active":false%7D
	at com.sun.jersey.api.uri.UriBuilderImpl.createURI(UriBuilderImpl.java:723)
	at com.sun.jersey.api.uri.UriBuilderImpl._build(UriBuilderImpl.java:651)
	at com.sun.jersey.api.uri.UriBuilderImpl.build(UriBuilderImpl.java:641)
	at com.sun.jersey.api.client.WebResource.<init>(WebResource.java:88)
	at com.sun.jersey.api.client.WebResource.path(WebResource.java:396)
	at no.company.app.restclient.wsclient.AppClient.toDataList(AppClient.java:46)

There is a bug reported for for version 1.18.1 - Bug in URL encoding in 1.18.1 but the problem is present in 1.18 as well.

As it appears, downgrading to version 1.17.1 fixes the problem and is done by following the documentation to change the Jersey version used: How to Update the Version of Jersey JAX-RS RI in an EAR File

Action plan outline:

1) Update weblogic-application.xml (or weblogic.xml depending structure)
2) Include jersey-bundle 1.17.1 in your application.
3) Redeploy


    <!-- jersey-bundle-*.jar -->
    <!-- Jackson-*.jar -->
    <!-- jettison-*.jar -->
    <!-- jsr311*.jar -->
    <!-- asm.jar -->

If you’re building with Maven you also need to add the following to your project’s POM file:


<!-- Optional - include if you use JSON binding -->

Now you can live happily even after upgrading WebLogic and you don’t have to rewrite your REST clients to JAX-RS 2.0 which is kinda fiddly because of public API changes.

Thomas is part of the middleware team at Sysco and has been a developer since 1995 working with HTML,Javascript and Java ++ since the day they were born. He's been working with Oracle middleware and database products since 2006.

Customizing service calls with multiple levels of security in OSB 12c

This will be a part two of my previous post which you can read [here](http://blog.sysco.no/osb/jdeveloper/Service-call-with-multiple-leve...… Continue reading